rpms/kernel-xen-2.6/devel linux-2.6-xen-execshield.patch, 1.3.2.2, 1.3.2.3

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Fri Apr 13 18:41:10 UTC 2007


Author: ehabkost

Update of /cvs/dist/rpms/kernel-xen-2.6/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv13506

Modified Files:
      Tag: private-ehabkost-2_6_21-branch
	linux-2.6-xen-execshield.patch 
Log Message:
Fixing linux-2.6-xen-execshield.patch

Some chunks (mostly mach-xen headers) vanished when the patch was remade
for the new kernel. Don't ask me how this happened.



linux-2.6-xen-execshield.patch:
 arch/i386/kernel/cpu/common-xen.c         |    7 ++
 arch/i386/kernel/process-xen.c            |   60 +++++++++++++++++++
 arch/i386/kernel/smp-xen.c                |    3 
 arch/i386/kernel/traps-xen.c              |   93 +++++++++++++++++++++++++++++-
 arch/i386/mm/init-xen.c                   |    6 +
 arch/x86_64/kernel/process-xen.c          |    6 -
 arch/x86_64/kernel/setup64-xen.c          |   40 ------------
 arch/x86_64/mm/fault-xen.c                |    2 
 include/asm-i386/mach-xen/asm/desc.h      |   14 ++++
 include/asm-i386/mach-xen/asm/pgalloc.h   |    1 
 include/asm-i386/mach-xen/asm/processor.h |    8 ++
 include/asm-x86_64/mach-xen/asm/pgalloc.h |    7 ++
 12 files changed, 197 insertions(+), 50 deletions(-)

Index: linux-2.6-xen-execshield.patch
===================================================================
RCS file: /cvs/dist/rpms/kernel-xen-2.6/devel/linux-2.6-xen-execshield.patch,v
retrieving revision 1.3.2.2
retrieving revision 1.3.2.3
diff -u -r1.3.2.2 -r1.3.2.3
--- linux-2.6-xen-execshield.patch	10 Apr 2007 13:11:45 -0000	1.3.2.2
+++ linux-2.6-xen-execshield.patch	13 Apr 2007 18:41:08 -0000	1.3.2.3
@@ -1,7 +1,7 @@
-Index: linux-2.6.20.i386/arch/i386/kernel/cpu/common-xen.c
+Index: linux-2.6.20.patching/arch/i386/kernel/cpu/common-xen.c
 ===================================================================
---- linux-2.6.20.i386.orig/arch/i386/kernel/cpu/common-xen.c
-+++ linux-2.6.20.i386/arch/i386/kernel/cpu/common-xen.c
+--- linux-2.6.20.patching.orig/arch/i386/kernel/cpu/common-xen.c
++++ linux-2.6.20.patching/arch/i386/kernel/cpu/common-xen.c
 @@ -447,6 +447,13 @@ void __cpuinit identify_cpu(struct cpuin
  	if (disable_pse)
  		clear_bit(X86_FEATURE_PSE, c->x86_capability);
@@ -16,10 +16,10 @@
  	/* If the model name is still unset, do table lookup. */
  	if ( !c->x86_model_id[0] ) {
  		char *p;
-Index: linux-2.6.20.i386/arch/i386/kernel/process-xen.c
+Index: linux-2.6.20.patching/arch/i386/kernel/process-xen.c
 ===================================================================
---- linux-2.6.20.i386.orig/arch/i386/kernel/process-xen.c
-+++ linux-2.6.20.i386/arch/i386/kernel/process-xen.c
+--- linux-2.6.20.patching.orig/arch/i386/kernel/process-xen.c
++++ linux-2.6.20.patching/arch/i386/kernel/process-xen.c
 @@ -500,6 +500,9 @@ static inline void disable_tsc(struct ta
  {
  	struct thread_info *prev, *next;
@@ -91,10 +91,10 @@
 +		current->mm->brk = new_brk;
 +}
 +
-Index: linux-2.6.20.i386/arch/i386/kernel/smp-xen.c
+Index: linux-2.6.20.patching/arch/i386/kernel/smp-xen.c
 ===================================================================
---- linux-2.6.20.i386.orig/arch/i386/kernel/smp-xen.c
-+++ linux-2.6.20.i386/arch/i386/kernel/smp-xen.c
+--- linux-2.6.20.patching.orig/arch/i386/kernel/smp-xen.c
++++ linux-2.6.20.patching/arch/i386/kernel/smp-xen.c
 @@ -23,6 +23,7 @@
  
  #include <asm/mtrr.h>
@@ -112,10 +112,10 @@
  
  	if (!cpu_isset(cpu, flush_cpumask))
  		goto out;
-Index: linux-2.6.20.i386/arch/i386/kernel/traps-xen.c
+Index: linux-2.6.20.patching/arch/i386/kernel/traps-xen.c
 ===================================================================
---- linux-2.6.20.i386.orig/arch/i386/kernel/traps-xen.c
-+++ linux-2.6.20.i386/arch/i386/kernel/traps-xen.c
+--- linux-2.6.20.patching.orig/arch/i386/kernel/traps-xen.c
++++ linux-2.6.20.patching/arch/i386/kernel/traps-xen.c
 @@ -573,11 +573,88 @@ DO_ERROR(10, SIGSEGV, "invalid TSS", inv
  DO_ERROR(11, SIGBUS,  "segment not present", segment_not_present)
  DO_ERROR(12, SIGBUS,  "stack segment", stack_segment)
@@ -238,10 +238,10 @@
  	if (!fixup_exception(regs)) {
  		if (notify_die(DIE_GPF, "general protection fault", regs,
  				error_code, 13, SIGSEGV) == NOTIFY_STOP)
-Index: linux-2.6.20.i386/arch/i386/mm/init-xen.c
+Index: linux-2.6.20.patching/arch/i386/mm/init-xen.c
 ===================================================================
---- linux-2.6.20.i386.orig/arch/i386/mm/init-xen.c
-+++ linux-2.6.20.i386/arch/i386/mm/init-xen.c
+--- linux-2.6.20.patching.orig/arch/i386/mm/init-xen.c
++++ linux-2.6.20.patching/arch/i386/mm/init-xen.c
 @@ -465,7 +465,7 @@ EXPORT_SYMBOL(__supported_pte_mask);
   * Control non executable mappings.
   *
@@ -270,10 +270,10 @@
  
  	pagetable_init();
  
-Index: linux-2.6.20.i386/arch/x86_64/kernel/process-xen.c
+Index: linux-2.6.20.patching/arch/x86_64/kernel/process-xen.c
 ===================================================================
---- linux-2.6.20.i386.orig/arch/x86_64/kernel/process-xen.c
-+++ linux-2.6.20.i386/arch/x86_64/kernel/process-xen.c
+--- linux-2.6.20.patching.orig/arch/x86_64/kernel/process-xen.c
++++ linux-2.6.20.patching/arch/x86_64/kernel/process-xen.c
 @@ -670,12 +670,6 @@ void set_personality_64bit(void)
  
  	/* Make sure to be in 64bit mode */
@@ -287,10 +287,10 @@
  }
  
  asmlinkage long sys_fork(struct pt_regs *regs)
-Index: linux-2.6.20.i386/arch/x86_64/kernel/setup64-xen.c
+Index: linux-2.6.20.patching/arch/x86_64/kernel/setup64-xen.c
 ===================================================================
---- linux-2.6.20.i386.orig/arch/x86_64/kernel/setup64-xen.c
-+++ linux-2.6.20.i386/arch/x86_64/kernel/setup64-xen.c
+--- linux-2.6.20.patching.orig/arch/x86_64/kernel/setup64-xen.c
++++ linux-2.6.20.patching/arch/x86_64/kernel/setup64-xen.c
 @@ -49,46 +49,6 @@ unsigned long __supported_pte_mask __rea
  EXPORT_SYMBOL(__supported_pte_mask);
  static int do_not_nx __cpuinitdata = 0;
@@ -338,10 +338,10 @@
  /*
   * Great future plan:
   * Declare PDA itself and support (irqstack,tss,pgd) as per cpu data.
-Index: linux-2.6.20.i386/arch/x86_64/mm/fault-xen.c
+Index: linux-2.6.20.patching/arch/x86_64/mm/fault-xen.c
 ===================================================================
---- linux-2.6.20.i386.orig/arch/x86_64/mm/fault-xen.c
-+++ linux-2.6.20.i386/arch/x86_64/mm/fault-xen.c
+--- linux-2.6.20.patching.orig/arch/x86_64/mm/fault-xen.c
++++ linux-2.6.20.patching/arch/x86_64/mm/fault-xen.c
 @@ -87,7 +87,7 @@ static noinline int is_prefetch(struct p
  	instr = (unsigned char __user *)convert_rip_to_linear(current, regs);
  	max_instr = instr + 15;
@@ -351,3 +351,84 @@
  		return 0;
  
  	while (scan_more && instr < max_instr) { 
+Index: linux-2.6.20.patching/include/asm-i386/mach-xen/asm/desc.h
+===================================================================
+--- linux-2.6.20.patching.orig/include/asm-i386/mach-xen/asm/desc.h
++++ linux-2.6.20.patching/include/asm-i386/mach-xen/asm/desc.h
+@@ -194,6 +194,20 @@ static inline unsigned long get_desc_bas
+ 	return base;
+ }
+ 
++static inline void set_user_cs(struct desc_struct *desc, unsigned long limit)
++{
++	limit = (limit - 1) / PAGE_SIZE;
++	desc->a = limit & 0xffff;
++	desc->b = (limit & 0xf0000) | 0x00c0fb00;
++}
++
++#define load_user_cs_desc(cpu, mm) \
++	get_cpu_gdt_table(cpu)[GDT_ENTRY_DEFAULT_USER_CS] = (mm)->context.user_cs
++
++extern void arch_add_exec_range(struct mm_struct *mm, unsigned long limit);
++extern void arch_remove_exec_range(struct mm_struct *mm, unsigned long limit);
++extern void arch_flush_exec_range(struct mm_struct *mm);
++
+ #else /* __ASSEMBLY__ */
+ 
+ /*
+Index: linux-2.6.20.patching/include/asm-i386/mach-xen/asm/pgalloc.h
+===================================================================
+--- linux-2.6.20.patching.orig/include/asm-i386/mach-xen/asm/pgalloc.h
++++ linux-2.6.20.patching/include/asm-i386/mach-xen/asm/pgalloc.h
+@@ -2,6 +2,7 @@
+ #define _I386_PGALLOC_H
+ 
+ #include <asm/fixmap.h>
++#include <asm/desc.h>
+ #include <linux/threads.h>
+ #include <linux/mm.h>		/* for struct page */
+ #include <asm/io.h>		/* for phys_to_virt and page_to_pseudophys */
+Index: linux-2.6.20.patching/include/asm-i386/mach-xen/asm/processor.h
+===================================================================
+--- linux-2.6.20.patching.orig/include/asm-i386/mach-xen/asm/processor.h
++++ linux-2.6.20.patching/include/asm-i386/mach-xen/asm/processor.h
+@@ -280,7 +280,10 @@ extern int bootloader_type;
+ /* This decides where the kernel will search for a free chunk of vm
+  * space during mmap's.
+  */
+-#define TASK_UNMAPPED_BASE	(PAGE_ALIGN(TASK_SIZE / 3))
++#define TASK_UNMAPPED_BASE	PAGE_ALIGN(TASK_SIZE/3)
++
++#define __HAVE_ARCH_ALIGN_STACK
++extern unsigned long arch_align_stack(unsigned long sp);
+ 
+ #define HAVE_ARCH_PICK_MMAP_LAYOUT
+ 
+@@ -460,6 +463,9 @@ struct thread_struct {
+ 	regs->xcs = __USER_CS;					\
+ 	regs->eip = new_eip;					\
+ 	regs->esp = new_esp;					\
++	preempt_disable();					\
++	load_user_cs_desc(smp_processor_id(), current->mm);	\
++	preempt_enable();					\
+ } while (0)
+ 
+ /* Forward declaration, a strange C thing */
+Index: linux-2.6.20.patching/include/asm-x86_64/mach-xen/asm/pgalloc.h
+===================================================================
+--- linux-2.6.20.patching.orig/include/asm-x86_64/mach-xen/asm/pgalloc.h
++++ linux-2.6.20.patching/include/asm-x86_64/mach-xen/asm/pgalloc.h
+@@ -13,6 +13,13 @@ void make_page_writable(void *va, unsign
+ void make_pages_readonly(void *va, unsigned int nr, unsigned int feature);
+ void make_pages_writable(void *va, unsigned int nr, unsigned int feature);
+ 
++#define arch_add_exec_range(mm, limit) \
++		do { (void)(mm), (void)(limit); } while (0)
++#define arch_flush_exec_range(mm) \
++		do { (void)(mm); } while (0)
++#define arch_remove_exec_range(mm, limit) \
++		do { (void)(mm), (void)(limit); } while (0)
++
+ #define __user_pgd(pgd) ((pgd) + PTRS_PER_PGD)
+ 
+ static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, pte_t *pte)




More information about the fedora-cvs-commits mailing list