Commit edf9364d authored by Linus Torvalds's avatar Linus Torvalds

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

Pull x86 fixes from Thomas Gleixner:
 "Two fixlets for x86:

   - Handle WARN_ONs proper with the new UD based WARN implementation

   - Disable 1G mappings when 2M mappings are disabled by kmemleak or
     debug_pagealloc. Otherwise 1G mappings might still be used,
     confusing the debug mechanisms"

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/mm: Disable 1GB direct mappings when disabling 2MB mappings
  x86/debug: Handle early WARN_ONs proper
parents 4f51d57f d9ee35ac
...@@ -29,6 +29,7 @@ struct pt_regs; ...@@ -29,6 +29,7 @@ struct pt_regs;
} while (0) } while (0)
extern int fixup_exception(struct pt_regs *regs, int trapnr); extern int fixup_exception(struct pt_regs *regs, int trapnr);
extern int fixup_bug(struct pt_regs *regs, int trapnr);
extern bool ex_has_fault_handler(unsigned long ip); extern bool ex_has_fault_handler(unsigned long ip);
extern void early_fixup_exception(struct pt_regs *regs, int trapnr); extern void early_fixup_exception(struct pt_regs *regs, int trapnr);
......
...@@ -182,7 +182,7 @@ int is_valid_bugaddr(unsigned long addr) ...@@ -182,7 +182,7 @@ int is_valid_bugaddr(unsigned long addr)
return ud == INSN_UD0 || ud == INSN_UD2; return ud == INSN_UD0 || ud == INSN_UD2;
} }
static int fixup_bug(struct pt_regs *regs, int trapnr) int fixup_bug(struct pt_regs *regs, int trapnr)
{ {
if (trapnr != X86_TRAP_UD) if (trapnr != X86_TRAP_UD)
return 0; return 0;
......
...@@ -162,6 +162,9 @@ void __init early_fixup_exception(struct pt_regs *regs, int trapnr) ...@@ -162,6 +162,9 @@ void __init early_fixup_exception(struct pt_regs *regs, int trapnr)
if (fixup_exception(regs, trapnr)) if (fixup_exception(regs, trapnr))
return; return;
if (fixup_bug(regs, trapnr))
return;
fail: fail:
early_printk("PANIC: early exception 0x%02x IP %lx:%lx error %lx cr2 0x%lx\n", early_printk("PANIC: early exception 0x%02x IP %lx:%lx error %lx cr2 0x%lx\n",
(unsigned)trapnr, (unsigned long)regs->cs, regs->ip, (unsigned)trapnr, (unsigned long)regs->cs, regs->ip,
......
...@@ -161,16 +161,16 @@ static int page_size_mask; ...@@ -161,16 +161,16 @@ static int page_size_mask;
static void __init probe_page_size_mask(void) static void __init probe_page_size_mask(void)
{ {
#if !defined(CONFIG_KMEMCHECK)
/* /*
* For CONFIG_KMEMCHECK or pagealloc debugging, identity mapping will * For CONFIG_KMEMCHECK or pagealloc debugging, identity mapping will
* use small pages. * use small pages.
* This will simplify cpa(), which otherwise needs to support splitting * This will simplify cpa(), which otherwise needs to support splitting
* large pages into small in interrupt context, etc. * large pages into small in interrupt context, etc.
*/ */
if (boot_cpu_has(X86_FEATURE_PSE) && !debug_pagealloc_enabled()) if (boot_cpu_has(X86_FEATURE_PSE) && !debug_pagealloc_enabled() && !IS_ENABLED(CONFIG_KMEMCHECK))
page_size_mask |= 1 << PG_LEVEL_2M; page_size_mask |= 1 << PG_LEVEL_2M;
#endif else
direct_gbpages = 0;
/* Enable PSE if available */ /* Enable PSE if available */
if (boot_cpu_has(X86_FEATURE_PSE)) if (boot_cpu_has(X86_FEATURE_PSE))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment