Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

versal: add LPD SLCR #19

Merged
merged 5 commits into from
Dec 10, 2024
Merged

Conversation

ho28
Copy link
Collaborator

@ho28 ho28 commented Dec 6, 2024

Add the low power domain system level control register to the Versal SoC definition.

@ho28 ho28 force-pushed the nho/versal/lpd_slcr_1 branch 3 times, most recently from 455c984 to c8d81b1 Compare December 7, 2024 00:09
ho28 added 5 commits December 10, 2024 03:32
This commit copies the versal LPD SLCR skeleton implementation
from the Xilinx QEMU fork unchanged. This is intended to be
integrated into the Versal SoC definition.

Taken from commit SHA
    554c25a60d432da639a72acfce893b40e1487e7c

Signed-off-by: Nelson Ho <[email protected]>
Move the LPD SLCR device state structure into a header
file to be included in versal SoC implementation.

Signed-off-by: Nelson Ho <[email protected]>
Meson changes to build xlnx-versal-lpd-slcr device
when build configuration includes versal soc.

Signed-off-by: Nelson Ho <[email protected]>
Realize the low power domain system level control
registers as part of Versal SoC and map the control
registers into the PS address space.

Signed-off-by: Nelson Ho <[email protected]>
At some point between the Xilinx QEMU fork base and 9.1,
it has become enforced that qom type names do not contain
commas. This change replaces the comma in the type name
for the LPD_SLCR to fix the illegal type name error that
occurs when registering the device.

Signed-off-by: Nelson Ho <[email protected]>
@ho28 ho28 force-pushed the nho/versal/lpd_slcr_1 branch from c8d81b1 to 28c711e Compare December 10, 2024 03:36
@ho28 ho28 merged commit 52756ec into Wind-River:wr-integration Dec 10, 2024
1 check passed
@ho28 ho28 deleted the nho/versal/lpd_slcr_1 branch December 10, 2024 03:39
jackychen614615 pushed a commit to jackychen614615/qemu that referenced this pull request Dec 13, 2024
Allow overlapping request by removing the assert that made it
impossible. There are only two callers:

1. block_copy_task_create()

It already asserts the very same condition before calling
reqlist_init_req().

2. cbw_snapshot_read_lock()

There is no need to have read requests be non-overlapping in
copy-before-write when used for snapshot-access. In fact, there was no
protection against two callers of cbw_snapshot_read_lock() calling
reqlist_init_req() with overlapping ranges and this could lead to an
assertion failure [1].

In particular, with the reproducer script below [0], two
cbw_co_snapshot_block_status() callers could race, with the second
calling reqlist_init_req() before the first one finishes and removes
its conflicting request.

[0]:

> #!/bin/bash -e
> dd if=/dev/urandom of=/tmp/disk.raw bs=1M count=1024
> ./qemu-img create /tmp/fleecing.raw -f raw 1G
> (
> ./qemu-system-x86_64 --qmp stdio \
> --blockdev raw,node-name=node0,file.driver=file,file.filename=/tmp/disk.raw \
> --blockdev raw,node-name=node1,file.driver=file,file.filename=/tmp/fleecing.raw \
> <<EOF
> {"execute": "qmp_capabilities"}
> {"execute": "blockdev-add", "arguments": { "driver": "copy-before-write", "file": "node0", "target": "node1", "node-name": "node3" } }
> {"execute": "blockdev-add", "arguments": { "driver": "snapshot-access", "file": "node3", "node-name": "snap0" } }
> {"execute": "nbd-server-start", "arguments": {"addr": { "type": "unix", "data": { "path": "/tmp/nbd.socket" } } } }
> {"execute": "block-export-add", "arguments": {"id": "exp0", "node-name": "snap0", "type": "nbd", "name": "exp0"}}
> EOF
> ) &
> sleep 5
> while true; do
> ./qemu-nbd -d /dev/nbd0
> ./qemu-nbd -c /dev/nbd0 nbd:unix:/tmp/nbd.socket:exportname=exp0 -f raw -r
> nbdinfo --map 'nbd+unix:///exp0?socket=/tmp/nbd.socket'
> done

[1]:

> Wind-River#5  0x000071e5f0088eb2 in __GI___assert_fail (...) at ./assert/assert.c:101
> Wind-River#6  0x0000615285438017 in reqlist_init_req (...) at ../block/reqlist.c:23
> Wind-River#7  0x00006152853e2d98 in cbw_snapshot_read_lock (...) at ../block/copy-before-write.c:237
> Wind-River#8  0x00006152853e3068 in cbw_co_snapshot_block_status (...) at ../block/copy-before-write.c:304
> Wind-River#9  0x00006152853f4d22 in bdrv_co_snapshot_block_status (...) at ../block/io.c:3726
> Wind-River#10 0x000061528543a63e in snapshot_access_co_block_status (...) at ../block/snapshot-access.c:48
> Wind-River#11 0x00006152853f1a0a in bdrv_co_do_block_status (...) at ../block/io.c:2474
> Wind-River#12 0x00006152853f2016 in bdrv_co_common_block_status_above (...) at ../block/io.c:2652
> Wind-River#13 0x00006152853f22cf in bdrv_co_block_status_above (...) at ../block/io.c:2732
> Wind-River#14 0x00006152853d9a86 in blk_co_block_status_above (...) at ../block/block-backend.c:1473
> Wind-River#15 0x000061528538da6c in blockstatus_to_extents (...) at ../nbd/server.c:2374
> Wind-River#16 0x000061528538deb1 in nbd_co_send_block_status (...) at ../nbd/server.c:2481
> Wind-River#17 0x000061528538f424 in nbd_handle_request (...) at ../nbd/server.c:2978
> Wind-River#18 0x000061528538f906 in nbd_trip (...) at ../nbd/server.c:3121
> Wind-River#19 0x00006152855a7caf in coroutine_trampoline (...) at ../util/coroutine-ucontext.c:175

Cc: [email protected]
Suggested-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Signed-off-by: Fiona Ebner <[email protected]>
Message-Id: <[email protected]>
Reviewed-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]>
(cherry picked from commit 6475155d519209c80fdda53e05130365aa769838)
Signed-off-by: Michael Tokarev <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants