Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a8bdf745 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 fixes from Peter Anvin:
 "Two regression fixes:

  1. On 64 bits, we would set NX on non-NX-capable hardware (very rare
     in 64-bit land, but a nonzero subset.)

  2. Fix suspend/resume across kernel versions"

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86-64, init: Do not set NX bits on non-NX capable hardware
  x86, gdt, hibernate: Store/load GDT for hibernate path.
parents fbe8ed63 78d77df7
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@ struct saved_context {
	unsigned long cr0, cr2, cr3, cr4;
	u64 misc_enable;
	bool misc_enable_saved;
	struct desc_ptr gdt_desc;
	struct desc_ptr idt;
	u16 ldt;
	u16 tss;
+2 −0
Original line number Diff line number Diff line
@@ -25,6 +25,8 @@ struct saved_context {
	u64 misc_enable;
	bool misc_enable_saved;
	unsigned long efer;
	u16 gdt_pad; /* Unused */
	struct desc_ptr gdt_desc;
	u16 idt_pad;
	u16 idt_limit;
	unsigned long idt_base;
+3 −0
Original line number Diff line number Diff line
@@ -60,6 +60,9 @@ void foo(void)
	OFFSET(IA32_RT_SIGFRAME_sigcontext, rt_sigframe, uc.uc_mcontext);
	BLANK();

	OFFSET(saved_context_gdt_desc, saved_context, gdt_desc);
	BLANK();

	/* Offset from the sysenter stack to tss.sp0 */
	DEFINE(TSS_sysenter_sp0, offsetof(struct tss_struct, x86_tss.sp0) -
		 sizeof(struct tss_struct));
+1 −0
Original line number Diff line number Diff line
@@ -73,6 +73,7 @@ int main(void)
	ENTRY(cr3);
	ENTRY(cr4);
	ENTRY(cr8);
	ENTRY(gdt_desc);
	BLANK();
#undef ENTRY

+2 −1
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@
extern pgd_t early_level4_pgt[PTRS_PER_PGD];
extern pmd_t early_dynamic_pgts[EARLY_DYNAMIC_PAGE_TABLES][PTRS_PER_PMD];
static unsigned int __initdata next_early_pgt = 2;
pmdval_t __initdata early_pmd_flags = __PAGE_KERNEL_LARGE & ~(_PAGE_GLOBAL | _PAGE_NX);

/* Wipe all early page tables except for the kernel symbol map */
static void __init reset_early_page_tables(void)
@@ -99,7 +100,7 @@ int __init early_make_pgtable(unsigned long address)
			pmd_p[i] = 0;
		*pud_p = (pudval_t)pmd_p - __START_KERNEL_map + phys_base + _KERNPG_TABLE;
	}
	pmd = (physaddr & PMD_MASK) + (__PAGE_KERNEL_LARGE & ~_PAGE_GLOBAL);
	pmd = (physaddr & PMD_MASK) + early_pmd_flags;
	pmd_p[pmd_index(address)] = pmd;

	return 0;
Loading