Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756629AbdLTXtA (ORCPT ); Wed, 20 Dec 2017 18:49:00 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:53799 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754303AbdLTXs7 (ORCPT ); Wed, 20 Dec 2017 18:48:59 -0500 Date: Thu, 21 Dec 2017 00:48:50 +0100 (CET) From: Thomas Gleixner To: LKML cc: x86@kernel.org, Linus Torvalds , Andy Lutomirsky , Peter Zijlstra , Dave Hansen , Borislav Petkov , Greg KH , keescook@google.com, hughd@google.com, Brian Gerst , Josh Poimboeuf , Denys Vlasenko , Rik van Riel , Boris Ostrovsky , Juergen Gross , David Laight , Eduardo Valentin , aliguori@amazon.com, Will Deacon , Vlastimil Babka , daniel.gruss@iaik.tugraz.at Subject: Re: [patch V181 00/54] x86/pti: Final XMAS release In-Reply-To: <20171220213503.672610178@linutronix.de> Message-ID: References: <20171220213503.672610178@linutronix.de> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2984 Lines: 95 On Wed, 20 Dec 2017, Thomas Gleixner wrote: > Changes since V163: > > - Moved the cpu entry area out of the fixmap because that caused failures > due to fixmap size and cleanup_highmap() zapping fixmap PTEs. > > - Moved all cpu entry area related code into separate files. The > hodgepodge in cpu/common.c was really not appropriate. > > - Folded Juergens XEN PV fix for vsyscall > > - Folded Peters ACCESS bit simplification > > - Cleaned up and fixed dump_pagetables > > - Added Vlastimils PTI/NOPTI marker for dumpstack > > - Addressed various minor review comments > > Diffstat against V163 appended. > > Thanks to everyone who looked and cared! > > It's perfect now because I'm going to have quiet holidays no matter what. Almost perfect. 0-day is amazing. It unearthed yet more include hell. I'm not going to repost the whole thing. Find the delta fix below. I've updated the git tree at: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git WIP.x86/pti head commit is now: 9b12709513089f4e71190685930e7f9f0d75fee7 The new patch tarball is at: https://tglx.de/~tglx/patches-pti-184.tar.bz2 sha1sum of decompressed tarball: 2dbdfb57cf65a0c1e558ed55747e17d3c8d8adee Thanks, tglx 8<-------------- diff --git a/arch/x86/include/asm/cpu_entry_area.h b/arch/x86/include/asm/cpu_entry_area.h index e05a39029446..4a7884b8dca5 100644 --- a/arch/x86/include/asm/cpu_entry_area.h +++ b/arch/x86/include/asm/cpu_entry_area.h @@ -71,13 +71,7 @@ extern void cea_set_pte(void *cea_vaddr, phys_addr_t pa, pgprot_t flags); #define CPU_ENTRY_AREA_MAP_SIZE \ (CPU_ENTRY_AREA_PER_CPU + CPU_ENTRY_AREA_TOT_SIZE - CPU_ENTRY_AREA_BASE) -static inline struct cpu_entry_area *get_cpu_entry_area(int cpu) -{ - unsigned long va = CPU_ENTRY_AREA_PER_CPU + cpu * CPU_ENTRY_AREA_SIZE; - BUILD_BUG_ON(sizeof(struct cpu_entry_area) % PAGE_SIZE != 0); - - return (struct cpu_entry_area *) va; -} +extern struct cpu_entry_area *get_cpu_entry_area(int cpu); static inline struct entry_stack *cpu_entry_stack(int cpu) { diff --git a/arch/x86/mm/cpu_entry_area.c b/arch/x86/mm/cpu_entry_area.c index 66c0d1207243..b5dfb762c64c 100644 --- a/arch/x86/mm/cpu_entry_area.c +++ b/arch/x86/mm/cpu_entry_area.c @@ -1,6 +1,8 @@ // SPDX-License-Identifier: GPL-2.0 +#include #include + #include #include #include @@ -13,6 +15,15 @@ static DEFINE_PER_CPU_PAGE_ALIGNED(char, exception_stacks [(N_EXCEPTION_STACKS - 1) * EXCEPTION_STKSZ + DEBUG_STKSZ]); #endif +struct cpu_entry_area *get_cpu_entry_area(int cpu) +{ + unsigned long va = CPU_ENTRY_AREA_PER_CPU + cpu * CPU_ENTRY_AREA_SIZE; + BUILD_BUG_ON(sizeof(struct cpu_entry_area) % PAGE_SIZE != 0); + + return (struct cpu_entry_area *) va; +} +EXPORT_SYMBOL(get_cpu_entry_area); + void cea_set_pte(void *cea_vaddr, phys_addr_t pa, pgprot_t flags) { unsigned long va = (unsigned long) cea_vaddr;