Skip to contentSkip to conversation

x86/pvh: disable posted interrupts

PATCH In review Roger Pau Monne 3 participants 3 messages May 21, 2015 – May 22, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/pvh: disable posted interrupts

Enabling posted interrupts requires the virtual interrupt delivery feature, which is disabled for PVH guests, so make sure posted interrupts are also disabled or else vmlaunch will fail.

Reported-and-Tested-by Lars Eggert <[email protected]>
Cc Jun Nakajima <[email protected]>
Cc Eddie Dong <[email protected]>
Cc Kevin Tian <[email protected]>
Cc Jan Beulich <[email protected]>
Cc Andrew Cooper <[email protected]>
---
 xen/arch/x86/hvm/vmx/vmcs.c | 4 ++++
 1 file changed, 4 insertions(+)
xen/arch/x86/hvm/vmx/vmcs.c +4 -0
index a714549..9827a8e 100644
@@ -980,6 +980,10 @@ static int construct_vmcs(struct vcpu *v)
         v->arch.hvm_vmx.secondary_exec_control &=
             ~SECONDARY_EXEC_UNRESTRICTED_GUEST;
 
+        /* Disable posted interrupts */
+        __vmwrite(PIN_BASED_VM_EXEC_CONTROL,
+            vmx_pin_based_exec_control & ~PIN_BASED_POSTED_INTERRUPT);
+
         /* Start in 64-bit mode. PVH 32bitfixme. */
         vmentry_ctl |= VM_ENTRY_IA32E_MODE;       /* GUEST_EFER.LME/LMA ignored */
 
Signature · 7 lines
1.9.5 (Apple Git-50.3)


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#1 lore raw

xen/arch/x86/hvm/vmx/vmcs.c static int construct_vmcs(struct vcpu *v) · line 985

Quoted 10 lines
Quoted 1 line
Quoted 1 line · On 21.05.15 at 14:14, <[email protected]> wrote:
xen/arch/x86/hvm/vmx/vmcs.c +3 -0
@@ -980,6 +980,10 @@ static int construct_vmcs(struct vcpu *v)
         v->arch.hvm_vmx.secondary_exec_control &=
             ~SECONDARY_EXEC_UNRESTRICTED_GUEST;
 
+        /* Disable posted interrupts */
+        __vmwrite(PIN_BASED_VM_EXEC_CONTROL,
+            vmx_pin_based_exec_control & ~PIN_BASED_POSTED_INTERRUPT);

To be understandable in a few months/years, this should be moved up a few lines, and the comment should be something like "In turn, disable posted interrupts." (Please also note the stop at its end.)

Jan

Acked-by on v1 1/1
#2 lore raw
In reply to Roger Pau Monne
Quoted 7 lines

From: Roger Pau Monne [mailto:[email protected]]
Sent: Thursday, May 21, 2015 8:15 PM

Enabling posted interrupts requires the virtual interrupt delivery feature, which is disabled for PVH guests, so make sure posted interrupts are also disabled or else vmlaunch will fail.

Quoted 7 lines
Reported-and-Tested-by Lars Eggert <[email protected]>
Cc Jun Nakajima <[email protected]>
Cc Eddie Dong <[email protected]>
Cc Kevin Tian <[email protected]>
Cc Jan Beulich <[email protected]>
Cc Andrew Cooper <[email protected]>

Thanks
Kevin

Quoted 21 lines
---
 xen/arch/x86/hvm/vmx/vmcs.c | 4 ++++
 1 file changed, 4 insertions(+)
xen/arch/x86/hvm/vmx/vmcs.c +4 -0
index a714549..9827a8e 100644
@@ -980,6 +980,10 @@ static int construct_vmcs(struct vcpu *v)
         v->arch.hvm_vmx.secondary_exec_control &=
             ~SECONDARY_EXEC_UNRESTRICTED_GUEST;
 
+        /* Disable posted interrupts */
+        __vmwrite(PIN_BASED_VM_EXEC_CONTROL,
+            vmx_pin_based_exec_control &
 ~PIN_BASED_POSTED_INTERRUPT);
+
         /* Start in 64-bit mode. PVH 32bitfixme. */
         vmentry_ctl |= VM_ENTRY_IA32E_MODE;       /*

GUEST_EFER.LME/LMA ignored */

Quoted 2 lines

--
1.9.5 (Apple Git-50.3)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel