[PULL 31/47] hw/ppc: Add N1 chiplet model

2024-02-23 Thread Nicholas Piggin
model where chiplet control registers are implemented. This commit also implement the read/write method for the powerbus scom registers Reviewed-by: Cédric Le Goater Signed-off-by: Chalapathi V Signed-off-by: Nicholas Piggin --- hw/ppc/meson.build | 1 + hw/ppc/pnv_n1_chiplet.c

[PULL 26/47] ppc/pnv: Use resettable interface to reset child I2C buses

2024-02-23 Thread Nicholas Piggin
interface so that all child buses and devices are automatically reset. Reviewed-by: Cédric Le Goater Signed-off-by: Glenn Miles Signed-off-by: Nicholas Piggin --- hw/ppc/pnv_i2c.c | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/hw/ppc/pnv_i2c.c b/hw/ppc

[PULL 47/47] target/ppc: optimise ppcemb_tlb_t flushing

2024-02-23 Thread Nicholas Piggin
508238 7680722 After 34s 73 1143 Tested-by: BALATON Zoltan Acked-by: Cédric Le Goater Signed-off-by: Nicholas Piggin --- target/ppc/mmu_helper.c | 43 +++-- 1 file changed, 37 insertions(+), 6

[PULL 42/47] target/ppc: Fix 440 tlbwe TLB invalidation gaps

2024-02-23 Thread Nicholas Piggin
-by: Cédric Le Goater Signed-off-by: Nicholas Piggin --- target/ppc/mmu_helper.c | 35 ++- 1 file changed, 10 insertions(+), 25 deletions(-) diff --git a/target/ppc/mmu_helper.c b/target/ppc/mmu_helper.c index f87d35379a..c140f3c96d 100644 --- a/target/ppc/mmu_helper.c

[PULL 35/47] target/ppc: Improve timebase register defines naming

2024-02-23 Thread Nicholas Piggin
to TBL, TBU, WR_TBL, WR_TBU, respectively. Reviewed-by: Cédric Le Goater Signed-off-by: Nicholas Piggin --- target/ppc/cpu.h | 8 target/ppc/helper_regs.c | 10 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index

[PULL 34/47] target/ppc: Rename TBL to TB on 64-bit

2024-02-23 Thread Nicholas Piggin
ead TBL on 32-bit. Change SPR 268 to be called TB on 64-bit implementations. Reviewed-by: Cédric Le Goater Signed-off-by: Nicholas Piggin --- target/ppc/helper_regs.c | 4 target/ppc/ppc-qmp-cmds.c | 4 2 files changed, 8 insertions(+) diff --git a/target/ppc/helper_regs.c b/target/

[PULL 32/47] hw/ppc: N1 chiplet wiring

2024-02-23 Thread Nicholas Piggin
From: Chalapathi V This part of the patchset connects the nest1 chiplet model to p10 chip. Reviewed-by: Cédric Le Goater Signed-off-by: Chalapathi V Signed-off-by: Nicholas Piggin --- hw/ppc/pnv.c | 15 +++ include/hw/ppc/pnv_chip.h | 2 ++ 2 files changed, 17

[PULL 08/47] tests/avocado: ppc add hypervisor tests

2024-02-23 Thread Nicholas Piggin
image, boots it and downloads and installs the qemu package, then boots a virtual machine under it, re-using the original Alpine VM image. Signed-off-by: Nicholas Piggin --- MAINTAINERS | 1 + tests/avocado/ppc_hv_tests.py | 202 ++ 2 files

[PULL 02/47] target/ppc: Fix crash on machine check caused by ifetch

2024-02-23 Thread Nicholas Piggin
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2108 Fixes: 55a7fa34f89 ("target/ppc: Machine check on invalid real address access on POWER9/10") Fixes: 5a5d3b23cb2 ("target/ppc: Add SRR1 prefix indication to interrupt handlers") Signed-off-by: Nicholas Piggin --- targ

[PULL 11/47] target/ppc: Rename registers to match ISA

2024-02-23 Thread Nicholas Piggin
users should be low. QEMU should follow the ISA for register name convention (where there is no established GDB name). Acked-by: Cédric Le Goater Signed-off-by: Nicholas Piggin --- target/ppc/cpu_init.c| 20 ++-- target/ppc/helper_regs.c | 2 +- 2 files changed, 11 insertions

[PULL 17/47] ppc/spapr: Initialize max_cpus limit to SPAPR_IRQ_NR_IPIS.

2024-02-23 Thread Nicholas Piggin
t@host build]# Reported-by: Kowshik Jois Tested-by: Kowshik Jois Reviewed-by: Cédric Le Goater Signed-off-by: Harsh Prateek Bora Signed-off-by: Nicholas Piggin --- hw/ppc/spapr.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c inde

[PULL 18/47] ppc/spapr: change pseries machine default to POWER10 CPU

2024-02-23 Thread Nicholas Piggin
POWER10 is the latest pseries CPU. Reviewed-by: Harsh Prateek Bora Signed-off-by: Nicholas Piggin --- hw/ppc/spapr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 0028ce0b67..b442d18317 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c

[PULL 27/47] misc: Add a pca9554 GPIO device model

2024-02-23 Thread Nicholas Piggin
Goater Signed-off-by: Glenn Miles Signed-off-by: Nicholas Piggin --- MAINTAINERS| 10 +- hw/misc/pca9554.c | 328 + include/hw/misc/pca9554.h | 36 include/hw/misc/pca9554_regs.h | 19 ++ 4 files changed, 391 insertions

[PULL 01/47] target/ppc: Fix lxv/stxv MSR facility check

2024-02-23 Thread Nicholas Piggin
-by: Harsh Prateek Bora Tested-by: Harsh Prateek Bora Reviewed-by: Cédric Le Goater Tested-by: Cédric Le Goater Signed-off-by: Nicholas Piggin --- target/ppc/translate/vsx-impl.c.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/ppc/translate/vsx-impl.c.inc b/target/ppc

[PULL 23/47] ppc/pnv: New powernv10-rainier machine type

2024-02-23 Thread Nicholas Piggin
From: Glenn Miles Create a new powernv machine type, powernv10-rainier, that will contain rainier-specific devices. Reviewed-by: Cédric Le Goater Signed-off-by: Glenn Miles Signed-off-by: Nicholas Piggin --- hw/ppc/pnv.c | 24 ++-- 1 file changed, 22 insertions(+), 2

[PULL 13/47] hw/ppc/spapr_hcall: Allow elision of softmmu_resize_hpt_prep

2024-02-23 Thread Nicholas Piggin
From: Philippe Mathieu-Daudé Check tcg_enabled() before calling softmmu_resize_hpt_prepare() and softmmu_resize_hpt_commit() to allow the compiler to elide their calls. The stubs are then unnecessary, remove them. Reviewed-by: Nicholas Piggin Signed-off-by: Philippe Mathieu-Daudé Signed-off

[PULL 37/47] ppc/pnv: Add POWER9/10 chiptod model

2024-02-23 Thread Nicholas Piggin
, because the QEMU ppc timebase implementation is always synchronised acros all cores. Reviewed-by: Cédric Le Goater Signed-off-by: Nicholas Piggin --- hw/ppc/meson.build | 1 + hw/ppc/pnv_chiptod.c | 454 +++ hw/ppc/trace-events | 4

[PULL 45/47] target/ppc: 4xx optimise tlbwe_lo TLB flushing

2024-02-23 Thread Nicholas Piggin
Rather than tlbwe_lo always flushing all TCG TLBs, have it flush just those corresponding to the old software TLB, and only if it was valid. Tested-by: BALATON Zoltan Acked-by: Cédric Le Goater Signed-off-by: Nicholas Piggin --- target/ppc/mmu_helper.c | 10 -- 1 file changed, 8

[PULL 30/47] hw/ppc: Add pnv nest pervasive common chiplet model

2024-02-23 Thread Nicholas Piggin
et control registers. Reviewed-by: Cédric Le Goater Signed-off-by: Chalapathi V Signed-off-by: Nicholas Piggin --- hw/ppc/meson.build | 1 + hw/ppc/pnv_nest_pervasive.c | 208 include/hw/ppc/pnv_nest_pervasive.h | 32 + includ

[PULL 33/47] target/ppc: Update gdbstub to read SPR's CFAR, DEC, HDEC, TB-L/U

2024-02-23 Thread Nicholas Piggin
From: Saif Abrar SPR's CFAR, DEC, HDEC, TB-L/U are not implemented as part of CPUPPCState. Hence, gdbstub is not able to access them using (CPUPPCState *)env->spr[] array. Update gdb_get_spr_reg() method to handle these SPR's specifically. Reviewed-by: Nicholas Piggin Signed-off-by: Saif Ab

[PULL 04/47] tests/avocado: improve flaky ppc/pnv boot_linux_console.py test

2024-02-23 Thread Nicholas Piggin
Le Goater Signed-off-by: Nicholas Piggin --- tests/avocado/boot_linux_console.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/avocado/boot_linux_console.py b/tests/avocado/boot_linux_console.py index 3f0180e1f8..af104fff1c 100644 --- a/tests/avocado

[PULL 39/47] ppc/pnv: Implement the ChipTOD to Core transfer

2024-02-23 Thread Nicholas Piggin
Signed-off-by: Nicholas Piggin --- hw/ppc/pnv.c | 15 hw/ppc/pnv_chiptod.c | 132 +++ include/hw/ppc/pnv.h | 2 + include/hw/ppc/pnv_chiptod.h | 4 ++ target/ppc/cpu.h | 13 5 files changed, 166 insertions

[PULL 25/47] ppc/pnv: Wire up pca9552 GPIO pins for PCIe hotplug power control

2024-02-23 Thread Nicholas Piggin
lenn Miles Signed-off-by: Nicholas Piggin --- hw/ppc/pnv.c | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index 78f5c6262a..97bdfb2d1e 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -1900,7 +1900,19 @@ static void pnv_rainie

[PULL 12/47] hw/ppc/spapr: Add missing license

2024-02-23 Thread Nicholas Piggin
and copyrights from the original spapr_hcall.c at commit 9fdf0c2995. Signed-off-by: Philippe Mathieu-Daudé [npiggin: Update file description.] Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Nicholas Piggin --- hw/ppc/spapr_softmmu.c | 9 + 1 file changed, 9 insertions(+)

[PULL 05/47] tests/avocado: ppc add powernv10 boot_linux_console test

2024-02-23 Thread Nicholas Piggin
Add test for POWER10. Reviewed-by: Cédric Le Goater Signed-off-by: Nicholas Piggin --- tests/avocado/boot_linux_console.py | 8 1 file changed, 8 insertions(+) diff --git a/tests/avocado/boot_linux_console.py b/tests/avocado/boot_linux_console.py index af104fff1c..a00202df3c 100644

[PULL 43/47] target/ppc: Factor out 4xx ppcemb_tlb_t flushing

2024-02-23 Thread Nicholas Piggin
Flushing the TCG TLB pages that cache a software TLB is a common operation, factor it into its own function. Tested-by: BALATON Zoltan Acked-by: Cédric Le Goater Signed-off-by: Nicholas Piggin --- target/ppc/mmu_helper.c | 24 +--- 1 file changed, 13 insertions(+), 11

[PULL 38/47] ppc/pnv: Wire ChipTOD model to powernv9 and powernv10 machines

2024-02-23 Thread Nicholas Piggin
Wire the ChipTOD model to powernv9 and powernv10 machines. Suggested-by-by: Cédric Le Goater Reviewed-by: Cédric Le Goater Signed-off-by: Nicholas Piggin --- hw/ppc/pnv.c | 30 ++ include/hw/ppc/pnv_chip.h | 3 +++ 2 files changed, 33 insertions

[PULL 16/47] ppc/spapr: Introduce SPAPR_IRQ_NR_IPIS to refer IRQ range for CPU IPIs.

2024-02-23 Thread Nicholas Piggin
-by: Cedric Le Goater Reviewed-by: Cédric Le Goater Tested-by: Kowshik Jois Signed-off-by: Harsh Prateek Bora Signed-off-by: Nicholas Piggin --- hw/ppc/spapr_irq.c | 6 -- include/hw/ppc/spapr_irq.h | 14 +- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/hw

[PULL 44/47] target/ppc: 4xx don't flush TLB for a newly written software TLB entry

2024-02-23 Thread Nicholas Piggin
-by: Cédric Le Goater Signed-off-by: Nicholas Piggin --- target/ppc/mmu_helper.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/target/ppc/mmu_helper.c b/target/ppc/mmu_helper.c index 949ae87f4f..68632bf54e 100644 --- a/target/ppc/mmu_helper.c +++ b/target/ppc/mmu_helper.c @@ -808,13 +808,6

[PULL 41/47] target/ppc: Add SMT support to time facilities

2024-02-23 Thread Nicholas Piggin
and certain other proprietary firmware. Acked-by: Cédric Le Goater Signed-off-by: Nicholas Piggin --- target/ppc/timebase_helper.c | 105 --- target/ppc/translate.c | 42 +- 2 files changed, 136 insertions(+), 11 deletions(-) diff --git a/target/ppc

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

2024-02-23 Thread Nicholas Piggin
for. This does not seem to affect any upstream test case that I can see, but it does cause occasional hangs in the proposed ppc_hv_tests.py test, usually when run on KVM hosts that are fast enough to output important lines early enough to be consumed. Signed-off-by: Nicholas Piggin --- tests/avocado

[PULL 19/47] spapr: Tag pseries-2.1 - 2.11 machines as deprecated

2024-02-23 Thread Nicholas Piggin
, still in use by old distros. Reviewed-by: Thomas Huth Reviewed-by: Daniel Henrique Barboza Signed-off-by: Cédric Le Goater Signed-off-by: Nicholas Piggin --- docs/about/deprecated.rst | 8 hw/ppc/spapr.c| 1 + roms/skiboot | 2 +- 3 files changed, 10 insertions

[PULL 09/47] tests/avocado: Use default CPU for pseries machine

2024-02-23 Thread Nicholas Piggin
Use the default CPU with the pseries machine unless there is a specific requirement. Signed-off-by: Nicholas Piggin --- tests/avocado/migration.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/avocado/migration.py b/tests/avocado/migration.py index 09b62f813e..be6234b3c2 100644

[PULL 28/47] ppc/pnv: Add a pca9554 I2C device to powernv10-rainier

2024-02-23 Thread Nicholas Piggin
Reviewed-by: Cédric Le Goater Signed-off-by: Glenn Miles Signed-off-by: Nicholas Piggin --- hw/misc/Kconfig | 4 hw/misc/meson.build | 1 + hw/ppc/Kconfig | 1 + hw/ppc/pnv.c| 6 ++ 4 files changed, 12 insertions(+) diff --git a/hw/misc/Kconfig b/hw/misc/Kconfig index

[PULL 22/47] misc/pca9552: Let external devices set pca9552 inputs

2024-02-23 Thread Nicholas Piggin
Signed-off-by: Nicholas Piggin --- hw/misc/pca9552.c | 50 +-- include/hw/misc/pca9552.h | 3 ++- 2 files changed, 45 insertions(+), 8 deletions(-) diff --git a/hw/misc/pca9552.c b/hw/misc/pca9552.c index f00a149d61..2ae13af35e 100644 --- a/hw/misc

[PULL 14/47] hw/ppc/spapr_hcall: Rename {softmmu -> vhyp_mmu}_resize_hpt_pr

2024-02-23 Thread Nicholas Piggin
hypervisor interface, called vhyp. Reviewed-by: Nicholas Piggin Signed-off-by: Philippe Mathieu-Daudé [npiggin: Pick a different name, explain it in changelog.] Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Nicholas Piggin --- hw/ppc/spapr_hcall.c | 4 ++-- hw/ppc/spapr_softmmu.c | 4

