public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH kvm-kmod]
@ 2014-01-22 16:29 Paolo Bonzini
  2014-01-23  8:08 ` Jan Kiszka
  0 siblings, 1 reply; 2+ messages in thread
From: Paolo Bonzini @ 2014-01-22 16:29 UTC (permalink / raw)
  To: Jan Kiszka, kvm@vger.kernel.org

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 <tytso@mit.edu>
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).
    
    Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
    Cc: tglx@linutronix.de
    Cc: linux-kernel@vger.kernel.com
    Cc: kvm-devel@lists.sourceforge.net
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

so the compatibility shim should probably just be dropped.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

---


diff --git a/external-module-compat-comm.h b/external-module-compat-comm.h
index 34fb320..580aa9f 100644
--- a/external-module-compat-comm.h
+++ b/external-module-compat-comm.h
@@ -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>
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH kvm-kmod]
  2014-01-22 16:29 [PATCH kvm-kmod] Paolo Bonzini
@ 2014-01-23  8:08 ` Jan Kiszka
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Kiszka @ 2014-01-23  8:08 UTC (permalink / raw)
  To: Paolo Bonzini, kvm@vger.kernel.org

On 2014-01-22 17:29, Paolo Bonzini wrote:
> 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 <tytso@mit.edu>
> 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).
>     
>     Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
>     Cc: tglx@linutronix.de
>     Cc: linux-kernel@vger.kernel.com
>     Cc: kvm-devel@lists.sourceforge.net
>     Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
>     Signed-off-by: Ingo Molnar <mingo@elte.hu>
> 
> so the compatibility shim should probably just be dropped.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> 
> ---
> 
> 
> diff --git a/external-module-compat-comm.h b/external-module-compat-comm.h
> index 34fb320..580aa9f 100644
> --- a/external-module-compat-comm.h
> +++ b/external-module-compat-comm.h
> @@ -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>
>  
> 

Thanks, applied.

Jan

-- 
Siemens AG, Corporate Technology, CT RTC ITP SES-DE
Corporate Competence Center Embedded Linux

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-01-23  8:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-22 16:29 [PATCH kvm-kmod] Paolo Bonzini
2014-01-23  8:08 ` Jan Kiszka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox