From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753163AbdLDQwF (ORCPT ); Mon, 4 Dec 2017 11:52:05 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:60237 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752379AbdLDQv3 (ORCPT ); Mon, 4 Dec 2017 11:51:29 -0500 Message-Id: <20171204150607.962555782@linutronix.de> User-Agent: quilt/0.63-1 Date: Mon, 04 Dec 2017 15:07:44 +0100 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 , daniel.gruss@iaik.tugraz.at Subject: [patch 38/60] x86/fixmap: Move cpu entry area into a separate PMD References: <20171204140706.296109558@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Disposition: inline; filename=x86-fixmap--Move_cpu_entry_area_into_a_separate_PMD.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andy Lutomirski This allows the cpu entry area PMDs to be shared between the kernel and user space page tables. [ tglx: Fixed bottom of by one and added guards so other fixmaps can be added later ] Signed-off-by: Andy Lutomirski Signed-off-by: Thomas Gleixner --- arch/x86/include/asm/fixmap.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) --- a/arch/x86/include/asm/fixmap.h +++ b/arch/x86/include/asm/fixmap.h @@ -134,16 +134,22 @@ enum fixed_addresses { #ifdef CONFIG_PARAVIRT FIX_PARAVIRT_BOOTMAP, #endif - FIX_TEXT_POKE1, /* reserve 2 pages for text_poke() */ - FIX_TEXT_POKE0, /* first page is last, because allocation is backward */ #ifdef CONFIG_X86_INTEL_MID FIX_LNW_VRTC, #endif - /* Fixmap entries to remap the GDTs, one per processor. */ + FIX_TEXT_POKE1, /* reserve 2 pages for text_poke() */ + FIX_TEXT_POKE0, /* first page is last, because allocation is backward */ + + /* + * Fixmap entries to remap the IDT, and the per cpu entry areas. + * Aligend to a PMD boundary. + */ + FIX_USR_SHARED_TOP = round_up(FIX_TEXT_POKE0 + 1, PTRS_PER_PMD), FIX_CPU_ENTRY_AREA_TOP, FIX_CPU_ENTRY_AREA_BOTTOM = FIX_CPU_ENTRY_AREA_TOP + (CPU_ENTRY_AREA_PAGES * NR_CPUS) - 1, + FIX_USR_SHARED_BOTTOM = round_up(FIX_CPU_ENTRY_AREA_BOTTOM + 2, PTRS_PER_PMD) - 1, - __end_of_permanent_fixed_addresses, + __end_of_permanent_fixed_addresses = FIX_USR_SHARED_BOTTOM, /* * 512 temporary boot-time mappings, used by early_ioremap(),