[PULL 15/47] hw/ppc/spapr: Rename 'softmmu' -> 'vhyp_mmu'

2024-02-23 Thread Nicholas Piggin
From: Philippe Mathieu-Daudé To reduce the use of the term 'softmmu', rename spapr_softmmu.c to spapr_vhyp_mmu.c. Reviewed-by: Nicholas Piggin Signed-off-by: Philippe Mathieu-Daudé [np: change name] Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Nicholas Piggin --- hw/ppc/meson.build

[PULL 03/47] tests/avocado: mark boot_linux.py long runtime instead of flaky

2024-02-23 Thread Nicholas Piggin
cc99318 ("docs/devel: rationalise unstable gitlab tests under FLAKY_TESTS") changed this to being flaky but it isn't really, it just had a long runtime. So take the SPEED=slow variable from qtests and introduce it to avocado, and make these tests require it. Reviewed-by: Cédric Le Goater

[PULL 24/47] ppc/pnv: Add pca9552 to powernv10-rainier for PCIe hotplug power control

2024-02-23 Thread Nicholas Piggin
Signed-off-by: Glenn Miles Signed-off-by: Nicholas Piggin --- hw/ppc/Kconfig | 1 + hw/ppc/pnv.c | 25 + include/hw/ppc/pnv.h | 1 + 3 files changed, 27 insertions(+) diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig index 99d571fa20..0e5acfd1c4 100644 --- a/hw

[PULL 46/47] target/ppc: 440 optimise tlbwe TLB flushing

2024-02-23 Thread Nicholas Piggin
Have 440 tlbwe flush only the range corresponding to the addresses covered by the software TLB entry being modified rather than the entire TLB. This matches what 4xx does. Tested-by: BALATON Zoltan Acked-by: Cédric Le Goater Signed-off-by: Nicholas Piggin --- target/ppc/mmu_helper.c | 2 +- 1

[PULL 06/47] tests/avocado: Add ppc pseries and powernv hash MMU tests

2024-02-23 Thread Nicholas Piggin
POWER CPUs support hash and radix MMU modes. Linux supports running in either mode, but defaults to radix. To keep up testing of QEMU's hash MMU implementation, add some Linux hash boot tests. Reviewed-by: Cédric Le Goater Signed-off-by: Nicholas Piggin --- tests/avocado/ppc_powernv.py | 23

[PULL 20/47] ppc/pnv: Change powernv default to powernv10

2024-02-23 Thread Nicholas Piggin
POWER10 is the latest IBM Power machine. Although it is not offered in "OPAL mode" (i.e., powernv configuration), so there is a case that it should remain at powernv9, most of the development work is going into powernv10 at the moment. Reviewed-by: Cédric Le Goater Signed-off-by: Nicho

[PULL 21/47] misc/pca9552: Fix inverted input status

2024-02-23 Thread Nicholas Piggin
scenario. Existing code was doing the opposite and setting INPUT0/1 bit to a 1 when the LSn bit was set to 0, so this commit fixes that. Reviewed-by: Andrew Jeffery Signed-off-by: Glenn Miles Signed-off-by: Nicholas Piggin --- hw/misc/pca9552.c | 18 +- tests/qtest

[PULL 07/47] tests/avocado: Add pseries KVM boot_linux test

2024-02-23 Thread Nicholas Piggin
ppc has no avocado tests for the KVM backend. Add a KVM boot_linux.py test for pseries. Reviewed-by: Cédric Le Goater Signed-off-by: Nicholas Piggin --- tests/avocado/boot_linux.py | 9 + 1 file changed, 9 insertions(+) diff --git a/tests/avocado/boot_linux.py b/tests/avocado

[PULL 29/47] ppc/pnv: Test pnv i2c master and connected devices

2024-02-23 Thread Nicholas Piggin
- Connected GPIO pin tests of P10 PCA9552 device. Tests output of pins 0-4 affect input of pins 5-9 respectively. - PCA9554 GPIO pins test. Tests input and ouput functionality. Reviewed-by: Cédric Le Goater Signed-off-by: Glenn Miles Signed-off-by: Nicholas Piggin --- hw/ppc/pnv_i2c.c

[PULL 40/47] target/ppc: Implement core timebase state machine and TFMR

2024-02-23 Thread Nicholas Piggin
-by: Nicholas Piggin --- target/ppc/cpu.h | 36 ++ target/ppc/timebase_helper.c | 210 ++- 2 files changed, 243 insertions(+), 3 deletions(-) diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index 0e932838aa..ec14574d14 100644 --- a/target/ppc/cpu.h

[PULL 36/47] target/ppc: Fix move-to timebase SPR access permissions

2024-02-23 Thread Nicholas Piggin
The move-to timebase registers TBU and TBL can not be read, and they can not be written in supervisor mode on hypervisor-capable CPUs. Reviewed-by: Cédric Le Goater Signed-off-by: Nicholas Piggin --- target/ppc/helper_regs.c | 31 +++ 1 file changed, 23 insertions

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

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

[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-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 v4 19/33] target/ppc/mmu_common.c: Don't use mmu_ctx_t for mmu40x_get_physical_address()

2024-05-09 Thread Nicholas Piggin
ret = -1; > -raddr = (hwaddr)-1ULL; > +*prot = 0; This is still doing some sneaky used-uninit things which I would rather not without a comment, but okay we can try untangle things more after this series. Reviewed-by: Nicholas Piggin > pr = FIELD_EX6

Re: [PATCH v4 20/33] target/ppc/mmu_common.c: Don't use mmu_ctx_t in mmubooke_get_physical_address()

2024-05-09 Thread Nicholas Piggin
On Thu May 9, 2024 at 9:36 AM AEST, BALATON Zoltan wrote: > mmubooke_get_physical_address() only uses the raddr and prot fields > from mmu_ctx_t. Pass these directly instead of using a ctx struct. Reviewed-by: Nicholas Piggin > > Signed-off-by: BALATON Zoltan > --- > targe

Re: [PATCH v4 33/33] target/ppc: Move out BookE and related MMU functions from mmu_common.c

2024-05-09 Thread Nicholas Piggin
On Thu May 9, 2024 at 9:36 AM AEST, BALATON Zoltan wrote: > Add a new mmu-booke.c file for BookE and related MMU bits from > mmu_common.c. > Nice work. Acked-by: Nicholas Piggin > Signed-off-by: BALATON Zoltan > --- > target/ppc/cpu.h| 4 - > target/p

Re: [PATCH v4 27/33] target/ppc/mmu_common.c: Simplify ppc_booke_xlate() part 2

2024-05-09 Thread Nicholas Piggin
On Thu May 9, 2024 at 9:36 AM AEST, BALATON Zoltan wrote: > Merge the code fetch and data access cases in a common switch. > > Signed-off-by: BALATON Zoltan Reviewed-by: Nicholas Piggin > --- > target/ppc/mmu_common.c | 52 - >

Re: [PATCH v3 01/33] target/ppc: Fix gen_sc to use correct nip

2024-05-08 Thread Nicholas Piggin
On Thu May 9, 2024 at 1:17 AM AEST, BALATON Zoltan wrote: > On Wed, 8 May 2024, Nicholas Piggin wrote: > > On Wed May 8, 2024 at 10:14 AM AEST, BALATON Zoltan wrote: > >> Most exceptions are raised with nip pointing to the faulting > >> instruction but the sc instr

Re: [PATCH v3 33/33] target/ppc: Add a macro to check for page protection bit

2024-05-08 Thread Nicholas Piggin
On Thu May 9, 2024 at 1:23 AM AEST, BALATON Zoltan wrote: > On Wed, 8 May 2024, Nicholas Piggin wrote: > > On Wed May 8, 2024 at 10:15 AM AEST, BALATON Zoltan wrote: > >> Checking if a page protection bit is set for a given access type is a > >> common operation. Add

Re: [PATCH v3 26/33] target/ppc/mmu_common.c: Simplify ppc_booke_xlate() part 1

2024-05-08 Thread Nicholas Piggin
On Thu May 9, 2024 at 1:25 AM AEST, BALATON Zoltan wrote: > On Wed, 8 May 2024, Nicholas Piggin wrote: > > On Wed May 8, 2024 at 10:15 AM AEST, BALATON Zoltan wrote: > >> Move setting error_code that appears in every case out in front and > >> hoist the common fal

Re: [PATCH v4 08/33] target/ppc/mmu_common.c: Drop cases for unimplemented MPC8xx MMU

2024-05-09 Thread Nicholas Piggin
> called in ppc_cpu_reset_hold() so likely we never get here but to make > sure add a case to ppc_xlate() to the same effect. > > Signed-off-by: BALATON Zoltan Reviewed-by: Nicholas Piggin > --- > target/ppc/mmu_common.c | 12 ++-- > 1 file changed, 2 insertions(+), 10 deleti

Re: [PATCH v4 11/33] target/ppc/mmu_common.c: Move some debug logging

2024-05-09 Thread Nicholas Piggin
On Thu May 9, 2024 at 9:36 AM AEST, BALATON Zoltan wrote: > Move the debug logging within ppc6xx_tlb_check() from after its only > call to simplify the caller. > > Signed-off-by: BALATON Zoltan Reviewed-by: Nicholas Piggin > --- > target/ppc

Re: [PATCH v4 22/33] target/ppc/mmu_common.c: Make get_physical_address_wtlb() static

2024-05-09 Thread Nicholas Piggin
in this file. get_physical_address_wtlb and mmu_ctx_t is becoming basically 6xx specific after this. Nice. Reviewed-by: Nicholas Piggin > > Signed-off-by: BALATON Zoltan > --- > target/ppc/internal.h | 17 + > target/ppc/mmu_common.c | 17 ++--- > 2 files

Re: [PATCH v4 25/33] target/ppc/mmu_common.c: Split off BookE handling from ppc_jumbo_xlate()

2024-05-09 Thread Nicholas Piggin
On Thu May 9, 2024 at 9:36 AM AEST, BALATON Zoltan wrote: > Introduce ppc_booke_xlate() to handle BookE and BookE 2.06 cases to > reduce ppc_jumbo_xlate() further. > Reviewed-by: Nicholas Piggin > Signed-off-by: BALATON Zoltan > --- > target/ppc/

Re: [PATCH v3 33/33] target/ppc: Add a macro to check for page protection bit

2024-05-08 Thread Nicholas Piggin
On Thu May 9, 2024 at 9:35 AM AEST, BALATON Zoltan wrote: > On Wed, 8 May 2024, Nicholas Piggin wrote: > > On Wed May 8, 2024 at 10:15 AM AEST, BALATON Zoltan wrote: > >> Checking if a page protection bit is set for a given access type is a > >> common operation. Add

