KVM: AMD SVM: Avoid three more new instructions
PATCH 1/1 KVM: AMD SVM: Avoid three more new instructions
The clgi, stgi, and invlpga instructions are all too new to unleash on the world's assemblers. Replace them with the opcode sequences.
Signed-off-by Avi Kivity <[email protected]>
drivers/kvm/svm.c +3 -3
@@ -102,17 +102,17 @@static inline void clgi (void ) { - asmvolatile ("clgi" ); + asm volatile (SVM_CLGI); }static inline void stgi (void ) { - asmvolatile ("stgi" ); + asm volatile (SVM_STGI); }static inline void invlpga (unsigned long addr,u32 asid) { - asmvolatile ("invlpga" ::"a" (addr),"c" (asid)); + asm volatile (SVM_INVLPGA :: "a"(addr), "c"(asid)); }static inline unsigned long read_cr2 (void )
drivers/kvm/svm.h +3 -0
@@ -307,6 +307,9 @@#define SVM_VMLOAD ".byte 0x0f, 0x01, 0xda"#define SVM_VMRUN ".byte 0x0f, 0x01, 0xd8"#define SVM_VMSAVE ".byte 0x0f, 0x01, 0xdb" +#define SVM_CLGI ".byte 0x0f, 0x01, 0xdd" +#define SVM_STGI ".byte 0x0f, 0x01, 0xdc" +#define SVM_INVLPGA ".byte 0x0f, 0x01, 0xdf"#endif