]> xenbits.xensource.com Git - people/sstabellini/xen-unstable.git/.git/commitdiff
x86/svm: Reimplement VMRUN/STGI/CLGI with new asm-defns.h infrastructure
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 29 Jan 2021 10:32:18 +0000 (10:32 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 29 Jan 2021 11:59:58 +0000 (11:59 +0000)
... in order to reuse stgi elsewhere.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/hvm/svm/entry.S
xen/include/asm-x86/asm-defns.h

index 1d2df08e897985cc7ad45455056c57870098c9f3..e208a4b32ae74a282eb58607a1d7cd6fa544d15a 100644 (file)
 #include <asm/asm_defns.h>
 #include <asm/page.h>
 
-#define VMRUN  .byte 0x0F,0x01,0xD8
-#define STGI   .byte 0x0F,0x01,0xDC
-#define CLGI   .byte 0x0F,0x01,0xDD
-
 ENTRY(svm_asm_do_resume)
         GET_CURRENT(bx)
 .Lsvm_do_resume:
@@ -82,9 +78,9 @@ __UNLIKELY_END(nsvm_hap)
         pop  %rsi
         pop  %rdi
 
-        CLGI
+        clgi
         sti
-        VMRUN
+        vmrun
 
         SAVE_ALL
 
@@ -93,7 +89,7 @@ __UNLIKELY_END(nsvm_hap)
         SPEC_CTRL_ENTRY_FROM_HVM    /* Req: b=curr %rsp=regs/cpuinfo, Clob: acd */
         /* WARNING! `ret`, `call *`, `jmp *` not safe before this point. */
 
-        STGI
+        stgi
 GLOBAL(svm_stgi_label)
         mov  %rsp,%rdi
         call svm_vmexit_handler
index 43f4868d40d86ae4d93e523dd8735066153d5025..2e3ec0ac018a5217a189183f610e6079a949bf56 100644 (file)
@@ -8,6 +8,18 @@
 .endm
 #endif
 
+.macro vmrun
+    .byte 0x0f, 0x01, 0xd8
+.endm
+
+.macro stgi
+    .byte 0x0f, 0x01, 0xdc
+.endm
+
+.macro clgi
+    .byte 0x0f, 0x01, 0xdd
+.endm
+
 .macro INDIRECT_BRANCH insn:req arg:req
 /*
  * Create an indirect branch.  insn is one of call/jmp, arg is a single