direct-io.hg

changeset 9330:d982f5fa9bad

Upgrade genapic code to 2.6.16-rc6 codebase. Remove entries from
genapic structure that Xen does not require (mostly because we do
not support Visual Workstation nor IBM/Sequent NUMA-Q).

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Mon Mar 20 17:01:16 2006 +0100 (2006-03-20)
parents a8b1d4fad72d
children a27f22868d68
files xen/arch/x86/genapic/default.c xen/arch/x86/genapic/es7000.h xen/arch/x86/genapic/es7000plat.c xen/include/asm-x86/genapic.h xen/include/asm-x86/mach-bigsmp/mach_apic.h xen/include/asm-x86/mach-bigsmp/mach_apicdef.h xen/include/asm-x86/mach-default/mach_apic.h xen/include/asm-x86/mach-default/mach_apicdef.h xen/include/asm-x86/mach-default/mach_ipi.h xen/include/asm-x86/mach-default/mach_mpparse.h xen/include/asm-x86/mach-es7000/mach_apic.h xen/include/asm-x86/mach-es7000/mach_apicdef.h xen/include/asm-x86/mach-es7000/mach_mpparse.h xen/include/asm-x86/mach-generic/mach_apic.h xen/include/asm-x86/mach-generic/mach_apicdef.h xen/include/asm-x86/mach-generic/mach_mpparse.h xen/include/asm-x86/mach-summit/mach_apic.h xen/include/asm-x86/mach-summit/mach_apicdef.h xen/include/asm-x86/mach-summit/mach_mpparse.h
line diff
     1.1 --- a/xen/arch/x86/genapic/default.c	Mon Mar 20 12:01:32 2006 +0100
     1.2 +++ b/xen/arch/x86/genapic/default.c	Mon Mar 20 17:01:16 2006 +0100
     1.3 @@ -18,6 +18,15 @@
     1.4  #include <asm/mach-default/mach_ipi.h>
     1.5  #include <asm/mach-default/mach_mpparse.h>
     1.6  
     1.7 +#ifdef CONFIG_HOTPLUG_CPU
     1.8 +#define DEFAULT_SEND_IPI	(1)
     1.9 +#else
    1.10 +#define DEFAULT_SEND_IPI	(0)
    1.11 +#endif
    1.12 +
    1.13 +int no_broadcast = DEFAULT_SEND_IPI;
    1.14 +integer_param("no_ipi_broadcast", no_broadcast);
    1.15 +
    1.16  /* should be called last. */
    1.17  static __init int probe_default(void)
    1.18  { 
    1.19 @@ -25,3 +34,12 @@ static __init int probe_default(void)
    1.20  } 
    1.21  
    1.22  struct genapic apic_default = APIC_INIT("default", probe_default); 
    1.23 +
    1.24 +static int __init print_ipi_mode(void)
    1.25 +{
    1.26 +	if (genapic == &apic_default)
    1.27 +		printk("Using IPI %sShortcut mode\n",
    1.28 +		       no_broadcast ? "No-" : "");
    1.29 +	return 0;
    1.30 +}
    1.31 +__initcall(print_ipi_mode);
     2.1 --- a/xen/arch/x86/genapic/es7000.h	Mon Mar 20 12:01:32 2006 +0100
     2.2 +++ b/xen/arch/x86/genapic/es7000.h	Mon Mar 20 17:01:16 2006 +0100
     2.3 @@ -24,6 +24,15 @@
     2.4   * http://www.unisys.com
     2.5   */
     2.6  
     2.7 +/*
     2.8 + * ES7000 chipsets
     2.9 + */
    2.10 +
    2.11 +#define NON_UNISYS		0
    2.12 +#define ES7000_CLASSIC		1
    2.13 +#define ES7000_ZORRO		2
    2.14 +
    2.15 +
    2.16  #define	MIP_REG			1
    2.17  #define	MIP_PSAI_REG		4
    2.18  
    2.19 @@ -104,7 +113,8 @@ struct mip_reg {
    2.20  #define	MIP_SW_APIC		0x1020b
    2.21  #define	MIP_FUNC(VALUE) 	(VALUE & 0xff)
    2.22  
    2.23 -extern int parse_unisys_oem (char *oemptr, int oem_entries);
    2.24 -extern int find_unisys_acpi_oem_table(unsigned long *oem_addr, int *length);
    2.25 +extern int parse_unisys_oem (char *oemptr);
    2.26 +extern int find_unisys_acpi_oem_table(unsigned long *oem_addr);
    2.27 +extern void setup_unisys(void);
    2.28  extern int es7000_start_cpu(int cpu, unsigned long eip);
    2.29  extern void es7000_sw_apic(void);
     3.1 --- a/xen/arch/x86/genapic/es7000plat.c	Mon Mar 20 12:01:32 2006 +0100
     3.2 +++ b/xen/arch/x86/genapic/es7000plat.c	Mon Mar 20 17:01:16 2006 +0100
     3.3 @@ -49,7 +49,7 @@ struct mip_reg		*host_reg;
     3.4  int 			mip_port;
     3.5  unsigned long		mip_addr, host_addr;
     3.6  
     3.7 -#if defined(CONFIG_X86_IO_APIC) && (defined(CONFIG_ACPI_INTERPRETER) || defined(CONFIG_ACPI_BOOT))
     3.8 +#if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_ACPI)
     3.9  
    3.10  /*
    3.11   * GSI override for ES7000 platforms.
    3.12 @@ -60,6 +60,9 @@ static unsigned int base;
    3.13  static int
    3.14  es7000_rename_gsi(int ioapic, int gsi)
    3.15  {
    3.16 +	if (es7000_plat == ES7000_ZORRO)
    3.17 +		return gsi;
    3.18 +
    3.19  	if (!base) {
    3.20  		int i;
    3.21  		for (i = 0; i < nr_ioapics; i++)
    3.22 @@ -71,14 +74,31 @@ es7000_rename_gsi(int ioapic, int gsi)
    3.23  	return gsi;
    3.24  }
    3.25  
    3.26 -#endif // (CONFIG_X86_IO_APIC) && (CONFIG_ACPI_INTERPRETER || CONFIG_ACPI_BOOT)
    3.27 +#endif	/* (CONFIG_X86_IO_APIC) && (CONFIG_ACPI) */
    3.28 +
    3.29 +void __init
    3.30 +setup_unisys(void)
    3.31 +{
    3.32 +	/*
    3.33 +	 * Determine the generation of the ES7000 currently running.
    3.34 +	 *
    3.35 +	 * es7000_plat = 1 if the machine is a 5xx ES7000 box
    3.36 +	 * es7000_plat = 2 if the machine is a x86_64 ES7000 box
    3.37 +	 *
    3.38 +	 */
    3.39 +	if (!(boot_cpu_data.x86 <= 15 && boot_cpu_data.x86_model <= 2))
    3.40 +		es7000_plat = ES7000_ZORRO;
    3.41 +	else
    3.42 +		es7000_plat = ES7000_CLASSIC;
    3.43 +	ioapic_renumber_irq = es7000_rename_gsi;
    3.44 +}
    3.45  
    3.46  /*
    3.47   * Parse the OEM Table
    3.48   */
    3.49  
    3.50  int __init
    3.51 -parse_unisys_oem (char *oemptr, int oem_entries)
    3.52 +parse_unisys_oem (char *oemptr)
    3.53  {
    3.54  	int                     i;
    3.55  	int 			success = 0;
    3.56 @@ -93,7 +113,7 @@ parse_unisys_oem (char *oemptr, int oem_
    3.57  
    3.58  	tp += 8;
    3.59  
    3.60 -	for (i=0; i <= oem_entries; i++) {
    3.61 +	for (i=0; i <= 6; i++) {
    3.62  		type = *tp++;
    3.63  		size = *tp++;
    3.64  		tp -= 2;
    3.65 @@ -128,40 +148,24 @@ parse_unisys_oem (char *oemptr, int oem_
    3.66  		default:
    3.67  			break;
    3.68  		}
    3.69 -		if (i == 6) break;
    3.70  		tp += size;
    3.71  	}
    3.72  
    3.73  	if (success < 2) {
    3.74 -		es7000_plat = 0;
    3.75 -	} else {
    3.76 -		printk("\nEnabling ES7000 specific features...\n");
    3.77 -		/*
    3.78 -		 * Determine the generation of the ES7000 currently running.
    3.79 -		 *
    3.80 -		 * es7000_plat = 0 if the machine is NOT a Unisys ES7000 box
    3.81 -		 * es7000_plat = 1 if the machine is a 5xx ES7000 box
    3.82 -		 * es7000_plat = 2 if the machine is a x86_64 ES7000 box
    3.83 -		 *
    3.84 -		 */
    3.85 -		if (!(boot_cpu_data.x86 <= 15 && boot_cpu_data.x86_model <= 2))
    3.86 -			es7000_plat = 2;
    3.87 -		else
    3.88 -			es7000_plat = 1;
    3.89 -
    3.90 -		ioapic_renumber_irq = es7000_rename_gsi;
    3.91 -	}
    3.92 +		es7000_plat = NON_UNISYS;
    3.93 +	} else
    3.94 +		setup_unisys();
    3.95  	return es7000_plat;
    3.96  }
    3.97  
    3.98  int __init
    3.99 -find_unisys_acpi_oem_table(unsigned long *oem_addr, int *length)
   3.100 +find_unisys_acpi_oem_table(unsigned long *oem_addr)
   3.101  {
   3.102  	struct acpi_table_rsdp		*rsdp = NULL;
   3.103  	unsigned long			rsdp_phys = 0;
   3.104  	struct acpi_table_header 	*header = NULL;
   3.105  	int				i;
   3.106 -	struct acpi_table_sdt		sdt = { 0 };
   3.107 +	struct acpi_table_sdt		sdt;
   3.108  
   3.109  	rsdp_phys = acpi_find_rsdp();
   3.110  	rsdp = __va(rsdp_phys);
   3.111 @@ -199,13 +203,11 @@ find_unisys_acpi_oem_table(unsigned long
   3.112  				acpi_table_print(header, sdt.entry[i].pa);
   3.113  				t = (struct oem_table *) __acpi_map_table(sdt.entry[i].pa, header->length);
   3.114  				addr = (void *) __acpi_map_table(t->OEMTableAddr, t->OEMTableSize);
   3.115 -				*length = header->length;
   3.116  				*oem_addr = (unsigned long) addr;
   3.117  				return 0;
   3.118  			}
   3.119  		}
   3.120  	}
   3.121 -	Dprintk("ES7000: did not find Unisys ACPI OEM table!\n");
   3.122  	return -1;
   3.123  }
   3.124  
   3.125 @@ -298,7 +300,7 @@ es7000_stop_cpu(int cpu)
   3.126  void __init
   3.127  es7000_sw_apic()
   3.128  {
   3.129 -	if (es7000_plat == 1) {
   3.130 +	if (es7000_plat) {
   3.131  		int mip_status;
   3.132  		struct mip_reg es7000_mip_reg;
   3.133  
     4.1 --- a/xen/include/asm-x86/genapic.h	Mon Mar 20 12:01:32 2006 +0100
     4.2 +++ b/xen/include/asm-x86/genapic.h	Mon Mar 20 17:01:16 2006 +0100
     4.3 @@ -34,24 +34,14 @@ struct genapic {
     4.4  	physid_mask_t (*ioapic_phys_id_map)(physid_mask_t map);
     4.5  
     4.6  	void (*clustered_apic_check)(void);
     4.7 -	int (*multi_timer_check)(int apic, int irq);
     4.8  	int (*apicid_to_node)(int logical_apicid); 
     4.9  	int (*cpu_to_logical_apicid)(int cpu);
    4.10  	int (*cpu_present_to_apicid)(int mps_cpu);
    4.11  	physid_mask_t (*apicid_to_cpu_present)(int phys_apicid);
    4.12 -	int (*mpc_apic_id)(struct mpc_config_processor *m, 
    4.13 -			   struct mpc_config_translation *t); 
    4.14 -	void (*setup_portio_remap)(void); 
    4.15  	int (*check_phys_apicid_present)(int boot_cpu_physical_apicid);
    4.16  	void (*enable_apic_mode)(void);
    4.17  	u32 (*phys_pkg_id)(u32 cpuid_apic, int index_msb);
    4.18  
    4.19 -	/* mpparse */
    4.20 -	void (*mpc_oem_bus_info)(struct mpc_config_bus *, char *, 
    4.21 -				 struct mpc_config_translation *);
    4.22 -	void (*mpc_oem_pci_bus)(struct mpc_config_bus *, 
    4.23 -				struct mpc_config_translation *); 
    4.24 -
    4.25  	/* When one of the next two hooks returns 1 the genapic
    4.26  	   is switched to this. Essentially they are additional probe 
    4.27  	   functions. */
    4.28 @@ -60,7 +50,6 @@ struct genapic {
    4.29  	int (*acpi_madt_oem_check)(char *oem_id, char *oem_table_id);
    4.30  
    4.31  	unsigned (*get_apic_id)(unsigned long x);
    4.32 -	unsigned long apic_id_mask;
    4.33  	unsigned int (*cpu_mask_to_apicid)(cpumask_t cpumask);
    4.34  	
    4.35  	/* ipi */
    4.36 @@ -86,19 +75,13 @@ struct genapic {
    4.37  	APICFUNC(init_apic_ldr), \
    4.38  	APICFUNC(ioapic_phys_id_map), \
    4.39  	APICFUNC(clustered_apic_check), \
    4.40 -	APICFUNC(multi_timer_check), \
    4.41  	APICFUNC(apicid_to_node), \
    4.42  	APICFUNC(cpu_to_logical_apicid), \
    4.43  	APICFUNC(cpu_present_to_apicid), \
    4.44  	APICFUNC(apicid_to_cpu_present), \
    4.45 -	APICFUNC(mpc_apic_id), \
    4.46 -	APICFUNC(setup_portio_remap), \
    4.47  	APICFUNC(check_phys_apicid_present), \
    4.48 -	APICFUNC(mpc_oem_bus_info), \
    4.49 -	APICFUNC(mpc_oem_pci_bus), \
    4.50  	APICFUNC(mps_oem_check), \
    4.51  	APICFUNC(get_apic_id), \
    4.52 -	.apic_id_mask = APIC_ID_MASK, \
    4.53  	APICFUNC(cpu_mask_to_apicid), \
    4.54  	APICFUNC(acpi_madt_oem_check), \
    4.55  	APICFUNC(send_IPI_mask), \
     5.1 --- a/xen/include/asm-x86/mach-bigsmp/mach_apic.h	Mon Mar 20 12:01:32 2006 +0100
     5.2 +++ b/xen/include/asm-x86/mach-bigsmp/mach_apic.h	Mon Mar 20 17:01:16 2006 +0100
     5.3 @@ -1,17 +1,10 @@
     5.4  #ifndef __ASM_MACH_APIC_H
     5.5  #define __ASM_MACH_APIC_H
     5.6 -#include <asm/smp.h>
     5.7 +
     5.8  
     5.9 -#define SEQUENTIAL_APICID
    5.10 -#ifdef SEQUENTIAL_APICID
    5.11 -#define xapic_phys_to_log_apicid(phys_apic) ( (1ul << ((phys_apic) & 0x3)) |\
    5.12 -		((phys_apic<<2) & (~0xf)) )
    5.13 -#elif CLUSTERED_APICID
    5.14 -#define xapic_phys_to_log_apicid(phys_apic) ( (1ul << ((phys_apic) & 0x3)) |\
    5.15 -		((phys_apic) & (~0xf)) )
    5.16 -#endif
    5.17 +extern u8 bios_cpu_apicid[];
    5.18  
    5.19 -#define NO_BALANCE_IRQ (1)
    5.20 +#define xapic_phys_to_log_apicid(cpu) (bios_cpu_apicid[cpu])
    5.21  #define esr_disable (1)
    5.22  
    5.23  static inline int apic_id_registered(void)
    5.24 @@ -19,7 +12,6 @@ static inline int apic_id_registered(voi
    5.25  	return (1);
    5.26  }
    5.27  
    5.28 -#define APIC_DFR_VALUE	(APIC_DFR_CLUSTER)
    5.29  /* Round robin the irqs amoung the online cpus */
    5.30  static inline cpumask_t target_cpus(void)
    5.31  { 
    5.32 @@ -32,29 +24,34 @@ static inline cpumask_t target_cpus(void
    5.33  	} while (cpu >= NR_CPUS);
    5.34  	return cpumask_of_cpu(cpu);
    5.35  }
    5.36 -#define TARGET_CPUS	(target_cpus())
    5.37  
    5.38 -#define INT_DELIVERY_MODE dest_Fixed
    5.39 -#define INT_DEST_MODE 1     /* logical delivery broadcast to all procs */
    5.40 +#undef APIC_DEST_LOGICAL
    5.41 +#define APIC_DEST_LOGICAL 	0
    5.42 +#define TARGET_CPUS		(target_cpus())
    5.43 +#define APIC_DFR_VALUE		(APIC_DFR_FLAT)
    5.44 +#define INT_DELIVERY_MODE	(dest_Fixed)
    5.45 +#define INT_DEST_MODE		(0)    /* phys delivery to target proc */
    5.46 +#define NO_BALANCE_IRQ		(0)
    5.47 +#define WAKE_SECONDARY_VIA_INIT
    5.48 +
    5.49  
    5.50  static inline unsigned long check_apicid_used(physid_mask_t bitmap, int apicid)
    5.51  {
    5.52 -	return 0;
    5.53 +	return (0);
    5.54 +}
    5.55 +
    5.56 +static inline unsigned long check_apicid_present(int bit)
    5.57 +{
    5.58 +	return (1);
    5.59  }
    5.60  
    5.61 -/* we don't use the phys_cpu_present_map to indicate apicid presence */
    5.62 -static inline unsigned long check_apicid_present(int bit) 
    5.63 +static inline unsigned long calculate_ldr(int cpu)
    5.64  {
    5.65 -	return 1;
    5.66 -}
    5.67 -
    5.68 -#define apicid_cluster(apicid) (apicid & 0xF0)
    5.69 -
    5.70 -static inline unsigned long calculate_ldr(unsigned long old)
    5.71 -{
    5.72 -	unsigned long id;
    5.73 -	id = xapic_phys_to_log_apicid(hard_smp_processor_id());
    5.74 -	return ((old & ~APIC_LDR_MASK) | SET_APIC_LOGICAL_ID(id));
    5.75 +	unsigned long val, id;
    5.76 +	val = apic_read(APIC_LDR) & ~APIC_LDR_MASK;
    5.77 +	id = xapic_phys_to_log_apicid(cpu);
    5.78 +	val |= SET_APIC_LOGICAL_ID(id);
    5.79 +	return val;
    5.80  }
    5.81  
    5.82  /*
    5.83 @@ -67,37 +64,30 @@ static inline unsigned long calculate_ld
    5.84  static inline void init_apic_ldr(void)
    5.85  {
    5.86  	unsigned long val;
    5.87 +	int cpu = smp_processor_id();
    5.88  
    5.89  	apic_write_around(APIC_DFR, APIC_DFR_VALUE);
    5.90 -	val = apic_read(APIC_LDR) & ~APIC_LDR_MASK;
    5.91 -	val = calculate_ldr(val);
    5.92 +	val = calculate_ldr(cpu);
    5.93  	apic_write_around(APIC_LDR, val);
    5.94  }
    5.95  
    5.96  static inline void clustered_apic_check(void)
    5.97  {
    5.98  	printk("Enabling APIC mode:  %s.  Using %d I/O APICs\n",
    5.99 -		"Cluster", nr_ioapics);
   5.100 -}
   5.101 -
   5.102 -static inline int multi_timer_check(int apic, int irq)
   5.103 -{
   5.104 -	return 0;
   5.105 +		"Physflat", nr_ioapics);
   5.106  }
   5.107  
   5.108  static inline int apicid_to_node(int logical_apicid)
   5.109  {
   5.110 -	return 0;
   5.111 +	return (0);
   5.112  }
   5.113  
   5.114 -extern u8 bios_cpu_apicid[];
   5.115 -
   5.116  static inline int cpu_present_to_apicid(int mps_cpu)
   5.117  {
   5.118  	if (mps_cpu < NR_CPUS)
   5.119 -		return (int)bios_cpu_apicid[mps_cpu];
   5.120 -	else
   5.121 -		return BAD_APICID;
   5.122 +		return (int) bios_cpu_apicid[mps_cpu];
   5.123 +
   5.124 +	return BAD_APICID;
   5.125  }
   5.126  
   5.127  static inline physid_mask_t apicid_to_cpu_present(int phys_apicid)
   5.128 @@ -109,32 +99,15 @@ extern u8 cpu_2_logical_apicid[];
   5.129  /* Mapping from cpu number to logical apicid */
   5.130  static inline int cpu_to_logical_apicid(int cpu)
   5.131  {
   5.132 -       if (cpu >= NR_CPUS)
   5.133 -	       return BAD_APICID;
   5.134 -       return (int)cpu_2_logical_apicid[cpu];
   5.135 - }
   5.136 -
   5.137 -static inline int mpc_apic_id(struct mpc_config_processor *m,
   5.138 -			struct mpc_config_translation *translation_record)
   5.139 -{
   5.140 -	printk("Processor #%d %d:%d APIC version %d\n",
   5.141 -	        m->mpc_apicid,
   5.142 -	        (m->mpc_cpufeature & CPU_FAMILY_MASK) >> 8,
   5.143 -	        (m->mpc_cpufeature & CPU_MODEL_MASK) >> 4,
   5.144 -	        m->mpc_apicver);
   5.145 -	return m->mpc_apicid;
   5.146 +	if (cpu >= NR_CPUS)
   5.147 +		return BAD_APICID;
   5.148 +	return cpu_physical_id(cpu);
   5.149  }
   5.150  
   5.151  static inline physid_mask_t ioapic_phys_id_map(physid_mask_t phys_map)
   5.152  {
   5.153  	/* For clustered we don't have a good way to do this yet - hack */
   5.154 -	return physids_promote(0xFUL);
   5.155 -}
   5.156 -
   5.157 -#define WAKE_SECONDARY_VIA_INIT
   5.158 -
   5.159 -static inline void setup_portio_remap(void)
   5.160 -{
   5.161 +	return physids_promote(0xFFL);
   5.162  }
   5.163  
   5.164  static inline void enable_apic_mode(void)
     6.1 --- a/xen/include/asm-x86/mach-bigsmp/mach_apicdef.h	Mon Mar 20 12:01:32 2006 +0100
     6.2 +++ b/xen/include/asm-x86/mach-bigsmp/mach_apicdef.h	Mon Mar 20 17:01:16 2006 +0100
     6.3 @@ -1,11 +1,9 @@
     6.4  #ifndef __ASM_MACH_APICDEF_H
     6.5  #define __ASM_MACH_APICDEF_H
     6.6  
     6.7 -#define		APIC_ID_MASK		(0x0F<<24)
     6.8 -
     6.9  static inline unsigned get_apic_id(unsigned long x) 
    6.10  { 
    6.11 -	return (((x)>>24)&0x0F);
    6.12 +	return (((x)>>24)&0xFF);
    6.13  } 
    6.14  
    6.15  #define		GET_APIC_ID(x)	get_apic_id(x)
     7.1 --- a/xen/include/asm-x86/mach-default/mach_apic.h	Mon Mar 20 12:01:32 2006 +0100
     7.2 +++ b/xen/include/asm-x86/mach-default/mach_apic.h	Mon Mar 20 17:01:16 2006 +0100
     7.3 @@ -60,11 +60,6 @@ static inline void clustered_apic_check(
     7.4  					"Flat", nr_ioapics);
     7.5  }
     7.6  
     7.7 -static inline int multi_timer_check(int apic, int irq)
     7.8 -{
     7.9 -	return 0;
    7.10 -}
    7.11 -
    7.12  static inline int apicid_to_node(int logical_apicid)
    7.13  {
    7.14  	return 0;
    7.15 @@ -89,21 +84,6 @@ static inline physid_mask_t apicid_to_cp
    7.16  	return physid_mask_of_physid(phys_apicid);
    7.17  }
    7.18  
    7.19 -static inline int mpc_apic_id(struct mpc_config_processor *m, 
    7.20 -			struct mpc_config_translation *translation_record)
    7.21 -{
    7.22 -	printk("Processor #%d %d:%d APIC version %d\n",
    7.23 -			m->mpc_apicid,
    7.24 -			(m->mpc_cpufeature & CPU_FAMILY_MASK) >> 8,
    7.25 -			(m->mpc_cpufeature & CPU_MODEL_MASK) >> 4,
    7.26 -			m->mpc_apicver);
    7.27 -	return (m->mpc_apicid);
    7.28 -}
    7.29 -
    7.30 -static inline void setup_portio_remap(void)
    7.31 -{
    7.32 -}
    7.33 -
    7.34  static inline int check_phys_apicid_present(int boot_cpu_physical_apicid)
    7.35  {
    7.36  	return physid_isset(boot_cpu_physical_apicid, phys_cpu_present_map);
     8.1 --- a/xen/include/asm-x86/mach-default/mach_apicdef.h	Mon Mar 20 12:01:32 2006 +0100
     8.2 +++ b/xen/include/asm-x86/mach-default/mach_apicdef.h	Mon Mar 20 17:01:16 2006 +0100
     8.3 @@ -1,8 +1,6 @@
     8.4  #ifndef __ASM_MACH_APICDEF_H
     8.5  #define __ASM_MACH_APICDEF_H
     8.6  
     8.7 -#define		APIC_ID_MASK		(0xF<<24)
     8.8 -
     8.9  static inline unsigned get_apic_id(unsigned long x) 
    8.10  { 
    8.11  	return (((x)>>24)&0xF);
     9.1 --- a/xen/include/asm-x86/mach-default/mach_ipi.h	Mon Mar 20 12:01:32 2006 +0100
     9.2 +++ b/xen/include/asm-x86/mach-default/mach_ipi.h	Mon Mar 20 17:01:16 2006 +0100
     9.3 @@ -4,11 +4,32 @@
     9.4  void send_IPI_mask_bitmask(cpumask_t mask, int vector);
     9.5  void __send_IPI_shortcut(unsigned int shortcut, int vector);
     9.6  
     9.7 +extern int no_broadcast;
     9.8 +
     9.9  static inline void send_IPI_mask(cpumask_t mask, int vector)
    9.10  {
    9.11  	send_IPI_mask_bitmask(mask, vector);
    9.12  }
    9.13  
    9.14 +static inline void __local_send_IPI_allbutself(int vector)
    9.15 +{
    9.16 +	if (no_broadcast) {
    9.17 +		cpumask_t mask = cpu_online_map;
    9.18 +
    9.19 +		cpu_clear(smp_processor_id(), mask);
    9.20 +		send_IPI_mask(mask, vector);
    9.21 +	} else
    9.22 +		__send_IPI_shortcut(APIC_DEST_ALLBUT, vector);
    9.23 +}
    9.24 +
    9.25 +static inline void __local_send_IPI_all(int vector)
    9.26 +{
    9.27 +	if (no_broadcast)
    9.28 +		send_IPI_mask(cpu_online_map, vector);
    9.29 +	else
    9.30 +		__send_IPI_shortcut(APIC_DEST_ALLINC, vector);
    9.31 +}
    9.32 +
    9.33  static inline void send_IPI_allbutself(int vector)
    9.34  {
    9.35  	/*
    9.36 @@ -18,13 +39,13 @@ static inline void send_IPI_allbutself(i
    9.37  	if (!(num_online_cpus() > 1))
    9.38  		return;
    9.39  
    9.40 -	__send_IPI_shortcut(APIC_DEST_ALLBUT, vector);
    9.41 +	__local_send_IPI_allbutself(vector);
    9.42  	return;
    9.43  }
    9.44  
    9.45  static inline void send_IPI_all(int vector)
    9.46  {
    9.47 -	__send_IPI_shortcut(APIC_DEST_ALLINC, vector);
    9.48 +	__local_send_IPI_all(vector);
    9.49  }
    9.50  
    9.51  #endif /* __ASM_MACH_IPI_H */
    10.1 --- a/xen/include/asm-x86/mach-default/mach_mpparse.h	Mon Mar 20 12:01:32 2006 +0100
    10.2 +++ b/xen/include/asm-x86/mach-default/mach_mpparse.h	Mon Mar 20 17:01:16 2006 +0100
    10.3 @@ -1,17 +1,6 @@
    10.4  #ifndef __ASM_MACH_MPPARSE_H
    10.5  #define __ASM_MACH_MPPARSE_H
    10.6  
    10.7 -static inline void mpc_oem_bus_info(struct mpc_config_bus *m, char *name, 
    10.8 -				struct mpc_config_translation *translation)
    10.9 -{
   10.10 -//	Dprintk("Bus #%d is %s\n", m->mpc_busid, name);
   10.11 -}
   10.12 -
   10.13 -static inline void mpc_oem_pci_bus(struct mpc_config_bus *m, 
   10.14 -				struct mpc_config_translation *translation)
   10.15 -{
   10.16 -}
   10.17 -
   10.18  static inline int mps_oem_check(struct mp_config_table *mpc, char *oem, 
   10.19  		char *productid)
   10.20  {
    11.1 --- a/xen/include/asm-x86/mach-es7000/mach_apic.h	Mon Mar 20 12:01:32 2006 +0100
    11.2 +++ b/xen/include/asm-x86/mach-es7000/mach_apic.h	Mon Mar 20 17:01:16 2006 +0100
    11.3 @@ -89,11 +89,6 @@ static inline void clustered_apic_check(
    11.4  		"Physical Cluster" : "Logical Cluster", nr_ioapics, cpus_addr(TARGET_CPUS)[0]);
    11.5  }
    11.6  
    11.7 -static inline int multi_timer_check(int apic, int irq)
    11.8 -{
    11.9 -	return 0;
   11.10 -}
   11.11 -
   11.12  static inline int apicid_to_node(int logical_apicid)
   11.13  {
   11.14  	return 0;
   11.15 @@ -128,27 +123,12 @@ static inline int cpu_to_logical_apicid(
   11.16         return (int)cpu_2_logical_apicid[cpu];
   11.17  }
   11.18  
   11.19 -static inline int mpc_apic_id(struct mpc_config_processor *m, struct mpc_config_translation *unused)
   11.20 -{
   11.21 -	printk("Processor #%d %d:%d APIC version %d\n",
   11.22 -	        m->mpc_apicid,
   11.23 -	        (m->mpc_cpufeature & CPU_FAMILY_MASK) >> 8,
   11.24 -	        (m->mpc_cpufeature & CPU_MODEL_MASK) >> 4,
   11.25 -	        m->mpc_apicver);
   11.26 -	return (m->mpc_apicid);
   11.27 -}
   11.28 -
   11.29  static inline physid_mask_t ioapic_phys_id_map(physid_mask_t phys_map)
   11.30  {
   11.31  	/* For clustered we don't have a good way to do this yet - hack */
   11.32  	return physids_promote(0xff);
   11.33  }
   11.34  
   11.35 -
   11.36 -static inline void setup_portio_remap(void)
   11.37 -{
   11.38 -}
   11.39 -
   11.40  extern unsigned int boot_cpu_physical_apicid;
   11.41  static inline int check_phys_apicid_present(int cpu_physical_apicid)
   11.42  {
    12.1 --- a/xen/include/asm-x86/mach-es7000/mach_apicdef.h	Mon Mar 20 12:01:32 2006 +0100
    12.2 +++ b/xen/include/asm-x86/mach-es7000/mach_apicdef.h	Mon Mar 20 17:01:16 2006 +0100
    12.3 @@ -1,8 +1,6 @@
    12.4  #ifndef __ASM_MACH_APICDEF_H
    12.5  #define __ASM_MACH_APICDEF_H
    12.6  
    12.7 -#define		APIC_ID_MASK		(0xFF<<24)
    12.8 -
    12.9  static inline unsigned get_apic_id(unsigned long x) 
   12.10  { 
   12.11  	return (((x)>>24)&0xFF);
    13.1 --- a/xen/include/asm-x86/mach-es7000/mach_mpparse.h	Mon Mar 20 12:01:32 2006 +0100
    13.2 +++ b/xen/include/asm-x86/mach-es7000/mach_mpparse.h	Mon Mar 20 17:01:16 2006 +0100
    13.3 @@ -1,39 +1,46 @@
    13.4  #ifndef __ASM_MACH_MPPARSE_H
    13.5  #define __ASM_MACH_MPPARSE_H
    13.6  
    13.7 -static inline void mpc_oem_bus_info(struct mpc_config_bus *m, char *name, 
    13.8 -				struct mpc_config_translation *translation)
    13.9 -{
   13.10 -	Dprintk("Bus #%d is %s\n", m->mpc_busid, name);
   13.11 -}
   13.12 +#include <xen/acpi.h>
   13.13  
   13.14 -static inline void mpc_oem_pci_bus(struct mpc_config_bus *m, 
   13.15 -				struct mpc_config_translation *translation)
   13.16 -{
   13.17 -}
   13.18 -
   13.19 -extern int parse_unisys_oem (char *oemptr, int oem_entries);
   13.20 -extern int find_unisys_acpi_oem_table(unsigned long *oem_addr, int *length);
   13.21 +extern int parse_unisys_oem (char *oemptr);
   13.22 +extern int find_unisys_acpi_oem_table(unsigned long *oem_addr);
   13.23 +extern void setup_unisys(void);
   13.24  
   13.25  static inline int mps_oem_check(struct mp_config_table *mpc, char *oem,
   13.26  		char *productid)
   13.27  {
   13.28  	if (mpc->mpc_oemptr) {
   13.29  		struct mp_config_oemtable *oem_table = 
   13.30 -			(struct mp_config_oemtable *)(long)mpc->mpc_oemptr;
   13.31 +			(struct mp_config_oemtable *)mpc->mpc_oemptr;
   13.32  		if (!strncmp(oem, "UNISYS", 6))
   13.33 -			return parse_unisys_oem((char *)oem_table, oem_table->oem_length);
   13.34 +			return parse_unisys_oem((char *)oem_table);
   13.35  	}
   13.36  	return 0;
   13.37  }
   13.38  
   13.39 +static inline int es7000_check_dsdt(void)
   13.40 +{
   13.41 +	struct acpi_table_header *header = NULL;
   13.42 +	if(!acpi_get_table_header_early(ACPI_DSDT, &header))
   13.43 +		acpi_table_print(header, 0);
   13.44 +	if (!strncmp(header->oem_id, "UNISYS", 6))
   13.45 +		return 1;
   13.46 +	return 0;
   13.47 +}
   13.48 +
   13.49  /* Hook from generic ACPI tables.c */
   13.50  static inline int acpi_madt_oem_check(char *oem_id, char *oem_table_id)
   13.51  {
   13.52  	unsigned long oem_addr; 
   13.53 -	int oem_entries;
   13.54 -	if (!find_unisys_acpi_oem_table(&oem_addr, &oem_entries))
   13.55 -		return parse_unisys_oem((char *)oem_addr, oem_entries);
   13.56 +	if (!find_unisys_acpi_oem_table(&oem_addr)) {
   13.57 +		if (es7000_check_dsdt())
   13.58 +			return parse_unisys_oem((char *)oem_addr);
   13.59 +		else {
   13.60 +			setup_unisys();
   13.61 +			return 1;
   13.62 +		}
   13.63 +	}
   13.64  	return 0;
   13.65  }
   13.66  
    14.1 --- a/xen/include/asm-x86/mach-generic/mach_apic.h	Mon Mar 20 12:01:32 2006 +0100
    14.2 +++ b/xen/include/asm-x86/mach-generic/mach_apic.h	Mon Mar 20 17:01:16 2006 +0100
    14.3 @@ -14,13 +14,10 @@
    14.4  #define init_apic_ldr (genapic->init_apic_ldr)
    14.5  #define ioapic_phys_id_map (genapic->ioapic_phys_id_map)
    14.6  #define clustered_apic_check (genapic->clustered_apic_check) 
    14.7 -#define multi_timer_check (genapic->multi_timer_check)
    14.8  #define apicid_to_node (genapic->apicid_to_node)
    14.9  #define cpu_to_logical_apicid (genapic->cpu_to_logical_apicid) 
   14.10  #define cpu_present_to_apicid (genapic->cpu_present_to_apicid)
   14.11  #define apicid_to_cpu_present (genapic->apicid_to_cpu_present)
   14.12 -#define mpc_apic_id (genapic->mpc_apic_id) 
   14.13 -#define setup_portio_remap (genapic->setup_portio_remap)
   14.14  #define check_apicid_present (genapic->check_apicid_present)
   14.15  #define check_phys_apicid_present (genapic->check_phys_apicid_present)
   14.16  #define check_apicid_used (genapic->check_apicid_used)
   14.17 @@ -28,6 +25,26 @@
   14.18  #define enable_apic_mode (genapic->enable_apic_mode)
   14.19  #define phys_pkg_id (genapic->phys_pkg_id)
   14.20  
   14.21 +static inline int mpc_apic_id(struct mpc_config_processor *m, 
   14.22 +			struct mpc_config_translation *translation_record)
   14.23 +{
   14.24 +	printk("Processor #%d %d:%d APIC version %d\n",
   14.25 +			m->mpc_apicid,
   14.26 +			(m->mpc_cpufeature & CPU_FAMILY_MASK) >> 8,
   14.27 +			(m->mpc_cpufeature & CPU_MODEL_MASK) >> 4,
   14.28 +			m->mpc_apicver);
   14.29 +	return (m->mpc_apicid);
   14.30 +}
   14.31 +
   14.32 +static inline void setup_portio_remap(void)
   14.33 +{
   14.34 +}
   14.35 +
   14.36 +static inline int multi_timer_check(int apic, int irq)
   14.37 +{
   14.38 +	return 0;
   14.39 +}
   14.40 +
   14.41  extern void generic_bigsmp_probe(void);
   14.42  
   14.43  #endif /* __ASM_MACH_APIC_H */
    15.1 --- a/xen/include/asm-x86/mach-generic/mach_apicdef.h	Mon Mar 20 12:01:32 2006 +0100
    15.2 +++ b/xen/include/asm-x86/mach-generic/mach_apicdef.h	Mon Mar 20 17:01:16 2006 +0100
    15.3 @@ -5,7 +5,6 @@
    15.4  #include <asm/genapic.h>
    15.5  
    15.6  #define GET_APIC_ID (genapic->get_apic_id)
    15.7 -#define APIC_ID_MASK (genapic->apic_id_mask)
    15.8  #endif
    15.9  
   15.10  #endif
    16.1 --- a/xen/include/asm-x86/mach-generic/mach_mpparse.h	Mon Mar 20 12:01:32 2006 +0100
    16.2 +++ b/xen/include/asm-x86/mach-generic/mach_mpparse.h	Mon Mar 20 17:01:16 2006 +0100
    16.3 @@ -1,10 +1,16 @@
    16.4  #ifndef _MACH_MPPARSE_H
    16.5  #define _MACH_MPPARSE_H 1
    16.6  
    16.7 -#include <asm/genapic.h>
    16.8 +static inline void mpc_oem_bus_info(struct mpc_config_bus *m, char *name, 
    16.9 +				struct mpc_config_translation *translation)
   16.10 +{
   16.11 +	Dprintk("Bus #%d is %s\n", m->mpc_busid, name);
   16.12 +}
   16.13  
   16.14 -#define mpc_oem_bus_info (genapic->mpc_oem_bus_info)
   16.15 -#define mpc_oem_pci_bus (genapic->mpc_oem_pci_bus)
   16.16 +static inline void mpc_oem_pci_bus(struct mpc_config_bus *m, 
   16.17 +				struct mpc_config_translation *translation)
   16.18 +{
   16.19 +}
   16.20  
   16.21  int mps_oem_check(struct mp_config_table *mpc, char *oem, char *productid); 
   16.22  int acpi_madt_oem_check(char *oem_id, char *oem_table_id); 
    17.1 --- a/xen/include/asm-x86/mach-summit/mach_apic.h	Mon Mar 20 12:01:32 2006 +0100
    17.2 +++ b/xen/include/asm-x86/mach-summit/mach_apic.h	Mon Mar 20 17:01:16 2006 +0100
    17.3 @@ -68,11 +68,6 @@ static inline void init_apic_ldr(void)
    17.4  	apic_write_around(APIC_LDR, val);
    17.5  }
    17.6  
    17.7 -static inline int multi_timer_check(int apic, int irq)
    17.8 -{
    17.9 -	return 0;
   17.10 -}
   17.11 -
   17.12  static inline int apic_id_registered(void)
   17.13  {
   17.14  	return 1;
   17.15 @@ -116,21 +111,6 @@ static inline physid_mask_t apicid_to_cp
   17.16  	return physid_mask_of_physid(0);
   17.17  }
   17.18  
   17.19 -static inline int mpc_apic_id(struct mpc_config_processor *m, 
   17.20 -			struct mpc_config_translation *translation_record)
   17.21 -{
   17.22 -	printk("Processor #%d %d:%d APIC version %d\n",
   17.23 -			m->mpc_apicid,
   17.24 -			(m->mpc_cpufeature & CPU_FAMILY_MASK) >> 8,
   17.25 -			(m->mpc_cpufeature & CPU_MODEL_MASK) >> 4,
   17.26 -			m->mpc_apicver);
   17.27 -	return (m->mpc_apicid);
   17.28 -}
   17.29 -
   17.30 -static inline void setup_portio_remap(void)
   17.31 -{
   17.32 -}
   17.33 -
   17.34  static inline int check_phys_apicid_present(int boot_cpu_physical_apicid)
   17.35  {
   17.36  	return 1;
    18.1 --- a/xen/include/asm-x86/mach-summit/mach_apicdef.h	Mon Mar 20 12:01:32 2006 +0100
    18.2 +++ b/xen/include/asm-x86/mach-summit/mach_apicdef.h	Mon Mar 20 17:01:16 2006 +0100
    18.3 @@ -1,8 +1,6 @@
    18.4  #ifndef __ASM_MACH_APICDEF_H
    18.5  #define __ASM_MACH_APICDEF_H
    18.6  
    18.7 -#define		APIC_ID_MASK		(0xFF<<24)
    18.8 -
    18.9  static inline unsigned get_apic_id(unsigned long x) 
   18.10  { 
   18.11  	return (((x)>>24)&0xFF);
    19.1 --- a/xen/include/asm-x86/mach-summit/mach_mpparse.h	Mon Mar 20 12:01:32 2006 +0100
    19.2 +++ b/xen/include/asm-x86/mach-summit/mach_mpparse.h	Mon Mar 20 17:01:16 2006 +0100
    19.3 @@ -11,17 +11,6 @@ extern void setup_summit(void);
    19.4  #define setup_summit()	{}
    19.5  #endif
    19.6  
    19.7 -static inline void mpc_oem_bus_info(struct mpc_config_bus *m, char *name, 
    19.8 -				struct mpc_config_translation *translation)
    19.9 -{
   19.10 -	Dprintk("Bus #%d is %s\n", m->mpc_busid, name);
   19.11 -}
   19.12 -
   19.13 -static inline void mpc_oem_pci_bus(struct mpc_config_bus *m, 
   19.14 -				struct mpc_config_translation *translation)
   19.15 -{
   19.16 -}
   19.17 -
   19.18  extern int usb_early_handoff;
   19.19  static inline int mps_oem_check(struct mp_config_table *mpc, char *oem, 
   19.20  		char *productid)