Skip to contentSkip to conversation

[PATCH kvm-kmod]

PATCH Applied Paolo Bonzini 2 participants 2 messages Jan 22, 2014 – Jan 23, 2014 KVM

lore
Share & tools
lore

Paolo Bonzini

author maintainer
#0 lore raw

PATCH 1/1 [PATCH kvm-kmod]

After KVM commit 8a3caa6d74597c2a083f7c87f866891a0b12540b, kvm-kmod is broken in weird ways (for me it breaks every other time kvm is loaded, but only with ept=0...).

The reason is that, after this commit, empty_zero_page is expected to be page-aligned, but the kvm-kmod compatibility shim isn't. empty_zero_page has been exported since v2.6.25:

commit 8232fd625217dc641ed05dd238a8bb5c82828082

Author: Theodore Ts'o <[email protected]>
Date:   Mon Nov 26 20:42:19 2007 +0100

x86: export the symbol empty_zero_page on the 32-bit x86 architecture

The latest KVM driver wants to use the empty_zero_page symbol, and it's not exported in 32-bit x86 (although it is exported by x86_64, s390, and uml architectures).

so the compatibility shim should probably just be dropped.

---

external-module-compat-comm.h +0 -12
index 34fb320..580aa9f 100644
@@ -180,18 +180,6 @@ void kvm_smp_send_reschedule(int cpu);
 
 #endif
 
-/* empty_zero_page isn't exported in all kernels */
-#include <asm/pgtable.h>
-
-#define empty_zero_page kvm_empty_zero_page
-
-static char empty_zero_page[PAGE_SIZE];
-
-static inline void blahblah(void)
-{
-	(void)empty_zero_page[0];
-}
-
 /* __mmdrop() is not exported before 2.6.25 */
 #include <linux/sched.h>
 
Applied
#1 lore raw
Quoted 46 lines · Paolo Bonzini

After KVM commit 8a3caa6d74597c2a083f7c87f866891a0b12540b, kvm-kmod is broken in weird ways (for me it breaks every other time kvm is loaded, but only with ept=0...).

The reason is that, after this commit, empty_zero_page is expected to be page-aligned, but the kvm-kmod compatibility shim isn't. empty_zero_page has been exported since v2.6.25:

commit 8232fd625217dc641ed05dd238a8bb5c82828082

Author: Theodore Ts'o <[email protected]>
Date:   Mon Nov 26 20:42:19 2007 +0100

x86: export the symbol empty_zero_page on the 32-bit x86 architecture

The latest KVM driver wants to use the empty_zero_page symbol, and it's not exported in 32-bit x86 (although it is exported by x86_64, s390, and uml architectures).

so the compatibility shim should probably just be dropped.

---

external-module-compat-comm.h +0 -5
index 34fb320..580aa9f 100644
@@ -180,18 +180,6 @@ void kvm_smp_send_reschedule(int cpu);
 
 #endif
 
-/* empty_zero_page isn't exported in all kernels */
-#include <asm/pgtable.h>
-
-#define empty_zero_page kvm_empty_zero_page
-

external-module-compat-comm.h void kvm_smp_send_reschedule(int cpu); · line 185

Quoted 10 lines
external-module-compat-comm.h +0 -7
-static char empty_zero_page[PAGE_SIZE];
-
-static inline void blahblah(void)
-{
-	(void)empty_zero_page[0];
-}
-
 /* __mmdrop() is not exported before 2.6.25 */
 #include <linux/sched.h>
 

Thanks, applied.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT RTC ITP SES-DE
Corporate Competence Center Embedded Linux