[Xen-devel] [PATCH for-4.13 v2] x86/vlapic: allow setting APIC_SPIV_FOCUS_DISABLED in x2APIC mode

Roger Pau Monne posted 1 patch 4 years, 4 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/xen tags/patchew/20191121101904.10295-1-roger.pau@citrix.com
xen/arch/x86/hvm/vlapic.c | 1 +
1 file changed, 1 insertion(+)
[Xen-devel] [PATCH for-4.13 v2] x86/vlapic: allow setting APIC_SPIV_FOCUS_DISABLED in x2APIC mode
Posted by Roger Pau Monne 4 years, 4 months ago
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é <roger.pau@citrix.com>
---
Cc: Juergen Gross <jgross@suse.com>
---
Changes since v1:
 - Always allow setting the APIC_SPIV_FOCUS_DISABLED bit.
---
 xen/arch/x86/hvm/vlapic.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 9466258d6f..b790ba6bbd 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -993,6 +993,7 @@ int guest_wrmsr_x2apic(struct vcpu *v, uint32_t 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_EXCEPTION;
-- 
2.24.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH for-4.13 v2] x86/vlapic: allow setting APIC_SPIV_FOCUS_DISABLED in x2APIC mode
Posted by Jan Beulich 4 years, 4 months ago
On 21.11.2019 11:19, Roger Pau Monne wrote:
> 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é <roger.pau@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH for-4.13 v2] x86/vlapic: allow setting APIC_SPIV_FOCUS_DISABLED in x2APIC mode
Posted by Jürgen Groß 4 years, 4 months ago
On 21.11.19 11:19, Roger Pau Monne wrote:
> 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é <roger.pau@citrix.com>

Release-acked-by: Juergen Gross <jgross@suse.com>


Juergen

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel