ia64/xen-unstable

changeset 14022:0a348e9ecedb

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@novell.com>
author kfraser@localhost.localdomain
date Tue Feb 20 12:18:29 2007 +0000 (2007-02-20)
parents 4990b2236f06
children 93035b689834
files linux-2.6-xen-sparse/arch/i386/kernel/Makefile linux-2.6-xen-sparse/arch/i386/kernel/head-xen.S linux-2.6-xen-sparse/arch/x86_64/kernel/Makefile linux-2.6-xen-sparse/arch/x86_64/kernel/head-xen.S patches/linux-2.6.18/x86-elfnote-as-preprocessor-macro.patch xen/include/public/elfnote.h
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/i386/kernel/Makefile	Tue Feb 20 11:57:06 2007 +0000
     1.2 +++ b/linux-2.6-xen-sparse/arch/i386/kernel/Makefile	Tue Feb 20 12:18:29 2007 +0000
     1.3 @@ -98,4 +98,5 @@ n-obj-xen := i8259.o timers/ reboot.o sm
     1.4  obj-y := $(call filterxen, $(obj-y), $(n-obj-xen))
     1.5  obj-y := $(call cherrypickxen, $(obj-y))
     1.6  extra-y := $(call cherrypickxen, $(extra-y))
     1.7 +%/head-xen.o %/head-xen.s: EXTRA_AFLAGS :=
     1.8  endif
     2.1 --- a/linux-2.6-xen-sparse/arch/i386/kernel/head-xen.S	Tue Feb 20 11:57:06 2007 +0000
     2.2 +++ b/linux-2.6-xen-sparse/arch/i386/kernel/head-xen.S	Tue Feb 20 12:18:29 2007 +0000
     2.3 @@ -12,6 +12,8 @@
     2.4  #include <xen/interface/xen.h>
     2.5  #include <xen/interface/elfnote.h>
     2.6  
     2.7 +#define _PAGE_PRESENT 0x1
     2.8 +
     2.9  /*
    2.10   * References to members of the new_cpu_data structure.
    2.11   */
    2.12 @@ -198,7 +200,9 @@ ENTRY(cpu_gdt_table)
    2.13  	ELFNOTE(Xen, XEN_ELFNOTE_FEATURES,       .asciz, "writable_page_tables|writable_descriptor_tables|auto_translated_physmap|pae_pgdir_above_4gb|supervisor_mode_kernel")
    2.14  #ifdef CONFIG_X86_PAE
    2.15  	ELFNOTE(Xen, XEN_ELFNOTE_PAE_MODE,       .asciz, "yes")
    2.16 +	ELFNOTE(Xen, XEN_ELFNOTE_L1_MFN_VALID,   .quad,  _PAGE_PRESENT,_PAGE_PRESENT)
    2.17  #else
    2.18  	ELFNOTE(Xen, XEN_ELFNOTE_PAE_MODE,       .asciz, "no")
    2.19 +	ELFNOTE(Xen, XEN_ELFNOTE_L1_MFN_VALID,   .long,  _PAGE_PRESENT,_PAGE_PRESENT)
    2.20  #endif
    2.21  	ELFNOTE(Xen, XEN_ELFNOTE_LOADER,         .asciz, "generic")
     3.1 --- a/linux-2.6-xen-sparse/arch/x86_64/kernel/Makefile	Tue Feb 20 11:57:06 2007 +0000
     3.2 +++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/Makefile	Tue Feb 20 12:18:29 2007 +0000
     3.3 @@ -72,4 +72,5 @@ include $(srctree)/scripts/Makefile.xen
     3.4  obj-y := $(call filterxen, $(obj-y), $(n-obj-xen))
     3.5  obj-y := $(call cherrypickxen, $(obj-y))
     3.6  extra-y := $(call cherrypickxen, $(extra-y))
     3.7 +%/head-xen.o %/head-xen.s: EXTRA_AFLAGS :=
     3.8  endif
     4.1 --- a/linux-2.6-xen-sparse/arch/x86_64/kernel/head-xen.S	Tue Feb 20 11:57:06 2007 +0000
     4.2 +++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/head-xen.S	Tue Feb 20 12:18:29 2007 +0000
     4.3 @@ -25,6 +25,8 @@
     4.4  
     4.5  #include <xen/interface/elfnote.h>
     4.6  
     4.7 +#define _PAGE_PRESENT 0x1
     4.8 +
     4.9  	.section .bootstrap.text, "ax", @progbits
    4.10  	.code64
    4.11  #define VIRT_ENTRY_OFFSET 0x0
    4.12 @@ -49,7 +51,7 @@ ENTRY(_stext)
    4.13  #define NEXT_PAGE(name) \
    4.14  	$page = $page + 1; \
    4.15  	.org $page * 0x1000; \
    4.16 -	phys_/**/name = $page * 0x1000 + __PHYSICAL_START; \
    4.17 +	phys_##name = $page * 0x1000 + __PHYSICAL_START; \
    4.18  ENTRY(name)
    4.19  
    4.20  NEXT_PAGE(init_level4_pgt)
    4.21 @@ -181,5 +183,6 @@ ENTRY(empty_zero_page)
    4.22  #endif /* !CONFIG_XEN_COMPAT_030002 */
    4.23  	ELFNOTE(Xen, XEN_ELFNOTE_ENTRY,          .quad,  startup_64)
    4.24  	ELFNOTE(Xen, XEN_ELFNOTE_HYPERCALL_PAGE, .quad,  hypercall_page)
    4.25 +	ELFNOTE(Xen, XEN_ELFNOTE_L1_MFN_VALID,   .quad,  _PAGE_PRESENT,_PAGE_PRESENT)
    4.26  	ELFNOTE(Xen, XEN_ELFNOTE_FEATURES,       .asciz, "writable_page_tables|writable_descriptor_tables|auto_translated_physmap|pae_pgdir_above_4gb|supervisor_mode_kernel")
    4.27  	ELFNOTE(Xen, XEN_ELFNOTE_LOADER,         .asciz, "generic")
     5.1 --- a/patches/linux-2.6.18/x86-elfnote-as-preprocessor-macro.patch	Tue Feb 20 11:57:06 2007 +0000
     5.2 +++ b/patches/linux-2.6.18/x86-elfnote-as-preprocessor-macro.patch	Tue Feb 20 12:18:29 2007 +0000
     5.3 @@ -1,7 +1,7 @@
     5.4  diff -pruN ../orig-linux-2.6.18/include/linux/elfnote.h ./include/linux/elfnote.h
     5.5  --- ../orig-linux-2.6.18/include/linux/elfnote.h	2007-01-12 18:19:44.000000000 +0000
     5.6  +++ ./include/linux/elfnote.h	2007-01-12 18:21:02.000000000 +0000
     5.7 -@@ -31,22 +31,24 @@
     5.8 +@@ -31,22 +31,38 @@
     5.9   /*
    5.10    * Generate a structure with the same shape as Elf{32,64}_Nhdr (which
    5.11    * turn out to be the same size and shape), followed by the name and
    5.12 @@ -25,9 +25,21 @@ diff -pruN ../orig-linux-2.6.18/include/
    5.13  -2:.align 4
    5.14  -3:\desc
    5.15  -4:.align 4
    5.16 --.popsection
    5.17 ++#ifdef __STDC__
    5.18 ++#define ELFNOTE(name, type, desctype, descdata...) \
    5.19 ++.pushsection .note.name			;	\
    5.20 ++  .align 4				;	\
    5.21 ++  .long 2f - 1f		/* namesz */	;	\
    5.22 ++  .long 4f - 3f		/* descsz */	;	\
    5.23 ++  .long type				;	\
    5.24 ++1:.asciz #name				;	\
    5.25 ++2:.align 4				;	\
    5.26 ++3:desctype descdata			;	\
    5.27 ++4:.align 4				;	\
    5.28 + .popsection
    5.29  -.endm
    5.30 -+#define ELFNOTE(name, type, desctype, descdata)	\
    5.31 ++#else /* !__STDC__, i.e. -traditional */
    5.32 ++#define ELFNOTE(name, type, desctype, descdata) \
    5.33  +.pushsection .note.name			;	\
    5.34  +  .align 4				;	\
    5.35  +  .long 2f - 1f		/* namesz */	;	\
    5.36 @@ -37,7 +49,8 @@ diff -pruN ../orig-linux-2.6.18/include/
    5.37  +2:.align 4				;	\
    5.38  +3:desctype descdata			;	\
    5.39  +4:.align 4				;	\
    5.40 -+.popsection				;
    5.41 ++.popsection
    5.42 ++#endif /* __STDC__ */
    5.43   #else	/* !__ASSEMBLER__ */
    5.44   #include <linux/elf.h>
    5.45   /*
     6.1 --- a/xen/include/public/elfnote.h	Tue Feb 20 11:57:06 2007 +0000
     6.2 +++ b/xen/include/public/elfnote.h	Tue Feb 20 12:18:29 2007 +0000
     6.3 @@ -151,6 +151,12 @@
     6.4  #define XEN_ELFNOTE_HV_START_LOW  12
     6.5  
     6.6  /*
     6.7 + * List of maddr_t-sized mask/value pairs describing how to recognize
     6.8 + * (non-present) L1 page table entries carrying valid MFNs (numeric).
     6.9 + */
    6.10 +#define XEN_ELFNOTE_L1_MFN_VALID  13
    6.11 +
    6.12 +/*
    6.13   * System information exported through crash notes.
    6.14   *
    6.15   * The kexec / kdump code will create one XEN_ELFNOTE_CRASH_INFO