On Sun, 8 Nov 2026, Bin Meng wrote:
The generic models use PVRs 0x80230020, 0x80240020 and 0x80400020.
The default PVR callback is an exact comparison, so KVM's fallback
lookup fails on various P/T-series SoCs and the VMM cannot register
the host CPU type.

Match the architected core-version field in the upper 16 bits for
all three families, allowing differences in the revision field.

Signed-off-by: Bin Meng <[email protected]>


---

Changes in v3:
- New

target/ppc/cpu_init.c | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c
index a2da7c509d..42d69d0865 100644
--- a/target/ppc/cpu_init.c
+++ b/target/ppc/cpu_init.c
@@ -3159,6 +3159,12 @@ POWERPC_FAMILY(e500v2)(ObjectClass *oc, const void *data)
                 POWERPC_FLAG_BUS_CLK;
}

+static bool ppc_pvr_match_booke(PowerPCCPUClass *pcc, uint32_t pvr, bool best)

Not sure how booke specific is this. Why not call it _match_core if that's what it does? But it's not a big deal so probably does not worth a respin if there are no changes needed otherwise.

Regards,
BALATON Zoltan

+{
+    /* Match the core version while allowing hardware revision differences */
+    return (pvr & 0xffff0000) == (pcc->pvr & 0xffff0000);
+}
+
static void init_proc_e500mc(CPUPPCState *env)
{
    init_proc_e500(env, fsl_e500mc);
@@ -3170,6 +3176,7 @@ POWERPC_FAMILY(e500mc)(ObjectClass *oc, const void *data)
    PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);

    dc->desc = "e500mc core";
+    pcc->pvr_match = ppc_pvr_match_booke;
    pcc->init_proc = init_proc_e500mc;
    pcc->check_pow = check_pow_none;
    pcc->check_attn = check_attn_none;
@@ -3218,6 +3225,7 @@ POWERPC_FAMILY(e5500)(ObjectClass *oc, const void *data)
    PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);

    dc->desc = "e5500 core";
+    pcc->pvr_match = ppc_pvr_match_booke;
    pcc->init_proc = init_proc_e5500;
    pcc->check_pow = check_pow_none;
    pcc->check_attn = check_attn_none;
@@ -3268,6 +3276,7 @@ POWERPC_FAMILY(e6500)(ObjectClass *oc, const void *data)
    PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);

    dc->desc = "e6500 core";
+    pcc->pvr_match = ppc_pvr_match_booke;
    pcc->init_proc = init_proc_e6500;
    pcc->check_pow = check_pow_none;
    pcc->check_attn = check_attn_none;


Reply via email to