xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Egger <Christoph.Egger@amd.com>
To: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: [PATCH] nestedsvm: update rip on invlpga intercept
Date: Wed, 11 May 2011 15:28:44 +0200	[thread overview]
Message-ID: <4DCA8F0C.1040706@amd.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 381 bytes --]


Hi,

update rip on invlpga intercept. Fixes endless loop.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>

-- 
---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

[-- Attachment #2: xen_nh_invlpga.diff --]
[-- Type: text/plain, Size: 1688 bytes --]

diff -r 0c60c61ff836 xen/arch/x86/hvm/svm/emulate.c
--- a/xen/arch/x86/hvm/svm/emulate.c	Tue May 10 11:42:02 2011 +0200
+++ b/xen/arch/x86/hvm/svm/emulate.c	Wed May 11 15:25:51 2011 +0200
@@ -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)
diff -r 0c60c61ff836 xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c	Tue May 10 11:42:02 2011 +0200
+++ b/xen/arch/x86/hvm/svm/svm.c	Wed May 11 15:25:51 2011 +0200
@@ -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:
diff -r 0c60c61ff836 xen/include/asm-x86/hvm/svm/emulate.h
--- a/xen/include/asm-x86/hvm/svm/emulate.h	Tue May 10 11:42:02 2011 +0200
+++ b/xen/include/asm-x86/hvm/svm/emulate.h	Wed May 11 15:25:51 2011 +0200
@@ -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 */
 };
 

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

                 reply	other threads:[~2011-05-11 13:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DCA8F0C.1040706@amd.com \
    --to=christoph.egger@amd.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).