# This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/03/31 22:51:10-05:00 len.brown@intel.com # [ACPI] Evaluate CPEI Processor Override flag # # ACPI 3.0 added a Correctable Platform Error Interrupt (CPEI) # Processor Overide flag to MADT.Platform_Interrupt_Source. # Record the processor that was provided as hint from ACPI. # # Signed-off-by: Ashok Raj # Signed-off-by: Len Brown # # include/linux/acpi.h # 2005/03/21 17:51:34-05:00 len.brown@intel.com +4 -1 # CPEI Processor Override support # # include/asm-ia64/acpi.h # 2005/03/21 17:51:34-05:00 len.brown@intel.com +9 -0 # CPEI Processor Override support # # arch/ia64/kernel/topology.c # 2005/03/21 17:51:34-05:00 len.brown@intel.com +7 -0 # CPEI Processor Override support # # arch/ia64/kernel/mca.c # 2005/03/21 18:22:57-05:00 len.brown@intel.com +1 -1 # CPEI Processor override support # # arch/ia64/kernel/acpi.c # 2005/03/22 16:21:07-05:00 len.brown@intel.com +54 -0 # CPEI Processor Override support # Index: linux-2.6.13/arch/ia64/kernel/acpi.c =================================================================== --- linux-2.6.13.orig/arch/ia64/kernel/acpi.c 2005-07-10 01:01:35.000000000 -0400 +++ linux-2.6.13/arch/ia64/kernel/acpi.c 2005-07-10 01:05:18.000000000 -0400 @@ -11,6 +11,7 @@ * Copyright (C) 2001 Jenna Hall * Copyright (C) 2001 Takayoshi Kochi * Copyright (C) 2002 Erich Focht + * Copyright (C) 2004 Ashok Raj * * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * @@ -67,6 +68,11 @@ unsigned char acpi_kbd_controller_present = 1; unsigned char acpi_legacy_devices; +static unsigned int __initdata acpi_madt_rev; + +unsigned int acpi_cpei_override; +unsigned int acpi_cpei_phys_cpuid; + #define MAX_SAPICS 256 u16 ia64_acpiid_to_sapicid[MAX_SAPICS] = { [0 ... MAX_SAPICS - 1] = -1 }; @@ -265,10 +271,56 @@ (plintsrc->flags.trigger == 1) ? IOSAPIC_EDGE : IOSAPIC_LEVEL); platform_intr_list[plintsrc->type] = vector; + if (acpi_madt_rev > 1) { + acpi_cpei_override = plintsrc->plint_flags.cpei_override_flag; + } + + /* + * Save the physical id, so we can check when its being removed + */ + acpi_cpei_phys_cpuid = ((plintsrc->id << 8) | (plintsrc->eid)) & 0xffff; + return 0; } +unsigned int can_cpei_retarget(void) +{ + extern int cpe_vector; + + /* + * Only if CPEI is supported and the override flag + * is present, otherwise return that its re-targettable + * if we are in polling mode. + */ + if (cpe_vector > 0 && !acpi_cpei_override) + return 0; + else + return 1; +} + +unsigned int is_cpu_cpei_target(unsigned int cpu) +{ + unsigned int logical_id; + + logical_id = cpu_logical_id(acpi_cpei_phys_cpuid); + + if (logical_id == cpu) + return 1; + else + return 0; +} + +void set_cpei_target_cpu(unsigned int cpu) +{ + acpi_cpei_phys_cpuid = cpu_physical_id(cpu); +} + +unsigned int get_cpei_target_cpu(void) +{ + return acpi_cpei_phys_cpuid; +} + static int __init acpi_parse_int_src_ovr ( acpi_table_entry_header *header, const unsigned long end) @@ -326,6 +378,8 @@ acpi_madt = (struct acpi_table_madt *) __va(phys_addr); + acpi_madt_rev = acpi_madt->header.revision; + /* remember the value for reference after free_initmem() */ #ifdef CONFIG_ITANIUM has_8259 = 1; /* Firmware on old Itanium systems is broken */ Index: linux-2.6.13/arch/ia64/kernel/mca.c =================================================================== --- linux-2.6.13.orig/arch/ia64/kernel/mca.c 2005-07-10 01:01:35.000000000 -0400 +++ linux-2.6.13/arch/ia64/kernel/mca.c 2005-07-10 01:05:18.000000000 -0400 @@ -271,7 +271,7 @@ #ifdef CONFIG_ACPI -static int cpe_vector = -1; +int cpe_vector = -1; static irqreturn_t ia64_mca_cpe_int_handler (int cpe_irq, void *arg, struct pt_regs *ptregs) Index: linux-2.6.13/arch/ia64/kernel/topology.c =================================================================== --- linux-2.6.13.orig/arch/ia64/kernel/topology.c 2005-07-10 01:01:48.000000000 -0400 +++ linux-2.6.13/arch/ia64/kernel/topology.c 2005-07-10 01:05:18.000000000 -0400 @@ -36,6 +36,13 @@ parent = &sysfs_nodes[cpu_to_node(num)]; #endif /* CONFIG_NUMA */ + /* + * If CPEI cannot be re-targetted, and this is + * CPEI target, then dont create the control file + */ + if (!can_cpei_retarget() && is_cpu_cpei_target(num)) + sysfs_cpus[num].cpu.no_control = 1; + return register_cpu(&sysfs_cpus[num].cpu, num, parent); } Index: linux-2.6.13/include/asm-ia64/acpi.h =================================================================== --- linux-2.6.13.orig/include/asm-ia64/acpi.h 2005-07-10 01:01:40.000000000 -0400 +++ linux-2.6.13/include/asm-ia64/acpi.h 2005-07-10 01:05:18.000000000 -0400 @@ -98,6 +98,15 @@ int acpi_request_vector (u32 int_type); int acpi_gsi_to_irq (u32 gsi, unsigned int *irq); +/* + * Record the cpei override flag and current logical cpu. This is + * useful for CPU removal. + */ +extern unsigned int can_cpei_retarget(void); +extern unsigned int is_cpu_cpei_target(unsigned int cpu); +extern void set_cpei_target_cpu(unsigned int cpu); +extern unsigned int get_cpei_target_cpu(void); + #ifdef CONFIG_ACPI_NUMA /* Proximity bitmap length; _PXM is at most 255 (8 bit)*/ #define MAX_PXM_DOMAINS (256) Index: linux-2.6.13/include/linux/acpi.h =================================================================== --- linux-2.6.13.orig/include/linux/acpi.h 2005-07-10 01:01:47.000000000 -0400 +++ linux-2.6.13/include/linux/acpi.h 2005-07-10 01:05:18.000000000 -0400 @@ -206,7 +206,10 @@ u8 eid; u8 iosapic_vector; u32 global_irq; - u32 reserved; + struct { + u32 cpei_override_flag:1; + u32 reserved:31; + } plint_flags; } __attribute__ ((packed)); enum acpi_interrupt_id {