Re: [PATCH v5 06/11] tests/qtest/ahci: don't unmap pci bar if it wasn't mapped

2025-05-05 Thread Nicholas Piggin
On Mon May 5, 2025 at 3:25 PM AEST, Akihiko Odaki wrote: > On 2025/05/02 12:04, Nicholas Piggin wrote: >> ahci-test has a bunch of tests where the pci bar was not mapped. Avoid >> unmapping it in these cases, to keep iomaps balanced. >> >> Cc: Michael S. Tsirkin >

Re: [PATCH v5 03/11] tests/qtest: Add libqos function for testing msix interrupt status

2025-05-05 Thread Nicholas Piggin
On Mon May 5, 2025 at 3:37 PM AEST, Akihiko Odaki wrote: > On 2025/05/02 12:04, Nicholas Piggin wrote: >> This function is duplicated 3 times, with more potential future users. >> Factor it into libqos, using qtest_memset instead of qtest_writel to >> clear the message ju

Re: [PATCH v5 06/11] tests/qtest/ahci: don't unmap pci bar if it wasn't mapped

2025-05-04 Thread Nicholas Piggin
On Mon May 5, 2025 at 3:25 PM AEST, Akihiko Odaki wrote: > On 2025/05/02 12:04, Nicholas Piggin wrote: >> ahci-test has a bunch of tests where the pci bar was not mapped. Avoid >> unmapping it in these cases, to keep iomaps balanced. >> >> Cc: Michael S. Tsirkin >

Re: [PATCH v5 02/11] tests/qtest: Fix virtio msix message endianness

2025-05-04 Thread Nicholas Piggin
On Mon May 5, 2025 at 3:05 PM AEST, Akihiko Odaki wrote: > On 2025/05/02 12:04, Nicholas Piggin wrote: >> msix messages are written to memory in little-endian order, so they >> should not be byteswapped depending on target endianness, but read >> as le and converted to hos

[PATCH v5 02/11] tests/qtest: Fix virtio msix message endianness

2025-05-01 Thread Nicholas Piggin
msix messages are written to memory in little-endian order, so they should not be byteswapped depending on target endianness, but read as le and converted to host endian by the qtest. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Fabiano Rosas Signed-off-by: Nicholas Piggin --- tests/qtest

[PATCH v5 11/11] qtest/libqos/pci: Factor msix entry helpers into pci common code

2025-05-01 Thread Nicholas Piggin
-off-by: Nicholas Piggin --- tests/qtest/libqos/pci.h| 3 ++ tests/qtest/libqos/pci.c| 53 + tests/qtest/libqos/virtio-pci.c | 48 - 3 files changed, 61 insertions(+), 43 deletions(-) diff --git a/tests/qtest/libqos

[PATCH v5 09/11] qtest/libqos/pci: Enforce balanced iomap/unmap

2025-05-01 Thread Nicholas Piggin
Add assertions to ensure a BAR is not mapped twice, and that only previously mapped BARs are unmapped. This can help catch bugs and fragile coding. Cc: Michael S. Tsirkin Cc: Marcel Apfelbaum Reviewed-by: Akihiko Odaki Reviewed-by: Fabiano Rosas Signed-off-by: Nicholas Piggin --- tests

[PATCH v5 07/11] tests/qtest/libquos/virtio: unmap pci bar when disabling device

2025-05-01 Thread Nicholas Piggin
Unmap the virtio-pci bar in qvirtio_pci_disable_device() to keep iomap/iounmap balanced. Cc: Michael S. Tsirkin Cc: Marcel Apfelbaum Reviewed-by: Akihiko Odaki Reviewed-by: Fabiano Rosas Signed-off-by: Nicholas Piggin --- tests/qtest/libqos/virtio-pci.h | 1 + tests/qtest/libqos/virtio

[PATCH v5 08/11] tests/qtest/libquos/pci: Add migration fixup helper for pci devices

2025-05-01 Thread Nicholas Piggin
-by: Akihiko Odaki Signed-off-by: Nicholas Piggin --- tests/qtest/libqos/pci.h | 1 + tests/qtest/ahci-test.c | 1 + tests/qtest/libqos/pci.c | 4 3 files changed, 6 insertions(+) diff --git a/tests/qtest/libqos/pci.h b/tests/qtest/libqos/pci.h index ef40a6917d3..19f1dd13501 100644 --- a

[PATCH v5 05/11] tests/qtest/ahci: unmap pci bar before reusing device

2025-05-01 Thread Nicholas Piggin
ahci-test double-maps the hba bar in the pending_callback test. Unmap it first, to keep iomaps balanced. Cc: Michael S. Tsirkin Cc: Marcel Apfelbaum Cc: Akihiko Odaki Reviewed-by: Akihiko Odaki Reviewed-by: Fabiano Rosas Signed-off-by: Nicholas Piggin --- tests/qtest/libqos/ahci.h | 2

[PATCH v5 10/11] qtest/libqos/pci: Fix qpci_msix_enable sharing bar0

2025-05-01 Thread Nicholas Piggin
change to have qpci_misx_enable() use existing iomaps if msix bars are already mapped. Cc: Michael S. Tsirkin Cc: Marcel Apfelbaum Reviewed-by: Akihiko Odaki Reviewed-by: Fabiano Rosas Signed-off-by: Nicholas Piggin --- tests/qtest/libqos/pci.h | 1 + tests/qtest/libqos/pci.c | 40

[PATCH v5 04/11] tests/qtest: Enable spapr dma with linear iommu map

2025-05-01 Thread Nicholas Piggin
memory when running qtests. The buggy msix checks can all be removed since the tests all work now. Reviewed-by: Fabiano Rosas Signed-off-by: Nicholas Piggin --- tests/qtest/libqos/pci.h | 4 hw/ppc/spapr_iommu.c | 10 +- tests/qtest/e1000e-test.c

[PATCH v5 06/11] tests/qtest/ahci: don't unmap pci bar if it wasn't mapped

2025-05-01 Thread Nicholas Piggin
ahci-test has a bunch of tests where the pci bar was not mapped. Avoid unmapping it in these cases, to keep iomaps balanced. Cc: Michael S. Tsirkin Cc: Marcel Apfelbaum Cc: Akihiko Odaki Cc: Fabiano Rosas Signed-off-by: Nicholas Piggin --- tests/qtest/libqos/ahci.h | 1 + tests/qtest/ahci

[PATCH v5 03/11] tests/qtest: Add libqos function for testing msix interrupt status

2025-05-01 Thread Nicholas Piggin
This function is duplicated 3 times, with more potential future users. Factor it into libqos, using qtest_memset instead of qtest_writel to clear the message just because that looks nicer with the qtest_memread used to read it. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Nicholas Piggin

[PATCH v5 01/11] tests/qtest: Enforce zero for the "un-fired" msix message value

2025-05-01 Thread Nicholas Piggin
unexpected value. This catches an endian conversion bug in the message value when running these tests on a big endian target. Previously the test just times out waiting for interrupt, after this it fails nicely. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Fabiano Rosas Signed-off-by: Nicholas

[PATCH v5 00/11] tests/qtest: pci and msix fixes

2025-05-01 Thread Nicholas Piggin
d shutdown function. Thanks, Nick Nicholas Piggin (11): tests/qtest: Enforce zero for the "un-fired" msix message value tests/qtest: Fix virtio msix message endianness tests/qtest: Add libqos function for testing msix interrupt status tests/qtest: Enable spapr dma with linear iom

[PATCH 1/4] tests/qtest: Enforce zero for the "un-fired" msix message value

2025-04-16 Thread Nicholas Piggin
unexpected value. This catches an endian conversion bug in the message value when running these tests on a big endian target. Previously the test just times out waiting for interrupt, after this it fails nicely. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Fabiano Rosas Signed-off-by: Nicholas

[PATCH 2/4] tests/qtest: Fix virtio msix message endianness

2025-04-16 Thread Nicholas Piggin
msix messages are written to memory in little-endian order, so they should not be byteswapped depending on target endianness, but read as le and converted to host endian by the qtest. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Fabiano Rosas Signed-off-by: Nicholas Piggin --- tests/qtest

[PATCH 3/4] tests/qtest: Add libqos function for testing msix interrupt status

2025-04-16 Thread Nicholas Piggin
This function is duplicated 3 times, with more potential future users. Factor it into libqos, using qtest_memset instead of qtest_writel to clear the message just because that looks nicer with the qtest_memread used to read it. Signed-off-by: Nicholas Piggin --- tests/qtest/libqos/pci.h

[PATCH 4/4] tests/qtest: Enable spapr dma with linear iommu map

