From: Roger Pau Monné Date: Mon, 25 Nov 2019 15:24:44 +0000 (+0100) Subject: x86/vlapic: allow setting APIC_SPIV_FOCUS_DISABLED in x2APIC mode X-Git-Tag: archive/raspbian/4.11.3+24-g14b62ab3e5-1+rpi1^2~55^2~29 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=48a2e5d91fc8311d222e8b166b25fc72e755ea6e;p=xen.git x86/vlapic: allow setting APIC_SPIV_FOCUS_DISABLED in x2APIC mode Current code unconditionally prevents setting APIC_SPIV_FOCUS_DISABLED regardless of the processor model, which is not correct according to the specification. This issue was discovered while trying to boot a pvshim with x2APIC enabled. Always allow setting APIC_SPIV_FOCUS_DISABLED: the local APIC provided to guests is emulated by Xen, and as such doesn't depend on the features found on the hardware processor. Note for example that Xen offers x2APIC support to guests even when the underlying hardware doesn't have such feature. Signed-off-by: Roger Pau Monné Reviewed-by: Jan Beulich master commit: d7cd999faa1edf745a7597db811956cb882a5436 master date: 2019-11-22 17:52:59 +0100 --- diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c index b5f2c895e4..871c9a46b4 100644 --- a/xen/arch/x86/hvm/vlapic.c +++ b/xen/arch/x86/hvm/vlapic.c @@ -974,6 +974,7 @@ int hvm_x2apic_msr_write(struct vcpu *v, unsigned int msr, uint64_t msr_content) case APIC_SPIV: if ( msr_content & ~(APIC_VECTOR_MASK | APIC_SPIV_APIC_ENABLED | + APIC_SPIV_FOCUS_DISABLED | (VLAPIC_VERSION & APIC_LVR_DIRECTED_EOI ? APIC_SPIV_DIRECTED_EOI : 0)) ) return X86EMUL_UNHANDLEABLE;