public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Baoquan He <bhe@redhat.com>
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, Baoquan He <bhe@redhat.com>
Subject: [PATCH v2 RESEND 1/2] x86/UV: Introduce a helper function to check UV system at earlier stage
Date: Thu,  7 Sep 2017 15:42:29 +0800	[thread overview]
Message-ID: <1504770150-25456-2-git-send-email-bhe@redhat.com> (raw)
In-Reply-To: <1504770150-25456-1-git-send-email-bhe@redhat.com>

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 <bhe@redhat.com>
Acked-by: Mike Travis <travis@sgi.com>
---
 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 <linux/efi.h>
+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

  reply	other threads:[~2017-09-07  7:42 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-07  7:42 [PATCH v2 RESEND 0/2] x86/mm/KASLR: Do not adapt the size of the direct mapping section for SGI UV system Baoquan He
2017-09-07  7:42 ` Baoquan He [this message]
2017-09-14  7:29   ` [PATCH v2 RESEND 1/2] x86/UV: Introduce a helper function to check UV system at earlier stage Baoquan He
2017-09-14  7:49     ` Dave Young
2017-09-14  8:08       ` Baoquan He
2017-09-15  0:47         ` Dave Young
2017-09-15  0:55         ` Dave Young
2017-09-07  7:42 ` [PATCH v2 RESEND 2/2] x86/mm/KASLR: Do not adapt the size of the direct mapping section for SGI UV system Baoquan He
2017-09-28  7:56   ` Ingo Molnar
2017-09-28  8:31     ` Baoquan He
2017-09-28  9:01       ` Ingo Molnar
2017-09-28 14:10         ` Mike Travis
2017-09-30 11:25           ` Baoquan He
2018-05-17  3:18           ` Baoquan He
2018-05-17 15:06             ` Ramsay, Frank
2018-05-17 15:47               ` Mike Travis
     [not found]             ` <53301a1e-e817-912f-cf7d-0000b078c7a3@hpe.com>
     [not found]               ` <20180523000306.GY24627@MiWiFi-R3L-srv>
     [not found]                 ` <7ce3cc80-3991-f914-c539-9fa38256ea4b@hpe.com>
2018-05-31  3:26                   ` Baoquan He
2017-09-14  1:44 ` [PATCH v2 RESEND 0/2] " Baoquan He

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1504770150-25456-2-git-send-email-bhe@redhat.com \
    --to=bhe@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=frank.ramsay@hpe.com \
    --cc=hpa@zytor.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rja@hpe.com \
    --cc=tglx@linutronix.de \
    --cc=thgarnie@google.com \
    --cc=x86@kernel.org \
    --cc=yamada.masahiro@socionext.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox