ia64/xen-unstable

changeset 2257:bb91ba552d34

bitkeeper revision 1.1159.32.4 (4120f833Zfm2esb4Xhphee52vBEz0g)

Merge scramble.cl.cam.ac.uk:/auto/groups/xeno/BK/xeno.bk
into scramble.cl.cam.ac.uk:/local/scratch/kaf24/xeno
author kaf24@scramble.cl.cam.ac.uk
date Mon Aug 16 18:08:51 2004 +0000 (2004-08-16)
parents 1ec35141a882 821d32bd8ce0
children 8346a7a9c1e1
files .rootkeys linux-2.6.7-xen-sparse/arch/xen/i386/kernel/process.c linux-2.6.7-xen-sparse/arch/xen/i386/mm/mmap.c linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/mmu_context.h linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/processor.h
line diff
     1.1 --- a/.rootkeys	Mon Aug 16 16:55:39 2004 +0000
     1.2 +++ b/.rootkeys	Mon Aug 16 18:08:51 2004 +0000
     1.3 @@ -218,6 +218,7 @@ 40f5623aDLxmbOtUHvkWztKjAO4EjA linux-2.6
     1.4  41062ab7HMSSuaUv3_Z4agLpjSO88A linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/mach-xen/pci-functions.h
     1.5  40f5623aDMCsWOFO0jktZ4e8sjwvEg linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/mach-xen/setup_arch_post.h
     1.6  40f5623arsFXkGdPvIqvFi3yFXGR0Q linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/mach-xen/setup_arch_pre.h
     1.7 +4120f807GCO0uqsLqdZj9csxR1Wthw linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/mmu_context.h
     1.8  40f5623aFTyFTR-vdiA-KaGxk5JOKQ linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/msr.h
     1.9  40f5623adgjZq9nAgCt0IXdWl7udSA linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/page.h
    1.10  40f5623a54NuG-7qHihGYmw4wWQnMA linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/param.h
     2.1 --- a/linux-2.6.7-xen-sparse/arch/xen/i386/kernel/process.c	Mon Aug 16 16:55:39 2004 +0000
     2.2 +++ b/linux-2.6.7-xen-sparse/arch/xen/i386/kernel/process.c	Mon Aug 16 18:08:51 2004 +0000
     2.3 @@ -502,10 +502,10 @@ struct task_struct fastcall * __switch_t
     2.4  				 *next = &next_p->thread;
     2.5  	int cpu = smp_processor_id();
     2.6  	struct tss_struct *tss = init_tss + cpu;
     2.7 -	unsigned long flags;
     2.8  	dom0_op_t op;
     2.9  
    2.10 -	local_irq_save(flags);
    2.11 +        /* NB. No need to disable interrupts as already done in sched.c */
    2.12 +        /* __cli(); */
    2.13  
    2.14  	/*
    2.15  	 * Save away %fs and %gs. No need to save %es and %ds, as
    2.16 @@ -569,8 +569,7 @@ struct task_struct fastcall * __switch_t
    2.17  
    2.18  	/* EXECUTE ALL TASK SWITCH XEN SYSCALLS AT THIS POINT. */
    2.19  	execute_multicall_list();
    2.20 -
    2.21 -	local_irq_restore(flags);
    2.22 +        /* __sti(); */
    2.23  
    2.24  	/*
    2.25  	 * Restore %fs and %gs if needed.
     3.1 --- a/linux-2.6.7-xen-sparse/arch/xen/i386/mm/mmap.c	Mon Aug 16 16:55:39 2004 +0000
     3.2 +++ b/linux-2.6.7-xen-sparse/arch/xen/i386/mm/mmap.c	Mon Aug 16 18:08:51 2004 +0000
     3.3 @@ -27,7 +27,7 @@ arch_get_unmapped_area(struct file *filp
     3.4  #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
     3.5  	start_addr = addr = mm->free_area_cache;
     3.6  #else
     3.7 -	addr = PAGE_ALIGN(TASK_UNMAPPED_BASE);
     3.8 +	start_addr = addr = PAGE_ALIGN(TASK_UNMAPPED_BASE);
     3.9  #endif
    3.10  
    3.11  full_search:
    3.12 @@ -61,7 +61,10 @@ unsigned long
    3.13  arch_check_fixed_mapping(struct file *filp, unsigned long addr,
    3.14  		unsigned long len, unsigned long pgoff, unsigned long flags)
    3.15  {
    3.16 -	if ( addr < (FIRST_USER_PGD_NR<<PGDIR_SHIFT) )
    3.17 +	if (addr < (FIRST_USER_PGD_NR<<PGDIR_SHIFT)) {
    3.18 +		printk(KERN_ALERT "WARNING: Preventing a mmap() request by %s at 0x%08lx, len %08lx\n",
    3.19 +		current->comm, addr, len);
    3.20  		return -EINVAL;
    3.21 +	}
    3.22  	return 0;
    3.23  }
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/mmu_context.h	Mon Aug 16 18:08:51 2004 +0000
     4.3 @@ -0,0 +1,75 @@
     4.4 +#ifndef __I386_SCHED_H
     4.5 +#define __I386_SCHED_H
     4.6 +
     4.7 +#include <linux/config.h>
     4.8 +#include <asm/desc.h>
     4.9 +#include <asm/atomic.h>
    4.10 +#include <asm/pgalloc.h>
    4.11 +#include <asm/tlbflush.h>
    4.12 +
    4.13 +/*
    4.14 + * Used for LDT copy/destruction.
    4.15 + */
    4.16 +int init_new_context(struct task_struct *tsk, struct mm_struct *mm);
    4.17 +void destroy_context(struct mm_struct *mm);
    4.18 +
    4.19 +
    4.20 +static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
    4.21 +{
    4.22 +#ifdef CONFIG_SMP
    4.23 +	unsigned cpu = smp_processor_id();
    4.24 +	if (cpu_tlbstate[cpu].state == TLBSTATE_OK)
    4.25 +		cpu_tlbstate[cpu].state = TLBSTATE_LAZY;	
    4.26 +#endif
    4.27 +}
    4.28 +
    4.29 +static inline void switch_mm(struct mm_struct *prev,
    4.30 +			     struct mm_struct *next,
    4.31 +			     struct task_struct *tsk)
    4.32 +{
    4.33 +	int cpu = smp_processor_id();
    4.34 +
    4.35 +	if (likely(prev != next)) {
    4.36 +		/* stop flush ipis for the previous mm */
    4.37 +		cpu_clear(cpu, prev->cpu_vm_mask);
    4.38 +#ifdef CONFIG_SMP
    4.39 +		cpu_tlbstate[cpu].state = TLBSTATE_OK;
    4.40 +		cpu_tlbstate[cpu].active_mm = next;
    4.41 +#endif
    4.42 +		cpu_set(cpu, next->cpu_vm_mask);
    4.43 +
    4.44 +		/* Re-load page tables */
    4.45 +		load_cr3_noflush(next->pgd);
    4.46 +
    4.47 +		/*
    4.48 +		 * load the LDT, if the LDT is different:
    4.49 +		 */
    4.50 +		if (unlikely(prev->context.ldt != next->context.ldt))
    4.51 +			load_LDT_nolock(&next->context, cpu);
    4.52 +	}
    4.53 +#ifdef CONFIG_SMP
    4.54 +	else {
    4.55 +		cpu_tlbstate[cpu].state = TLBSTATE_OK;
    4.56 +		BUG_ON(cpu_tlbstate[cpu].active_mm != next);
    4.57 +
    4.58 +		if (!cpu_test_and_set(cpu, next->cpu_vm_mask)) {
    4.59 +			/* We were in lazy tlb mode and leave_mm disabled 
    4.60 +			 * tlb flush IPI delivery. We must reload %cr3.
    4.61 +			 */
    4.62 +			load_cr3_noflush(next->pgd);
    4.63 +			load_LDT_nolock(&next->context, cpu);
    4.64 +		}
    4.65 +	}
    4.66 +#endif
    4.67 +}
    4.68 +
    4.69 +#define deactivate_mm(tsk, mm) \
    4.70 +	asm("movl %0,%%fs ; movl %0,%%gs": :"r" (0))
    4.71 +
    4.72 +#define activate_mm(prev, next) \
    4.73 +do { \
    4.74 +	switch_mm((prev),(next),NULL); \
    4.75 +	flush_page_update_queue();			\
    4.76 +} while ( 0 )
    4.77 +
    4.78 +#endif
     5.1 --- a/linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/processor.h	Mon Aug 16 16:55:39 2004 +0000
     5.2 +++ b/linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/processor.h	Mon Aug 16 18:08:51 2004 +0000
     5.3 @@ -186,6 +186,11 @@ static inline unsigned int cpuid_edx(uns
     5.4  	cur_pgd = pgdir;	/* XXXsmp */		\
     5.5  } while (/* CONSTCOND */0)
     5.6  
     5.7 +#define load_cr3_noflush(pgdir) do {			\
     5.8 +	queue_pt_switch(__pa(pgdir));			\
     5.9 +	cur_pgd = pgdir;	/* XXXsmp */		\
    5.10 +} while (/* CONSTCOND */0)
    5.11 +
    5.12  
    5.13  /*
    5.14   * Intel CPU features in CR4