Skip to content

Commit ee114b9

Browse files
committed
Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fixes from Peter Anvin: "Trying again to get the fixes queue, including the fixed IDT alignment patch. The UEFI patch is by far the biggest issue at hand: it is currently causing quite a few machines to boot. Which is sad, because the only reason they would is because their BIOSes touch memory that has already been freed. The other major issue is that we finally have tracked down the root cause of a significant number of machines failing to suspend/resume" * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86: Make sure IDT is page aligned x86, suspend: Handle CPUs which fail to #GP on RDMSR x86/platform/ce4100: Add header file for reboot type Revert "UEFI: Don't pass boot services regions to SetVirtualAddressMap()" efivars: check for EFI_RUNTIME_SERVICES
2 parents 4b8b8a4 + 4df05f3 commit ee114b9

File tree

7 files changed

+28
-34
lines changed

7 files changed

+28
-34
lines changed

arch/x86/kernel/acpi/sleep.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,20 @@ int x86_acpi_suspend_lowlevel(void)
4848
#ifndef CONFIG_64BIT
4949
native_store_gdt((struct desc_ptr *)&header->pmode_gdt);
5050

51+
/*
52+
* We have to check that we can write back the value, and not
53+
* just read it. At least on 90 nm Pentium M (Family 6, Model
54+
* 13), reading an invalid MSR is not guaranteed to trap, see
55+
* Erratum X4 in "Intel Pentium M Processor on 90 nm Process
56+
* with 2-MB L2 Cache and Intel® Processor A100 and A110 on 90
57+
* nm process with 512-KB L2 Cache Specification Update".
58+
*/
5159
if (!rdmsr_safe(MSR_EFER,
5260
&header->pmode_efer_low,
53-
&header->pmode_efer_high))
61+
&header->pmode_efer_high) &&
62+
!wrmsr_safe(MSR_EFER,
63+
header->pmode_efer_low,
64+
header->pmode_efer_high))
5465
header->pmode_behavior |= (1 << WAKEUP_BEHAVIOR_RESTORE_EFER);
5566
#endif /* !CONFIG_64BIT */
5667

@@ -61,7 +72,10 @@ int x86_acpi_suspend_lowlevel(void)
6172
}
6273
if (!rdmsr_safe(MSR_IA32_MISC_ENABLE,
6374
&header->pmode_misc_en_low,
64-
&header->pmode_misc_en_high))
75+
&header->pmode_misc_en_high) &&
76+
!wrmsr_safe(MSR_IA32_MISC_ENABLE,
77+
header->pmode_misc_en_low,
78+
header->pmode_misc_en_high))
6579
header->pmode_behavior |=
6680
(1 << WAKEUP_BEHAVIOR_RESTORE_MISC_ENABLE);
6781
header->realmode_flags = acpi_realmode_flags;

arch/x86/kernel/head_64.S

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -512,21 +512,6 @@ ENTRY(phys_base)
512512

513513
#include "../../x86/xen/xen-head.S"
514514

515-
.section .bss, "aw", @nobits
516-
.align L1_CACHE_BYTES
517-
ENTRY(idt_table)
518-
.skip IDT_ENTRIES * 16
519-
520-
.align L1_CACHE_BYTES
521-
ENTRY(debug_idt_table)
522-
.skip IDT_ENTRIES * 16
523-
524-
#ifdef CONFIG_TRACING
525-
.align L1_CACHE_BYTES
526-
ENTRY(trace_idt_table)
527-
.skip IDT_ENTRIES * 16
528-
#endif
529-
530515
__PAGE_ALIGNED_BSS
531516
NEXT_PAGE(empty_zero_page)
532517
.skip PAGE_SIZE

arch/x86/kernel/tracepoint.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,8 @@ atomic_t trace_idt_ctr = ATOMIC_INIT(0);
1212
struct desc_ptr trace_idt_descr = { NR_VECTORS * 16 - 1,
1313
(unsigned long) trace_idt_table };
1414

15-
#ifndef CONFIG_X86_64
16-
gate_desc trace_idt_table[NR_VECTORS] __page_aligned_data
17-
= { { { { 0, 0 } } }, };
18-
#endif
15+
/* No need to be aligned, but done to keep all IDTs defined the same way. */
16+
gate_desc trace_idt_table[NR_VECTORS] __page_aligned_bss;
1917

2018
static int trace_irq_vector_refcount;
2119
static DEFINE_MUTEX(irq_vector_mutex);

arch/x86/kernel/traps.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,19 +63,19 @@
6363
#include <asm/x86_init.h>
6464
#include <asm/pgalloc.h>
6565
#include <asm/proto.h>
66+
67+
/* No need to be aligned, but done to keep all IDTs defined the same way. */
68+
gate_desc debug_idt_table[NR_VECTORS] __page_aligned_bss;
6669
#else
6770
#include <asm/processor-flags.h>
6871
#include <asm/setup.h>
6972

7073
asmlinkage int system_call(void);
71-
72-
/*
73-
* The IDT has to be page-aligned to simplify the Pentium
74-
* F0 0F bug workaround.
75-
*/
76-
gate_desc idt_table[NR_VECTORS] __page_aligned_data = { { { { 0, 0 } } }, };
7774
#endif
7875

76+
/* Must be page-aligned because the real IDT is used in a fixmap. */
77+
gate_desc idt_table[NR_VECTORS] __page_aligned_bss;
78+
7979
DECLARE_BITMAP(used_vectors, NR_VECTORS);
8080
EXPORT_SYMBOL_GPL(used_vectors);
8181

arch/x86/platform/ce4100/ce4100.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <linux/module.h>
1515
#include <linux/serial_reg.h>
1616
#include <linux/serial_8250.h>
17+
#include <linux/reboot.h>
1718

1819
#include <asm/ce4100.h>
1920
#include <asm/prom.h>

arch/x86/platform/efi/efi.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -931,13 +931,6 @@ void __init efi_enter_virtual_mode(void)
931931
va = efi_ioremap(md->phys_addr, size,
932932
md->type, md->attribute);
933933

934-
if (!(md->attribute & EFI_MEMORY_RUNTIME)) {
935-
if (!va)
936-
pr_err("ioremap of 0x%llX failed!\n",
937-
(unsigned long long)md->phys_addr);
938-
continue;
939-
}
940-
941934
md->virt_addr = (u64) (unsigned long) va;
942935

943936
if (!va) {

drivers/firmware/efi/efivars.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,9 @@ int efivars_sysfs_init(void)
583583
struct kobject *parent_kobj = efivars_kobject();
584584
int error = 0;
585585

586+
if (!efi_enabled(EFI_RUNTIME_SERVICES))
587+
return -ENODEV;
588+
586589
/* No efivars has been registered yet */
587590
if (!parent_kobj)
588591
return 0;

0 commit comments

Comments
 (0)