aboutsummaryrefslogtreecommitdiffstats
path: root/xen/drivers/acpi
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2010-07-16 13:52:18 +0100
committerKeir Fraser <keir.fraser@citrix.com>2010-07-16 13:52:18 +0100
commitb3625d1e2c5815e6d65a47197bebeae2061153ce (patch)
tree0b81045610df333d54d1e17b5d081ca08560b362 /xen/drivers/acpi
parent1652d36bbe2108109159bf62ec11be2736351c02 (diff)
downloadxen-b3625d1e2c5815e6d65a47197bebeae2061153ce.tar.gz
xen-b3625d1e2c5815e6d65a47197bebeae2061153ce.tar.bz2
xen-b3625d1e2c5815e6d65a47197bebeae2061153ce.zip
ACPI: add support for x2APIC ACPI extensions
All logical processors with APIC ID values of 255 and greater will have their APIC reported through Processor X2APIC structure (type-9 entry type) and all logical processors with APIC ID less than 255 will have their APIC reported through legacy Processor Local APIC (type-0 entry type) only. This is the same case even for NMI structure reporting. The Processor X2APIC Affinity structure provides the association between the X2APIC ID of a logical processor and the proximity domain to which the logical processor belongs. This patch adds 2 new subtables to MADT and one new subtable to SRAT. This patch also changes x86_acpiid_to_apicid from u8 to u32 for x2APIC ID, and changes mp_register_lapic to accept 32-bit id. But there are still some 8-bit apic id hardcode and assumptions in Xen code, it needs to be fixed in future. Signed-off-by: Weidong Han <weidong.han@intel.com>
Diffstat (limited to 'xen/drivers/acpi')
-rw-r--r--xen/drivers/acpi/numa.c44
-rw-r--r--xen/drivers/acpi/tables.c30
2 files changed, 74 insertions, 0 deletions
diff --git a/xen/drivers/acpi/numa.c b/xen/drivers/acpi/numa.c
index 498a039401..2da987914c 100644
--- a/xen/drivers/acpi/numa.c
+++ b/xen/drivers/acpi/numa.c
@@ -90,6 +90,21 @@ void __init acpi_table_print_srat_entry(struct acpi_subtable_header * header)
#endif /* ACPI_DEBUG_OUTPUT */
break;
+ case ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY:
+#ifdef ACPI_DEBUG_OUTPUT
+ {
+ struct acpi_srat_x2apic_cpu_affinity *p =
+ (struct acpi_srat_x2apic_cpu_affinity *)header;
+ ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+ "SRAT Processor (x2apicid[0x%08x]) in"
+ " proximity domain %d %s\n",
+ p->apic_id,
+ p->proximity_domain,
+ (p->flags & ACPI_SRAT_CPU_ENABLED) ?
+ "enabled" : "disabled"));
+ }
+#endif /* ACPI_DEBUG_OUTPUT */
+ break;
default:
printk(KERN_WARNING PREFIX
"Found unsupported SRAT entry (type = 0x%x)\n",
@@ -105,6 +120,33 @@ static int __init acpi_parse_slit(struct acpi_table_header *table)
return 0;
}
+void __init __attribute__ ((weak))
+acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
+{
+ printk(KERN_WARNING PREFIX
+ "Found unsupported x2apic [0x%08x] SRAT entry\n", pa->apic_id);
+ return;
+}
+
+
+static int __init
+acpi_parse_x2apic_affinity(struct acpi_subtable_header *header,
+ const unsigned long end)
+{
+ struct acpi_srat_x2apic_cpu_affinity *processor_affinity;
+
+ processor_affinity = (struct acpi_srat_x2apic_cpu_affinity *)header;
+ if (!processor_affinity)
+ return -EINVAL;
+
+ acpi_table_print_srat_entry(header);
+
+ /* let architecture-dependent part to do it */
+ acpi_numa_x2apic_affinity_init(processor_affinity);
+
+ return 0;
+}
+
static int __init
acpi_parse_processor_affinity(struct acpi_subtable_header * header,
const unsigned long end)
@@ -164,6 +206,8 @@ int __init acpi_numa_init(void)
{
/* SRAT: Static Resource Affinity Table */
if (!acpi_table_parse(ACPI_SIG_SRAT, acpi_parse_srat)) {
+ acpi_table_parse_srat(ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY,
+ acpi_parse_x2apic_affinity, NR_CPUS);
acpi_table_parse_srat(ACPI_SRAT_PROCESSOR_AFFINITY,
acpi_parse_processor_affinity,
NR_CPUS);
diff --git a/xen/drivers/acpi/tables.c b/xen/drivers/acpi/tables.c
index 252bf98873..e4f402e7c1 100644
--- a/xen/drivers/acpi/tables.c
+++ b/xen/drivers/acpi/tables.c
@@ -63,6 +63,18 @@ void __init acpi_table_print_madt_entry(struct acpi_subtable_header *header)
}
break;
+ case ACPI_MADT_TYPE_LOCAL_X2APIC:
+ {
+ struct acpi_madt_local_x2apic *p =
+ (struct acpi_madt_local_x2apic *)header;
+ printk(KERN_INFO PREFIX
+ "X2APIC (apic_id[0x%02x] uid[0x%02x] %s)\n",
+ p->local_apic_id, p->uid,
+ (p->lapic_flags & ACPI_MADT_ENABLED) ?
+ "enabled" : "disabled");
+ }
+ break;
+
case ACPI_MADT_TYPE_IO_APIC:
{
struct acpi_madt_io_apic *p =
@@ -117,6 +129,24 @@ void __init acpi_table_print_madt_entry(struct acpi_subtable_header *header)
}
break;
+ case ACPI_MADT_TYPE_LOCAL_X2APIC_NMI:
+ {
+ u16 polarity, trigger;
+ struct acpi_madt_local_x2apic_nmi *p =
+ (struct acpi_madt_local_x2apic_nmi *)header;
+
+ polarity = p->inti_flags & ACPI_MADT_POLARITY_MASK;
+ trigger = (p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2;
+
+ printk(KERN_INFO PREFIX
+ "X2APIC_NMI (uid[0x%02x] %s %s lint[0x%x])\n",
+ p->uid,
+ mps_inti_flags_polarity[polarity],
+ mps_inti_flags_trigger[trigger],
+ p->lint);
+ }
+ break;
+
case ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE:
{
struct acpi_madt_local_apic_override *p =