Re: [PATCH v7 04/10] target/ppc: Fix gen_sc to use correct nip

2024-03-12 Thread Nicholas Piggin
ets nip back but correctly set nip to > pc_next so we don't have to patch this in the exception handlers. > > Signed-off-by: BALATON Zoltan Reviewed-by: Nicholas Piggin > --- > target/ppc/excp_helper.c | 43 ++-- > target/ppc/translate.c

Re: [PATCH v7 03/10] target/ppc: Add gen_exception_err_nip() function

2024-03-12 Thread Nicholas Piggin
it. > > The gen_exception() and gen_exception_nip() functions are similar so > remove code duplication from those too while at it. > > Suggested-by: Nicholas Piggin > Signed-off-by: BALATON Zoltan Thanks for doing this one Reviewed-by: Nicholas Piggin > -

Re: [PATCH] target/ppc: Add power10 pmu SPRs

2024-03-12 Thread Nicholas Piggin
his is becuase, no read/write call-backs are registered 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 > --- > target/ppc/cpu.h | 6

Re: [PATCH v5 14/14] spapr: nested: Introduce cap-nested-papr for Nested PAPR API

2024-03-12 Thread Nicholas Piggin
"cap-nested-papr to proceed.\n"); > +return; > +} else { > +spapr->nested.api = NESTED_API_PAPR; > +} > + > +} else if (kvm_enabled()) { > +/* > + * this gets executed in L1 qemu when L2 is launched, >

Re: [PATCH v5 14/14] spapr: nested: Introduce cap-nested-papr for Nested PAPR API

2024-03-12 Thread Nicholas Piggin
On Fri Mar 8, 2024 at 9:19 PM AEST, Harsh Prateek Bora wrote: > 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. > > Signed-off-by: Mich

Re: [PATCH v5 13/14] spapr: nested: Introduce H_GUEST_RUN_VCPU hcall.

2024-03-12 Thread Nicholas Piggin
> > Signed-off-by: Michael Neuling > Signed-off-by: Harsh Prateek Bora Reviewed-by: Nicholas Piggin > --- > target/ppc/cpu.h | 2 + > hw/ppc/ppc.c | 10 ++ > hw/ppc/spapr_nested.c | 334 ++ > 3 files changed,

Re: [PATCH v5 12/14] spapr: nested: Use correct source for parttbl info for nested PAPR API.

2024-03-12 Thread Nicholas Piggin
hineStateNestedGuest *spapr_get_nested_guest(SpaprMachineState > *spapr, > + target_ulong lpid); Why is this made non-static? Doesn't seem to be needed in later patches either? Other than that, Reviewed-by: Nicholas Piggin >

Re: [PATCH v5 10/14] spapr: nested: Initialize the GSB elements lookup table.

2024-03-12 Thread Nicholas Piggin
> Signed-off-by: Shivaprasad G Bhat > Signed-off-by: Amit Machhiwal > Signed-off-by: Harsh Prateek Bora Reviewed-by: Nicholas Piggin > --- > include/hw/ppc/spapr_nested.h | 312 ++ > hw/ppc/spapr_nested.c | 486 +- &g

Re: [PATCH v5 11/14] spapr: nested: Introduce H_GUEST_[GET|SET]_STATE hcalls.

2024-03-12 Thread Nicholas Piggin
; Signed-off-by: Harsh Prateek Bora Reviewed-by: Nicholas Piggin > --- > include/hw/ppc/spapr.h| 3 + > include/hw/ppc/spapr_nested.h | 23 +++ > hw/ppc/spapr_nested.c | 268 ++ > 3 files changed, 294 insertions(+) > > d

Re: [PATCH v5 09/14] spapr: nested: Extend nested_ppc_state for nested PAPR API

2024-03-12 Thread Nicholas Piggin
PAPR API. > > Signed-off-by: Harsh Prateek Bora > Suggested-by: Nicholas Piggin I still have concerns with exactly how registers are saved and restored, but it's not necessarily a new problem with v2, and not so much fundamental design flow more of verifying details so I'm i

Re: [PATCH v5 08/14] spapr: nested: Introduce H_GUEST_CREATE_VCPU hcall.

2024-03-12 Thread Nicholas Piggin
for a guest gets deallocated on guest delete. > > Signed-off-by: Michael Neuling > Signed-off-by: Harsh Prateek Bora Reviewed-by: Nicholas Piggin > --- > include/hw/ppc/spapr.h| 2 ++ > include/hw/ppc/spapr_nested.h | 8 + > h

Re: [PATCH v5 06/14] spapr: nested: Introduce H_GUEST_[GET|SET]_CAPABILITIES hcalls.

2024-03-12 Thread Nicholas Piggin
capabilities that the Host Partition supports and may use. > > [amachhiw: support for p9 compat mode and return register bug fixes] > > Signed-off-by: Michael Neuling > Signed-off-by: Amit Machhiwal > Signed-off-by: Harsh Prateek Bora Reviewed-by: Nicholas Piggin

Re: [PATCH v5 07/14] spapr: nested: Introduce H_GUEST_[CREATE|DELETE] hcalls.

2024-03-12 Thread Nicholas Piggin
he nested guest being deleted. It also supports deleting all nested > guests at once using a deleteAll flag. > > Signed-off-by: Michael Neuling > Signed-off-by: Harsh Prateek Bora Reviewed-by: Nicholas Piggin > --- > include/hw/ppc/spapr.h| 4 +- > include/hw/pp

Re: [PATCH v5 04/14] spapr: nested: keep nested-hv related code restricted to its API.

2024-03-12 Thread Nicholas Piggin
sh Prateek Bora > Suggested-by: Nicholas Piggin Reviewed-by: Nicholas Piggin > --- > include/hw/ppc/spapr_nested.h | 3 +++ > hw/ppc/spapr.c| 6 +- > hw/ppc/spapr_nested.c | 25 ++--- > 3 files changed, 30 insertions(+), 4 deletio

Re: [PATCH v5 05/14] spapr: nested: Document Nested PAPR API

2024-03-12 Thread Nicholas Piggin
; > Signed-off-by: Michael Neuling > Signed-off-by: Harsh Prateek Bora Reviewed-by: Nicholas Piggin > --- > docs/devel/nested-papr.txt | 119 + > 1 file changed, 119 insertions(+) > create mode 100644 docs/devel/nested-papr.txt > >

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

2024-03-12 Thread Nicholas Piggin
how marked as being incompatible with rr? Thanks, Nick > > On 11.03.2024 20:40, Nicholas Piggin wrote: > > Using virtual time for announce ensures that guest visible effects > > are deterministic and don't break replay. > > > > Signed-off-by: Nicholas Piggin >

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

2024-03-12 Thread Nicholas Piggin
On Tue Mar 12, 2024 at 7:00 PM AEST, Pavel Dovgalyuk wrote: > On 11.03.2024 20:40, Nicholas Piggin wrote: > > record makes an initial snapshot when the machine is created, to enable > > reverse-debugging. Often the issue being debugged appears near the end of > > the trace, s

Re: [PATCH] spapr: avoid overhead of finding vhyp class in critical operations

2024-03-12 Thread Nicholas Piggin
On Tue Mar 12, 2024 at 6:56 PM AEST, Harsh Prateek Bora wrote: > > > On 3/12/24 14:18, Nicholas Piggin wrote: > > On Tue Mar 12, 2024 at 4:38 PM AEST, Harsh Prateek Bora wrote: > >> Hi Nick, > >> > >> One minor comment below: > &g

Re: [PATCH v3] docs/system/ppc: Document running Linux on AmigaNG machines

2024-03-12 Thread Nicholas Piggin
how Thanks, always helpful. Thanks, Nick > > > > >> Regards, > >> BALATON Zoltan > >> > >>> Co-authored-by: Bernhard Beschow > >>> Signed-off-by: BALATON Zoltan > >>> Reviewed-by: Nicholas Piggin > >>> Test

Re: [PATCH 06/13] ppc/spapr: Add pa-features for POWER10 machines

2024-03-12 Thread Nicholas Piggin
On Tue Mar 12, 2024 at 7:34 PM AEST, Harsh Prateek Bora wrote: > > > On 3/12/24 00:21, Nicholas Piggin wrote: > > From: Benjamin Gray > > > > Add POWER10 pa-features entry. > > > > Notably DEXCR and and [P]HASHST/[P]HASHCHK instruction support is > &g

Re: [PATCH 10/13] spapr: set MSR[ME] and MSR[FP] on client entry

2024-03-12 Thread Nicholas Piggin
On Tue Mar 12, 2024 at 8:03 PM AEST, Harsh Prateek Bora wrote: > > > On 3/12/24 00:21, Nicholas Piggin wrote: > > The initial MSR state for PAPR specifies MSR[ME] and MSR[FP] are set. > > > > Signed-off-by: Nicholas Piggin > > It would be good to mention PAPR se

Re: [PATCH 06/13] ppc/spapr: Add pa-features for POWER10 machines

2024-03-12 Thread Nicholas Piggin
On Tue Mar 12, 2024 at 7:59 PM AEST, BALATON Zoltan wrote: > On Tue, 12 Mar 2024, Nicholas Piggin wrote: > > On Tue Mar 12, 2024 at 7:07 AM AEST, BALATON Zoltan wrote: > >> On Mon, 11 Mar 2024, Philippe Mathieu-Daudé wrote: > >>> On 11/3/24 19:51, Nicholas Piggin wro

Re: [PATCH 09/13] target/ppc: Prevent supervisor from modifying MSR[ME]

2024-03-12 Thread Nicholas Piggin
On Tue Mar 12, 2024 at 8:27 PM AEST, Harsh Prateek Bora wrote: > > > On 3/12/24 00:21, Nicholas Piggin wrote: > > Prevent guest state modifying the MSR[ME] bit. Per ISA: > > > >An attempt to modify MSRME in privileged but non-hypervisor state is > &g

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

2024-03-12 Thread Nicholas Piggin
;frc); > +get_fpr(t2, a->frb); > +helper(t3, tcg_env, t0, t1, t2); > +set_fpr(a->frt, t3); > +gen_compute_fprf_float64(t3); > +if (unlikely(a->rc != false)) { This reads better without the double negative. I.e., just if (unlikely(a->rc

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

2024-03-12 Thread Nicholas Piggin
On Thu Mar 7, 2024 at 9:03 PM AEST, Chinmay Rath wrote: > This patch moves the below instructions to decodetree specification : > > f{add, sub, mul, div, re, rsqrte, madd, msub, nmadd, nmsub}[s][.] : A-form > ft{div, sqrt} : X-form > > Wit

Re: [PATCH 01/13] ppc: Drop support for POWER9 and POWER10 DD1 chips

2024-03-12 Thread Nicholas Piggin
On Tue Mar 12, 2024 at 2:55 PM AEST, Harsh Prateek Bora wrote: > > > On 3/12/24 10:20, Harsh Prateek Bora wrote: > > > > > > On 3/12/24 00:21, Nicholas Piggin wrote: > >> The POWER9 DD1 and POWER10 DD1 chips are not public and are no longer of > >> a

Re: [PATCH 02/13] target/ppc: POWER10 does not have transactional memory

2024-03-12 Thread Nicholas Piggin
On Tue Mar 12, 2024 at 6:10 PM AEST, Harsh Prateek Bora wrote: > Hi Nick, > > One query/comment below: > > On 3/12/24 00:21, Nicholas Piggin wrote: > > POWER10 hardware implements a degenerate transactional memory facility > > in POWER8/9 PCR compatibility modes to

Re: [PATCH 08/13] ppc/pnv: Set POWER9, POWER10 ibm,pa-features bits

2024-03-12 Thread Nicholas Piggin
On Tue Mar 12, 2024 at 6:06 PM AEST, Cédric Le Goater wrote: > On 3/11/24 19:51, Nicholas Piggin wrote: > > Copy the pa-features arrays from spapr, adjusting slightly as > > described in comments. > > > > Cc: "Cédric Le Goater" > > Cc: "Fréd

Re: [PATCH] spapr: avoid overhead of finding vhyp class in critical operations

2024-03-12 Thread Nicholas Piggin
On Tue Mar 12, 2024 at 4:38 PM AEST, Harsh Prateek Bora wrote: > Hi Nick, > > One minor comment below: > > On 2/24/24 13:03, Nicholas Piggin wrote: > > PPC_VIRTUAL_HYPERVISOR_GET_CLASS is used in critical operations like > > interrupts and TLB misses and is quite costl

Re: [PATCH v5 00/14] Nested PAPR API (KVM on PowerVM)

2024-03-11 Thread Nicholas Piggin
On Fri Mar 8, 2024 at 9:19 PM AEST, Harsh Prateek Bora wrote: > There is an existing Nested-HV API to enable nested guests on powernv > machines. However, that is not supported on pseries/PowerVM LPARs. > This patch series implements required hcall interfaces to enable nested > guests with KVM on P

Re: [PATCH-for-9.0] docs: Deprecate the pseries-2.12 machines

2024-03-11 Thread Nicholas Piggin
ore.h:31:bool pre_3_0_migration; /* older > machine don't know about SpaprCpuState */ Acked-by: Nicholas Piggin I can merge this via the PPC tree. Thanks, Nick > --- > docs/about/deprecated.rst | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff -

Re: [PATCH v2] spapr: Tag pseries-2.1 - 2.11 machines as deprecated

2024-03-11 Thread Nicholas Piggin
On Tue Mar 12, 2024 at 4:56 AM AEST, Daniel P. Berrangé wrote: > On Mon, Mar 11, 2024 at 06:46:53PM +0100, Philippe Mathieu-Daudé wrote: > > Hi, > > > > On 14/12/23 19:17, Cédric Le Goater wrote: > > > pseries machines before version 2.11 have undergone many changes to > > > correct issues, mostly

Re: [PATCH 06/13] ppc/spapr: Add pa-features for POWER10 machines

2024-03-11 Thread Nicholas Piggin
On Tue Mar 12, 2024 at 7:07 AM AEST, BALATON Zoltan wrote: > On Mon, 11 Mar 2024, Philippe Mathieu-Daudé wrote: > > On 11/3/24 19:51, Nicholas Piggin wrote: > >> From: Benjamin Gray > >> > >> Add POWER10 pa-features entry. > >> > >> Notably

Re: [PATCH 06/13] ppc/spapr: Add pa-features for POWER10 machines

2024-03-11 Thread Nicholas Piggin
On Tue Mar 12, 2024 at 6:05 AM AEST, Philippe Mathieu-Daudé wrote: > On 11/3/24 19:51, Nicholas Piggin wrote: > > From: Benjamin Gray > > > > Add POWER10 pa-features entry. > > > > Notably DEXCR and and [P]HASHST/[P]HASHCHK instruction support is > > adver

[PATCH 01/13] ppc: Drop support for POWER9 and POWER10 DD1 chips

2024-03-11 Thread Nicholas Piggin
The POWER9 DD1 and POWER10 DD1 chips are not public and are no longer of any use in QEMU. Remove them. Signed-off-by: Nicholas Piggin --- hw/ppc/spapr_cpu_core.c | 2 -- target/ppc/cpu-models.c | 4 target/ppc/cpu_init.c | 7 ++- target/ppc/kvm.c| 11 --- 4 files

[PATCH 06/13] ppc/spapr: Add pa-features for POWER10 machines

2024-03-11 Thread Nicholas Piggin
separately declared in byte 72, bit 0 (BE). Signed-off-by: Benjamin Gray [npiggin: reword title and changelog, adjust a few bits] Signed-off-by: Nicholas Piggin --- hw/ppc/spapr.c | 34 ++ 1 file changed, 34 insertions(+) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c

[PATCH 10/13] spapr: set MSR[ME] and MSR[FP] on client entry

2024-03-11 Thread Nicholas Piggin
The initial MSR state for PAPR specifies MSR[ME] and MSR[FP] are set. Signed-off-by: Nicholas Piggin --- hw/ppc/spapr_cpu_core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c index 50523ead25..f3b01b0801 100644 --- a/hw/ppc

[PATCH 04/13] ppc/spapr: Remove copy-paste from pa-features

2024-03-11 Thread Nicholas Piggin
TCG does not support copy/paste instructions. Remove it from ibm,pa-features. This has never been implemented under TCG or practically usable under KVM, so it won't be missed. Signed-off-by: Nicholas Piggin --- hw/ppc/spapr.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-)

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

2024-03-11 Thread Nicholas Piggin
SAO is a page table attribute that strengthens the memory ordering of accesses. QEMU with MTTCG does not implement this, so clear it in ibm,pa-features. This is an obscure feature that has been removed from POWER10 ISA v3.1, there isn't much concern with removing it. Signed-off-by: Nic

[PATCH 07/13] ppc/pnv: Permit ibm, pa-features set per machine variant

2024-03-11 Thread Nicholas Piggin
This allows different pa-features for powernv8/9/10. Cc: "Cédric Le Goater" Cc: "Frédéric Barrat" Signed-off-by: Nicholas Piggin --- hw/ppc/pnv.c | 41 + 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/hw/ppc/pnv.c

[PATCH 08/13] ppc/pnv: Set POWER9, POWER10 ibm,pa-features bits

2024-03-11 Thread Nicholas Piggin
Copy the pa-features arrays from spapr, adjusting slightly as described in comments. Cc: "Cédric Le Goater" Cc: "Frédéric Barrat" Signed-off-by: Nicholas Piggin --- hw/ppc/pnv.c | 67 -- hw/ppc/spapr.c | 1 + 2 files ch

[PATCH 13/13] target/ppc: Implement attn instruction on BookS 64-bit processors

2024-03-11 Thread Nicholas Piggin
, which should be good enough for QEMU debugging. Signed-off-by: Nicholas Piggin --- target/ppc/cpu.h | 16 +++- target/ppc/helper.h | 4 ++ target/ppc/cpu_init.c| 82 +--- target/ppc/excp_helper.c | 59

[PATCH 12/13] target/ppc: improve checkstop logging

2024-03-11 Thread Nicholas Piggin
Change the logging not to print to stderr as well, because a checkstop is a guest error (or perhaps a simulated machine error) rather than a QEMU error, so send it to the log. Update the checkstop message, and log CPU registers too. Signed-off-by: Nicholas Piggin --- target/ppc/excp_helper.c

[PATCH 00/13] misc ppc patches

2024-03-11 Thread Nicholas Piggin
David. Thanks, Nick Benjamin Gray (1): ppc/spapr: Add pa-features for POWER10 machines Nicholas Piggin (12): ppc: Drop support for POWER9 and POWER10 DD1 chips target/ppc: POWER10 does not have transactional memory ppc/spapr|pnv: Remove SAO from pa-features ppc/spapr: Remove copy-paste fr

[PATCH 05/13] ppc/spapr: Adjust ibm,pa-features for POWER9

2024-03-11 Thread Nicholas Piggin
"MMR" and "SPR SO" are not implemented in POWER9, so clear those bits. HTM is not set by default, and only later if the cap is set, so remove the comment that suggests otherwise. Signed-off-by: Nicholas Piggin --- hw/ppc/spapr.c | 10 +- 1 file changed, 5 insert

[PATCH 02/13] target/ppc: POWER10 does not have transactional memory

2024-03-11 Thread Nicholas Piggin
POWER10 hardware implements a degenerate transactional memory facility in POWER8/9 PCR compatibility modes to permit migration from older CPUs, but POWER10 / ISA v3.1 mode does not support it so the CPU model should not support it. Signed-off-by: Nicholas Piggin --- target/ppc/cpu_init.c | 4

[PATCH 11/13] target/ppc: Make checkstop actually stop the system

2024-03-11 Thread Nicholas Piggin
checkstop state does not halt the system, interrupts continue to be serviced, and other CPUs run. Make it stop the machine with qemu_system_guest_panicked. Signed-off-by: Nicholas Piggin --- target/ppc/excp_helper.c | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff

[PATCH 09/13] target/ppc: Prevent supervisor from modifying MSR[ME]

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

[PATCH] target/ppc: Fix GDB SPR regnum indexing

2024-03-11 Thread Nicholas Piggin
Fix an off by one bug. Cc: Akihiko Odaki Cc: Alex Bennée Fixes: 1b53948ff8f70 ("target/ppc: Use GDBFeature for dynamic XML") Signed-off-by: Nicholas Piggin --- target/ppc/gdbstub.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/target/ppc/gdbstub.c b/

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

2024-03-11 Thread Nicholas Piggin
adds a replay test that runs to the end of the trace, steps back then forward and verifies the pc. Signed-off-by: Nicholas Piggin --- tests/avocado/reverse_debugging.py | 50 +- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/tests/avocado

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

2024-03-11 Thread Nicholas Piggin
Add a ppc64 pseries test. IO in SLOF is very slow when running in record-replay modes, so this this uses guestfish to extract the kernel and initrd and boot them directly. Cc: qemu-...@nongnu.org Signed-off-by: Nicholas Piggin --- The test takes about double the length of time of aarch64 and x86

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

2024-03-11 Thread Nicholas Piggin
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 v4 11/24] net: Use virtual time for net announce

2024-03-11 Thread Nicholas Piggin
Using virtual time for announce ensures that guest visible effects are deterministic and don't break replay. Signed-off-by: Nicholas Piggin --- net/announce.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/announce.c b/net/announce.c index 9e99044422..70b5d5e822 1

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

2024-03-11 Thread Nicholas Piggin
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 v4 21/24] tests/avocado: reverse_debugging.py test auto-snapshot mode

2024-03-11 Thread Nicholas Piggin
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 | 24 ++-- 1 file changed, 18 insertions(+), 6

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

2024-03-11 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 v4 22/24] target/ppc: fix timebase register reset state

2024-03-11 Thread Nicholas Piggin
been observed to cause replay bugs when running Linux. Fix this by resetting using a time of 0. Cc: qemu-...@nongnu.org Signed-off-by: Nicholas Piggin --- hw/ppc/ppc.c | 11 --- target/ppc/machine.c | 4 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/hw/ppc

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

2024-03-11 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. Cc: qemu-...@nongnu.org Signed-off-by: Nicholas Piggin --- include/hw/ppc/spapr_cpu_core.h | 3 +++ hw/ppc/spapr.c | 36

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

2024-03-11 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 dc1fb9c0d3..fee9318c06 100644 --- a/migration/savevm.c +++ b/migration

