ia64/xen-unstable

changeset 3347:0c088ed2de6f

bitkeeper revision 1.1159.1.513 (41d408a3JUgu3aO0DUVuu6Cdvk-wig)

update for 2.6 smp changes
author smh22@tempest.cl.cam.ac.uk
date Thu Dec 30 13:54:43 2004 +0000 (2004-12-30)
parents a19c7e2a1238
children 3d7f4ed76300
files linux-2.4.28-xen-sparse/arch/xen/mm/fault.c linux-2.6.10-xen-sparse/arch/xen/i386/mm/hypervisor.c linux-2.6.10-xen-sparse/arch/xen/kernel/evtchn.c linux-2.6.10-xen-sparse/include/asm-xen/evtchn.h linux-2.6.10-xen-sparse/include/asm-xen/hypervisor.h
line diff
     1.1 --- a/linux-2.4.28-xen-sparse/arch/xen/mm/fault.c	Thu Dec 30 09:57:47 2004 +0000
     1.2 +++ b/linux-2.4.28-xen-sparse/arch/xen/mm/fault.c	Thu Dec 30 13:54:43 2004 +0000
     1.3 @@ -84,8 +84,8 @@ asmlinkage void do_page_fault(struct pt_
     1.4          error_code &= 3;
     1.5          error_code |= (regs->xcs & 2) << 1;
     1.6  
     1.7 -	if ( flush_page_update_queue() != 0 )
     1.8 -		return;
     1.9 +	/* ensure all updates have completed */
    1.10 +	flush_page_update_queue();
    1.11  
    1.12  	/*
    1.13  	 * We fault-in kernel-space virtual memory on-demand. The
     2.1 --- a/linux-2.6.10-xen-sparse/arch/xen/i386/mm/hypervisor.c	Thu Dec 30 09:57:47 2004 +0000
     2.2 +++ b/linux-2.6.10-xen-sparse/arch/xen/i386/mm/hypervisor.c	Thu Dec 30 13:54:43 2004 +0000
     2.3 @@ -36,7 +36,9 @@
     2.4  #include <asm-xen/hypervisor.h>
     2.5  #include <asm-xen/multicall.h>
     2.6  #include <asm-xen/balloon.h>
     2.7 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
     2.8  #include <linux/percpu.h>
     2.9 +#endif
    2.10  
    2.11  /*
    2.12   * This suffices to protect us if we ever move to SMP domains.
     3.1 --- a/linux-2.6.10-xen-sparse/arch/xen/kernel/evtchn.c	Thu Dec 30 09:57:47 2004 +0000
     3.2 +++ b/linux-2.6.10-xen-sparse/arch/xen/kernel/evtchn.c	Thu Dec 30 13:54:43 2004 +0000
     3.3 @@ -42,7 +42,6 @@
     3.4  #include <asm-xen/xen-public/physdev.h>
     3.5  #include <asm-xen/ctrl_if.h>
     3.6  #include <asm-xen/hypervisor.h>
     3.7 -#define XEN_EVTCHN_MASK_OPS
     3.8  #include <asm-xen/evtchn.h>
     3.9  
    3.10  #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
    3.11 @@ -64,6 +63,9 @@ static int irq_to_evtchn[NR_IRQS];
    3.12  DEFINE_PER_CPU(int, virq_to_irq[NR_VIRQS]);
    3.13  
    3.14  /* evtchn <-> IPI mapping. */
    3.15 +#ifndef NR_IPIS    // XXX SMH: temp fix for 2.4 
    3.16 +#define NR_IPIS 1 
    3.17 +#endif
    3.18  DEFINE_PER_CPU(int, ipi_to_evtchn[NR_IPIS]);
    3.19  
    3.20  /* Reference counts for bindings to IRQs. */
     4.1 --- a/linux-2.6.10-xen-sparse/include/asm-xen/evtchn.h	Thu Dec 30 09:57:47 2004 +0000
     4.2 +++ b/linux-2.6.10-xen-sparse/include/asm-xen/evtchn.h	Thu Dec 30 13:54:43 2004 +0000
     4.3 @@ -48,8 +48,6 @@ asmlinkage void evtchn_do_upcall(struct 
     4.4  /* Entry point for notifications into the userland character device. */
     4.5  void evtchn_device_upcall(int port);
     4.6  
     4.7 -#ifdef XEN_EVTCHN_MASK_OPS
     4.8 -
     4.9  static inline void mask_evtchn(int port)
    4.10  {
    4.11      shared_info_t *s = HYPERVISOR_shared_info;
    4.12 @@ -76,8 +74,6 @@ static inline void unmask_evtchn(int por
    4.13      }
    4.14  }
    4.15  
    4.16 -#endif /* XEN_EVTCHN_MASK_OPS */
    4.17 -
    4.18  static inline void clear_evtchn(int port)
    4.19  {
    4.20      shared_info_t *s = HYPERVISOR_shared_info;
     5.1 --- a/linux-2.6.10-xen-sparse/include/asm-xen/hypervisor.h	Thu Dec 30 09:57:47 2004 +0000
     5.2 +++ b/linux-2.6.10-xen-sparse/include/asm-xen/hypervisor.h	Thu Dec 30 13:54:43 2004 +0000
     5.3 @@ -91,6 +91,23 @@ void xen_set_ldt(unsigned long ptr, unsi
     5.4  void xen_machphys_update(unsigned long mfn, unsigned long pfn);
     5.5  
     5.6  void _flush_page_update_queue(void);
     5.7 +
     5.8 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
     5.9 +/* 
    5.10 +** XXX SMH: 2.4 doesn't have percpu.h (or support SMP guests) so just 
    5.11 +** include sufficient #defines to allow the below to build. 
    5.12 +*/
    5.13 +#define DEFINE_PER_CPU(type, name) \
    5.14 +    __typeof__(type) per_cpu__##name
    5.15 +
    5.16 +#define per_cpu(var, cpu)           (*((void)cpu, &per_cpu__##var))
    5.17 +#define __get_cpu_var(var)          per_cpu__##var
    5.18 +#define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu__##name
    5.19 +
    5.20 +#define EXPORT_PER_CPU_SYMBOL(var) EXPORT_SYMBOL(per_cpu__##var)
    5.21 +#define EXPORT_PER_CPU_SYMBOL_GPL(var) EXPORT_SYMBOL_GPL(per_cpu__##var)
    5.22 +#endif /* linux < 2.6.0 */
    5.23 +
    5.24  #define flush_page_update_queue() do {				\
    5.25      DECLARE_PER_CPU(unsigned int, mmu_update_queue_idx);	\
    5.26      if (per_cpu(mmu_update_queue_idx, smp_processor_id()))	\