Re: [PATCH v2 26/28] target/ppc/mmu_common.c: Move BookE MMU functions together

2024-05-08 Thread Nicholas Piggin
On Thu May 9, 2024 at 9:33 AM AEST, BALATON Zoltan wrote: > On Wed, 8 May 2024, Nicholas Piggin wrote: > > On Tue May 7, 2024 at 10:31 PM AEST, BALATON Zoltan wrote: > >> On Tue, 7 May 2024, Nicholas Piggin wrote: > >>> What do you think about adding mmu-book

Re: [PATCH v4 21/33] target/ppc/mmu_common.c: Don't use mmu_ctx_t in mmubooke206_get_physical_address()

2024-05-09 Thread Nicholas Piggin
On Thu May 9, 2024 at 9:36 AM AEST, BALATON Zoltan wrote: > mmubooke206_get_physical_address() only uses the raddr and prot fields > from mmu_ctx_t. Pass these directly instead of using a ctx struct. > Reviewed-by: Nicholas Piggin > Signed-off-by: BALATON Zoltan > --

[PATCH] spapr: Migrate ail-mode-3 spapr cap

2024-05-06 Thread Nicholas Piggin
Signed-off-by: Nicholas Piggin --- include/hw/ppc/spapr.h | 1 + hw/ppc/spapr.c | 1 + hw/ppc/spapr_caps.c| 1 + 3 files changed, 3 insertions(+) diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h index 4aaf23d28f..f6de3e9972 100644 --- a/include/hw/ppc/spapr.h +++ b/include/hw/p

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

2024-05-06 Thread Nicholas Piggin
On Fri May 3, 2024 at 3:44 PM AEST, Cédric Le Goater wrote: > On 5/3/24 06:51, Nicholas Piggin wrote: > > On Thu May 2, 2024 at 6:47 PM AEST, Cédric Le Goater wrote: > >> On 5/1/24 14:39, Nicholas Piggin wrote: > >>> On Wed Apr 17, 2024 at 9:25 PM AEST, Cédric Le G

Re: [PATCH v2] ppc: Deprecate 'ref405ep' machine and 405 CPUs

2024-05-08 Thread Nicholas Piggin
ent hardware and focus on newer CPUs and platforms. > > Signed-off-by: Cédric Le Goater Acked-by: Nicholas Piggin > --- > v2: fixed header line > > docs/about/deprecated.rst | 8 > hw/ppc/ppc405_boards.c| 1 + > 2 files changed, 9 insertions(+) > >

Re: [PATCH v2 26/28] target/ppc/mmu_common.c: Move BookE MMU functions together

2024-05-08 Thread Nicholas Piggin
On Tue May 7, 2024 at 10:31 PM AEST, BALATON Zoltan wrote: > On Tue, 7 May 2024, Nicholas Piggin wrote: > > What do you think about adding mmu-book3e.c instead? > > I have considered that but found that some functions have to be in the > same file and declared static for the

Re: [PATCH v2 27/28] target/ppc: Remove id_tlbs flag from CPU env

2024-05-08 Thread Nicholas Piggin
On Wed May 8, 2024 at 2:02 AM AEST, BALATON Zoltan wrote: > On Tue, 7 May 2024, Nicholas Piggin wrote: > > On Thu May 2, 2024 at 9:43 AM AEST, BALATON Zoltan wrote: > >> This flag for split instruction/data TLBs is only set for 6xx soft TLB > >> MMU model and not used o

Re: [PATCH v3 09/33] target/ppc/mmu_common.c: Introduce mmu6xx_get_physical_address()

2024-05-08 Thread Nicholas Piggin
r so no need to keep these separate functions and > combining them simplifies the caller allowing further restructuring. > Reviewed-by: Nicholas Piggin > Signed-off-by: BALATON Zoltan > --- > target/ppc/mmu_common.c | 26 -- > 1 file changed, 12 insertion

Re: [PATCH v3 10/33] target/ppc/mmu_common.c: Move else branch to avoid large if block

2024-05-08 Thread Nicholas Piggin
return -3; > +} Function is already inconsistent with assigning ret and falling through to the return ret at the end vs returning immediately, so okay since you're tidying it up. Reviewed-by: Nicholas Piggin > +/* Page address translation */ > +

Re: [PATCH] target/ppc: handle vcpu hotplug failure gracefully

2024-05-13 Thread Nicholas Piggin
On Tue Apr 23, 2024 at 4:30 PM AEST, Harsh Prateek Bora wrote: > + qemu-devel > > On 4/23/24 11:40, Harsh Prateek Bora wrote: > > On ppc64, the PowerVM hypervisor runs with limited memory and a VCPU > > creation during hotplug may fail during kvm_ioctl for KVM_CREATE_VCPU, > > leading to

Re: [PATCH 00/24] Misc PPC exception and BookE MMU clean ups

2024-04-30 Thread Nicholas Piggin
On Wed Apr 24, 2024 at 8:31 AM AEST, BALATON Zoltan wrote: > This series does some further clean up mostly around BookE MMU to > untangle it from other MMU models. It also contains some other changes > that I've come up with while working on this. The first 3 patches are > from the last exception

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

