diff options
author | Brian Gerst <brgerst@gmail.com> | 2022-03-25 11:39:52 -0400 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2022-04-14 14:09:43 +0200 |
commit | 3a24a60854d2ef19e0edcd11cdbbb4fabc655dde (patch) | |
tree | 6061a7a4b6201c8614472b17bbccafb249bd91d3 /arch/x86/lib | |
parent | 9554e908fb5d02e48a681d1eca180225bf109e83 (diff) | |
download | lwn-3a24a60854d2ef19e0edcd11cdbbb4fabc655dde.tar.gz lwn-3a24a60854d2ef19e0edcd11cdbbb4fabc655dde.zip |
x86/32: Remove lazy GS macros
GS is always a user segment now.
Signed-off-by: Brian Gerst <brgerst@gmail.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Andy Lutomirski <luto@kernel.org>
Link: https://lore.kernel.org/r/20220325153953.162643-4-brgerst@gmail.com
Diffstat (limited to 'arch/x86/lib')
-rw-r--r-- | arch/x86/lib/insn-eval.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/x86/lib/insn-eval.c b/arch/x86/lib/insn-eval.c index b781d324211b..21104c41cba0 100644 --- a/arch/x86/lib/insn-eval.c +++ b/arch/x86/lib/insn-eval.c @@ -342,9 +342,9 @@ static int resolve_seg_reg(struct insn *insn, struct pt_regs *regs, int regoff) */ static short get_segment_selector(struct pt_regs *regs, int seg_reg_idx) { -#ifdef CONFIG_X86_64 unsigned short sel; +#ifdef CONFIG_X86_64 switch (seg_reg_idx) { case INAT_SEG_REG_IGNORE: return 0; @@ -402,7 +402,8 @@ static short get_segment_selector(struct pt_regs *regs, int seg_reg_idx) case INAT_SEG_REG_FS: return (unsigned short)(regs->fs & 0xffff); case INAT_SEG_REG_GS: - return get_user_gs(regs); + savesegment(gs, sel); + return sel; case INAT_SEG_REG_IGNORE: default: return -EINVAL; |