Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751354AbdINHaC (ORCPT ); Thu, 14 Sep 2017 03:30:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:29786 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751085AbdINHaB (ORCPT ); Thu, 14 Sep 2017 03:30:01 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 3A41A7CDEA Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=bhe@redhat.com Date: Thu, 14 Sep 2017 15:29:52 +0800 From: Baoquan He To: linux-kernel@vger.kernel.org, x86@kernel.org Cc: mingo@redhat.com, tglx@linutronix.de, hpa@zytor.com, thgarnie@google.com, keescook@chromium.org, akpm@linux-foundation.org, yamada.masahiro@socionext.com, rja@hpe.com, frank.ramsay@hpe.com, dyoung@redhat.com Subject: Re: [PATCH v2 RESEND 1/2] x86/UV: Introduce a helper function to check UV system at earlier stage Message-ID: <20170914072952.GN12824@x1> References: <1504770150-25456-1-git-send-email-bhe@redhat.com> <1504770150-25456-2-git-send-email-bhe@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1504770150-25456-2-git-send-email-bhe@redhat.com> User-Agent: Mutt/1.7.0 (2016-08-17) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 14 Sep 2017 07:30:01 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1622 Lines: 45 Add Dave to the CC list, he may have concerns about the code change. On 09/07/17 at 03:42pm, Baoquan He wrote: > The BIOS on SGI UV system will report a UV system table which describes > specific firmware capabilities available to the Linux kernel at runtime. > This UV system table only exists on SGI UV system. And it's detected > in efi_init() which is at very early stage. > > So introduce a new helper function is_early_uv_system() to identify if > a system is UV system. Later we will use it to check if the running > system is UV system in mm KASLR code. > > Signed-off-by: Baoquan He > Acked-by: Mike Travis > --- > arch/x86/include/asm/uv/uv.h | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/arch/x86/include/asm/uv/uv.h b/arch/x86/include/asm/uv/uv.h > index b5a32231abd8..93d7ad8763ba 100644 > --- a/arch/x86/include/asm/uv/uv.h > +++ b/arch/x86/include/asm/uv/uv.h > @@ -18,6 +18,11 @@ extern void uv_nmi_init(void); > extern void uv_system_init(void); > extern const struct cpumask *uv_flush_tlb_others(const struct cpumask *cpumask, > const struct flush_tlb_info *info); > +#include > +static inline int is_early_uv_system(void) > +{ > + return !((efi.uv_systab == EFI_INVALID_TABLE_ADDR) || !efi.uv_systab); > +} > > #else /* X86_UV */ > > @@ -30,6 +35,7 @@ static inline const struct cpumask * > uv_flush_tlb_others(const struct cpumask *cpumask, > const struct flush_tlb_info *info) > { return cpumask; } > +static inline int is_early_uv_system(void) { return 0; } > > #endif /* X86_UV */ > > -- > 2.5.5 >