2025-04-16 Thread Nicholas Piggin
memory when running qtests. The buggy msix checks can all be removed since the tests all work now. Signed-off-by: Nicholas Piggin --- tests/qtest/libqos/pci.h | 4 hw/ppc/spapr_iommu.c | 9 - tests/qtest/e1000e-test.c| 21

[PATCH 0/4] tests/qtest: Enable spapr dma tests

2025-04-16 Thread Nicholas Piggin
value can be seen. - Added patch 3 to factor duplicated code we just changed. Some patches I have for e1000e and xhci tests also want to use the same function... - Fixed stray hunk from mis-rebase in the spapr patch. Thanks, Nick Nicholas Piggin (4): tests/qtest: Enforce zero for the "un-

Re: [RFC PATCH 2/2] tests/qtest: Enable spapr dma with linear iommu map

2025-04-15 Thread Nicholas Piggin
On Wed Apr 16, 2025 at 4:07 AM AEST, Fabiano Rosas wrote: > Nicholas Piggin writes: > >> qtests spapr dma was broken because the iommu was not set up. >> >> spapr requires hypercalls to set up the iommu (TCE tables), but >> there is no support for that or a side-cha

[RFC PATCH 2/2] tests/qtest: Enable spapr dma with linear iommu map

2025-04-15 Thread Nicholas Piggin
memory when running qtests. The buggy msix checks can all be removed since the tests all work now. Signed-off-by: Nicholas Piggin --- tests/qtest/libqos/pci.h | 4 hw/ppc/spapr_iommu.c | 9 - tests/qtest/e1000e-test.c| 23

[RFC PATCH 0/2] tests/qtest: Enable spapr dma tests

