From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751425AbdKURRF (ORCPT ); Tue, 21 Nov 2017 12:17:05 -0500 Received: from mx2.suse.de ([195.135.220.15]:40286 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751145AbdKURRE (ORCPT ); Tue, 21 Nov 2017 12:17:04 -0500 Date: Tue, 21 Nov 2017 18:16:43 +0100 From: Borislav Petkov To: Andy Lutomirski Cc: X86 ML , "linux-kernel@vger.kernel.org" , Brian Gerst , Dave Hansen , Linus Torvalds , Josh Poimboeuf Subject: Re: [PATCH 03/16] x86/gdt: Put per-cpu GDT remaps in ascending order Message-ID: <20171121171643.jtwbfuvxwi6wecj3@pd.tnic> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 20, 2017 at 09:07:34AM -0800, Andy Lutomirski wrote: > We currently have CPU 0's GDT at the top of the GDT range and > higher-numbered CPUs at lower addreses. This happens because the addresses > fixmap is upside down (index 0 is the top of the fixmap). > > Flip it so that GDTs are in ascending order by virtual address. > This will simplify a future patch that will generalize the GDT > remap to contain multiple pages. > > Signed-off-by: Andy Lutomirski > --- > arch/x86/include/asm/desc.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/x86/include/asm/desc.h b/arch/x86/include/asm/desc.h > index 4011cb03ef08..95cd95eb7285 100644 > --- a/arch/x86/include/asm/desc.h > +++ b/arch/x86/include/asm/desc.h > @@ -63,7 +63,7 @@ static inline struct desc_struct *get_current_gdt_rw(void) > /* Get the fixmap index for a specific processor */ > static inline unsigned int get_cpu_gdt_ro_index(int cpu) > { > - return FIX_GDT_REMAP_BEGIN + cpu; > + return FIX_GDT_REMAP_END - cpu; > } > > /* Provide the fixmap address of the remapped GDT */ > -- Other than the typo above: Reviewed-by: Borislav Petkov -- Regards/Gruss, Boris. SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) --