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

[Xen-changelog] [xen-unstable] linux/x86: Advertise which page table entries contain MFNs and hence



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1171973909 0
# Node ID 0a348e9ecedb0228f9089e1120df5ad2d69d9650
# Parent  4990b2236f066983271587241c7b267297164bf3
linux/x86: Advertise which page table entries contain MFNs and hence
need to be (un)canonicalized during save/restore.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
---
 linux-2.6-xen-sparse/arch/i386/kernel/Makefile               |    1 +
 linux-2.6-xen-sparse/arch/i386/kernel/head-xen.S             |    4 ++++
 linux-2.6-xen-sparse/arch/x86_64/kernel/Makefile             |    1 +
 linux-2.6-xen-sparse/arch/x86_64/kernel/head-xen.S           |    5 ++++-
 patches/linux-2.6.18/x86-elfnote-as-preprocessor-macro.patch |    5 ++---
 xen/include/public/elfnote.h                                 |    6 ++++++
 6 files changed, 18 insertions(+), 4 deletions(-)

diff -r 4990b2236f06 -r 0a348e9ecedb 
linux-2.6-xen-sparse/arch/i386/kernel/Makefile
--- a/linux-2.6-xen-sparse/arch/i386/kernel/Makefile    Tue Feb 20 11:57:06 
2007 +0000
+++ b/linux-2.6-xen-sparse/arch/i386/kernel/Makefile    Tue Feb 20 12:18:29 
2007 +0000
@@ -98,4 +98,5 @@ obj-y := $(call filterxen, $(obj-y), $(n
 obj-y := $(call filterxen, $(obj-y), $(n-obj-xen))
 obj-y := $(call cherrypickxen, $(obj-y))
 extra-y := $(call cherrypickxen, $(extra-y))
+%/head-xen.o %/head-xen.s: EXTRA_AFLAGS :=
 endif
diff -r 4990b2236f06 -r 0a348e9ecedb 
linux-2.6-xen-sparse/arch/i386/kernel/head-xen.S
--- a/linux-2.6-xen-sparse/arch/i386/kernel/head-xen.S  Tue Feb 20 11:57:06 
2007 +0000
+++ b/linux-2.6-xen-sparse/arch/i386/kernel/head-xen.S  Tue Feb 20 12:18:29 
2007 +0000
@@ -11,6 +11,8 @@
 #include <asm/asm-offsets.h>
 #include <xen/interface/xen.h>
 #include <xen/interface/elfnote.h>
+
+#define _PAGE_PRESENT 0x1
 
 /*
  * References to members of the new_cpu_data structure.
@@ -198,7 +200,9 @@ ENTRY(cpu_gdt_table)
        ELFNOTE(Xen, XEN_ELFNOTE_FEATURES,       .asciz, 
"writable_page_tables|writable_descriptor_tables|auto_translated_physmap|pae_pgdir_above_4gb|supervisor_mode_kernel")
 #ifdef CONFIG_X86_PAE
        ELFNOTE(Xen, XEN_ELFNOTE_PAE_MODE,       .asciz, "yes")
+       ELFNOTE(Xen, XEN_ELFNOTE_L1_MFN_VALID,   .quad,  
_PAGE_PRESENT,_PAGE_PRESENT)
 #else
        ELFNOTE(Xen, XEN_ELFNOTE_PAE_MODE,       .asciz, "no")
+       ELFNOTE(Xen, XEN_ELFNOTE_L1_MFN_VALID,   .long,  
_PAGE_PRESENT,_PAGE_PRESENT)
 #endif
        ELFNOTE(Xen, XEN_ELFNOTE_LOADER,         .asciz, "generic")
diff -r 4990b2236f06 -r 0a348e9ecedb 
linux-2.6-xen-sparse/arch/x86_64/kernel/Makefile
--- a/linux-2.6-xen-sparse/arch/x86_64/kernel/Makefile  Tue Feb 20 11:57:06 
2007 +0000
+++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/Makefile  Tue Feb 20 12:18:29 
2007 +0000
@@ -72,4 +72,5 @@ obj-y := $(call filterxen, $(obj-y), $(n
 obj-y := $(call filterxen, $(obj-y), $(n-obj-xen))
 obj-y := $(call cherrypickxen, $(obj-y))
 extra-y := $(call cherrypickxen, $(extra-y))
+%/head-xen.o %/head-xen.s: EXTRA_AFLAGS :=
 endif
diff -r 4990b2236f06 -r 0a348e9ecedb 
linux-2.6-xen-sparse/arch/x86_64/kernel/head-xen.S
--- a/linux-2.6-xen-sparse/arch/x86_64/kernel/head-xen.S        Tue Feb 20 
11:57:06 2007 +0000
+++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/head-xen.S        Tue Feb 20 
12:18:29 2007 +0000
@@ -24,6 +24,8 @@
 #include <asm/cache.h>
 
 #include <xen/interface/elfnote.h>
+
+#define _PAGE_PRESENT 0x1
 
        .section .bootstrap.text, "ax", @progbits
        .code64
@@ -49,7 +51,7 @@ ENTRY(_stext)
 #define NEXT_PAGE(name) \
        $page = $page + 1; \
        .org $page * 0x1000; \
-       phys_/**/name = $page * 0x1000 + __PHYSICAL_START; \
+       phys_##name = $page * 0x1000 + __PHYSICAL_START; \
 ENTRY(name)
 
 NEXT_PAGE(init_level4_pgt)
@@ -181,5 +183,6 @@ ENTRY(empty_zero_page)
 #endif /* !CONFIG_XEN_COMPAT_030002 */
        ELFNOTE(Xen, XEN_ELFNOTE_ENTRY,          .quad,  startup_64)
        ELFNOTE(Xen, XEN_ELFNOTE_HYPERCALL_PAGE, .quad,  hypercall_page)
+       ELFNOTE(Xen, XEN_ELFNOTE_L1_MFN_VALID,   .quad,  
_PAGE_PRESENT,_PAGE_PRESENT)
        ELFNOTE(Xen, XEN_ELFNOTE_FEATURES,       .asciz, 
"writable_page_tables|writable_descriptor_tables|auto_translated_physmap|pae_pgdir_above_4gb|supervisor_mode_kernel")
        ELFNOTE(Xen, XEN_ELFNOTE_LOADER,         .asciz, "generic")
diff -r 4990b2236f06 -r 0a348e9ecedb 
patches/linux-2.6.18/x86-elfnote-as-preprocessor-macro.patch
--- a/patches/linux-2.6.18/x86-elfnote-as-preprocessor-macro.patch      Tue Feb 
20 11:57:06 2007 +0000
+++ b/patches/linux-2.6.18/x86-elfnote-as-preprocessor-macro.patch      Tue Feb 
20 12:18:29 2007 +0000
@@ -1,7 +1,7 @@ diff -pruN ../orig-linux-2.6.18/include/
 diff -pruN ../orig-linux-2.6.18/include/linux/elfnote.h 
./include/linux/elfnote.h
 --- ../orig-linux-2.6.18/include/linux/elfnote.h       2007-01-12 
18:19:44.000000000 +0000
 +++ ./include/linux/elfnote.h  2007-01-12 18:21:02.000000000 +0000
-@@ -31,22 +31,24 @@
+@@ -31,22 +31,38 @@
  /*
   * Generate a structure with the same shape as Elf{32,64}_Nhdr (which
   * turn out to be the same size and shape), followed by the name and
@@ -25,9 +25,21 @@ diff -pruN ../orig-linux-2.6.18/include/
 -2:.align 4
 -3:\desc
 -4:.align 4
--.popsection
++#ifdef __STDC__
++#define ELFNOTE(name, type, desctype, descdata...) \
++.pushsection .note.name                       ;       \
++  .align 4                            ;       \
++  .long 2f - 1f               /* namesz */    ;       \
++  .long 4f - 3f               /* descsz */    ;       \
++  .long type                          ;       \
++1:.asciz #name                                ;       \
++2:.align 4                            ;       \
++3:desctype descdata                   ;       \
++4:.align 4                            ;       \
+ .popsection
 -.endm
-+#define ELFNOTE(name, type, desctype, descdata)       \
++#else /* !__STDC__, i.e. -traditional */
++#define ELFNOTE(name, type, desctype, descdata) \
 +.pushsection .note.name                       ;       \
 +  .align 4                            ;       \
 +  .long 2f - 1f               /* namesz */    ;       \
@@ -37,7 +49,8 @@ diff -pruN ../orig-linux-2.6.18/include/
 +2:.align 4                            ;       \
 +3:desctype descdata                   ;       \
 +4:.align 4                            ;       \
-+.popsection                           ;
++.popsection
++#endif /* __STDC__ */
  #else /* !__ASSEMBLER__ */
  #include <linux/elf.h>
  /*
diff -r 4990b2236f06 -r 0a348e9ecedb xen/include/public/elfnote.h
--- a/xen/include/public/elfnote.h      Tue Feb 20 11:57:06 2007 +0000
+++ b/xen/include/public/elfnote.h      Tue Feb 20 12:18:29 2007 +0000
@@ -151,6 +151,12 @@
 #define XEN_ELFNOTE_HV_START_LOW  12
 
 /*
+ * List of maddr_t-sized mask/value pairs describing how to recognize
+ * (non-present) L1 page table entries carrying valid MFNs (numeric).
+ */
+#define XEN_ELFNOTE_L1_MFN_VALID  13
+
+/*
  * System information exported through crash notes.
  *
  * The kexec / kdump code will create one XEN_ELFNOTE_CRASH_INFO 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.