]> xenbits.xensource.com Git - xen.git/commitdiff
x86/svm: Drop wrappers of SVM instructions
authorAlexander M. Merritt <alexander@edera.dev>
Wed, 2 Apr 2025 14:54:10 +0000 (14:54 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 2 Apr 2025 15:06:53 +0000 (16:06 +0100)
The new toolchain baseline knows the SVM instructions.

Resolves: xen-project/xen#204

Signed-off-by: "Alexander M. Merritt" <alexander@edera.dev>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/hvm/svm/svm.h
xen/arch/x86/include/asm/asm-defns.h

index beeaaab4f7a713267e0cb60c1a37c62481d6d2cf..f5b0312d2dcfd5cab4c1f7c917e639a9f6edf07a 100644 (file)
@@ -23,25 +23,17 @@ void __update_guest_eip(struct cpu_user_regs *regs, unsigned int inst_len);
 
 static inline void svm_vmload_pa(paddr_t vmcb)
 {
-    asm volatile (
-        ".byte 0x0f,0x01,0xda" /* vmload */
-        : : "a" (vmcb) : "memory" );
+    asm volatile ( "vmload" :: "a" (vmcb) : "memory" );
 }
 
 static inline void svm_vmsave_pa(paddr_t vmcb)
 {
-    asm volatile (
-        ".byte 0x0f,0x01,0xdb" /* vmsave */
-        : : "a" (vmcb) : "memory" );
+    asm volatile ( "vmsave" :: "a" (vmcb) : "memory" );
 }
 
 static inline void svm_invlpga(unsigned long linear, uint32_t asid)
 {
-    asm volatile (
-        ".byte 0x0f,0x01,0xdf"
-        : /* output */
-        : /* input */
-        "a" (linear), "c" (asid) );
+    asm volatile ( "invlpga" :: "a" (linear), "c" (asid) );
 }
 
 /*
index ab653f321800385633c2f8bdcf43bfedfedb6f59..1b821db49ca38a8080848372f84d436fa05cb5b1 100644 (file)
@@ -1,17 +1,5 @@
 #include <asm/page-bits.h>
 
-.macro vmrun
-    .byte 0x0f, 0x01, 0xd8
-.endm
-
-.macro stgi
-    .byte 0x0f, 0x01, 0xdc
-.endm
-
-.macro clgi
-    .byte 0x0f, 0x01, 0xdd
-.endm
-
 /*
  * Call a noreturn function.  This could be JMP, but CALL results in a more
  * helpful backtrace.  BUG is to catch functions which do decide to return...