[PATCH v4 07/24] replay: Fix migration use of clock

2024-03-11 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 v4 17/24] tests/avocado: reverse_debugging.py stop VM before sampling icount

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

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

2024-03-11 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: Nic

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

2024-03-11 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: Pavel Dovgalyuk Signed-off-by: Nicholas Piggin --- scripts/replay-dump.py

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

2024-03-11 Thread Nicholas Piggin
: 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 635ff7bacc..4bf4e6e1e5 100644 --- a/tests/avocado/reverse_debugging.py +++ b

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

2024-03-11 Thread Nicholas Piggin
, so add a flag to avoid some of the new checks. Signed-off-by: Nicholas Piggin --- tests/avocado/reverse_debugging.py | 66 -- 1 file changed, 53 insertions(+), 13 deletions(-) diff --git a/tests/avocado/reverse_debugging.py b/tests/avocado/reverse_debugging.py index

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

2024-03-11 Thread Nicholas Piggin
replaying it. Continuing to the end of the trace then reverse-stepping in gdb crashes due to invalid runstate transition. Just permitting the transition seems to be all that's necessary for reverse-debugging to work well in such a state. Reviewed-by: Pavel Dovgalyuk Signed-off-by: Nicholas P

[PATCH v4 10/24] virtio-net: Use virtual time for RSC timers

