aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/platform
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2016-09-01 12:33:46 -0400
committerThomas Gleixner <tglx@linutronix.de>2016-09-01 12:33:46 -0400
commit0cb7bf61b1e9f05027de58c80f9b46a714d24e35 (patch)
tree41fb55cf62d07b425122f9a8b96412c0d8eb99c5 /arch/x86/platform
parentaa877175e7a9982233ed8f10cb4bfddd78d82741 (diff)
parent3eab887a55424fc2c27553b7bfe32330df83f7b8 (diff)
Merge branch 'linus' into smp/hotplug
Apply upstream changes to avoid conflicts with pending patches.
Diffstat (limited to 'arch/x86/platform')
-rw-r--r--arch/x86/platform/efi/quirks.c21
-rw-r--r--arch/x86/platform/uv/bios_uv.c11
2 files changed, 28 insertions, 4 deletions
diff --git a/arch/x86/platform/efi/quirks.c b/arch/x86/platform/efi/quirks.c
index 4480c06cade7..89d1146f5a6f 100644
--- a/arch/x86/platform/efi/quirks.c
+++ b/arch/x86/platform/efi/quirks.c
@@ -254,6 +254,7 @@ void __init efi_free_boot_services(void)
254 for_each_efi_memory_desc(md) { 254 for_each_efi_memory_desc(md) {
255 unsigned long long start = md->phys_addr; 255 unsigned long long start = md->phys_addr;
256 unsigned long long size = md->num_pages << EFI_PAGE_SHIFT; 256 unsigned long long size = md->num_pages << EFI_PAGE_SHIFT;
257 size_t rm_size;
257 258
258 if (md->type != EFI_BOOT_SERVICES_CODE && 259 if (md->type != EFI_BOOT_SERVICES_CODE &&
259 md->type != EFI_BOOT_SERVICES_DATA) 260 md->type != EFI_BOOT_SERVICES_DATA)
@@ -263,6 +264,26 @@ void __init efi_free_boot_services(void)
263 if (md->attribute & EFI_MEMORY_RUNTIME) 264 if (md->attribute & EFI_MEMORY_RUNTIME)
264 continue; 265 continue;
265 266
267 /*
268 * Nasty quirk: if all sub-1MB memory is used for boot
269 * services, we can get here without having allocated the
270 * real mode trampoline. It's too late to hand boot services
271 * memory back to the memblock allocator, so instead
272 * try to manually allocate the trampoline if needed.
273 *
274 * I've seen this on a Dell XPS 13 9350 with firmware
275 * 1.4.4 with SGX enabled booting Linux via Fedora 24's
276 * grub2-efi on a hard disk. (And no, I don't know why
277 * this happened, but Linux should still try to boot rather
278 * panicing early.)
279 */
280 rm_size = real_mode_size_needed();
281 if (rm_size && (start + rm_size) < (1<<20) && size >= rm_size) {
282 set_real_mode_mem(start, rm_size);
283 start += rm_size;
284 size -= rm_size;
285 }
286
266 free_bootmem_late(start, size); 287 free_bootmem_late(start, size);
267 } 288 }
268 289
diff --git a/arch/x86/platform/uv/bios_uv.c b/arch/x86/platform/uv/bios_uv.c
index 66b2166ea4a1..23f2f3e41c7f 100644
--- a/arch/x86/platform/uv/bios_uv.c
+++ b/arch/x86/platform/uv/bios_uv.c
@@ -187,7 +187,8 @@ EXPORT_SYMBOL_GPL(uv_bios_set_legacy_vga_target);
187void uv_bios_init(void) 187void uv_bios_init(void)
188{ 188{
189 uv_systab = NULL; 189 uv_systab = NULL;
190 if ((efi.uv_systab == EFI_INVALID_TABLE_ADDR) || !efi.uv_systab) { 190 if ((efi.uv_systab == EFI_INVALID_TABLE_ADDR) ||
191 !efi.uv_systab || efi_runtime_disabled()) {
191 pr_crit("UV: UVsystab: missing\n"); 192 pr_crit("UV: UVsystab: missing\n");
192 return; 193 return;
193 } 194 }
@@ -199,12 +200,14 @@ void uv_bios_init(void)
199 return; 200 return;
200 } 201 }
201 202
203 /* Starting with UV4 the UV systab size is variable */
202 if (uv_systab->revision >= UV_SYSTAB_VERSION_UV4) { 204 if (uv_systab->revision >= UV_SYSTAB_VERSION_UV4) {
205 int size = uv_systab->size;
206
203 iounmap(uv_systab); 207 iounmap(uv_systab);
204 uv_systab = ioremap(efi.uv_systab, uv_systab->size); 208 uv_systab = ioremap(efi.uv_systab, size);
205 if (!uv_systab) { 209 if (!uv_systab) {
206 pr_err("UV: UVsystab: ioremap(%d) failed!\n", 210 pr_err("UV: UVsystab: ioremap(%d) failed!\n", size);
207 uv_systab->size);
208 return; 211 return;
209 } 212 }
210 } 213 }