2024-05-02 Thread Nicholas Piggin
On Thu May 2, 2024 at 6:32 PM AEST, Cédric Le Goater wrote: > Hello Nick, > > > >>> diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c > >>> index 5869aac89a..eb9dbc62dd 100644 > >>> --- a/hw/ppc/pnv.c > >>> +++ b/hw/ppc/pnv.c > >>> @@ -1642,6 +1642,8 @@ static void pnv_chip_power9_realize(DeviceState >

Re: [PATCH] ppc/pnv: Introduce pnv_chip_foreach_cpu()

2024-05-02 Thread Nicholas Piggin
On Wed Apr 24, 2024 at 7:30 PM AEST, Cédric Le Goater wrote: > This helper routine uses the machine definition, sockets, cores and > threads, to loop on all CPUs of the machine. Replace CPU_FOREACH() > with it. > > Signed-off-by: Cédric Le Goater Reviewed-by: Nicholas Piggin

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

2024-05-02 Thread Nicholas Piggin
On Thu May 2, 2024 at 6:47 PM AEST, Cédric Le Goater wrote: > On 5/1/24 14:39, Nicholas Piggin wrote: > > On Wed Apr 17, 2024 at 9:25 PM AEST, Cédric Le Goater wrote: > >> Hello Nick, > >> > >> On 4/17/24 13:02, Nicholas Piggin wrote: > >>> T

Re: [PATCH v2 09/10] ppc: Make Power11 as default cpu type for 'pseries' and 'powernv'

2024-05-02 Thread Nicholas Piggin
On Sat Apr 27, 2024 at 12:32 AM AEST, Cédric Le Goater wrote: > On 4/26/24 13:00, Aditya Gupta wrote: > > Make Power11 as default cpu type for 'pseries' and 'powernv' machine type, > > with Power11 being the newest supported Power processor in QEMU. > > This is too early. We should merge Power11

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

2024-05-01 Thread Nicholas Piggin
On Wed Apr 17, 2024 at 9:25 PM AEST, Cédric Le Goater wrote: > Hello Nick, > > On 4/17/24 13:02, Nicholas Piggin wrote: > > This implements a framework for an ADU unit model. > > > > The ADU unit actually implements XSCOM, which is the bridge between MMIO > >

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

2024-05-01 Thread Nicholas Piggin
On Wed Apr 17, 2024 at 10:25 PM AEST, Cédric Le Goater wrote: > On 4/17/24 13:02, Nicholas Piggin wrote: > > One of the functions of the ADU is indirect memory access engines that > > send and receive data via ADU registers. > > > > This implements the ADU LPC

[PATCH 1/3] target/ppc: Move sync instructions to decodetree

2024-05-01 Thread Nicholas Piggin
instruction exceptions when using new POWER10 sync variants that add new fields, after this the instructions are accepted and are implemented as supersets of the new behaviour, as intended. Signed-off-by: Nicholas Piggin --- target/ppc/insn32.decode | 7 ++ target/ppc/translate.c

[PATCH 3/3] target/ppc: Add ISA v3.1 variants of sync instruction

2024-05-01 Thread Nicholas Piggin
POWER10 adds a new field to sync for store-store syncs, and some new variants of the existing syncs that include persistent memory. Implement the store-store syncs and plwsync/phwsync. Signed-off-by: Nicholas Piggin --- target/ppc/insn32.decode | 6 ++-- target/ppc/translate/misc

[PATCH 0/3] target/ppc: Fixes and updates for sync instructions

2024-05-01 Thread Nicholas Piggin
probably add at least patch 1 to -stable, so the Linux changes can be upstreamed a bit sooner. Thanks, Nick Nicholas Piggin (3): target/ppc: Move sync instructions to decodetree target/ppc: Fix embedded memory barriers target/ppc: Add ISA v3.1 variants of sync instruction target/ppc

[PATCH 2/3] target/ppc: Fix embedded memory barriers

2024-05-01 Thread Nicholas Piggin
Memory barriers are supposed to do something on BookE systems, these were probably just missed during MTTCG enablement, maybe no targets support SMP. Either way, add proper BookE implementations. Signed-off-by: Nicholas Piggin --- target/ppc/translate/misc-impl.c.inc | 4 ++-- 1 file changed, 2

Re: [PATCH v2 04/28] target/ppc: Remove unused helper

2024-05-07 Thread Nicholas Piggin
On Thu May 2, 2024 at 9:43 AM AEST, BALATON Zoltan wrote: > The helper_rac function is defined but not used, remove it. > > Fixes: 005b69fdcc (target/ppc: Remove PowerPC 601 CPUs) > Signed-off-by: BALATON Zoltan Reviwed-by: Nicholas Piggin > --- > target/ppc/helper.h |

Re: [PATCH v2 05/28] target/ppc/mmu_common.c: Move calculation of a value closer to its usage

2024-05-07 Thread Nicholas Piggin
er and avoid computing it when not needed. > > Signed-off-by: BALATON Zoltan Reviwed-by: Nicholas Piggin > --- > target/ppc/mmu_common.c | 11 +-- > 1 file changed, 5 insertions(+), 6 deletions(-) > > diff --git a/target/ppc/mmu_common.c b/target/ppc/mmu_common.c >

Re: [PATCH v2 13/28] target/ppc/mmu_common.c: Split off real mode cases in get_physical_address_wtlb()

2024-05-07 Thread Nicholas Piggin
On Thu May 2, 2024 at 9:43 AM AEST, BALATON Zoltan wrote: > The real mode handling is identical in the remaining switch cases. > Split off these common real mode cases into a separate conditional to > leave only the else branches in the switch that are different. > Reviewed-by: Nic

Re: [PATCH v2 17/28] target/ppc/mmu_common.c: Fix misindented qemu_log_mask() calls

2024-05-07 Thread Nicholas Piggin
On Thu May 2, 2024 at 9:43 AM AEST, BALATON Zoltan wrote: > Fix several qemu_log_mask() calls that are misindented. Acked-by: Nicholas Piggin > > Signed-off-by: BALATON Zoltan > --- > target/ppc/mmu_common.c | 42 - > 1 file chan

Re: [PATCH v2 16/28] target/ppc/mmu_common.c: Simplify mmubooke206_get_physical_address()

2024-05-07 Thread Nicholas Piggin
nt i, j, ways, ret = -1; > > for (i = 0; i < BOOKE206_MAX_TLBN; i++) { > -int ways = booke206_tlb_ways(env, i); Don't need to bring the ways variable into a larger scope I think? Otherwise, Reviewed-by: Nicholas Piggin > - > +ways = booke206_tlb_ways(env, i); >

Re: [PATCH v2 19/28] target/ppc/mmu_common.c: Replace hard coded constants in ppc_jumbo_xlate()

2024-05-07 Thread Nicholas Piggin
so using MMU_DATA_LOAD here seems wrong so replace it with > access_type here as well that yields the same result. This also makes > these calls the same as the data access branch further down. Looks right. Reviewed-by: Nicholas Piggin > > Signed-off-by: BALATON Zoltan > --- >

Re: [PATCH v2 21/28] target/ppc: Move mmu_ctx_t definition to mmu_common.c

2024-05-07 Thread Nicholas Piggin
On Thu May 2, 2024 at 9:43 AM AEST, BALATON Zoltan wrote: > This type is only used within mmu_common.c. Move its definition from > internal.h to there. This can be squashed with the previous patch unexport the remaining user. Reviewed-by: Nicholas Piggin > > Signed-off-by: BA

Re: [PATCH v2 06/28] target/ppc/mmu_common.c: Move calculation of a value closer to its usage

2024-05-07 Thread Nicholas Piggin
er and avoid computing it when not needed. > > Signed-off-by: BALATON Zoltan Reviwed-by: Nicholas Piggin > --- > target/ppc/mmu_common.c | 25 - > 1 file changed, 12 insertions(+), 13 deletions(-) > > diff --git a/target/ppc/mmu_common.c b/target/pp

Re: [PATCH v2 08/28] target/ppc/mmu_common.c: Simplify checking for real mode

2024-05-07 Thread Nicholas Piggin
. Hopefully the compiler should be able to work it out, but IMO it reads better with your change. Reviewed-by: Nicholas Piggin > > Signed-off-by: BALATON Zoltan > --- > target/ppc/mmu_common.c | 6 -- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a

Re: [PATCH v2 09/28] target/ppc/mmu_common.c: Drop cases for unimplemented MPC8xx MMU

2024-05-07 Thread Nicholas Piggin
On Thu May 2, 2024 at 9:43 AM AEST, BALATON Zoltan wrote: > The default case will catch this and abort the same way and there is > still a warning about it in ppc_tlb_invalidate_all() so drop these > from mmu_common.c to simplify this code. Reviewed-by: Nicholas Piggin >

Re: [PATCH v2 11/28] target/ppc/mmu_common.c: Rename get_bat_6xx_tlb()

2024-05-07 Thread Nicholas Piggin
On Thu May 2, 2024 at 9:43 AM AEST, BALATON Zoltan wrote: > Rename to ppc6xx_tlb_get_bat() to match other similar names in the > same file. > > Signed-off-by: BALATON Zoltan Acked-by: Nicholas Piggin > --- > target/ppc/mmu_common.c | 6 +++--- > 1 file changed, 3 inser

Re: [PATCH v2 10/28] target/ppc/mmu_common.c: Introduce mmu6xx_get_physical_address()

2024-05-07 Thread Nicholas Piggin
y */ if (env->nb_BATs != 0) { int ret = get_bat_6xx_tlb(env, ctx, eaddr, access_type); if (ret >= 0) { return ret; } } Otherwise, Reviewed-by: Nicholas Piggin > +/* Perform segment based translation when no BATs matched */ > pr =

Re: [PATCH v2 12/28] target/ppc/mmu_common.c: Split out BookE cases before checking real mode

2024-05-07 Thread Nicholas Piggin
On Thu May 2, 2024 at 9:43 AM AEST, BALATON Zoltan wrote: > BookE does not have real mode so split off and handle it first in > get_physical_address_wtlb() before checking for real mode for other > MMU models. Reviewed-by: Nicholas Piggin > > Signed-off-by: BALATON Zoltan >

Re: [PATCH v2 15/28] target/ppc/mmu_common.c: Simplify mmubooke_get_physical_address()

2024-05-07 Thread Nicholas Piggin
On Thu May 2, 2024 at 9:43 AM AEST, BALATON Zoltan wrote: > Signed-off-by: BALATON Zoltan Reviewed-by: Nicholas Piggin > --- > target/ppc/mmu_common.c | 25 + > 1 file changed, 9 insertions(+), 16 deletions(-) > > diff --git a/target/ppc/mmu_com

<    5   6   7   8   9   10   11   12   13   14   >