2024-03-11 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 v4 13/24] tests/avocado: replay_linux.py remove the timeout expected guards

2024-03-11 Thread Nicholas Piggin
each, so require SPEED=slow. Signed-off-by: Nicholas Piggin --- tests/avocado/replay_linux.py | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/avocado/replay_linux.py b/tests/avocado/replay_linux.py index b3b91ddd9a..c0e50bb52b 100644 --- a/tests/avocado

[PATCH v4 09/24] virtio-net: Use replay_schedule_bh_event for bhs that affect machine state

2024-03-11 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 v4 06/24] chardev: set record/replay on the base device of a muxed device

2024-03-11 Thread Nicholas Piggin
tting 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 1

[PATCH v4 08/24] replay: Fix migration replay_mutex locking

2024-03-11 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 v4 00/24] replay: fixes and new test cases

2024-03-11 Thread Nicholas Piggin
rst thing I would look at is timers and clocks. pseries had some rounding issues in time calculations that meant clock/timer were not replayed exactly as they were recorded, which caused hangs. Thanks, Nick Nicholas Piggin (24): scripts/replay-dump.py: Update to current rr record format scri

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

2024-03-11 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 a

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

2024-03-11 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

Re: [PATCH 4/4] replay: simple auto-snapshot mode for record

2024-03-04 Thread Nicholas Piggin
On Wed Feb 28, 2024 at 3:07 PM AEST, Pavel Dovgalyuk wrote: > On 26.02.2024 10:36, Nicholas Piggin wrote: > >>> @@ -313,6 +317,27 @@ void replay_configure(QemuOpts *opts) > >>>} > >>> > >>>replay_snapshot = g_strd

Re: [PATCH 4/4] replay: simple auto-snapshot mode for record

2024-02-28 Thread Nicholas Piggin
On Wed Feb 28, 2024 at 3:07 PM AEST, Pavel Dovgalyuk wrote: > On 26.02.2024 10:36, Nicholas Piggin wrote: > > On Fri Aug 18, 2023 at 2:36 PM AEST, Pavel Dovgalyuk wrote: > >> On 14.08.2023 19:31, Nicholas Piggin wrote: > >>> record makes an initial snapshot when the

Re: [PATCH v3 3/9] tests/avocado: excercise scripts/replay-dump.py in replay tests

2024-02-28 Thread Nicholas Piggin
On Wed Feb 28, 2024 at 5:21 AM AEST, Alex Bennée wrote: > Nicholas Piggin writes: > > > 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 > > e

Re: [PATCH v7 02/10] target/ppc: Readability improvements in exception handlers

2024-02-28 Thread Nicholas Piggin
ome long comments, removing > >>> comments that state the obvious and dropping some empty lines so they > >>> don't distract when reading the code. > >>> > >>> Signed-off-by: BALATON Zoltan > >>> Acked-by: Nich

Re: [PATCH v8 2/2] ppc: spapr: Enable 2nd DAWR on Power10 pSeries machine

