]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.4.83/xen-boot-disable-bios-smp-mp-table-search.patch
5.1-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.4.83 / xen-boot-disable-bios-smp-mp-table-search.patch
CommitLineData
2720559d
GKH
1From 0a193b148d6d0ed05ea82f466b6d7eac50b87ac5 Mon Sep 17 00:00:00 2001
2From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
3Date: Wed, 19 Sep 2012 08:30:55 -0400
4Subject: xen/boot: Disable BIOS SMP MP table search.
5
6From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
7
8commit bd49940a35ec7d488ae63bd625639893b3385b97 upstream.
9
10As the initial domain we are able to search/map certain regions
11of memory to harvest configuration data. For all low-level we
12use ACPI tables - for interrupts we use exclusively ACPI _PRT
13(so DSDT) and MADT for INT_SRC_OVR.
14
15The SMP MP table is not used at all. As a matter of fact we do
16not even support machines that only have SMP MP but no ACPI tables.
17
18Lets follow how Moorestown does it and just disable searching
19for BIOS SMP tables.
20
21This also fixes an issue on HP Proliant BL680c G5 and DL380 G6:
22
239f->100 for 1:1 PTE
24Freeing 9f-100 pfn range: 97 pages freed
251-1 mapping on 9f->100
26.. snip..
27e820: BIOS-provided physical RAM map:
28Xen: [mem 0x0000000000000000-0x000000000009efff] usable
29Xen: [mem 0x000000000009f400-0x00000000000fffff] reserved
30Xen: [mem 0x0000000000100000-0x00000000cfd1dfff] usable
31.. snip..
32Scan for SMP in [mem 0x00000000-0x000003ff]
33Scan for SMP in [mem 0x0009fc00-0x0009ffff]
34Scan for SMP in [mem 0x000f0000-0x000fffff]
35found SMP MP-table at [mem 0x000f4fa0-0x000f4faf] mapped at [ffff8800000f4fa0]
36(XEN) mm.c:908:d0 Error getting mfn 100 (pfn 5555555555555555) from L1 entry 0000000000100461 for l1e_owner=0, pg_owner=0
37(XEN) mm.c:4995:d0 ptwr_emulate: could not get_page_from_l1e()
38BUG: unable to handle kernel NULL pointer dereference at (null)
39IP: [<ffffffff81ac07e2>] xen_set_pte_init+0x66/0x71
40. snip..
41Pid: 0, comm: swapper Not tainted 3.6.0-rc6upstream-00188-gb6fb969-dirty #2 HP ProLiant BL680c G5
42.. snip..
43Call Trace:
44 [<ffffffff81ad31c6>] __early_ioremap+0x18a/0x248
45 [<ffffffff81624731>] ? printk+0x48/0x4a
46 [<ffffffff81ad32ac>] early_ioremap+0x13/0x15
47 [<ffffffff81acc140>] get_mpc_size+0x2f/0x67
48 [<ffffffff81acc284>] smp_scan_config+0x10c/0x136
49 [<ffffffff81acc2e4>] default_find_smp_config+0x36/0x5a
50 [<ffffffff81ac3085>] setup_arch+0x5b3/0xb5b
51 [<ffffffff81624731>] ? printk+0x48/0x4a
52 [<ffffffff81abca7f>] start_kernel+0x90/0x390
53 [<ffffffff81abc356>] x86_64_start_reservations+0x131/0x136
54 [<ffffffff81abfa83>] xen_start_kernel+0x65f/0x661
55(XEN) Domain 0 crashed: 'noreboot' set - not rebooting.
56
57which is that ioremap would end up mapping 0xff using _PAGE_IOMAP
58(which is what early_ioremap sticks as a flag) - which meant
59we would get MFN 0xFF (pte ff461, which is OK), and then it would
60also map 0x100 (b/c ioremap tries to get page aligned request, and
61it was trying to map 0xf4fa0 + PAGE_SIZE - so it mapped the next page)
62as _PAGE_IOMAP. Since 0x100 is actually a RAM page, and the _PAGE_IOMAP
63bypasses the P2M lookup we would happily set the PTE to 1000461.
64Xen would deny the request since we do not have access to the
65Machine Frame Number (MFN) of 0x100. The P2M[0x100] is for example
660x80140.
67
68Fixes-Oracle-Bugzilla: https://bugzilla.oracle.com/bugzilla/show_bug.cgi?id=13665
69Acked-by: Jan Beulich <jbeulich@suse.com>
70Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
71[bwh: Backported to 3.2: adjust context]
72Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
73Cc: Yijing Wang <wangyijing@huawei.com>
74Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
75
76---
77 arch/x86/xen/enlighten.c | 4 ++++
78 1 file changed, 4 insertions(+)
79
80--- a/arch/x86/xen/enlighten.c
81+++ b/arch/x86/xen/enlighten.c
82@@ -1448,6 +1448,10 @@ asmlinkage void __init xen_start_kernel(
83
84 /* Make sure ACS will be enabled */
85 pci_request_acs();
86+
87+ /* Avoid searching for BIOS MP tables */
88+ x86_init.mpparse.find_smp_config = x86_init_noop;
89+ x86_init.mpparse.get_smp_config = x86_init_uint_noop;
90 }
91 #ifdef CONFIG_PCI
92 /* PCI BIOS service won't work from a PV guest. */