9e9b5acb9c
5604f239-x86-PV-properly-populate-descriptor-tables.patch 561bbc8b-VT-d-don-t-suppress-invalidation-address-write-when-0.patch 561d2046-VT-d-use-proper-error-codes-in-iommu_enable_x2apic_IR.patch 561d20a0-x86-hide-MWAITX-from-PV-domains.patch 561e3283-x86-NUMA-fix-SRAT-table-processor-entry-handling.patch - bsc#951845 - VUL-0: CVE-2015-7972: xen: x86: populate-on-demand balloon size inaccuracy can crash guests (XSA-153) xsa153-libxl.patch - bsc#950703 - VUL-1: CVE-2015-7969: xen: leak of main per-domain vcpu pointer array (DoS) (XSA-149) xsa149.patch - bsc#950705 - VUL-1: CVE-2015-7969: xen: x86: leak of per-domain profiling-related vcpu pointer array (DoS) (XSA-151) xsa151.patch - bsc#950706 - VUL-0: CVE-2015-7971: xen: x86: some pmu and profiling hypercalls log without rate limiting (XSA-152) xsa152.patch - Dropped 55dc7937-x86-IO-APIC-don-t-create-pIRQ-mapping-from-masked-RTE.patch 5604f239-x86-PV-properly-populate-descriptor-tables.patch - bsc#932267 - VUL-1: CVE-2015-4037: qemu,kvm,xen: insecure temporary file use in /net/slirp.c CVE-2015-4037-qemuu-smb-config-dir-name.patch CVE-2015-4037-qemut-smb-config-dir-name.patch - bsc#877642 - VUL-0: CVE-2014-0222: qemu: qcow1: validate L2 table size to avoid integer overflows OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=382
115 lines
3.8 KiB
Diff
115 lines
3.8 KiB
Diff
# Commit 83281fc9b31396e94c0bfb6550b75c165037a0ad
|
|
# Date 2015-10-14 12:46:27 +0200
|
|
# Author Jan Beulich <jbeulich@suse.com>
|
|
# Committer Jan Beulich <jbeulich@suse.com>
|
|
x86/NUMA: fix SRAT table processor entry parsing and consumption
|
|
|
|
- don't overrun apicid_to_node[] (possible in the x2APIC case)
|
|
- don't limit number of processor related SRAT entries we can consume
|
|
- make acpi_numa_{processor,x2apic}_affinity_init() as similar to one
|
|
another as possible
|
|
- print APIC IDs in hex (to ease matching with other log messages), at
|
|
once making legacy and x2APIC ones distinguishable (by width)
|
|
|
|
Signed-off-by: Jan Beulich <jbeulich@suse.com>
|
|
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
|
|
|
|
--- a/xen/arch/x86/numa.c
|
|
+++ b/xen/arch/x86/numa.c
|
|
@@ -347,7 +347,7 @@ void __init init_cpu_to_node(void)
|
|
u32 apicid = x86_cpu_to_apicid[i];
|
|
if ( apicid == BAD_APICID )
|
|
continue;
|
|
- node = apicid_to_node[apicid];
|
|
+ node = apicid < MAX_LOCAL_APIC ? apicid_to_node[apicid] : NUMA_NO_NODE;
|
|
if ( node == NUMA_NO_NODE || !node_online(node) )
|
|
node = 0;
|
|
numa_set_node(i, node);
|
|
--- a/xen/arch/x86/setup.c
|
|
+++ b/xen/arch/x86/setup.c
|
|
@@ -191,7 +191,7 @@ void __devinit srat_detect_node(int cpu)
|
|
unsigned node;
|
|
u32 apicid = x86_cpu_to_apicid[cpu];
|
|
|
|
- node = apicid_to_node[apicid];
|
|
+ node = apicid < MAX_LOCAL_APIC ? apicid_to_node[apicid] : NUMA_NO_NODE;
|
|
if ( node == NUMA_NO_NODE )
|
|
node = 0;
|
|
|
|
--- a/xen/arch/x86/smpboot.c
|
|
+++ b/xen/arch/x86/smpboot.c
|
|
@@ -885,7 +885,8 @@ int cpu_add(uint32_t apic_id, uint32_t a
|
|
cpu = node;
|
|
goto out;
|
|
}
|
|
- apicid_to_node[apic_id] = node;
|
|
+ if ( apic_id < MAX_LOCAL_APIC )
|
|
+ apicid_to_node[apic_id] = node;
|
|
}
|
|
|
|
/* Physically added CPUs do not have synchronised TSC. */
|
|
--- a/xen/arch/x86/srat.c
|
|
+++ b/xen/arch/x86/srat.c
|
|
@@ -170,7 +170,6 @@ void __init
|
|
acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
|
|
{
|
|
int pxm, node;
|
|
- int apic_id;
|
|
|
|
if (srat_disabled())
|
|
return;
|
|
@@ -178,8 +177,13 @@ acpi_numa_x2apic_affinity_init(struct ac
|
|
bad_srat();
|
|
return;
|
|
}
|
|
- if ((pa->flags & ACPI_SRAT_CPU_ENABLED) == 0)
|
|
+ if (!(pa->flags & ACPI_SRAT_CPU_ENABLED))
|
|
+ return;
|
|
+ if (pa->apic_id >= MAX_LOCAL_APIC) {
|
|
+ printk(KERN_INFO "SRAT: APIC %08x ignored\n", pa->apic_id);
|
|
return;
|
|
+ }
|
|
+
|
|
pxm = pa->proximity_domain;
|
|
node = setup_node(pxm);
|
|
if (node < 0) {
|
|
@@ -187,11 +191,11 @@ acpi_numa_x2apic_affinity_init(struct ac
|
|
return;
|
|
}
|
|
|
|
- apic_id = pa->apic_id;
|
|
- apicid_to_node[apic_id] = node;
|
|
+ apicid_to_node[pa->apic_id] = node;
|
|
+ node_set(node, processor_nodes_parsed);
|
|
acpi_numa = 1;
|
|
- printk(KERN_INFO "SRAT: PXM %u -> APIC %u -> Node %u\n",
|
|
- pxm, apic_id, node);
|
|
+ printk(KERN_INFO "SRAT: PXM %u -> APIC %08x -> Node %u\n",
|
|
+ pxm, pa->apic_id, node);
|
|
}
|
|
|
|
/* Callback for Proximity Domain -> LAPIC mapping */
|
|
@@ -221,7 +225,7 @@ acpi_numa_processor_affinity_init(struct
|
|
apicid_to_node[pa->apic_id] = node;
|
|
node_set(node, processor_nodes_parsed);
|
|
acpi_numa = 1;
|
|
- printk(KERN_INFO "SRAT: PXM %u -> APIC %u -> Node %u\n",
|
|
+ printk(KERN_INFO "SRAT: PXM %u -> APIC %02x -> Node %u\n",
|
|
pxm, pa->apic_id, node);
|
|
}
|
|
|
|
--- a/xen/drivers/acpi/numa.c
|
|
+++ b/xen/drivers/acpi/numa.c
|
|
@@ -199,9 +199,9 @@ 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_parse_x2apic_affinity, 0);
|
|
acpi_table_parse_srat(ACPI_SRAT_TYPE_CPU_AFFINITY,
|
|
- acpi_parse_processor_affinity, NR_CPUS);
|
|
+ acpi_parse_processor_affinity, 0);
|
|
acpi_table_parse_srat(ACPI_SRAT_TYPE_MEMORY_AFFINITY,
|
|
acpi_parse_memory_affinity,
|
|
NR_NODE_MEMBLKS);
|