2024-02-27 Thread Nicholas Piggin
alue1, > - target_ulong value2) > +static target_ulong h_set_mode_resource_set_dawr(PowerPCCPU *cpu, > + SpaprMachineState > *spapr, > + target_ulong mflags, > + target_ulong resource, > + target_ulong value1, > + target_ulong value2) Did the text alignment go wrong here? Aside from those things, Reviewed-by: Nicholas Piggin Thanks, Nick

Re: [PATCH v8 1/2] ppc: Enable 2nd DAWR support on Power10 PowerNV machine

2024-02-27 Thread Nicholas Piggin
/cpu.c > @@ -130,11 +130,13 @@ void ppc_store_ciabr(CPUPPCState *env, target_ulong val) > ppc_update_ciabr(env); > } > > -void ppc_update_daw0(CPUPPCState *env) > +void ppc_update_daw(CPUPPCState *env, int rid) What's rid? Register ID? Looks pretty good I think

Re: [PATCH v4 04/15] spapr: nested: keep nested-hv related code restricted to its API.

2024-02-27 Thread Nicholas Piggin
On Tue Feb 27, 2024 at 7:45 PM AEST, Harsh Prateek Bora wrote: > > > On 2/27/24 14:24, Nicholas Piggin wrote: > > On Tue Feb 20, 2024 at 6:35 PM AEST, Harsh Prateek Bora wrote: > >> spapr_exit_nested and spapr_get_pate_nested_hv contains code which > >> is specific

