mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2026-10-14 05:55:17 +00:00
KVM allows userspace to configure either all EL1 32bit or 64bit vCPUs
for a guest. At vCPU reset, vcpu_allowed_register_width() checks
if the vcpu's register width is consistent with all other vCPUs'.
Since the checking is done even against vCPUs that are not initialized
(KVM_ARM_VCPU_INIT has not been done) yet, the uninitialized vCPUs
are erroneously treated as 64bit vCPU, which causes the function to
incorrectly detect a mixed-width VM.
Introduce KVM_ARCH_FLAG_EL1_32BIT and KVM_ARCH_FLAG_REG_WIDTH_CONFIGURED
bits for kvm->arch.flags. A value of the EL1_32BIT bit indicates that
the guest needs to be configured with all 32bit or 64bit vCPUs, and
a value of the REG_WIDTH_CONFIGURED bit indicates if a value of the
EL1_32BIT bit is valid (already set up). Values in those bits are set at
the first KVM_ARM_VCPU_INIT for the guest based on KVM_ARM_VCPU_EL1_32BIT
configuration for the vCPU.
Check vcpu's register width against those new bits at the vcpu's
KVM_ARM_VCPU_INIT (instead of against other vCPUs' register width).
Fixes:
|
History
|
|
|---|---|---|
| .. | ||
| hyp | ||
| vgic | ||
| .gitignore | ||
| arch_timer.c | ||
| arm.c | ||
| debug.c | ||
| fpsimd.c | ||
| guest.c | ||
| handle_exit.c | ||
| hypercalls.c | ||
| inject_fault.c | ||
| irq.h | ||
| Kconfig | ||
| Makefile | ||
| mmio.c | ||
| mmu.c | ||
| pkvm.c | ||
| pmu-emul.c | ||
| pmu.c | ||
| psci.c | ||
| pvtime.c | ||
| reset.c | ||
| sys_regs.c | ||
| sys_regs.h | ||
| trace.h | ||
| trace_arm.h | ||
| trace_handle_exit.h | ||
| trng.c | ||
| va_layout.c | ||
| vgic-sys-reg-v3.c | ||
| vmid.c | ||