ppc-for-11.2 queue
The following changes since commit eea8fe61b8be8f3016e522e6af24924a0266ca95:
Merge tag 'igvm-20260821-pull-request' of https://gitlab.com/kraxel/qemu into staging (2026-08-21 10:39:31 -0700)
are available in the Git repository at:
https://gitlab.com/harshpb/qemu.git tags/pull-ppc-for-11.2-20260823
for you to fetch changes up to 45caf67b9a6a446629e1c133b76a3d9a3cebdcf1:
MAINTAINERS: add self as reviewer for PowerPC RAS (2026-08-23 11:42:57 +0530)
----------------------------------------------------------------
PPC PR for 11.2 - 20260823
* powernv: boot OpenBSD on POWER9
* Misc fixes in target/ppc and spapr_watchdog
* MAINTAINERS: adding reviewers - Amit (PPC KVM, sPAPR) and Shivang (PPC RAS)
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEa4EM1tK+EPOIPSFCRUTplPnWj7sFAmqKlQcACgkQRUTplPnW j7tgEw//anSKG8cNMcauqfv9kB4buOdtGPLZS7QjO35JPYD6bI8Z+DvPMSJKi+xP 3GcjT3rZbzCI0OsbAzw5OmSCZzsY/Cgr+1FrlJcC49jOEHC4VklD7tVV6dH5MS1j CUZlxd5TQrf49URitZcaOcQWHNxrr1WjDhGxmdz0VnV4nJF4QQMyACRM6e+KpgXN 0qLGfuHF77N79g+ttf1psI+VYESk8kMg48rQDDBqlF1y27D1GEMdsNqq8lhvzvZc tLUiui3xvhXPRqUTE6AcvGrpCfdkoiAsR/R6i0kdu+HrQ10CcRHTXCyYpPjBj2wg bo7erO4jQBHroIXXkAJ8EJzOTNMmaBtHuXjMZYgCHO9pYMGgHzp3yXvqyC9k3F/c dlOgrdw6mC7K+3b4REHeG8kaYRtIFi8vbENGQNSMyEDZswvU+obwKZWz24nmOvvl A6QP2C6/gAraodcoDMaJ9pYhU6/5ynGhbcrfjzqiGN1z/pmXIiXffW342oLciWa/ /yAMCiHhH9k7aBULm27JqcCWOiotk/Xv9J1/TlLfcs6h3YuMlVGl6V4zMvctufYO XqqP/iJqbj3djdYQLGUEdEG1Yh2LItO9KYu5F00jET1fE8DW6NS9ceUe4A6oma8f nMv3ErfxAbVkr5rN/vibo35yG2O26ApwW8oQDM0NzlesklsMHd0= =vkyg
-----END PGP SIGNATURE-----
----------------------------------------------------------------
Amit Machhiwal (1):
MAINTAINERS: Add myself as a reviewer for PPC KVM and sPAPR
Chinmay Rath (1):
hw/watchdog: Add lower bound check for watchdogNumber
Kirill A. Korinsky (1):
powernv: boot OpenBSD on POWER9
Minhang Zhang (1):
target/ppc: Validate HTABMASK and reserved bits in SDR1 for 32-bit mode
Pierrick Bouvier (1):
target/ppc/cpu_init: make cpu listing deterministic
Shivang Upadhyay (2):
MAINTAINERS: add dedicated PowerPC RAS section
MAINTAINERS: add self as reviewer for PowerPC RAS
MAINTAINERS | 35 ++++++++++++----------- hw/ppc/pnv_psi.c | 11 +++++-- hw/watchdog/spapr_watchdog.c | 16 +++++++---- target/ppc/cpu_init.c | 2 +- target/ppc/mmu-book3s-v3.c | 21 +++++++++++--- target/ppc/mmu_common.c | 25 ++++++++++++---- tests/functional/ppc64/meson.build | 2 ++ tests/functional/ppc64/test_openbsd.py | 52 ++++++++++++++++++++++++++++++++++ 8 files changed, 129 insertions(+), 35 deletions(-) create mode 100755 tests/functional/ppc64/test_openbsd.py
[PULL 1/7] target/ppc/cpu_init: make cpu listing deterministic
From: Pierrick Bouvier <[email protected]>
The existing compare function only make sure that we list cpus with PVR order. However, we never compare cpu names.
As a result, while cpus are grouped per PVR, the order within a group is non deterministic. Depending on QOM type initialization order, we get different results for -cpu help.
For instance, previous output could be:
Available CPUs:
755_v1.0 PVR 00083100 745_v1.0 PVR 00083100 755_v1.1 PVR 00083101 745_v1.1 PVR 00083101
While a sorted output should be:
Available CPUs:
745_v1.0 PVR 00083100 755_v1.0 PVR 00083100 745_v1.1 PVR 00083101 755_v1.1 PVR 00083101
Fix it by comparing cpu names to have a stable result.
This allows us to record and compare various command line results across versions to make sure we didn't break anything while working on single-binary.
--- target/ppc/cpu_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
target/ppc/cpu_init.c +1 -1
@@ -7130,7 +7130,7 @@ static gint ppc_cpu_list_compare(gconstpointer a, gconstpointer b, gpointer d) }else if (pcc_a->pvr > pcc_b->pvr) {return 1 ; }else { -return 0 ; +return strcmp (name_a, name_b); } } }
Signature · 1 line
2.52.0
[PULL 2/7] target/ppc: Validate HTABMASK and reserved bits in SDR1 for 32-bit mode
In reply to Harsh Prateek BoraFrom: Minhang Zhang <[email protected]>
ppc_store_sdr1() had validation for 64-bit SDR1 values but lacked corresponding checks for the 32-bit case. According to the Power ISA, in 32-bit mode SDR1 bits 16-22 are reserved (must be zero) and HTABMASK (bits 23-31) must consist of a consecutive string of 1-bits starting from the LSB, i.e., be of the form 2^n-1.
Add checks to reject invalid HTABMASK values and log a guest error for non-zero reserved bits, following the same pattern used by the existing 64-bit validation.
--- target/ppc/mmu_common.c | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-)
target/ppc/mmu_common.c +20 -5
@@ -42,24 +42,39 @@ void ppc_store_sdr1(CPUPPCState *env, target_ulong value)PowerPCCPU *cpu =env_archcpu (env);qemu_log_mask (CPU_LOG_MMU ,"%s: " TARGET_FMT_lx"\n" , __func__, value);assert (!cpu->env.has_hv_mode || !cpu->vhyp); -#if defined(TARGET_PPC64 )if (mmu_is_64bit (env->mmu_model)) { +#if defined(TARGET_PPC64 )target_ulong sdr_mask =SDR_64_HTABORG |SDR_64_HTABSIZE ;target_ulong htabsize = value &SDR_64_HTABSIZE ;if (value & ~sdr_mask) {qemu_log_mask (LOG_GUEST_ERROR ,"Invalid bits 0x" TARGET_FMT_lx -" set in SDR1" , value & ~sdr_mask); +" set in SDR1\n" , value & ~sdr_mask); value &= sdr_mask; }if (htabsize >28 ) {qemu_log_mask (LOG_GUEST_ERROR ,"Invalid HTABSIZE 0x" TARGET_FMT_lx -" stored in SDR1" , htabsize); +" stored in SDR1\n" , htabsize);return ; } - }#endif /* defined(TARGET_PPC64) */ -/* FIXME: Should check for valid HTABMASK values in 32-bit case */ + }else { +target_ulong sdr_mask =SDR_32_HTABORG |SDR_32_HTABMASK ; +target_ulong htabmask = value &SDR_32_HTABMASK ; + +if (value & ~sdr_mask) { +qemu_log_mask (LOG_GUEST_ERROR , +"Invalid bits 0x" TARGET_FMT_lx +" set in SDR1\n" , value & ~sdr_mask); + value &= sdr_mask; + } +if ((htabmask & (htabmask +1 )) !=0 ) { +qemu_log_mask (LOG_GUEST_ERROR , +"Invalid HTABMASK 0x" TARGET_FMT_lx +" in SDR1 (must be of form 2^n-1)\n" , htabmask); +return ; + } + } env->spr[SPR_SDR1 ] = value; }
Signature · 1 line
2.52.0
[PULL 4/7] hw/watchdog: Add lower bound check for watchdogNumber
In reply to Harsh Prateek BoraFrom: Chinmay Rath <[email protected]>
Add missing lower bound check for H_WATCHDOG H_CALL's watchdogNumber parameter as per PAPR documentation ver 12.10.00 section 14.15.5 'H_WATCHDOG'.
--- hw/watchdog/spapr_watchdog.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-)
hw/watchdog/spapr_watchdog.c +11 -5
@@ -127,6 +127,12 @@ static void watchdog_expired(void *pw) } } +static inline bool watchdog_number_valid (target_ulong watchdogNumber, +SpaprMachineState *spapr) +{ +return watchdogNumber >=1 && watchdogNumber <=ARRAY_SIZE (spapr->wds); +} +static target_ulong h_watchdog (PowerPCCPU *cpu,SpaprMachineState *spapr,target_ulong opcode,target_ulong *args)
@@ -145,7 +151,7 @@ static target_ulong h_watchdog(PowerPCCPU *cpu,switch (operation) {case PSERIES_WDTF_OP_START : -if (watchdogNumber >ARRAY_SIZE (spapr->wds)) { +if (!watchdog_number_valid (watchdogNumber, spapr)) {return H_P2 ; }if (timeoutInMs <=WDT_MIN_TIMEOUT ) {
@@ -170,11 +176,11 @@ static target_ulong h_watchdog(PowerPCCPU *cpu,case PSERIES_WDTF_OP_STOP :if (watchdogNumber ==PSERIES_WDT_STOP_ALL ) { ret =watchdog_stop_all (spapr); - }else if (watchdogNumber <=ARRAY_SIZE (spapr->wds)) { + }else if (!watchdog_number_valid (watchdogNumber, spapr)) { +return H_P2 ; + }else { ret =watchdog_stop (watchdogNumber, &spapr->wds[watchdogNumber -1 ]); - }else { -return H_P2 ; }break ;case PSERIES_WDTF_OP_QUERY :
@@ -184,7 +190,7 @@ static target_ulong h_watchdog(PowerPCCPU *cpu,trace_spapr_watchdog_query (args[0 ]);break ;case PSERIES_WDTF_OP_QUERY_LPM : -if (watchdogNumber >ARRAY_SIZE (spapr->wds)) { +if (!watchdog_number_valid (watchdogNumber, spapr)) {return H_P2 ; } args[0 ] =PSERIES_WDTQL_QUERY_NOT_STOPPED ;
Signature · 1 line
2.52.0
[PULL 5/7] powernv: boot OpenBSD on POWER9
In reply to Harsh Prateek BoraFrom: "Kirill A. Korinsky" <[email protected]>
The POWER9 Processor User's Manual, section 4.9.4, specifies that POWER9 ignores PTCR[PATS] and only supports a 64 KiB partition table. Use an effective PATS value of 4 on POWER9; other processors keep the existing ISA v3.0 interpretation.
The PSI model now exposes POWER9 IRQ level and pending status registers, and keeps both updated while delivering through the existing XIVE LSI source. This lets guests that select the POWER9 PSI LSI IRQ method continue to receive LPC interrupts.
The blast radius is probably minimal: the PTCR change is limited to POWER9, while the PSI change only touches POWER9 PSI state and reuses the existing delivery path.
--- hw/ppc/pnv_psi.c | 11 ++++-- target/ppc/mmu-book3s-v3.c | 21 +++++++++-- tests/functional/ppc64/meson.build | 2 + tests/functional/ppc64/test_openbsd.py | 52 ++++++++++++++++++++++++++ 4 files changed, 79 insertions(+), 7 deletions(-) create mode 100755 tests/functional/ppc64/test_openbsd.py
hw/ppc/pnv_psi.c +8 -3
@@ -688,6 +688,8 @@ static uint64_t pnv_psi_p9_mmio_read(void *opaque, hwaddr addr, unsigned size)case PSIHB9_ESB_CI_BASE :case PSIHB9_ESB_NOTIF_ADDR :case PSIHB9_IVT_OFFSET : +case PSIHB9_IRQ_LEVEL : +case PSIHB9_IRQ_STAT : val = psi->regs[reg];break ;default :
@@ -818,17 +820,20 @@ static void pnv_psi_power9_set_irq(void *opaque, int irq, int state) {PnvPsi *psi = opaque;uint64_t irq_method = psi->regs[PSIHB_REG (PSIHB9_INTERRUPT_CONTROL )]; +uint64_t irq_bit =PPC_BIT (irq);if (irq_method &PSIHB9_IRQ_METHOD ) {qemu_log_mask (LOG_GUEST_ERROR ,"PSI: LSI IRQ method no supported\n" );return ; } -/* Update LSI levels */ +/* Update LSI levels and pending status */ if (state) { - psi->regs[PSIHB_REG (PSIHB9_IRQ_LEVEL )] |=PPC_BIT (irq); + psi->regs[PSIHB_REG (PSIHB9_IRQ_LEVEL )] |= irq_bit; + psi->regs[PSIHB_REG (PSIHB9_IRQ_STAT )] |= irq_bit; }else { - psi->regs[PSIHB_REG (PSIHB9_IRQ_LEVEL )] &= ~PPC_BIT (irq); + psi->regs[PSIHB_REG (PSIHB9_IRQ_LEVEL )] &= ~irq_bit; + psi->regs[PSIHB_REG (PSIHB9_IRQ_STAT )] &= ~irq_bit; }qemu_set_irq (psi->qirqs[irq], state);
target/ppc/mmu-book3s-v3.c +17 -4
@@ -23,24 +23,37 @@#include "mmu-hash64.h" #include "mmu-book3s-v3.h" +#define PPC64_V3_PATE_SIZE 16/* two 64-bit words */ +bool ppc64_v3_get_pate (PowerPCCPU *cpu,target_ulong lpid,ppc_v3_pate_t *entry) {uint64_t patb = cpu->env.spr[SPR_PTCR ] &PTCR_PATB ;uint64_t pats = cpu->env.spr[SPR_PTCR ] &PTCR_PATS ; +uint64_t table_size; +uint64_t entries; + +/* +* The POWER9 Processor User's Manual, section 4.9.4, specifies that +* POWER9 ignores PTCR[PATS] and only supports a 64 KiB partition table. +*/ +if (cpu->env.excp_model ==POWERPC_EXCP_POWER9 ) { + pats =4 ; + } + table_size =1ULL << (pats +12 );/* Check if partition table is properly aligned */ -if (patb &MAKE_64BIT_MASK (0 , pats +12 )) { +if (patb & (table_size -1 )) {return false; }/* Calculate number of entries */ - pats =1ull << (pats +12 -4 ); -if (pats <= lpid) { + entries = table_size /PPC64_V3_PATE_SIZE ; +if (entries <= lpid) {return false; }/* Grab entry */ - patb +=16 * lpid; + patb +=PPC64_V3_PATE_SIZE * lpid; entry->dw0 =ldq_phys (CPU (cpu)->as, patb); entry->dw1 =ldq_phys (CPU (cpu)->as, patb +8 );return true;
tests/functional/ppc64/meson.build +2 -0
@@ -4,6 +4,7 @@ test_ppc64_timeouts = { 'fadump' : 480, 'hv' : 1000, 'mac99' : 120, + 'openbsd' : 240, 'powernv' : 480, 'pseries' : 480, 'replay' : 210,
@@ -20,6 +21,7 @@ tests_ppc64_system_thorough = [ 'fadump', 'hv', 'mac99', + 'openbsd', 'powernv', 'pseries', 'replay',
tests/functional/ppc64/test_openbsd.py new file +52 -0
52 lines not on this page · raw message
Signature · 1 line
2.52.0
[PULL 6/7] MAINTAINERS: add dedicated PowerPC RAS section
In reply to Harsh Prateek BoraFrom: Shivang Upadhyay <[email protected]>
Introduce a new "PowerPC RAS (Reliability, Availability and Serviceability)" entry in the PowerPC Machines block, replacing the existing Fadump/MPIPL sections. Retaining the maintainer and reviewer entries from Fadump/MPIPL sections for this broader umbrella.
Currently most of RAS related code sits in spapr_rtas.c, So Adding it to PowerPC RAS section. Additionally adding spapr_events.c, as it implements RTAS error logging infrastructure and spapr_pci_vfio.c, since its all EEH related code.
--- MAINTAINERS | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-)
MAINTAINERS +15 -17
@@ -1765,6 +1765,21 @@ F: include/hw/ppc/vof* F: pc-bios/vof/* F: pc-bios/vof* +PowerPC RAS (Reliability, Availability and Serviceability) +M: Aditya Gupta <[email protected]> +R: Sourabh Jain <[email protected]> +R: Hari Bathini <[email protected]> +L: [email protected] +S: Maintained +F: hw/ppc/spapr_events.c +F: hw/ppc/spapr_fadump.c +F: hw/ppc/spapr_pci_vfio.c +F: hw/ppc/spapr_rtas.c +F: hw/ppc/pnv_mpipl.c +F: include/hw/ppc/spapr_fadump.h +F: include/hw/ppc/pnv_mpipl.h +F: tests/functional/ppc64/test_fadump.py + RISC-V Machines --------------- OpenTitan
@@ -3402,23 +3417,6 @@ F: scripts/coccinelle/remove_local_err.cocci F: scripts/coccinelle/use-error_fatal.cocci F: scripts/coccinelle/errp-guard.cocci -Firmware Assisted Dump (fadump) for sPAPR (pseries) -M: Aditya Gupta <[email protected]> -R: Sourabh Jain <[email protected]> -S: Maintained -F: include/hw/ppc/spapr_fadump.h -F: hw/ppc/spapr_fadump.c -F: tests/functional/ppc64/test_fadump.py - -Memory-Preserving Initial Program Load (MPIPL) for PowerNV -M: Aditya Gupta <[email protected]> -R: Hari Bathini <[email protected]> -R: Sourabh <[email protected]> -S: Maintained -F: include/hw/ppc/pnv_mpipl.h -F: hw/ppc/pnv_mpipl.c -F: tests/functional/ppc64/test_fadump.py - GDB stub M: Alex Bennée <[email protected]> R: Philippe Mathieu-Daudé <[email protected]>
Signature · 1 line
2.52.0
[PULL 3/7] MAINTAINERS: Add myself as a reviewer for PPC KVM and sPAPR
In reply to Harsh Prateek BoraFrom: Amit Machhiwal <[email protected]>
I have been contributing to PPC KVM and sPAPR (pseries) for some time now and would like to get notified of incoming changes to help with code reviews.
--- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+)
MAINTAINERS +2 -0
@@ -497,6 +497,7 @@ F: tests/functional/aarch64/test_kvm.py PPC KVM CPUs M: Nicholas Piggin <[email protected]> R: Harsh Prateek Bora <[email protected]> +R: Amit Machhiwal <[email protected]> S: Odd Fixes F: target/ppc/kvm.c
@@ -1662,6 +1663,7 @@ F: tests/functional/ppc/test_40p.py sPAPR (pseries) M: Nicholas Piggin <[email protected]> M: Harsh Prateek Bora <[email protected]> +R: Amit Machhiwal <[email protected]> L: [email protected] S: Odd Fixes F: hw/*/spapr*
Signature · 1 line
2.52.0
[PULL 7/7] MAINTAINERS: add self as reviewer for PowerPC RAS
In reply to Harsh Prateek BoraFrom: Shivang Upadhyay <[email protected]>
I have been contributing to Fadump, MPIPL as well as PowerNV for quite some time, and my daily work responsibilities includes taking care of PowerPC RAS features. I, therefore would like to step up as a reviewer to get notified of incoming changes in this area and help reviewing them.
--- MAINTAINERS | 1 + 1 file changed, 1 insertion(+)
MAINTAINERS +1 -0
@@ -1769,6 +1769,7 @@ PowerPC RAS (Reliability, Availability and Serviceability) M: Aditya Gupta <[email protected]> R: Sourabh Jain <[email protected]> R: Hari Bathini <[email protected]> +R: Shivang Upadhyay <[email protected]> L: [email protected] S: Maintained F: hw/ppc/spapr_events.c
Signature · 1 line
2.52.0
Richard Henderson
AppliedQuoted 10 lines · Harsh Prateek Bora
The following changes since commit
eea8fe61b8be8f3016e522e6af24924a0266ca95:Merge tag 'igvm-20260821-pull-request' ofhttps://gitlab.com/kraxel/qemu into staging (2026-08-21 10:39:31 -0700)are available in the Git repository at:
https://gitlab.com/harshpb/qemu.git tags/pull-ppc-for-11.2-20260823for you to fetch changes up to
45caf67b9a6a446629e1c133b76a3d9a3cebdcf1:
Quoted 8 lines
MAINTAINERS: add self as reviewer for PowerPC RAS (2026-08-23 11:42:57 +0530)----------------------------------------------------------------
PPC PR for 11.2 - 20260823* powernv: boot OpenBSD on POWER9
* Misc fixes in target/ppc andspapr_watchdog
*MAINTAINERS: adding reviewers - Amit (PPC KVM, sPAPR) and Shivang (PPC RAS)
Applied, thanks. Please update https://wiki.qemu.org/ChangeLog/11.2 as appropriate.
r~