diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2019-01-07 18:18:27 +0100 |
---|---|---|
committer | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2019-01-07 18:18:27 +0100 |
commit | 83791e4fb81587c82f4143ab7b167fe934309663 (patch) | |
tree | 96ef9f18e652c0bfa755270676e414a25088894e /arch/x86/mm | |
parent | 457e6884cb33a86aef7e86119955ee3d87da6815 (diff) | |
parent | c04c050f5bf98845bfe22164b8a1503d696a6e26 (diff) |
Merge tag 'v4.19.13' into linux-4.19.y-rt
This is the 4.19.13 stable release
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Diffstat (limited to 'arch/x86/mm')
-rw-r--r-- | arch/x86/mm/pat.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c index 3d0c83ef6aab..a3c9ea29d7cc 100644 --- a/arch/x86/mm/pat.c +++ b/arch/x86/mm/pat.c @@ -519,8 +519,13 @@ static u64 sanitize_phys(u64 address) * for a "decoy" virtual address (bit 63 clear) passed to * set_memory_X(). __pa() on a "decoy" address results in a * physical address with bit 63 set. + * + * Decoy addresses are not present for 32-bit builds, see + * set_mce_nospec(). */ - return address & __PHYSICAL_MASK; + if (IS_ENABLED(CONFIG_X86_64)) + return address & __PHYSICAL_MASK; + return address; } /* @@ -546,7 +551,11 @@ int reserve_memtype(u64 start, u64 end, enum page_cache_mode req_type, start = sanitize_phys(start); end = sanitize_phys(end); - BUG_ON(start >= end); /* end is exclusive */ + if (start >= end) { + WARN(1, "%s failed: [mem %#010Lx-%#010Lx], req %s\n", __func__, + start, end - 1, cattr_name(req_type)); + return -EINVAL; + } if (!pat_enabled()) { /* This is identical to page table setting without PAT */ |