2025-04-15 Thread Nicholas Piggin
I took a look at the spapr buggy msix fixme in qtests... AFAIKS it turns out to be DMA entirely broken due to iommu not set up. Adding a quick workaround for spapr gets everything working properly other than exposing bugs in msi message endianness conversions. Thanks, Nick Nicholas Piggin (2

[RFC PATCH 1/2] tests/qtest: Fix virtio msix message endianness

2025-04-15 Thread Nicholas Piggin
msix messages are written to memory in little-endian order, so they should not be byteswapped depending on target endianness, but read as le and converted to host endian by the qtest. Signed-off-by: Nicholas Piggin --- tests/qtest/libqos/virtio-pci-modern.c | 9 +++-- tests/qtest/libqos

[PATCH v4 7/7] qtest/libqos/pci: Factor msix entry helpers into pci common code

2025-04-10 Thread Nicholas Piggin
-off-by: Nicholas Piggin --- tests/qtest/libqos/pci.h| 3 ++ tests/qtest/libqos/pci.c| 53 + tests/qtest/libqos/virtio-pci.c | 48 - 3 files changed, 61 insertions(+), 43 deletions(-) diff --git a/tests/qtest/libqos

[PATCH v4 4/7] tests/qtest/libquos/pci: Add migration fixup helper for pci devices

2025-04-10 Thread Nicholas Piggin
-by: Nicholas Piggin --- tests/qtest/libqos/pci.h | 1 + tests/qtest/ahci-test.c | 1 + tests/qtest/libqos/pci.c | 4 3 files changed, 6 insertions(+) diff --git a/tests/qtest/libqos/pci.h b/tests/qtest/libqos/pci.h index 83896145235..fd195ac4e6f 100644 --- a/tests/qtest/libqos/pci.h +++ b

[PATCH v4 6/7] qtest/libqos/pci: Fix qpci_msix_enable sharing bar0

2025-04-10 Thread Nicholas Piggin
change to have qpci_misx_enable() use existing iomaps if msix bars are already mapped. Cc: Michael S. Tsirkin Cc: Marcel Apfelbaum Reviewed-by: Akihiko Odaki Reviewed-by: Fabiano Rosas Signed-off-by: Nicholas Piggin --- tests/qtest/libqos/pci.h | 1 + tests/qtest/libqos/pci.c | 40

[PATCH v4 2/7] tests/qtest/ahci: don't unmap pci bar if it wasn't mapped

2025-04-10 Thread Nicholas Piggin
ahci-test has a bunch of tests where the pci bar was not mapped. Avoid unmapping it in these cases, to keep iomaps balanced. Cc: Michael S. Tsirkin Cc: Marcel Apfelbaum Cc: Akihiko Odaki Cc: Akihiko Odaki Cc: Fabiano Rosas Signed-off-by: Nicholas Piggin --- tests/qtest/ahci-test.c | 35

[PATCH v4 1/7] tests/qtest/ahci: unmap pci bar before reusing device

2025-04-10 Thread Nicholas Piggin
ahci-test double-maps the hba bar in the pending_callback test. Unmap it first, to keep iomaps balanced. Cc: Michael S. Tsirkin Cc: Marcel Apfelbaum Cc: Akihiko Odaki Reviewed-by: Akihiko Odaki Reviewed-by: Fabiano Rosas Signed-off-by: Nicholas Piggin --- tests/qtest/libqos/ahci.h | 2

[PATCH v4 5/7] qtest/libqos/pci: Enforce balanced iomap/unmap

2025-04-10 Thread Nicholas Piggin
Add assertions to ensure a BAR is not mapped twice, and that only previously mapped BARs are unmapped. This can help catch bugs and fragile coding. Cc: Michael S. Tsirkin Cc: Marcel Apfelbaum Reviewed-by: Akihiko Odaki Reviewed-by: Fabiano Rosas Signed-off-by: Nicholas Piggin --- tests

[PATCH v4 3/7] tests/qtest/libquos/virtio: unmap pci bar when disabling device

2025-04-10 Thread Nicholas Piggin
Unmap the virtio-pci bar in qvirtio_pci_disable_device() to keep iomap/iounmap balanced. Cc: Michael S. Tsirkin Cc: Marcel Apfelbaum Reviewed-by: Akihiko Odaki Reviewed-by: Fabiano Rosas Signed-off-by: Nicholas Piggin --- tests/qtest/libqos/virtio-pci.h | 1 + tests/qtest/libqos/virtio

[PATCH v4 0/7] qtest/libqos/pci: pci and msix fixes

2025-04-10 Thread Nicholas Piggin
previously mapped, which required a bunch more prep work in ahci including adding a qpci migration helper. Thanks, Nick Nicholas Piggin (7): tests/qtest/ahci: unmap pci bar before reusing device tests/qtest/ahci: don't unmap pci bar if it wasn't mapped tests/qtest/libquos/virtio: unm

Re: [PATCH v3 2/4] qtest/libqos/pci: Enforce balanced iomap/unmap

2025-01-20 Thread Nicholas Piggin
On Mon Jan 20, 2025 at 3:29 PM AEST, Philippe Mathieu-Daudé wrote: > Hi Nick, > > Only nitpicking comments... Hey, no they're good comments actually. > > On 17/1/25 18:22, Nicholas Piggin wrote: >> Add assertions to ensure a BAR is not mapped twice, and only >

[PATCH v3 4/4] qtest/libqos/pci: Factor msix entry helpers into pci common code

2025-01-17 Thread Nicholas Piggin
Setting msix entry address and data and masking is moved into common code helpers from virtio tests. For now that remains the only user, but there are changes under development to enable msix vectors for msix, e1000e, and xhci tests, which can make use of them. Signed-off-by: Nicholas Piggin

[PATCH v3 1/4] qtest/libqos/pci: Do not write to PBA memory

2025-01-17 Thread Nicholas Piggin
The PCI Local Bus Specification says the result of writes to MSI-X PBA memory is undefined. QEMU implements them as no-ops, so remove the pointless write from qpci_msix_pending(). Signed-off-by: Nicholas Piggin --- tests/qtest/libqos/pci.c | 2 -- 1 file changed, 2 deletions(-) diff --git a

[PATCH v3 3/4] qtest/libqos/pci: Fix qpci_msix_enable sharing bar0

2025-01-17 Thread Nicholas Piggin
change to have qpci_misx_enable() use existing iomaps if msix bars are already mapped. Reviewed-by: Fabiano Rosas Signed-off-by: Nicholas Piggin --- tests/qtest/libqos/pci.h | 1 + tests/qtest/libqos/pci.c | 40 ++-- 2 files changed, 35 insertions(+), 6

[PATCH v3 2/4] qtest/libqos/pci: Enforce balanced iomap/unmap

2025-01-17 Thread Nicholas Piggin
Add assertions to ensure a BAR is not mapped twice, and only previously mapped BARs are unmapped. This can help catch some bugs. Reviewed-by: Fabiano Rosas Signed-off-by: Nicholas Piggin --- tests/qtest/libqos/ahci.h | 1 + tests/qtest/libqos/pci.h| 2 ++ tests/qtest/libqos

[PATCH v3 0/4] qtest/libqos/pci: pci and msix fixes

2025-01-17 Thread Nicholas Piggin
Since v2: The e1000e|igb series got decoupled from this one and split into its own series. Patch 4 was added. Thanks, Nick Nicholas Piggin (4): qtest/libqos/pci: Do not write to PBA memory qtest/libqos/pci: Enforce balanced iomap/unmap qtest/libqos/pci: Fix qpci_msix_enable sharing bar0

[PATCH v2 5/5] qtest/e1000e|igb: Fix msix to re-trigger interrupts

2025-01-15 Thread Nicholas Piggin
ave device setup always enable and unmask the RXQ and TXQ irq vectors, and verify interrupt was seen by checking the msix message was seen. Cc: Michael S. Tsirkin Cc: Marcel Apfelbaum Cc: Dmitry Fleytman Cc: Akihiko Odaki Cc: Sriram Yagnaraman Signed-off-by: Nicholas Piggin --- tests/qtest/libqo

[PATCH v2 2/5] qtest/libqos/pci: Fix qpci_msix_enable sharing bar0

2025-01-15 Thread Nicholas Piggin
change to have qpci_misx_enable() use existing iomaps if msix bars are already mapped. Cc: Michael S. Tsirkin Cc: Marcel Apfelbaum Reviewed-by: Fabiano Rosas Signed-off-by: Nicholas Piggin --- tests/qtest/libqos/pci.h | 1 + tests/qtest/libqos/pci.c | 40

[PATCH v2 3/5] qtest/libqos/pci: Do not write to PBA memory

2025-01-15 Thread Nicholas Piggin
-off-by: Nicholas Piggin --- tests/qtest/libqos/pci.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/qtest/libqos/pci.c b/tests/qtest/libqos/pci.c index 023c1617680..a187349d30a 100644 --- a/tests/qtest/libqos/pci.c +++ b/tests/qtest/libqos/pci.c @@ -361,8 +361,6 @@ bool

[PATCH v2 1/5] qtest/pci: Enforce balanced iomap/unmap

2025-01-15 Thread Nicholas Piggin
Add assertions to ensure a BAR is not mapped twice, and only previously mapped BARs are unmapped. This can help catch some bugs. Cc: Michael S. Tsirkin Cc: Marcel Apfelbaum Reviewed-by: Fabiano Rosas Signed-off-by: Nicholas Piggin --- tests/qtest/libqos/ahci.h | 1 + tests/qtest

[PATCH v2 4/5] qtest/e1000e|igb: Clear interrupt-cause bits after irq

2025-01-15 Thread Nicholas Piggin
: Dmitry Fleytman Cc: Akihiko Odaki Cc: Sriram Yagnaraman Signed-off-by: Nicholas Piggin --- tests/qtest/e1000e-test.c | 4 tests/qtest/igb-test.c| 4 2 files changed, 8 insertions(+) diff --git a/tests/qtest/e1000e-test.c b/tests/qtest/e1000e-test.c index de9738fdb74..35548d1c20b

[PATCH v2 0/5] qtest: pci and e1000e/igb msix fixes

2025-01-15 Thread Nicholas Piggin
, as other test cases do. Since v1: - Patch 4 update comments as suggested by Akihiko Odaki. - Patch 5 significantly rework and simplify also suggested by Akihiko Odaki. In particular the msi vectors are always unmasked to avoid the extra case of handling masked. Thanks, Nick Nicholas Piggin

Re: [PATCH 13/17] hw/scsi: Convert to new bh API

2024-12-20 Thread Nicholas Piggin
On Sat Dec 21, 2024 at 9:54 AM AEST, Paolo Bonzini wrote: > Il ven 20 dic 2024, 11:44 Nicholas Piggin ha scritto: > > > Convert aio_bh_schedule_oneshot() to aio_bh_schedule_oneshot_event(), > > which can specify the clock type, making it compatible with > > record-repla

Re: [PATCH 01/17] replay: Fix migration use of clock for statistics

2024-12-20 Thread Nicholas Piggin
On Sat Dec 21, 2024 at 2:31 AM AEST, Peter Xu wrote: > On Fri, Dec 20, 2024 at 08:42:03PM +1000, Nicholas Piggin wrote: > > Migration reads CLOCK_HOST when not holding the replay_mutex, which > > asserts when recording a trace. These are not guest visible so should > > be CLOC

Re: [PATCH 02/17] replay: Fix migration replay_mutex locking

2024-12-20 Thread Nicholas Piggin
On Fri Dec 20, 2024 at 11:08 PM AEST, Fabiano Rosas wrote: > Nicholas Piggin writes: > > Hi Nick, > > I'm ignorant about replay, but we try to know why were taking the BQL in > the migration code, we move it around sometimes, etc. Can we be a bit > more strict with docu

[PATCH 17/17] tests/avocado/replay_linux: remove the timeout expected guards

2024-12-20 Thread Nicholas Piggin
replay_linux tests on is becoming more reliable now, so remove the timeout expected tag. These tests take about 400-800 seconds each, so add the SPEED=slow guard. Reviewed-by: Alex Bennée Signed-off-by: Nicholas Piggin --- Note that Alex gave R-B tag for previous version which marked a few

[PATCH 16/17] tests/avocado/replay_linux: Fix cdrom device setup

2024-12-20 Thread Nicholas Piggin
The cdrom device was not being added to the command line. Signed-off-by: Nicholas Piggin --- tests/avocado/replay_linux.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/avocado/replay_linux.py b/tests/avocado/replay_linux.py index 38b6f8e6652..6c08ddaaff1 100644 --- a/tests

[PATCH 15/17] tests/avocado/replay_linux: Fix compile error

2024-12-20 Thread Nicholas Piggin
The subprocess module was missing, the hunk got mismerged into a later patch that is required to make replay_linux work, so the broken commit was never tested in isolation. Fixes: 4926b6e6444f ("tests/avocado: excercise scripts/replay-dump.py in replay tests") Signed-off-by: Nicho

[PATCH 12/17] hw/ide: Fix record-replay and convert to new bh API

2024-12-20 Thread Nicholas Piggin
using IDE devices. Signed-off-by: Nicholas Piggin --- hw/ide/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ide/core.c b/hw/ide/core.c index c527caf3d69..500ea73c8be 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -2780,7 +2780,7 @@ static void ide_restart_cb

[PATCH 11/17] block: Convert to new bh API

2024-12-20 Thread Nicholas Piggin
is not recorded and replayed. blkreplay has cases at startup where the device is used before the event code is set up, so it needs special handling to avoid creating bh replay events. Signed-off-by: Nicholas Piggin --- include/block/aio.h| 9 + block.c| 4

[PATCH 10/17] qmp: Convert to new bh API

2024-12-20 Thread Nicholas Piggin
Convert aio_bh_schedule_oneshot() to aio_bh_schedule_oneshot_event(), which can specify the clock type, making it compatible with record-replay. qmp dispatching does not affect target machine state, so it should use QEMU_CLOCK_REALTIME so it is not recorded and replayed. Signed-off-by: Nicholas

[PATCH 14/17] async: add debugging assertions for record/replay in bh APIs

2024-12-20 Thread Nicholas Piggin
when running replay_linux.py avocado test with the x86-64 q35 non-virtio machine. Signed-off-by: Nicholas Piggin --- include/block/aio.h| 2 +- replay/replay-events.c | 20 util/async.c | 29 + 3 files changed, 38 insertions(+), 13

[PATCH 13/17] hw/scsi: Convert to new bh API

2024-12-20 Thread Nicholas Piggin
/replay when using SCSI devices. Signed-off-by: Nicholas Piggin --- hw/scsi/scsi-bus.c | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index 2f1678d51e7..16f294ce6b7 100644 --- a/hw/scsi/scsi-bus.c +++ b/hw/scsi/scsi-bus.c

[PATCH 09/17] monitor: Convert to new bh API

2024-12-20 Thread Nicholas Piggin
: Nicholas Piggin --- monitor/monitor.c | 3 ++- monitor/qmp.c | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/monitor/monitor.c b/monitor/monitor.c index 56786c0ccc7..accdee88b51 100644 --- a/monitor/monitor.c +++ b/monitor/monitor.c @@ -583,7 +583,8 @@ void

[PATCH 07/17] async/coroutine: Convert to new bh API

2024-12-20 Thread Nicholas Piggin
is not recorded and replayed. Signed-off-by: Nicholas Piggin --- job.c | 3 ++- util/async.c | 2 +- scripts/block-coroutine-wrapper.py | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/job.c b/job.c index 660ce22c56b

[PATCH 06/17] util/aio-wait: Convert to new bh API

2024-12-20 Thread Nicholas Piggin
Convert qemu_bh_schedule() to qemu_bh_schedule_event(), which can specify the clock type, making it compatible with record-replay. aio_wait_kick does not affect target machine state, so it should use QEMU_CLOCK_REALTIME so it is not recorded and replayed. Signed-off-by: Nicholas Piggin

[PATCH 03/17] async: rework async event API for replay

2024-12-20 Thread Nicholas Piggin
. Signed-off-by: Nicholas Piggin --- docs/devel/replay.rst | 7 --- include/block/aio.h | 35 +++ include/sysemu/replay.h | 2 +- backends/rng-builtin.c | 2 +- block/block-backend.c | 24 ++-- block/io.c | 5

[PATCH 05/17] util/thread-pool: Convert to new bh API

2024-12-20 Thread Nicholas Piggin
Convert qemu_bh_schedule() to qemu_bh_schedule_event(), which can specify the clock type, making it compatible with record-replay. The thread pool management does not affect target machine state, so it should use QEMU_CLOCK_REALTIME so it is not recorded and replayed. Signed-off-by: Nicholas

[PATCH 08/17] migration: Convert to new bh API

2024-12-20 Thread Nicholas Piggin
Convert aio_bh_schedule_oneshot() to aio_bh_schedule_oneshot_event(), which can specify the clock type, making it compatible with record-replay. Snapsohtting does not affect target machine state, so it should use QEMU_CLOCK_REALTIME so it is not recorded and replayed. Signed-off-by: Nicholas

[PATCH 04/17] util/main-loop: Convert to new bh API

2024-12-20 Thread Nicholas Piggin
Convert qemu_bh_schedule() to qemu_bh_schedule_event(), which can specify the clock type, making it compatible with record-replay. The notify event does not affect target machine state, so it should use QEMU_CLOCK_REALTIME so it is not recorded and replayed. Signed-off-by: Nicholas Piggin

[PATCH 02/17] replay: Fix migration replay_mutex locking

2024-12-20 Thread Nicholas Piggin
Migration causes a number of events that need to go in the replay trace, such as vm state transitions. The replay_mutex lock needs to be held for these. The simplest approach seems to be just take it up-front when taking the bql. Signed-off-by: Nicholas Piggin --- migration/migration.c | 9

[PATCH 01/17] replay: Fix migration use of clock for statistics

2024-12-20 Thread Nicholas Piggin
Migration reads CLOCK_HOST when not holding the replay_mutex, which asserts when recording a trace. These are not guest visible so should be CLOCK_REALTIME like other statistics in MigrationState, which do not require the replay_mutex. Signed-off-by: Nicholas Piggin --- migration/migration.c

[PATCH 00/17] replay: Fixes and avocado test updates

2024-12-20 Thread Nicholas Piggin
fixes I'll post a patch to add the ppc64 test later after everything works through. Thanks, Nick Nicholas Piggin (17): replay: Fix migration use of clock for statistics replay: Fix migration replay_mutex locking async: rework async event API for replay util/main-loop: Convert to ne

Re: [PATCH v2 06/15] ppc/vof: Fix unaligned FDT property access

2024-07-08 Thread Nicholas Piggin
On Sun Jul 7, 2024 at 9:46 AM AEST, David Gibson wrote: > On Sat, Jul 06, 2024 at 11:37:08AM +0100, Peter Maydell wrote: > > On Fri, 5 Jul 2024 at 06:13, David Gibson > > wrote: > > > > > > On Fri, Jul 05, 2024 at 02:40:19PM +1000, Nicholas Piggin wrote: >

Re: [PATCH v2 06/15] ppc/vof: Fix unaligned FDT property access

2024-07-05 Thread Nicholas Piggin
On Fri Jul 5, 2024 at 3:12 PM AEST, David Gibson wrote: > On Fri, Jul 05, 2024 at 02:40:19PM +1000, Nicholas Piggin wrote: > > On Fri Jul 5, 2024 at 11:41 AM AEST, David Gibson wrote: > > > On Fri, Jul 05, 2024 at 11:18:47AM +1000, Nicholas Piggin wrote: > > > > On Th

Re: [PATCH v2 06/15] ppc/vof: Fix unaligned FDT property access

2024-07-04 Thread Nicholas Piggin
On Fri Jul 5, 2024 at 11:41 AM AEST, David Gibson wrote: > On Fri, Jul 05, 2024 at 11:18:47AM +1000, Nicholas Piggin wrote: > > On Thu Jul 4, 2024 at 10:15 PM AEST, Peter Maydell wrote: > > > On Sat, 29 Jun 2024 at 04:17, David Gibson > > > wrote: > > > >

Re: [PATCH v2 06/15] ppc/vof: Fix unaligned FDT property access

2024-07-04 Thread Nicholas Piggin
On Thu Jul 4, 2024 at 10:15 PM AEST, Peter Maydell wrote: > On Sat, 29 Jun 2024 at 04:17, David Gibson > wrote: > > > > On Fri, Jun 28, 2024 at 04:20:02PM +0100, Peter Maydell wrote: > > > On Thu, 27 Jun 2024 at 14:39, Akihiko Odaki > > > wrote: > > > > > > > > FDT properties are aligned by 4 b

Re: [PATCH v2 06/15] ppc/vof: Fix unaligned FDT property access

2024-07-04 Thread Nicholas Piggin
On Sat Jun 29, 2024 at 1:16 PM AEST, David Gibson wrote: > On Fri, Jun 28, 2024 at 04:20:02PM +0100, Peter Maydell wrote: > > On Thu, 27 Jun 2024 at 14:39, Akihiko Odaki > > wrote: > > > > > > FDT properties are aligned by 4 bytes, not 8 bytes. > > > > > > Signed-off-by: Akihiko Odaki > > > ---

Re: [PATCH v2 00/15] Fix check-qtest-ppc64 sanitizer errors

2024-07-04 Thread Nicholas Piggin
On Tue Jul 2, 2024 at 4:23 PM AEST, Thomas Huth wrote: > On 02/07/2024 00.23, BALATON Zoltan wrote: > > On Mon, 1 Jul 2024, Michael S. Tsirkin wrote: > >> On Thu, Jun 27, 2024 at 10:37:43PM +0900, Akihiko Odaki wrote: > >>> Based-on: > >>> <3ad18bc590ef28e1526e8053568086b453e7ffde.1718211878.git.q

Re: [PATCH 07/13] RFC migration: icp/server is a mess

2023-10-20 Thread Nicholas Piggin
On Fri Oct 20, 2023 at 6:33 PM AEST, Greg Kurz wrote: > On Fri, 20 Oct 2023 17:49:38 +1000 > "Nicholas Piggin" wrote: > > > On Fri Oct 20, 2023 at 7:39 AM AEST, Greg Kurz wrote: > > > On Thu, 19 Oct 2023 21:08:25 +0200 > > > Juan Quint

Re: [PATCH v2 07/13] migration: Hack to maintain backwards compatibility for ppc

2023-10-20 Thread Nicholas Piggin
pre_2_10_vmstate_dummy_icp > * unregister pre_2_10_vmstate_dummy_icp > * register real vmstate_icp > > Created vmstate_replace_hack_for_ppc() with warnings left and right > that it is a hack. Thanks. We'll look at deprecating 2.9 soon so this can all be removed. Reviewed-by: Ni

Re: [PATCH 07/13] RFC migration: icp/server is a mess

2023-10-20 Thread Nicholas Piggin
On Fri Oct 20, 2023 at 7:39 AM AEST, Greg Kurz wrote: > On Thu, 19 Oct 2023 21:08:25 +0200 > Juan Quintela wrote: > > > Current code does: > > - register pre_2_10_vmstate_dummy_icp with "icp/server" and instance > > dependinfg on cpu number > > - for newer machines, it register vmstate_icp with

Re: [PATCH v3 0/9] bulk: Replace CONFIG_SOFTMMU by !CONFIG_USER_ONLY/CONFIG_SYSTEM_ONLY

2023-06-14 Thread Nicholas Piggin
On Tue Jun 13, 2023 at 11:33 PM AEST, Philippe Mathieu-Daudé wrote: > Missing review: 1, 7, 8 > > Since v2: > - Rebased > - Added R-b tags > - Rework i386_tr_init_disas_context() patch (Richard) > - Dropped RFC prefix > > This series aims to clarify the CONFIG_[USER|SYSTEM] vs CONFIG_SOFTMMU > conf

Re: [PATCH v3 4/9] target/ppc: Check for USER_ONLY definition instead of SOFTMMU one

2023-06-14 Thread Nicholas Piggin
On Tue Jun 13, 2023 at 11:33 PM AEST, Philippe Mathieu-Daudé wrote: > Since we *might* have user emulation with softmmu, > replace the system emulation check by !user emulation one. > > Signed-off-by: Philippe Mathieu-Daudé > Reviewed-by: Richard Henderson Reviewed-by: