[PATCH 1/2] ppc/pnv: Begin a more complete ADU LPC model for POWER9/10

2024-04-17 Thread Nicholas Piggin
the XSCOM bridge implementation, and pnv_adu.c implements the ADU registers and other functions. So far, just the ADU no-op registers in the pnv_xscom.c default handler are moved over to the adu model. Signed-off-by: Nicholas Piggin --- include/hw/ppc/pnv_adu.h | 34 include/hw/ppc

[PATCH 2/2] ppc/pnv: Implement ADU access to LPC space

2024-04-17 Thread Nicholas Piggin
. This requires a linkage between adu and lpc, which allows adu to perform memory access in the lpc space. Signed-off-by: Nicholas Piggin --- include/hw/ppc/pnv_adu.h | 7 include/hw/ppc/pnv_lpc.h | 5 +++ hw/ppc/pnv.c | 4 ++ hw/ppc/pnv_adu.c | 91

[PATCH 0/2] ppc/pnv: ADU model for POWER9/10

2024-04-17 Thread Nicholas Piggin
address space. Patch 2 implements one of the memory access functions of the ADU that drives access to LPC address space from XSCOM register operations which is non-trivial but there are similar examples already in tree. Thanks, Nick Nicholas Piggin (2): ppc/pnv: Begin a more complete ADU LPC model

Re: [PATCH for-9.0] ppc440_pcix: Do not expose a bridge device on PCI bus

2024-04-16 Thread Nicholas Piggin
On Tue Apr 16, 2024 at 7:43 PM AEST, BALATON Zoltan wrote: > On Tue, 16 Apr 2024, Nicholas Piggin wrote: > > On Wed Apr 10, 2024 at 9:03 PM AEST, BALATON Zoltan wrote: > >> On Wed, 10 Apr 2024, Nicholas Piggin wrote: > >>> On Wed Apr 10, 2024 at 9:55 AM AEST, BAL

Re: [PATCH for-9.0] ppc440_pcix: Do not expose a bridge device on PCI bus

2024-04-15 Thread Nicholas Piggin
On Wed Apr 10, 2024 at 9:03 PM AEST, BALATON Zoltan wrote: > On Wed, 10 Apr 2024, Nicholas Piggin wrote: > > On Wed Apr 10, 2024 at 9:55 AM AEST, BALATON Zoltan wrote: > >> Real 460EX SoC apparently does not expose a bridge device and having > >> it appear on PCI b

Re: [PATCH for-9.0] ppc440_pcix: Do not expose a bridge device on PCI bus

2024-04-09 Thread Nicholas Piggin
On Wed Apr 10, 2024 at 9:55 AM AEST, BALATON Zoltan wrote: > Real 460EX SoC apparently does not expose a bridge device and having > it appear on PCI bus confuses an AmigaOS file system driver that uses > this to detect which machine it is running on. Since values written > here by firmware are

[PATCH v2 3/3] tcg/cputlb: remove other-cpu capability from TLB flushing

2024-04-05 Thread Nicholas Piggin
, this is a footgun waiting to go off. There do not seem to be any callers that flush other CPUs, so remove the capability. Signed-off-by: Nicholas Piggin --- accel/tcg/cputlb.c | 42 +- 1 file changed, 9 insertions(+), 33 deletions(-) diff --git a/accel/tcg

[PATCH v2 1/3] target/ppc: Fix broadcast tlbie synchronisation

2024-04-05 Thread Nicholas Piggin
o required that the TB is ended, which will guarantee all CPUs have run the work before the next instruction will be executed. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Nicholas Piggin --- target/ppc/helper_regs.c | 2 +- target/ppc/mmu_helper.c

[PATCH v2 2/3] tcg/cputlb: Remove non-synced variants of global TLB flushes

2024-04-05 Thread Nicholas Piggin
: tlb_flush_range_by_mmuidx_all_cpus: never used. tlb_flush_by_mmuidx_all_cpus: never used. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Nicholas Piggin --- docs/devel/multi-thread-tcg.rst | 13 ++-- include/exec/exec-all.h | 97 +- accel/tcg

[PATCH-for-9.1 v2 0/3] target/ppc: fix tlb flushing race (plus

2024-04-05 Thread Nicholas Piggin
*_all_cpus_synced() like other arch, then 'powerpc/mmu.elf tlbie:tlbi-this-cpu' also breaks. Since v1 I understood the full problem and fix, and fixed the fix. Thanks, Nick Nicholas Piggin (3): target/ppc: Fix broadcast tlbie synchronisation tcg/cputlb: Remove non-synced variants of global TLB

Re: TCG change broke MorphOS boot on sam460ex

2024-04-02 Thread Nicholas Piggin
On Tue Apr 2, 2024 at 9:32 PM AEST, BALATON Zoltan wrote: > On Thu, 21 Mar 2024, BALATON Zoltan wrote: > > On 27/2/24 17:47, BALATON Zoltan wrote: > >> Hello, > >> > >> Commit 18a536f1f8 (accel/tcg: Always require can_do_io) broke booting > >> MorphOS on sam460ex (this was before 8.2.0 and I

Re: [PATCH 0/2] P11 support for QEMU

2024-04-02 Thread Nicholas Piggin
On Mon Apr 1, 2024 at 3:55 PM AEST, Aditya Gupta wrote: > This patch series adds support for Power11 pseries and powernv machine targets > to emulate VMs running on Power11. > > Most of the P11 support code has been taken from P10 code in QEMU. > And has been tested in pseries, powernv, with and

[PULL 5/8] target/ppc: Fix GDB register indexing on secondary CPUs

2024-03-31 Thread Nicholas Piggin
the gdb_id values, then return early if the XML is cached. Otherwise we generate the XML using the now already initialised gdb_id values. Fixes: 1b53948ff8f7 ("target/ppc: Use GDBFeature for dynamic XML") Reviewed-by: Nicholas Piggin Signed-off-by: Benjamin Gray Signed-off-by: Nicho

[PULL 4/8] target/ppc: Restore [H]DEXCR to 64-bits

2024-03-31 Thread Nicholas Piggin
) Reviewed-by: Nicholas Piggin Signed-off-by: Benjamin Gray Signed-off-by: Nicholas Piggin --- target/ppc/cpu_init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index 7e65f08147..22fdea093b 100644 --- a/target/ppc/cpu_in

[PULL 7/8] tests/avocado: Fix ppc_hv_tests.py xorriso dependency guard

2024-03-31 Thread Nicholas Piggin
to get things working. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2246 Fixes: c9cb496710758 ("tests/avocado: ppc add hypervisor tests") Signed-off-by: Nicholas Piggin --- tests/avocado/ppc_hv_tests.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --g

[PULL 8/8] tests/avocado: ppc_hv_tests.py set alpine time before setup-alpine

2024-03-31 Thread Nicholas Piggin
this by setting time from the host time before running setup-alpine. Fixes: c9cb496710758 ("tests/avocado: ppc add hypervisor tests") Signed-off-by: Nicholas Piggin --- tests/avocado/ppc_hv_tests.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/avocado/ppc_hv_tests.py b/tes

[PULL 1/8] spapr: nested: use bitwise NOT operator for flags check

2024-03-31 Thread Nicholas Piggin
by: Harsh Prateek Bora Signed-off-by: Nicholas Piggin --- hw/ppc/spapr_nested.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/spapr_nested.c b/hw/ppc/spapr_nested.c index 936659b4c0..c02785756c 100644 --- a/hw/ppc/spapr_nested.c +++ b/hw/ppc/spapr_nested.c @@ -1511,7

[PULL 6/8] target/ppc: Do not clear MSR[ME] on MCE interrupts to supervisor

2024-03-31 Thread Nicholas Piggin
) Reviewed-by: Harsh Prateek Bora Signed-off-by: Nicholas Piggin --- target/ppc/excp_helper.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index 80f584f933..674c05a2ce 100644 --- a/target/ppc/excp_helper.c +++ b/

[PULL 2/8] hw/ppc/spapr: Include missing 'sysemu/tcg.h' header

2024-03-31 Thread Nicholas Piggin
t implicit function declarations [-Wimplicit-function-declaration] if (tcg_enabled()) { ^ Reviewed-by: Harsh Prateek Bora Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Nicholas Piggin --- hw/ppc/spapr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/ppc/spapr.c b/hw/p

[PULL 3/8] target/ppc/mmu-radix64: Use correct string format in walk_tree()

2024-03-31 Thread Nicholas Piggin
From: Philippe Mathieu-Daudé 'mask', 'nlb' and 'base_addr' are all uin64_t types. Use the corresponding PRIx64 format. Fixes: d2066bc50d ("target/ppc: Check page dir/table base alignment") Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Nicholas Piggin --- target/ppc/mmu-rad

[PULL 0/8] ppc-for-9.0-3 queue

2024-03-31 Thread Nicholas Piggin
. Benjamin Gray (2): target/ppc: Restore [H]DEXCR to 64-bits target/ppc: Fix GDB register indexing on secondary CPUs Harsh Prateek Bora (1): spapr: nested: use bitwise NOT operator for flags check Nicholas Piggin (3): target/ppc: Do not clear MSR[ME] on MCE

Re: [PATCH 0/3] target/ppc: fix tlb flushing race

2024-03-28 Thread Nicholas Piggin
On Thu Mar 28, 2024 at 8:15 PM AEST, Nicholas Piggin wrote: > On Thu Mar 28, 2024 at 6:12 PM AEST, Nicholas Piggin wrote: > > On Thu Mar 28, 2024 at 3:31 PM AEST, Nicholas Piggin wrote: > > > ppc broadcast tlb flushes should be synchronised with other vCPUs, > > > l

Re: [PATCH 0/3] target/ppc: fix tlb flushing race

2024-03-28 Thread Nicholas Piggin
On Thu Mar 28, 2024 at 6:12 PM AEST, Nicholas Piggin wrote: > On Thu Mar 28, 2024 at 3:31 PM AEST, Nicholas Piggin wrote: > > ppc broadcast tlb flushes should be synchronised with other vCPUs, > > like all other architectures that support such operations seem to > > be doin

Re: [PATCH 0/3] target/ppc: fix tlb flushing race

2024-03-28 Thread Nicholas Piggin
On Thu Mar 28, 2024 at 3:31 PM AEST, Nicholas Piggin wrote: > ppc broadcast tlb flushes should be synchronised with other vCPUs, > like all other architectures that support such operations seem to > be doing. > > Fixing ppc removes the last caller of the non-synced TLB flush >

[PATCH 3/3] tcg/cputlb: remove other-cpu capability from TLB flushing

2024-03-27 Thread Nicholas Piggin
, this is a footgun waiting to go off. There do not seem to be any callers that flush other CPUs, so remove the capability. Signed-off-by: Nicholas Piggin --- accel/tcg/cputlb.c | 42 +- 1 file changed, 9 insertions(+), 33 deletions(-) diff --git a/accel/tcg/cputlb.c b

[PATCH 2/3] tcg/cputlb: Remove non-synced variants of global TLB flushes

2024-03-27 Thread Nicholas Piggin
These are no longer used. Signed-off-by: Nicholas Piggin --- docs/devel/multi-thread-tcg.rst | 13 ++-- include/exec/exec-all.h | 97 +- accel/tcg/cputlb.c | 103 3 files changed, 19 insertions(+), 194 deletions

[PATCH 0/3] target/ppc: fix tlb flushing race

2024-03-27 Thread Nicholas Piggin
2 and 3 until 9.1 to avoid churn (unless someone prefers to remove the dead code asap). Thanks, Nick Nicholas Piggin (3): target/ppc: Fix broadcast tlbie synchronisation tcg/cputlb: Remove non-synced variants of global TLB flushes tcg/cputlb: remove other-cpu capability from TLB flushing

[PATCH 1/3] target/ppc: Fix broadcast tlbie synchronisation

2024-03-27 Thread Nicholas Piggin
anywhere. Signed-off-by: Nicholas Piggin --- target/ppc/helper_regs.c | 2 +- target/ppc/mmu_helper.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target/ppc/helper_regs.c b/target/ppc/helper_regs.c index 25258986e3..9094ae5004 100644 --- a/target/ppc/helper_regs.c +++ b

[PATCH 1/4] tests/avocado: Fix ppc_hv_tests.py xorriso dependency guard

2024-03-27 Thread Nicholas Piggin
to get things working. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2246 Signed-off-by: Nicholas Piggin --- tests/avocado/ppc_hv_tests.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/avocado/ppc_hv_tests.py b/tests/avocado/ppc_hv_tests.py index

[PATCH 2/4] tests/avocado: ppc_hv_tests.py set alpine time before setup-alpine

2024-03-27 Thread Nicholas Piggin
this by setting time from the host time before running setup-alpine. Signed-off-by: Nicholas Piggin --- tests/avocado/ppc_hv_tests.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/avocado/ppc_hv_tests.py b/tests/avocado/ppc_hv_tests.py index 2c8ddd9257..bf8822bb97 100644 --- a/tests

[PATCH 3/4] tests/avocado: exec_command should not consume console output

2024-03-27 Thread Nicholas Piggin
for. This solves occasional hangs in ppc_hv_tests.py, usually when run on KVM hosts that are fast enough to output important lines quickly enough to be consumed by exec_command, so they get missed by subsequent wait for pattern calls. Signed-off-by: Nicholas Piggin --- tests/avocado/avocado_qemu

[PATCH 0/4] tests/avocado: Fixes for ppc_hv_tests.py

2024-03-27 Thread Nicholas Piggin
, then patch 4 should be left of too, but 1 and 2 at least should resolve some CI failures and are self-contained. Thanks, Nick Nicholas Piggin (4): tests/avocado: Fix ppc_hv_tests.py xorriso dependency guard tests/avocado: ppc_hv_tests.py set alpine time before setup-alpine tests/avocado

[PATCH 4/4] tests/avocado: Mark ppc_hv_tests.py as non-flaky after fixed console interaction

2024-03-27 Thread Nicholas Piggin
Now that exec_command doesn't incorrectly consume console output, and guest time is set correctly, ppc_hv_tests.py is working more reliably. Try marking it non-flaky. Signed-off-by: Nicholas Piggin --- tests/avocado/ppc_hv_tests.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests

[RFC PATCH] target/ppc: Fix TCG PMC5 instruction counting

2024-03-21 Thread Nicholas Piggin
PMC5 does not count instructions when single stepping (with gdb, haven't tried single stepping inside the target), or when taking exceptions. At least the single-steppig is a bit of a landmine for replay. I don't quite understand the logic of the approach taken for counting now. AFAIKS

[PATCH] target/ppc: Do not clear MSR[ME] on MCE interrupts to supervisor

2024-03-20 Thread Nicholas Piggin
Signed-off-by: Nicholas Piggin --- target/ppc/excp_helper.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index 80f584f933..674c05a2ce 100644 --- a/target/ppc/excp_helper.c +++ b/target/ppc/excp_helper.c @@ -1345,

Re: [PATCH-for-9.1 19/21] target/ppc: Factor ppc_add_alias_definitions() out

2024-03-19 Thread Nicholas Piggin
On Fri Mar 15, 2024 at 11:09 PM AEST, Philippe Mathieu-Daudé wrote: > Factor ppc_add_alias_definitions() out of qmp_query_cpu_definitions() > to clearly see the generic pattern used in all targets. Looks equivalent. Reviewed-by: Nicholas Piggin > > Signed-off-by: Philippe M

Re: [PATCH v2 1/2] target/ppc: Merge various fpu helpers

2024-03-19 Thread Nicholas Piggin
On Fri Mar 15, 2024 at 4:44 PM AEST, Chinmay Rath wrote: > This patch merges the definitions of the following set of fpu helper methods, > which are similar, using macros : > > 1. f{add, sub, mul, div}(s) > 2. fre(s) > 3. frsqrte(s) > Reviewed-by: Nicholas Piggin > Sig

Re: [PATCH] target/ppc/mmu-radix64: Use correct string format in walk_tree()

2024-03-19 Thread Nicholas Piggin
Thanks, I can put this in the ppc tree. Thanks, Nick On Tue Mar 19, 2024 at 4:30 PM AEST, Philippe Mathieu-Daudé wrote: > +Anton > > On 19/3/24 06:10, Philippe Mathieu-Daudé wrote: > > 'mask', 'nlb' and 'base_addr' are all uin64_t types. > > Use the corresponding PRIx64 format. > > > > Fixes:

Re: [PATCH-for-9.1 18/27] target/ppc: Convert to TCGCPUOps::get_cpu_state()

2024-03-19 Thread Nicholas Piggin
On Wed Mar 20, 2024 at 1:42 AM AEST, Philippe Mathieu-Daudé wrote: > Convert cpu_get_tb_cpu_state() to TCGCPUOps::get_cpu_state(), > unifying with the method declared in target/ppc/helper_regs.c. Looks okay AFAIKS. Reviewed-by: Nicholas Piggin > > Signed-off-by: Philippe M

Re: [PATCH-for-9.1 17/27] target/ppc: Indent ppc_tcg_ops[] with 4 spaces

2024-03-19 Thread Nicholas Piggin
Acked-by: Nicholas Piggin On Wed Mar 20, 2024 at 1:42 AM AEST, Philippe Mathieu-Daudé wrote: > Signed-off-by: Philippe Mathieu-Daudé > --- > target/ppc/cpu_init.c | 26 +- > 1 file changed, 13 insertions(+), 13 deletions(-) > > diff --git a/targe

Re: [PATCH v5 08/24] replay: Fix migration use of clock

2024-03-19 Thread Nicholas Piggin
On Wed Mar 20, 2024 at 6:40 AM AEST, Alex Bennée wrote: > Nicholas Piggin writes: > > > Migration reads host clocks when not holding the replay_mutex, which > > asserts when recording a trace. It seems that these migration times > > should be host times like other stat

Re: [PATCH v5 13/24] tests/avocado: replay_linux.py remove the timeout expected guards

2024-03-19 Thread Nicholas Piggin
On Wed Mar 20, 2024 at 3:57 AM AEST, Alex Bennée wrote: > Nicholas Piggin writes: > > > replay_linux tests with virtio on aarch64 gciv3 and x86-64 q35 machines > > seems to be more reliable now, so timeouts are no longer expected. > > pc_i440fx, gciv2, and non-virtio stil

Re: [PATCH 2/2] target/ppc: Fix GDB register indexing on secondary CPUs

2024-03-19 Thread Nicholas Piggin
d the matching gdb_id value on that > thread's SPRs. > > This is a minimal fix to first assign the gdb_id values, then return > early if the XML is cached. Otherwise we generate the XML using the > now already initialised gdb_id values. Reviewed-by: Nicholas Piggin > > Fixes: 1b53948ff

Re: [PATCH 1/2] target/ppc: Restore [H]DEXCR to 64-bits

2024-03-19 Thread Nicholas Piggin
r bag for me. > Fixes: c9de140c2171 ("target/ppc: Fix width of some 32-bit SPRs") Should that hash be fbda88f7abdee? Reviewed-by: Nicholas Piggin > Signed-off-by: Benjamin Gray > --- > target/ppc/cpu_init.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >

[PATCH v5 13/24] tests/avocado: replay_linux.py remove the timeout expected guards

2024-03-18 Thread Nicholas Piggin
400 seconds each, so add the SPEED=slow guard. Signed-off-by: Nicholas Piggin --- tests/avocado/replay_linux.py | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/avocado/replay_linux.py b/tests/avocado/replay_linux.py index b3b91ddd9a..b3b74a367c 100644

[PATCH v5 24/24] tests/avocado: replay_linux.py add ppc64 pseries test

2024-03-18 Thread Nicholas Piggin
Add a ppc64 pseries test. IO in SLOF is very slow when running in record-replay modes, so this test uses guestfish to extract the kernel and initrd and boot them directly, bypassing SLOF. Signed-off-by: Nicholas Piggin --- tests/avocado/replay_linux.py | 72

[PATCH v5 22/24] target/ppc: fix timebase register reset state

2024-03-18 Thread Nicholas Piggin
been observed to cause replay bugs when running Linux. Fix this by resetting using a time of 0. Signed-off-by: Nicholas Piggin --- hw/ppc/ppc.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/hw/ppc/ppc.c b/hw/ppc/ppc.c index e6fa5580c0..ddcbf8972b 100644 --- a/hw

[PATCH v5 15/24] tests/avocado: reverse_debugging.py add test for x86-64 q35 machine

2024-03-18 Thread Nicholas Piggin
The x86-64 pc machine has a problem with record/replay. q35 seems to work well. Add a new q35 test and update the flaky message for pc. Signed-off-by: Nicholas Piggin --- tests/avocado/reverse_debugging.py | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests

[PATCH v5 21/24] tests/avocado: reverse_debugging.py test auto-snapshot mode

2024-03-18 Thread Nicholas Piggin
, and reverse-stepped from there. This should load the last auto-snapshot taken. The test hangs on x86-64 and aarch64 with autosnapshots, so it is disabled for them. Signed-off-by: Nicholas Piggin --- tests/avocado/reverse_debugging.py | 28 +++- 1 file changed, 23 insertions

[PATCH v5 16/24] tests/avocado: reverse_debugging.py verify addresses between record and replay

2024-03-18 Thread Nicholas Piggin
, it does not advance the icount, so a workaround is added for it. Signed-off-by: Nicholas Piggin --- tests/avocado/reverse_debugging.py | 68 +- 1 file changed, 58 insertions(+), 10 deletions(-) diff --git a/tests/avocado/reverse_debugging.py b/tests/avocado

[PATCH v5 14/24] tests/avocado: reverse_debugging.py mark aarch64 and pseries as not flaky

2024-03-18 Thread Nicholas Piggin
These seem to be quite solid, including on several gitlab CI runs. Enabling them should help catch breakage in future. And update the powernv comment -- gitlab isn't the problem, there are known gaps in implementation. Tested-by: Alex Bennée Reviewed-by: Alex Bennée Signed-off-by: Nicholas

[PATCH v5 20/24] replay: simple auto-snapshot mode for record

2024-03-18 Thread Nicholas Piggin
of recent snapshots. This could be done by the debugger or other program that talks QMP, but for setting up simple scenarios and tests, this is more convenient. Signed-off-by: Nicholas Piggin --- docs/system/replay.rst | 5 include/sysemu/replay.h | 11 replay/replay-snapshot.c

[PATCH v5 23/24] spapr: Fix vpa dispatch count for record-replay

2024-03-18 Thread Nicholas Piggin
increment to keep track of whether the vCPU is considered dispatched or not, and only consider it preempted when calling cede / confer / join / stop-self / etc. Signed-off-by: Nicholas Piggin --- include/hw/ppc/spapr_cpu_core.h | 3 +++ hw/ppc/spapr.c | 36

[PATCH v5 11/24] virtio-net: Use virtual time for RSC timers

2024-03-18 Thread Nicholas Piggin
Receive coalescing is visible to the target machine, so its timers should use virtual time like other timers in virtio-net, to be compatible with record-replay. Signed-off-by: Nicholas Piggin --- hw/net/virtio-net.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw

[PATCH v5 18/24] tests/avocado: reverse_debugging reverse-step at the end of the trace

2024-03-18 Thread Nicholas Piggin
, and it adds a replay test that runs to the end of the trace, steps back then forward and verifies the pc. x86_64 and aarch64 have problems with verifying the pc at the end of the trace after reverse-stepping, so add a workaround to skip that check for them. Signed-off-by: Nicholas Piggin --- tests

[PATCH v5 19/24] tests/avocado: reverse_debugging.py add snapshot testing

2024-03-18 Thread Nicholas Piggin
-by: Nicholas Piggin --- tests/avocado/reverse_debugging.py | 19 +-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/tests/avocado/reverse_debugging.py b/tests/avocado/reverse_debugging.py index c0cf580d5c..185f055cf9 100644 --- a/tests/avocado/reverse_debugging.py +++ b

[PATCH v5 12/24] savevm: Fix load_snapshot error path crash

2024-03-18 Thread Nicholas Piggin
An error path missed setting *errp, which can cause a NULL deref. Signed-off-by: Nicholas Piggin --- migration/savevm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/migration/savevm.c b/migration/savevm.c index 388d7af7cd..10c187dd10 100644 --- a/migration/savevm.c +++ b/migration

[PATCH v5 17/24] tests/avocado: reverse_debugging.py stop VM before sampling icount

2024-03-18 Thread Nicholas Piggin
Rather than sampling icount while the vm is running, stop it before sampling icount. This allows the actual last recorded icount in the trace to be found. Signed-off-by: Nicholas Piggin --- tests/avocado/reverse_debugging.py | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff

[PATCH v5 09/24] replay: Fix migration replay_mutex locking

2024-03-18 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 v5 10/24] virtio-net: Use replay_schedule_bh_event for bhs that affect machine state

2024-03-18 Thread Nicholas Piggin
The regular qemu_bh_schedule() calls result in non-deterministic execution of the bh in record-replay mode, which causes replay failure. Signed-off-by: Nicholas Piggin --- hw/net/virtio-net.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/hw/net/virtio-net.c b

[PATCH v5 05/24] Revert "replay: stop us hanging in rr_wait_io_event"

2024-03-18 Thread Nicholas Piggin
is that related events will not get consumed at the same points (e.g., reading the clock). A hang with zero icount always seems to be a symptom of an earlier problem that has caused the recording to become out of synch with the execution and consumption of events by replay. Signed-off-by: Nicholas

[PATCH v5 08/24] replay: Fix migration use of clock

2024-03-18 Thread Nicholas Piggin
Migration reads host clocks when not holding the replay_mutex, which asserts when recording a trace. It seems that these migration times should be host times like other statistics in MigrationState. These do not require the replay_mutex. Signed-off-by: Nicholas Piggin --- migration/migration.c

[PATCH v5 01/24] scripts/replay-dump.py: Update to current rr record format

2024-03-18 Thread Nicholas Piggin
The v12 format support for replay-dump has a few issues still. This fixes async decoding; adds event, shutdown, and end decoding; fixes audio in / out events, fixes checkpoint checking of following async events. Reviewed-by: Alex Bennée Signed-off-by: Nicholas Piggin --- scripts/replay-dump.py

[PATCH v5 07/24] chardev: set record/replay on the base device of a muxed device

2024-03-18 Thread Nicholas Piggin
QEMU_CHAR_FEATURE_REPLAY on the base chardev fixes the problem. Signed-off-by: Nicholas Piggin --- chardev/char.c | 71 +++--- 1 file changed, 50 insertions(+), 21 deletions(-) diff --git a/chardev/char.c b/chardev/char.c index 3c43fb1278..ba847b6e9e 100644

[PATCH v5 03/24] tests/avocado: excercise scripts/replay-dump.py in replay tests

2024-03-18 Thread Nicholas Piggin
This runs replay-dump.py after recording a trace, and fails the test if the script fails. replay-dump.py is modified to exit with non-zero if an error is encountered while parsing, to support this. Reviewed-by: Alex Bennée Reviewed-by: Pavel Dovgalyuk Signed-off-by: Nicholas Piggin

[PATCH v5 06/24] tests/avocado: replay_kernel.py add x86-64 q35 machine test

2024-03-18 Thread Nicholas Piggin
The x86-64 pc machine is flaky with record/replay, but q35 is more stable. Add a q35 test to replay_kernel.py. Signed-off-by: Nicholas Piggin --- tests/avocado/replay_kernel.py | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tests/avocado/replay_kernel.py

[PATCH v5 04/24] replay: allow runstate shutdown->running when replaying trace

2024-03-18 Thread Nicholas Piggin
-by: Nicholas Piggin --- include/sysemu/runstate.h | 1 + replay/replay.c | 2 ++ system/runstate.c | 31 --- 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/include/sysemu/runstate.h b/include/sysemu/runstate.h index 0117d243c4

[PATCH v5 02/24] scripts/replay-dump.py: rejig decoders in event number order

2024-03-18 Thread Nicholas Piggin
Sort decoder functions to be ascending in order of event number, same as the decoder tables. Reviewed-by: Alex Bennée Signed-off-by: Nicholas Piggin --- scripts/replay-dump.py | 56 +- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git

[PATCH v5 00/24] replay: fixes and new test cases

2024-03-18 Thread Nicholas Piggin
, ppc64, and x86_64 tests: https://gitlab.com/npiggin/qemu/-/jobs/6416485196 https://gitlab.com/npiggin/qemu/-/jobs/6416485200 Thanks, Nick Nicholas Piggin (24): scripts/replay-dump.py: Update to current rr record format scripts/replay-dump.py: rejig decoders in event number order tests/avocado

Re: [PATCH v4 05/24] Revert "replay: stop us hanging in rr_wait_io_event"

2024-03-13 Thread Nicholas Piggin
On Wed Mar 13, 2024 at 7:03 AM AEST, Alex Bennée wrote: > "Nicholas Piggin" writes: > > > On Tue Mar 12, 2024 at 11:33 PM AEST, Alex Bennée wrote: > >> Nicholas Piggin writes: > >> > >> > This reverts commit 1f881ea4a444ef36a8b690

Re: [PATCH v2 03/10] ppc/spapr|pnv: Remove SAO from pa-features

2024-03-13 Thread Nicholas Piggin
On Thu Mar 14, 2024 at 12:34 PM AEST, David Gibson wrote: > On Tue, Mar 12, 2024 at 11:14:12PM +1000, Nicholas Piggin wrote: > > SAO is a page table attribute that strengthens the memory ordering of > > accesses. QEMU with MTTCG does not implement this, so clear it in >

Re: [PATCH-for-9.0? 05/12] target/ppc: Rename init_excp_4xx_softmmu() -> init_excp_4xx()

2024-03-13 Thread Nicholas Piggin
On Thu Mar 14, 2024 at 7:33 AM AEST, Philippe Mathieu-Daudé wrote: > Unify with other init_excp_FOO() in the same file. > > Signed-off-by: Philippe Mathieu-Daudé Acked-by: Nicholas Piggin > --- > target/ppc/cpu_init.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions

Re: [PATCH v4 11/24] net: Use virtual time for net announce

2024-03-13 Thread Nicholas Piggin
On Tue Mar 12, 2024 at 9:12 PM AEST, Pavel Dovgalyuk wrote: > On 12.03.2024 14:05, Nicholas Piggin wrote: > > On Tue Mar 12, 2024 at 7:09 PM AEST, Pavel Dovgalyuk wrote: > >> This won't work, as needed. Announce timer can't be enabled, because > >> it is set in po

Re: [PATCH v4 11/24] net: Use virtual time for net announce

2024-03-12 Thread Nicholas Piggin
On Tue Mar 12, 2024 at 9:12 PM AEST, Pavel Dovgalyuk wrote: > On 12.03.2024 14:05, Nicholas Piggin wrote: > > On Tue Mar 12, 2024 at 7:09 PM AEST, Pavel Dovgalyuk wrote: > >> This won't work, as needed. Announce timer can't be enabled, because > >> it is set in po

Re: [PATCH] target/ppc: Move floating-point arithmetic instructions to decodetree.

2024-03-12 Thread Nicholas Piggin
On Wed Mar 13, 2024 at 12:29 AM AEST, Peter Maydell wrote: > On Tue, 12 Mar 2024 at 14:25, Nicholas Piggin wrote: > > > > On Wed Mar 13, 2024 at 12:01 AM AEST, Richard Henderson wrote: > > > On 3/11/24 23:36, Nicholas Piggin wrote: > > > > [snip] > > &

Re: [PATCH v4 05/24] Revert "replay: stop us hanging in rr_wait_io_event"

2024-03-12 Thread Nicholas Piggin
On Wed Mar 13, 2024 at 7:03 AM AEST, Alex Bennée wrote: > "Nicholas Piggin" writes: > > > On Tue Mar 12, 2024 at 11:33 PM AEST, Alex Bennée wrote: > >> Nicholas Piggin writes: > >> > >> > This reverts commit 1f881ea4a444ef36a8b690

Re: [PATCH-for-9.0 v2 0/3] system/physmem: Fix migration dirty bitmap coherency with TCG memory access

2024-03-12 Thread Nicholas Piggin
On Wed Mar 13, 2024 at 7:09 AM AEST, Peter Xu wrote: > On Tue, Mar 12, 2024 at 09:14:55PM +0100, Philippe Mathieu-Daudé wrote: > > Respin of Nicholas patch, without introducing > > tcg_cpu_physical_memory_dirty_bits_cleared(), > > and split in more digestible parts. > &

Re: [PATCH-for-9.0 v2 1/3] physmem: Expose tlb_reset_dirty_range_all()

2024-03-12 Thread Nicholas Piggin
On Wed Mar 13, 2024 at 6:14 AM AEST, Philippe Mathieu-Daudé wrote: > In order to call tlb_reset_dirty_range_all() outside of > system/physmem.c, expose its prototype. > Acked-by: Nicholas Piggin > Signed-off-by: Philippe Mathieu-Daudé > --- > include/exec/exec-all.h | 1 + &

[PULL 32/38] spapr: nested: Introduce H_GUEST_CREATE_VCPU hcall.

2024-03-12 Thread Nicholas Piggin
-by: Nicholas Piggin Signed-off-by: Michael Neuling Signed-off-by: Harsh Prateek Bora Signed-off-by: Nicholas Piggin --- hw/ppc/spapr_nested.c | 62 +++ include/hw/ppc/spapr.h| 2 ++ include/hw/ppc/spapr_nested.h | 8 + 3 files changed, 72

[PULL 12/38] MAINTAINERS: Remove myself as reviewer from PPC

2024-03-12 Thread Nicholas Piggin
From: Cédric Le Goater PPC maintainership has been a side activity for the last 2 years and it is time to let go some of it now that Nick has taken over. Signed-off-by: Cédric Le Goater Signed-off-by: Nicholas Piggin --- MAINTAINERS | 3 --- 1 file changed, 3 deletions(-) diff --git

[PULL 35/38] spapr: nested: Introduce H_GUEST_[GET|SET]_STATE hcalls.

2024-03-12 Thread Nicholas Piggin
which is used to modify the state of a guest or a guest VCPU. On success, guest (or its VCPU) state shall be updated as per the value field for the requested element(s). Reviewed-by: Nicholas Piggin Signed-off-by: Michael Neuling Signed-off-by: Harsh Prateek Bora Signed-off

[PULL 16/38] target/ppc: Add power10 pmu SPRs

2024-03-12 Thread Nicholas Piggin
for these SPRs. Add support to register generic read/write functions to these power10 pmu sprs to fix it. Reviewed-by: Nicholas Piggin Signed-off-by: Madhavan Srinivasan Signed-off-by: Nicholas Piggin --- target/ppc/cpu.h | 6 ++ target/ppc/cpu_init.c | 34 ++ 2

[PULL 38/38] spapr: nested: Introduce cap-nested-papr for Nested PAPR API

2024-03-12 Thread Nicholas Piggin
From: Harsh Prateek Bora Introduce a SPAPR capability cap-nested-papr which enables nested PAPR API for nested guests. This new API is to enable support for KVM on PowerVM and the support in Linux kernel has already merged upstream. Reviewed-by: Nicholas Piggin Signed-off-by: Michael Neuling

[PULL 33/38] spapr: nested: Extend nested_ppc_state for nested PAPR API

2024-03-12 Thread Nicholas Piggin
From: Harsh Prateek Bora Currently, nested_ppc_state stores a certain set of registers and works with nested_[load|save]_state() for state transfer as reqd for nested-hv API. Extending these with additional registers state as reqd for nested PAPR API. Acked-by: Nicholas Piggin Suggested

[PULL 25/38] spapr: nested: register nested-hv api hcalls only for cap-nested-hv

2024-03-12 Thread Nicholas Piggin
reboots and re-registeration of hypercalls would hit assert otherwise. Reviewed-by: Nicholas Piggin Signed-off-by: Harsh Prateek Bora Signed-off-by: Nicholas Piggin --- hw/ppc/spapr.c| 1 + hw/ppc/spapr_hcall.c | 24 ++-- hw/ppc/spapr_nested.c

[PULL 37/38] spapr: nested: Introduce H_GUEST_RUN_VCPU hcall.

2024-03-12 Thread Nicholas Piggin
including HCALLs, hypervisor exceptions, or an outstanding Host Partition Interrupt. The reason that the Guest VCPU stopped running is communicated through R4 and the output buffer will be filled in with any relevant state. Reviewed-by: Nicholas Piggin Signed-off-by: Michael Neuling Signed-off

[PULL 20/38] target/ppc: Add gen_exception_err_nip() function

2024-03-12 Thread Nicholas Piggin
are similar so remove code duplication from those too while at it. Suggested-by: Nicholas Piggin Reviewed-by: Nicholas Piggin Signed-off-by: BALATON Zoltan Signed-off-by: Nicholas Piggin --- target/ppc/translate.c | 28 +++- 1 file changed, 15 insertions(+), 13 deletions

[PULL 06/38] ppc/spapr|pnv: Remove SAO from pa-features

2024-03-12 Thread Nicholas Piggin
Bora Signed-off-by: Nicholas Piggin --- hw/ppc/pnv.c | 2 +- hw/ppc/spapr.c | 14 ++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index 0b47b92baa..aa9786e970 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -150,7 +150,7 @@ static void

[PULL 31/38] spapr: nested: Introduce H_GUEST_[CREATE|DELETE] hcalls.

2024-03-12 Thread Nicholas Piggin
nested guests at once using a deleteAll flag. Reviewed-by: Nicholas Piggin Signed-off-by: Michael Neuling Signed-off-by: Harsh Prateek Bora Signed-off-by: Nicholas Piggin --- hw/ppc/spapr_nested.c | 103 ++ include/hw/ppc/spapr.h| 4 +- include

[PULL 28/38] spapr: nested: keep nested-hv related code restricted to its API.

2024-03-12 Thread Nicholas Piggin
From: Harsh Prateek Bora spapr_exit_nested and spapr_get_pate_nested_hv contains code which is specific to nested-hv API. Isolating code flows based on API helps extending it to be used with different API as well. Suggested-by: Nicholas Piggin Reviewed-by: Nicholas Piggin Signed-off-by: Harsh

[PULL 34/38] spapr: nested: Initialize the GSB elements lookup table.

2024-03-12 Thread Nicholas Piggin
routines for state exchange of each of the nested guest state elements for which get/set state should be supported by the API. [amachhiw: set the PCR whenever logical PVR is set] Reviewed-by: Nicholas Piggin Signed-off-by: Michael Neuling Signed-off-by: Shivaprasad G Bhat Signed-off-by: Amit

[PULL 29/38] spapr: nested: Document Nested PAPR API

2024-03-12 Thread Nicholas Piggin
From: Harsh Prateek Bora Adding initial documentation about Nested PAPR API to describe the set of APIs and its usage. Also talks about the Guest State Buffer elements and it's format which is used between L0/L1 to communicate L2 state. Reviewed-by: Nicholas Piggin Signed-off-by: Michael

[PULL 22/38] target/ppc: Clean up ifdefs in excp_helper.c, part 2

2024-03-12 Thread Nicholas Piggin
From: BALATON Zoltan Remove check for !defined(CONFIG_USER_ONLY) as this is already within an #ifndef CONFIG_USER_ONLY block. Reviewed-by: Harsh Prateek Bora Signed-off-by: BALATON Zoltan Signed-off-by: Nicholas Piggin --- target/ppc/excp_helper.c | 4 ++-- 1 file changed, 2 insertions

[PULL 18/38] target/ppc: Use env_cpu for cpu_abort in excp_helper

2024-03-12 Thread Nicholas Piggin
-off-by: BALATON Zoltan Signed-off-by: Nicholas Piggin --- target/ppc/excp_helper.c | 118 +-- 1 file changed, 63 insertions(+), 55 deletions(-) diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index 98952de267..56a5fe7f3b 100644 --- a/target/ppc

[PULL 30/38] spapr: nested: Introduce H_GUEST_[GET|SET]_CAPABILITIES hcalls.

2024-03-12 Thread Nicholas Piggin
. [amachhiw: support for p9 compat mode and return register bug fixes] Reviewed-by: Nicholas Piggin Signed-off-by: Michael Neuling Signed-off-by: Amit Machhiwal Signed-off-by: Harsh Prateek Bora Signed-off-by: Nicholas Piggin --- hw/ppc/spapr_nested.c | 115

[PULL 36/38] spapr: nested: Use correct source for parttbl info for nested PAPR API.

2024-03-12 Thread Nicholas Piggin
From: Harsh Prateek Bora For nested PAPR API, we use SpaprMachineStateNestedGuest struct to store partition table info, use the same in spapr_get_pate_nested() via helper. Reviewed-by: Nicholas Piggin Signed-off-by: Michael Neuling Signed-off-by: Harsh Prateek Bora Signed-off-by: Nicholas

[PULL 02/38] target/ppc: Prevent supervisor from modifying MSR[ME]

2024-03-12 Thread Nicholas Piggin
Prevent guest state modifying the MSR[ME] bit. Per ISA: An attempt to modify MSR[ME] in privileged but non-hypervisor state is ignored (i.e., the bit is not changed). Reviewed-by: Harsh Prateek Bora Signed-off-by: Nicholas Piggin --- target/ppc/helper_regs.c | 5 + 1 file changed, 5

[PULL 24/38] target/ppc: Remove interrupt handler wrapper functions

2024-03-12 Thread Nicholas Piggin
of these wrappers. This avoids one indirection and entirely compiles out the switch without TARGET_PPC64. Reviewed-by: Harsh Prateek Bora Signed-off-by: BALATON Zoltan Signed-off-by: Nicholas Piggin --- target/ppc/excp_helper.c | 67 +--- 1 file changed, 28

[PULL 11/38] ppc/pnv: Set POWER9, POWER10 ibm,pa-features bits

2024-03-12 Thread Nicholas Piggin
Copy the pa-features arrays from spapr, adjusting slightly as described in comments. Reviewed-by: Harsh Prateek Bora Signed-off-by: Nicholas Piggin --- hw/ppc/pnv.c | 67 -- hw/ppc/spapr.c | 1 + 2 files changed, 66 insertions(+), 2 deletions

[PULL 14/38] docs/system/ppc: Document running Linux on AmigaNG machines

2024-03-12 Thread Nicholas Piggin
Reviewed-by: Bernhard Beschow Reviewed-by: Nicholas Piggin Co-authored-by: Bernhard Beschow Signed-off-by: Bernhard Beschow Signed-off-by: BALATON Zoltan Signed-off-by: Nicholas Piggin --- MAINTAINERS | 1 + docs/system/ppc/amigang.rst | 161

  1   2   3   4   5   6   7   8   9   10   >