aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-07-26 20:56:45 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-07-26 20:56:45 -0400
commite663107fa1edda4d8a0d5b8ce704d71f8e27de43 (patch)
tree2ca367a9cdeb97ce613e792256b64831189af7b3 /arch/x86/mm
parent6453dbdda30428a3c56568c96fe70ea3612f07e2 (diff)
parent54d0b14ad7cc4ff3c710f092a93638f359c1b14b (diff)
Merge tag 'acpi-4.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI updates from Rafael Wysocki: "The new feaures here are the support for ACPI overlays (allowing ACPI tables to be loaded at any time from EFI variables or via configfs) and the LPI (Low-Power Idle) support. Also notable is the ACPI-based NUMA support for ARM64. Apart from that we have two new drivers, for the DPTF (Dynamic Power and Thermal Framework) power participant device and for the Intel Broxton WhiskeyCove PMIC, some more PMIC-related changes, support for the Boot Error Record Table (BERT) in APEI and support for platform-initiated graceful shutdown. Plus two new pieces of documentation and usual assorted fixes and cleanups in quite a few places. Specifics: - Support for ACPI SSDT overlays allowing Secondary System Description Tables (SSDTs) to be loaded at any time from EFI variables or via configfs (Octavian Purdila, Mika Westerberg). - Support for the ACPI LPI (Low-Power Idle) feature introduced in ACPI 6.0 and allowing processor idle states to be represented in ACPI tables in a hierarchical way (with the help of Processor Container objects) and support for ACPI idle states management on ARM64, based on LPI (Sudeep Holla). - General improvements of ACPI support for NUMA and ARM64 support for ACPI-based NUMA (Hanjun Guo, David Daney, Robert Richter). - General improvements of the ACPI table upgrade mechanism and ARM64 support for that feature (Aleksey Makarov, Jon Masters). - Support for the Boot Error Record Table (BERT) in APEI and improvements of kernel messages printed by the error injection code (Huang Ying, Borislav Petkov). - New driver for the Intel Broxton WhiskeyCove PMIC operation region and support for the REGS operation region on Broxton, PMIC code cleanups (Bin Gao, Felipe Balbi, Paul Gortmaker). - New driver for the power participant device which is part of the Dynamic Power and Thermal Framework (DPTF) and DPTF-related code reorganization (Srinivas Pandruvada). - Support for the platform-initiated graceful shutdown feature introduced in ACPI 6.1 (Prashanth Prakash). - ACPI button driver update related to lid input events generated automatically on initialization and system resume that have been problematic for some time (Lv Zheng). - ACPI EC driver cleanups (Lv Zheng). - Documentation of the ACPICA release automation process and the in-kernel ACPI AML debugger (Lv Zheng). - New blacklist entry and two fixes for the ACPI backlight driver (Alex Hung, Arvind Yadav, Ralf Gerbig). - Cleanups of the ACPI pci_slot driver (Joe Perches, Paul Gortmaker). - ACPI CPPC code changes to make it more robust against possible defects in ACPI tables and new symbol definitions for PCC (Hoan Tran). - System reboot code modification to execute the ACPI _PTS (Prepare To Sleep) method in addition to _TTS (Ocean He). - ACPICA-related change to carry out lock ordering checks in ACPICA if ACPICA debug is enabled in the kernel (Lv Zheng). - Assorted minor fixes and cleanups (Andy Shevchenko, Baoquan He, Bhaktipriya Shridhar, Paul Gortmaker, Rafael Wysocki)" * tag 'acpi-4.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (71 commits) ACPI: enable ACPI_PROCESSOR_IDLE on ARM64 arm64: add support for ACPI Low Power Idle(LPI) drivers: firmware: psci: initialise idle states using ACPI LPI cpuidle: introduce CPU_PM_CPU_IDLE_ENTER macro for ARM{32, 64} arm64: cpuidle: drop __init section marker to arm_cpuidle_init ACPI / processor_idle: Add support for Low Power Idle(LPI) states ACPI / processor_idle: introduce ACPI_PROCESSOR_CSTATE ACPI / DPTF: move int340x_thermal.c to the DPTF folder ACPI / DPTF: Add DPTF power participant driver ACPI / lpat: make it explicitly non-modular ACPI / dock: make dock explicitly non-modular ACPI / PCI: make pci_slot explicitly non-modular ACPI / PMIC: remove modular references from non-modular code ACPICA: Linux: Enable ACPI_MUTEX_DEBUG for Linux kernel ACPI: Rename configfs.c to acpi_configfs.c to prevent link error ACPI / debugger: Add AML debugger documentation ACPI: Add documentation describing ACPICA release automation ACPI: add support for loading SSDTs via configfs ACPI: add support for configfs efi / ACPI: load SSTDs from EFI variables ...
Diffstat (limited to 'arch/x86/mm')
-rw-r--r--arch/x86/mm/numa.c2
-rw-r--r--arch/x86/mm/srat.c116
2 files changed, 3 insertions, 115 deletions
diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c
index 9c086c57105c..968ac028c34e 100644
--- a/arch/x86/mm/numa.c
+++ b/arch/x86/mm/numa.c
@@ -1,4 +1,5 @@
1/* Common code for 32 and 64-bit NUMA */ 1/* Common code for 32 and 64-bit NUMA */
2#include <linux/acpi.h>
2#include <linux/kernel.h> 3#include <linux/kernel.h>
3#include <linux/mm.h> 4#include <linux/mm.h>
4#include <linux/string.h> 5#include <linux/string.h>
@@ -15,7 +16,6 @@
15#include <asm/e820.h> 16#include <asm/e820.h>
16#include <asm/proto.h> 17#include <asm/proto.h>
17#include <asm/dma.h> 18#include <asm/dma.h>
18#include <asm/acpi.h>
19#include <asm/amd_nb.h> 19#include <asm/amd_nb.h>
20 20
21#include "numa_internal.h" 21#include "numa_internal.h"
diff --git a/arch/x86/mm/srat.c b/arch/x86/mm/srat.c
index b5f821881465..b1ecff460a46 100644
--- a/arch/x86/mm/srat.c
+++ b/arch/x86/mm/srat.c
@@ -15,8 +15,6 @@
15#include <linux/bitmap.h> 15#include <linux/bitmap.h>
16#include <linux/module.h> 16#include <linux/module.h>
17#include <linux/topology.h> 17#include <linux/topology.h>
18#include <linux/bootmem.h>
19#include <linux/memblock.h>
20#include <linux/mm.h> 18#include <linux/mm.h>
21#include <asm/proto.h> 19#include <asm/proto.h>
22#include <asm/numa.h> 20#include <asm/numa.h>
@@ -24,51 +22,6 @@
24#include <asm/apic.h> 22#include <asm/apic.h>
25#include <asm/uv/uv.h> 23#include <asm/uv/uv.h>
26 24
27int acpi_numa __initdata;
28
29static __init int setup_node(int pxm)
30{
31 return acpi_map_pxm_to_node(pxm);
32}
33
34static __init void bad_srat(void)
35{
36 printk(KERN_ERR "SRAT: SRAT not used.\n");
37 acpi_numa = -1;
38}
39
40static __init inline int srat_disabled(void)
41{
42 return acpi_numa < 0;
43}
44
45/*
46 * Callback for SLIT parsing. pxm_to_node() returns NUMA_NO_NODE for
47 * I/O localities since SRAT does not list them. I/O localities are
48 * not supported at this point.
49 */
50void __init acpi_numa_slit_init(struct acpi_table_slit *slit)
51{
52 int i, j;
53
54 for (i = 0; i < slit->locality_count; i++) {
55 const int from_node = pxm_to_node(i);
56
57 if (from_node == NUMA_NO_NODE)
58 continue;
59
60 for (j = 0; j < slit->locality_count; j++) {
61 const int to_node = pxm_to_node(j);
62
63 if (to_node == NUMA_NO_NODE)
64 continue;
65
66 numa_set_distance(from_node, to_node,
67 slit->entry[slit->locality_count * i + j]);
68 }
69 }
70}
71
72/* Callback for Proximity Domain -> x2APIC mapping */ 25/* Callback for Proximity Domain -> x2APIC mapping */
73void __init 26void __init
74acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa) 27acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
@@ -91,7 +44,7 @@ acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
91 pxm, apic_id); 44 pxm, apic_id);
92 return; 45 return;
93 } 46 }
94 node = setup_node(pxm); 47 node = acpi_map_pxm_to_node(pxm);
95 if (node < 0) { 48 if (node < 0) {
96 printk(KERN_ERR "SRAT: Too many proximity domains %x\n", pxm); 49 printk(KERN_ERR "SRAT: Too many proximity domains %x\n", pxm);
97 bad_srat(); 50 bad_srat();
@@ -104,7 +57,6 @@ acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
104 } 57 }
105 set_apicid_to_node(apic_id, node); 58 set_apicid_to_node(apic_id, node);
106 node_set(node, numa_nodes_parsed); 59 node_set(node, numa_nodes_parsed);
107 acpi_numa = 1;
108 printk(KERN_INFO "SRAT: PXM %u -> APIC 0x%04x -> Node %u\n", 60 printk(KERN_INFO "SRAT: PXM %u -> APIC 0x%04x -> Node %u\n",
109 pxm, apic_id, node); 61 pxm, apic_id, node);
110} 62}
@@ -127,7 +79,7 @@ acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa)
127 pxm = pa->proximity_domain_lo; 79 pxm = pa->proximity_domain_lo;
128 if (acpi_srat_revision >= 2) 80 if (acpi_srat_revision >= 2)
129 pxm |= *((unsigned int*)pa->proximity_domain_hi) << 8; 81 pxm |= *((unsigned int*)pa->proximity_domain_hi) << 8;
130 node = setup_node(pxm); 82 node = acpi_map_pxm_to_node(pxm);
131 if (node < 0) { 83 if (node < 0) {
132 printk(KERN_ERR "SRAT: Too many proximity domains %x\n", pxm); 84 printk(KERN_ERR "SRAT: Too many proximity domains %x\n", pxm);
133 bad_srat(); 85 bad_srat();
@@ -146,74 +98,10 @@ acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa)
146 98
147 set_apicid_to_node(apic_id, node); 99 set_apicid_to_node(apic_id, node);
148 node_set(node, numa_nodes_parsed); 100 node_set(node, numa_nodes_parsed);
149 acpi_numa = 1;
150 printk(KERN_INFO "SRAT: PXM %u -> APIC 0x%02x -> Node %u\n", 101 printk(KERN_INFO "SRAT: PXM %u -> APIC 0x%02x -> Node %u\n",
151 pxm, apic_id, node); 102 pxm, apic_id, node);
152} 103}
153 104
154#ifdef CONFIG_MEMORY_HOTPLUG
155static inline int save_add_info(void) {return 1;}
156#else
157static inline int save_add_info(void) {return 0;}
158#endif
159
160/* Callback for parsing of the Proximity Domain <-> Memory Area mappings */
161int __init
162acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
163{
164 u64 start, end;
165 u32 hotpluggable;
166 int node, pxm;
167
168 if (srat_disabled())
169 goto out_err;
170 if (ma->header.length != sizeof(struct acpi_srat_mem_affinity))
171 goto out_err_bad_srat;
172 if ((ma->flags & ACPI_SRAT_MEM_ENABLED) == 0)
173 goto out_err;
174 hotpluggable = ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE;
175 if (hotpluggable && !save_add_info())
176 goto out_err;
177
178 start = ma->base_address;
179 end = start + ma->length;
180 pxm = ma->proximity_domain;
181 if (acpi_srat_revision <= 1)
182 pxm &= 0xff;
183
184 node = setup_node(pxm);
185 if (node < 0) {
186 printk(KERN_ERR "SRAT: Too many proximity domains.\n");
187 goto out_err_bad_srat;
188 }
189
190 if (numa_add_memblk(node, start, end) < 0)
191 goto out_err_bad_srat;
192
193 node_set(node, numa_nodes_parsed);
194
195 pr_info("SRAT: Node %u PXM %u [mem %#010Lx-%#010Lx]%s%s\n",
196 node, pxm,
197 (unsigned long long) start, (unsigned long long) end - 1,
198 hotpluggable ? " hotplug" : "",
199 ma->flags & ACPI_SRAT_MEM_NON_VOLATILE ? " non-volatile" : "");
200
201 /* Mark hotplug range in memblock. */
202 if (hotpluggable && memblock_mark_hotplug(start, ma->length))
203 pr_warn("SRAT: Failed to mark hotplug range [mem %#010Lx-%#010Lx] in memblock\n",
204 (unsigned long long)start, (unsigned long long)end - 1);
205
206 max_possible_pfn = max(max_possible_pfn, PFN_UP(end - 1));
207
208 return 0;
209out_err_bad_srat:
210 bad_srat();
211out_err:
212 return -1;
213}
214
215void __init acpi_numa_arch_fixup(void) {}
216
217int __init x86_acpi_numa_init(void) 105int __init x86_acpi_numa_init(void)
218{ 106{
219 int ret; 107 int ret;