|
|
|
|
|
|
|
|
|
|
xen-devel
[Xen-devel] [PATCH 02 of 20] pre-cleanup2: Move IDT_VECTORING processing
# HG changeset patch
# User Eddie Dong <eddie.dong@xxxxxxxxx>
# Date 1307607849 -28800
# Node ID dbf54a855530dc831ee975d8f090b1f06dbd62b1
# Parent 722771a2d429bbf5ab15e2979c0aa767a97caabe
pre-cleanup2: Move IDT_VECTORING processing code out of intr_assist.
Signed-off-by: Qing He <qing.he@xxxxxxxxx>
Signed-off-by: Eddie Dong <eddie.dong@xxxxxxxxx>
diff -r 722771a2d429 -r dbf54a855530 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c Thu Jun 09 16:24:09 2011 +0800
+++ b/xen/arch/x86/hvm/vmx/vmx.c Thu Jun 09 16:24:09 2011 +0800
@@ -2098,6 +2098,33 @@ static int vmx_handle_eoi_write(void)
return 0;
}
+static void vmx_idtv_reinject(unsigned long idtv_info)
+{
+
+ /* Event delivery caused this intercept? Queue for redelivery. */
+ if ( unlikely(idtv_info & INTR_INFO_VALID_MASK) )
+ {
+ if ( hvm_event_needs_reinjection((idtv_info>>8)&7, idtv_info&0xff) )
+ {
+ /* See SDM 3B 25.7.1.1 and .2 for info about masking resvd bits. */
+ __vmwrite(VM_ENTRY_INTR_INFO,
+ idtv_info & ~INTR_INFO_RESVD_BITS_MASK);
+ if ( idtv_info & INTR_INFO_DELIVER_CODE_MASK )
+ __vmwrite(VM_ENTRY_EXCEPTION_ERROR_CODE,
+ __vmread(IDT_VECTORING_ERROR_CODE));
+ }
+
+ /*
+ * Clear NMI-blocking interruptibility info if an NMI delivery faulted.
+ * Re-delivery will re-set it (see SDM 3B 25.7.1.2).
+ */
+ if ( (idtv_info & INTR_INFO_INTR_TYPE_MASK) == (X86_EVENTTYPE_NMI<<8) )
+ __vmwrite(GUEST_INTERRUPTIBILITY_INFO,
+ __vmread(GUEST_INTERRUPTIBILITY_INFO) &
+ ~VMX_INTR_SHADOW_NMI);
+ }
+}
+
asmlinkage void vmx_vmexit_handler(struct cpu_user_regs *regs)
{
unsigned int exit_reason, idtv_info, intr_info = 0, vector = 0;
@@ -2187,30 +2214,9 @@ asmlinkage void vmx_vmexit_handler(struc
hvm_maybe_deassert_evtchn_irq();
- /* Event delivery caused this intercept? Queue for redelivery. */
idtv_info = __vmread(IDT_VECTORING_INFO);
- if ( unlikely(idtv_info & INTR_INFO_VALID_MASK) &&
- (exit_reason != EXIT_REASON_TASK_SWITCH) )
- {
- if ( hvm_event_needs_reinjection((idtv_info>>8)&7, idtv_info&0xff) )
- {
- /* See SDM 3B 25.7.1.1 and .2 for info about masking resvd bits. */
- __vmwrite(VM_ENTRY_INTR_INFO,
- idtv_info & ~INTR_INFO_RESVD_BITS_MASK);
- if ( idtv_info & INTR_INFO_DELIVER_CODE_MASK )
- __vmwrite(VM_ENTRY_EXCEPTION_ERROR_CODE,
- __vmread(IDT_VECTORING_ERROR_CODE));
- }
-
- /*
- * Clear NMI-blocking interruptibility info if an NMI delivery faulted.
- * Re-delivery will re-set it (see SDM 3B 25.7.1.2).
- */
- if ( (idtv_info & INTR_INFO_INTR_TYPE_MASK) == (X86_EVENTTYPE_NMI<<8) )
- __vmwrite(GUEST_INTERRUPTIBILITY_INFO,
- __vmread(GUEST_INTERRUPTIBILITY_INFO) &
- ~VMX_INTR_SHADOW_NMI);
- }
+ if ( exit_reason != EXIT_REASON_TASK_SWITCH )
+ vmx_idtv_reinject(idtv_info);
switch ( exit_reason )
{
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
<Prev in Thread] |
Current Thread |
[Next in Thread>
|
- [Xen-devel] [PATCH 00 of 20] Rebased Nested VMX v2, Eddie Dong
- [Xen-devel] [PATCH 01 of 20] pre-cleanup1: Extend nhvm_vmcx_guest_intercepts_trap to include errcode to, Eddie Dong
- [Xen-devel] [PATCH 02 of 20] pre-cleanup2: Move IDT_VECTORING processing code out of intr_assist,
Eddie Dong <=
- [Xen-devel] [PATCH 03 of 20] Add data structure for nestedvmx, Eddie Dong
- [Xen-devel] [PATCH 04 of 20] Add APIs for nestedhvm_ops, Eddie Dong
- [Xen-devel] [PATCH 07 of 20] Emulation of guest vmptrld, Eddie Dong
- [Xen-devel] [PATCH 05 of 20] Emulation of guest VMXON/OFF instruction, Eddie Dong
- [Xen-devel] [PATCH 06 of 20] Define structure and access APIs for virtual VMCS, Eddie Dong
- [Xen-devel] [PATCH 09 of 20] Emulation of guest VMCLEAR, Eddie Dong
- [Xen-devel] [PATCH 08 of 20] Emulation of guest VMPTRST, Eddie Dong
- [Xen-devel] [PATCH 12 of 20] Add APIs to switch n1/n2 VMCS, Eddie Dong
- [Xen-devel] [PATCH 11 of 20] Emulation of guest VMREAD, Eddie Dong
- [Xen-devel] [PATCH 14 of 20] Extend VMCS control fields for n2 guest, Eddie Dong
|
|
|
|
|