[PATCH] KVM: AMD SVM: Avoid three more new instructions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

diff -X /home/avi/kvm/linux-2.6/Documentation/dontdiff --exclude=Makefile -ru /home/avi/kvm/linux-2.6/drivers/kvm/svm.c /home/avi/kvm-release/kernel/svm.c
--- linux-2.6/drivers/kvm/svm.c	2006-11-28 14:31:03.000000000 +0200
+++ linux-2.6/drivers/kvm/svm.c	2006-11-28 15:08:19.000000000 +0200
@@ -102,17 +102,17 @@
 
 static inline void clgi(void)
 {
-	asm volatile ("clgi");
+	asm volatile (SVM_CLGI);
 }
 
 static inline void stgi(void)
 {
-	asm volatile ("stgi");
+	asm volatile (SVM_STGI);
 }
 
 static inline void invlpga(unsigned long addr, u32 asid)
 {
-	asm volatile ("invlpga" :: "a"(addr), "c"(asid));
+	asm volatile (SVM_INVLPGA :: "a"(addr), "c"(asid));
 }
 
 static inline unsigned long read_cr2(void)
diff -X /home/avi/kvm/linux-2.6/Documentation/dontdiff --exclude=Makefile -ru /home/avi/kvm/linux-2.6/drivers/kvm/svm.h /home/avi/kvm-release/kernel/svm.h
--- linux-2.6/drivers/kvm/svm.h	2006-11-28 14:14:17.000000000 +0200
+++ linux-2.6/drivers/kvm/svm.h	2006-11-28 15:09:17.000000000 +0200
@@ -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
 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux