[RFC 0/5] KVM: drop 32-bit host support on all architectures

Arnd Bergmann arnd at arndb.de
Fri Dec 13 01:01:30 PST 2024


On Fri, Dec 13, 2024, at 09:42, A. Wilcox wrote:
>
> As for Power: I will admit I haven’t tested lately, but well into
> the 5 series (5.4, at least), you couldn’t boot a ppc32 Linux kernel
> on any 64-bit capable hardware.  It would throw what I believe was an
> alignment error while quiescing OpenFirmware and toss you back to an
> ‘ok >’ prompt.  Unfortunately I can’t find any of the bug reports
> or ML threads from the time - it was a known bug in the 2.6 days - but
> the answer was always “why are you booting a ppc32 kernel on that
> hardware anyway?  It’s a ppc64 machine!”  Is this a case where
> that would be accepted as a legitimate bug now?  It would be lovely
> to use my largely-SMT 3.0 GHz Power9 box for more of my kernel testing
> (where possible) instead of relying on a 933 MHz single-thread G4.

I'm fairly sure we don't allow booting 32-bit kernels on
the 64-bit IBM CPUs (g5, cell, POWER), but as Christophe
mentioned earlier, you can apparently run a 32-bit e500
kernel 64-bit QorIQ.

What I was thinking of is purely inside of qemu/kvm. I have
not tried this myself, but I saw that there is code to handle
this case in the kernel, at least for PR mode:

static void kvmppc_set_pvr_pr(struct kvm_vcpu *vcpu, u32 pvr)
{
        u32 host_pvr;

        vcpu->arch.hflags &= ~BOOK3S_HFLAG_SLB;
        vcpu->arch.pvr = pvr;
        if ((pvr >= 0x330000) && (pvr < 0x70330000)) {
                kvmppc_mmu_book3s_64_init(vcpu);
                if (!to_book3s(vcpu)->hior_explicit)
                        to_book3s(vcpu)->hior = 0xfff00000;
                to_book3s(vcpu)->msr_mask = 0xffffffffffffffffULL;
                vcpu->arch.cpu_type = KVM_CPU_3S_64;
        } else
        {
                kvmppc_mmu_book3s_32_init(vcpu);
                if (!to_book3s(vcpu)->hior_explicit)
                        to_book3s(vcpu)->hior = 0;
                to_book3s(vcpu)->msr_mask = 0xffffffffULL;
                vcpu->arch.cpu_type = KVM_CPU_3S_32;
        }
...

So I assumed this would work the same way as on x86 and arm,
where you can use the 32-bit machine emulation from qemu but
still enable KVM mode.

      Arnd



More information about the kvm-riscv mailing list