public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Brian Gerst <brgerst@gmail.com>
To: linux-kernel@vger.kernel.org, x86@kernel.org
Cc: Andy Lutomirski <luto@kernel.org>, Borislav Petkov <bp@alien8.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	"H . Peter Anvin" <hpa@zytor.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Brian Gerst <brgerst@gmail.com>
Subject: [PATCH 4/4] x86: Merge load_gs_index()
Date: Fri, 25 Mar 2022 11:39:53 -0400	[thread overview]
Message-ID: <20220325153953.162643-5-brgerst@gmail.com> (raw)
In-Reply-To: <20220325153953.162643-1-brgerst@gmail.com>

Merge the 32- and 64-bit implementations of load_gs_index().

Signed-off-by: Brian Gerst <brgerst@gmail.com>
---
 arch/x86/include/asm/segment.h       | 7 -------
 arch/x86/include/asm/special_insns.h | 7 ++++---
 2 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/arch/x86/include/asm/segment.h b/arch/x86/include/asm/segment.h
index 617b3663e4dd..2e7890dd58a4 100644
--- a/arch/x86/include/asm/segment.h
+++ b/arch/x86/include/asm/segment.h
@@ -350,13 +350,6 @@ static inline void __loadsegment_fs(unsigned short value)
 #define savesegment(seg, value)				\
 	asm("mov %%" #seg ",%0":"=r" (value) : : "memory")
 
-/*
- * x86-32 user GS accessors.  This is ugly and could do with some cleaning up.
- */
-#ifdef CONFIG_X86_32
-# define load_gs_index(v)		loadsegment(gs, (v))
-#endif	/* X86_32 */
-
 #endif /* !__ASSEMBLY__ */
 #endif /* __KERNEL__ */
 
diff --git a/arch/x86/include/asm/special_insns.h b/arch/x86/include/asm/special_insns.h
index 68c257a3de0d..45b18eb94fa1 100644
--- a/arch/x86/include/asm/special_insns.h
+++ b/arch/x86/include/asm/special_insns.h
@@ -184,14 +184,15 @@ static inline void wbinvd(void)
 	native_wbinvd();
 }
 
-#ifdef CONFIG_X86_64
 
 static inline void load_gs_index(unsigned int selector)
 {
+#ifdef CONFIG_X86_64
 	native_load_gs_index(selector);
-}
-
+#else
+	loadsegment(gs, selector);
 #endif
+}
 
 #endif /* CONFIG_PARAVIRT_XXL */
 
-- 
2.35.1


  parent reply	other threads:[~2022-03-25 15:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-25 15:39 [PATCH 0/4] x86-32: Clean up GS segment handling Brian Gerst
2022-03-25 15:39 ` [PATCH 1/4] x86-32: Simplify ELF_CORE_COPY_REGS Brian Gerst
2022-04-15  9:42   ` [tip: x86/core] x86/32: " tip-bot2 for Brian Gerst
2022-03-25 15:39 ` [PATCH 2/4] ELF: Remove elf_core_copy_kernel_regs() Brian Gerst
2022-04-13 11:41   ` Borislav Petkov
2022-04-13 12:31     ` Michael Ellerman
2022-04-15  9:42   ` [tip: x86/core] " tip-bot2 for Brian Gerst
2022-03-25 15:39 ` [PATCH 3/4] x86-32: Remove lazy GS macros Brian Gerst
2022-04-15  9:42   ` [tip: x86/core] x86/32: " tip-bot2 for Brian Gerst
2022-03-25 15:39 ` Brian Gerst [this message]
2022-04-15  9:42   ` [tip: x86/core] x86/asm: Merge load_gs_index() tip-bot2 for Brian Gerst
2022-03-25 15:45 ` [PATCH 0/4] x86-32: Clean up GS segment handling Andy Lutomirski
2022-04-05 16:12 ` Thomas Gleixner

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=20220325153953.162643-5-brgerst@gmail.com \
    --to=brgerst@gmail.com \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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