4a5ee0f11d
5537a4d8-libxl-use-DEBUG-log-level-instead-of-INFO.patch - Upstream patches from Jan 55dc78e9-x86-amd_ucode-skip-updates-for-final-levels.patch 55dc7937-x86-IO-APIC-don-t-create-pIRQ-mapping-from-masked-RTE.patch 55df2f76-IOMMU-skip-domains-without-page-tables-when-dumping.patch 55e43fd8-x86-NUMA-fix-setup_node.patch 55e43ff8-x86-NUMA-don-t-account-hotplug-regions.patch 55e593f1-x86-NUMA-make-init_node_heap-respect-Xen-heap-limit.patch 54c2553c-grant-table-use-uint16_t-consistently-for-offset-and-length.patch 54ca33bc-grant-table-refactor-grant-copy-to-reduce-duplicate-code.patch 54ca340e-grant-table-defer-releasing-pages-acquired-in-a-grant-copy.patch - bsc#944463 - VUL-0: CVE-2015-5239: qemu-kvm: Integer overflow in vnc_client_read() and protocol_client_msg() CVE-2015-5239-qemuu-limit-client_cut_text-msg-payload-size.patch CVE-2015-5239-qemut-limit-client_cut_text-msg-payload-size.patch - bsc#944697 - VUL-1: CVE-2015-6815: qemu: net: e1000: infinite loop issue CVE-2015-6815-qemuu-e1000-fix-infinite-loop.patch CVE-2015-6815-qemut-e1000-fix-infinite-loop.patch OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=375
96 lines
2.7 KiB
Diff
96 lines
2.7 KiB
Diff
# Commit 8f945d36d9bddd5b589ba23c7322b30d623dd084
|
|
# Date 2015-08-31 13:51:52 +0200
|
|
# Author Jan Beulich <jbeulich@suse.com>
|
|
# Committer Jan Beulich <jbeulich@suse.com>
|
|
x86/NUMA: fix setup_node()
|
|
|
|
The function referenced an __initdata object (nodes_found). Since this
|
|
being a node mask was more complicated than needed, the variable gets
|
|
replaced by a simple counter. Check at once that the count of nodes
|
|
doesn't go beyond MAX_NUMNODES.
|
|
|
|
Also consolidate three printk()s related to the function's use into just
|
|
one.
|
|
|
|
Finally (quite the opposite of the above issue) __init-annotate
|
|
nodes_cover_memory().
|
|
|
|
Signed-off-by: Jan Beulich <jbeulich@suse.com>
|
|
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
|
|
|
|
--- a/xen/arch/x86/srat.c
|
|
+++ b/xen/arch/x86/srat.c
|
|
@@ -25,7 +25,6 @@ static struct acpi_table_slit *__read_mo
|
|
|
|
static nodemask_t memory_nodes_parsed __initdata;
|
|
static nodemask_t processor_nodes_parsed __initdata;
|
|
-static nodemask_t nodes_found __initdata;
|
|
static struct node nodes[MAX_NUMNODES] __initdata;
|
|
static u8 __read_mostly pxm2node[256] = { [0 ... 255] = NUMA_NO_NODE };
|
|
|
|
@@ -45,17 +44,25 @@ int pxm_to_node(int pxm)
|
|
return (signed char)pxm2node[pxm];
|
|
}
|
|
|
|
-__devinit int setup_node(int pxm)
|
|
+int setup_node(int pxm)
|
|
{
|
|
unsigned node = pxm2node[pxm];
|
|
- if (node == 0xff) {
|
|
- if (nodes_weight(nodes_found) >= MAX_NUMNODES)
|
|
+
|
|
+ if (node == NUMA_NO_NODE) {
|
|
+ static bool_t warned;
|
|
+ static unsigned nodes_found;
|
|
+
|
|
+ node = nodes_found++;
|
|
+ if (node >= MAX_NUMNODES) {
|
|
+ printk(KERN_WARNING
|
|
+ "SRAT: Too many proximity domains (%#x)\n",
|
|
+ pxm);
|
|
+ warned = 1;
|
|
return -1;
|
|
- node = first_unset_node(nodes_found);
|
|
- node_set(node, nodes_found);
|
|
+ }
|
|
pxm2node[pxm] = node;
|
|
}
|
|
- return pxm2node[pxm];
|
|
+ return node;
|
|
}
|
|
|
|
int valid_numa_range(u64 start, u64 end, int node)
|
|
@@ -176,7 +183,6 @@ acpi_numa_x2apic_affinity_init(struct ac
|
|
pxm = pa->proximity_domain;
|
|
node = setup_node(pxm);
|
|
if (node < 0) {
|
|
- printk(KERN_ERR "SRAT: Too many proximity domains %x\n", pxm);
|
|
bad_srat();
|
|
return;
|
|
}
|
|
@@ -209,7 +215,6 @@ acpi_numa_processor_affinity_init(struct
|
|
}
|
|
node = setup_node(pxm);
|
|
if (node < 0) {
|
|
- printk(KERN_ERR "SRAT: Too many proximity domains %x\n", pxm);
|
|
bad_srat();
|
|
return;
|
|
}
|
|
@@ -253,7 +258,6 @@ acpi_numa_memory_affinity_init(struct ac
|
|
pxm &= 0xff;
|
|
node = setup_node(pxm);
|
|
if (node < 0) {
|
|
- printk(KERN_ERR "SRAT: Too many proximity domains.\n");
|
|
bad_srat();
|
|
return;
|
|
}
|
|
@@ -295,7 +299,7 @@ acpi_numa_memory_affinity_init(struct ac
|
|
|
|
/* Sanity check to catch more bad SRATs (they are amazingly common).
|
|
Make sure the PXMs cover all memory. */
|
|
-static int nodes_cover_memory(void)
|
|
+static int __init nodes_cover_memory(void)
|
|
{
|
|
int i;
|
|
|