Skip to contentSkip to conversation

nestedsvm: update rip on invlpga intercept

PATCH New Christoph Egger 1 participant 1 message May 11, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nestedsvm: update rip on invlpga intercept

Hi,

update rip on invlpga intercept. Fixes endless loop.

Signature · 6 lines
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Einsteinring 24, 85689 Dornach b. Muenchen
Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
xen/arch/x86/hvm/svm/emulate.c +2 -0
diff -r 0c60c61ff836 xen/arch/x86/hvm/svm/emulate.c
@@ -107,6 +107,7 @@ MAKE_INSTR(VMLOAD, 3, 0x0f, 0x01, 0xda);
 MAKE_INSTR(VMSAVE, 3, 0x0f, 0x01, 0xdb);
 MAKE_INSTR(STGI,   3, 0x0f, 0x01, 0xdc);
 MAKE_INSTR(CLGI,   3, 0x0f, 0x01, 0xdd);
+MAKE_INSTR(INVLPGA,3, 0x0f, 0x01, 0xdf);
 
 static const u8 *opc_bytes[INSTR_MAX_COUNT] = 
 {
@@ -126,6 +127,7 @@ static const u8 *opc_bytes[INSTR_MAX_COU
     [INSTR_VMSAVE] = OPCODE_VMSAVE,
     [INSTR_STGI]   = OPCODE_STGI,
     [INSTR_CLGI]   = OPCODE_CLGI,
+    [INSTR_INVLPGA] = OPCODE_INVLPGA,
 };
 
 static int fetch(struct vcpu *v, u8 *buf, unsigned long addr, int len)
xen/arch/x86/hvm/svm/svm.c +3 -0
diff -r 0c60c61ff836 xen/arch/x86/hvm/svm/svm.c
@@ -1993,7 +1990,10 @@ asmlinkage void svm_vmexit_handler(struc
         break;
 
     case VMEXIT_INVLPGA:
+        if ( (inst_len = __get_instruction_length(v, INSTR_INVLPGA)) == 0 )
+            break;
         svm_invlpga_intercept(v, regs->eax, regs->ecx);
+        __update_guest_eip(regs, inst_len);
         break;
 
     case VMEXIT_VMMCALL:
xen/include/asm-x86/hvm/svm/emulate.h +1 -0
diff -r 0c60c61ff836 xen/include/asm-x86/hvm/svm/emulate.h
@@ -38,6 +38,7 @@ enum instruction_index {
     INSTR_VMSAVE,
     INSTR_STGI,
     INSTR_CLGI,
+    INSTR_INVLPGA,
     INSTR_MAX_COUNT /* Must be last - Number of instructions supported */
 };
 

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