Re: [PATCH v4 05/15] spapr: nested: Document Nested PAPR API

2024-02-27 Thread Nicholas Piggin
On Tue Feb 27, 2024 at 7:31 PM AEST, Harsh Prateek Bora wrote: > > > On 2/27/24 14:59, Nicholas Piggin wrote: > > On Tue Feb 20, 2024 at 6:35 PM AEST, Harsh Prateek Bora wrote: > >> Adding initial documentation about Nested PAPR API to describe the set > >> of API

Re: [PATCH v4 15/15] spapr: nested: Set the PCR when logical PVR is set

2024-02-27 Thread Nicholas Piggin
On Tue Feb 20, 2024 at 6:36 PM AEST, Harsh Prateek Bora wrote: > From: Amit Machhiwal > > In APIv1, KVM L0 sets the PCR, while in the nested papr APIv2, this > doesn't work as the PCR can't be set via the guest state buffer; the > logical PVR is set via the GSB though. > > This change sets the PCR

Re: [PATCH v4 14/15] spapr: nested: Introduce cap-nested-papr for Nested PAPR API

2024-02-27 Thread Nicholas Piggin
On Tue Feb 20, 2024 at 6:36 PM AEST, Harsh Prateek Bora wrote: > 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. > > Signed-off-by: Mic

Re: [PATCH v4 12/15] spapr: nested: Use correct source for parttbl info for nested PAPR API.

2024-02-27 Thread Nicholas Piggin
On Tue Feb 20, 2024 at 6:36 PM AEST, Harsh Prateek Bora wrote: > For nested PAPR API, we use SpaprMachineStateNestedGuest struct to store > partition table info, use the same in spapr_get_pate_nested() via > helper. > > Signed-off-by: Michael Neuling > Signed-off-by: Harsh Prateek Bora > --- > i

Re: [PATCH v4 11/15] spapr: nested: Introduce H_GUEST_[GET|SET]_STATE hcalls.

2024-02-27 Thread Nicholas Piggin
On Tue Feb 20, 2024 at 6:36 PM AEST, Harsh Prateek Bora wrote: > Introduce the nested PAPR hcalls: > - H_GUEST_GET_STATE which is used to get state of a nested guest or > a guest VCPU. The value field for each element in the request is > ignored and on success, will be updated to re

Re: [PATCH v4 10/15] spapr: nested: Initialize the GSB elements lookup table.

2024-02-27 Thread Nicholas Piggin
On Tue Feb 20, 2024 at 6:36 PM AEST, Harsh Prateek Bora wrote: > Nested PAPR API provides a standard Guest State Buffer (GSB) format > with unique IDs for each guest state element for which get/set state is > supported by the API. Some of the elements are read-only and/or guest-wide. > Introducing

Re: [PATCH v4 09/15] spapr: nested: Extend nested_ppc_state for nested PAPR API

2024-02-27 Thread Nicholas Piggin
PAPR API. > > Signed-off-by: Harsh Prateek Bora > Suggested-by: Nicholas Piggin > --- > include/hw/ppc/spapr_nested.h | 49 > target/ppc/cpu.h | 2 + > hw/ppc/spapr_nested.c | 106 ++ > 3 files changed,

Re: [PATCH v4 08/15] spapr: nested: Introduce H_GUEST_CREATE_VCPU hcall.

2024-02-27 Thread Nicholas Piggin
On Tue Feb 20, 2024 at 6:36 PM AEST, Harsh Prateek Bora wrote: > Introduce the nested PAPR hcall H_GUEST_CREATE_VCPU which is used to > create and initialize the specified VCPU resource for the previously > created guest. Each guest can have multiple VCPUs upto max 2048. > All VCPUs for a guest get

Re: [PATCH v4 05/15] spapr: nested: Document Nested PAPR API

2024-02-27 Thread Nicholas Piggin
; > Signed-off-by: Michael Neuling > Signed-off-by: Harsh Prateek Bora v2 is upstream in Linux now, I suppose you could reference that too? Otherwise looks okay Reviewed-by: Nicholas Piggin > --- > docs/devel/nested-papr.txt | 514 + >

Re: [PATCH v4 04/15] spapr: nested: keep nested-hv related code restricted to its API.

2024-02-27 Thread Nicholas Piggin
sh Prateek Bora > Suggested-by: Nicholas Piggin > --- > include/hw/ppc/spapr_nested.h | 4 > hw/ppc/spapr.c| 7 ++- > hw/ppc/spapr_caps.c | 1 + > hw/ppc/spapr_nested.c | 27 --- > 4 files changed, 35 insertio

Re: [PATCH v4 01/15] spapr: nested: register nested-hv api hcalls only for cap-nested-hv

2024-02-27 Thread Nicholas Piggin
anity across guest reboot since caps are re-applied across reboots and > re-registeration of hypercalls would hit assert otherwise. > > Signed-off-by: Harsh Prateek Bora > Reviewed-by: Nicholas Piggin > --- > include/hw/ppc/spapr.h| 3 +++ > include/hw/ppc/spapr_neste

Re: [PATCH v6 5/9] target/ppc: Simplify syscall exception handlers

2024-02-26 Thread Nicholas Piggin
On Thu Feb 22, 2024 at 10:20 PM AEST, BALATON Zoltan wrote: > On Thu, 22 Feb 2024, Philippe Mathieu-Daudé wrote: > > On 22/2/24 12:33, BALATON Zoltan wrote: > >> After previous changes the hypercall handling in 7xx and 74xx > >> exception handlers can be folded into one if statement to simpilfy > >

Re: [PATCH v6 5/9] target/ppc: Simplify syscall exception handlers

2024-02-26 Thread Nicholas Piggin
On Thu Feb 22, 2024 at 9:33 PM AEST, BALATON Zoltan wrote: > After previous changes the hypercall handling in 7xx and 74xx > exception handlers can be folded into one if statement to simpilfy > this code. Also add "unlikely" to mark the less freqiently used branch > for the compiler. > > Signed-off

Re: [PATCH v6 3/9] target/ppc: Fix gen_sc to use correct nip

2024-02-26 Thread Nicholas Piggin
ets nip back but correctly set nip to > pc_next so we don't have to patch this in the exception handlers. > > Signed-off-by: BALATON Zoltan > Reviewed-by: Nicholas Piggin Mixed feelings about this one still but I suppose I will add it now you have the tracing corrected. Although on

[PATCH v3 8/9] replay: Fix migration replay_mutex locking

2024-02-26 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.h | 2

[PATCH v3 9/9] tests/avocado/reverse_debugging.py: mark aarch64 and pseries as not flaky

2024-02-26 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. Signed-off-by: Nicholas Piggin --- tests/avocado/reverse_debugging.p

[PATCH v3 7/9] replay: Fix migration use of clock

2024-02-26 Thread Nicholas Piggin
Migration reads host clocks when not holding the replay_mutex, which asserts when recording a trace. It seems that the times should be host times like other statistics in MigrationState, so this can easily be converted. Signed-off-by: Nicholas Piggin --- migration/migration.c | 8 1

[PATCH v3 5/9] Revert "replay: stop us hanging in rr_wait_io_event"

2024-02-26 Thread Nicholas Piggin
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 v3 6/9] chardev: set record/replay on the base device of a muxed device

2024-02-26 Thread Nicholas Piggin
tting 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 1

<    3   4   5   6   7   8   9   10   11   12   >