Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752488AbdFNMlC (ORCPT ); Wed, 14 Jun 2017 08:41:02 -0400 Received: from mail-qk0-f194.google.com ([209.85.220.194]:33427 "EHLO mail-qk0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752394AbdFNMk7 (ORCPT ); Wed, 14 Jun 2017 08:40:59 -0400 From: Brian Gerst To: x86@kernel.org, linux-kernel@vger.kernel.org Cc: Ingo Molnar , "H . Peter Anvin" , Andy Lutomirski , Juergen Gross , Boris Ostrovsky Subject: [PATCH 1/3] x86: Remove native_set_iopl_mask() Date: Wed, 14 Jun 2017 08:40:30 -0400 Message-Id: <20170614124032.4159-2-brgerst@gmail.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170614124032.4159-1-brgerst@gmail.com> References: <20170614124032.4159-1-brgerst@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1852 Lines: 64 On native hardware, IRET and POPF will correctly restore the IOPL bits. This was left over from when the SYSEXIT path did not restore the user flags with POPF. Signed-off-by: Brian Gerst --- arch/x86/include/asm/processor.h | 21 +-------------------- arch/x86/kernel/paravirt.c | 2 +- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index 3cada99..06c4795 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h @@ -482,25 +482,6 @@ struct thread_struct { */ #define TS_COMPAT 0x0002 /* 32bit syscall active (64BIT)*/ -/* - * Set IOPL bits in EFLAGS from given mask - */ -static inline void native_set_iopl_mask(unsigned mask) -{ -#ifdef CONFIG_X86_32 - unsigned int reg; - - asm volatile ("pushfl;" - "popl %0;" - "andl %1, %0;" - "orl %2, %0;" - "pushl %0;" - "popfl" - : "=&r" (reg) - : "i" (~X86_EFLAGS_IOPL), "r" (mask)); -#endif -} - static inline void native_load_sp0(struct tss_struct *tss, struct thread_struct *thread) { @@ -542,7 +523,7 @@ static inline void load_sp0(struct tss_struct *tss, native_load_sp0(tss, thread); } -#define set_iopl_mask native_set_iopl_mask +static inline void set_iopl_mask(unsigned mask) { } #endif /* CONFIG_PARAVIRT */ /* Free all resources held by a thread. */ diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c index 3586996..1d50eb5 100644 --- a/arch/x86/kernel/paravirt.c +++ b/arch/x86/kernel/paravirt.c @@ -367,7 +367,7 @@ __visible struct pv_cpu_ops pv_cpu_ops = { .iret = native_iret, .swapgs = native_swapgs, - .set_iopl_mask = native_set_iopl_mask, + .set_iopl_mask = paravirt_nop, .io_delay = native_io_delay, .start_context_switch = paravirt_nop, -- 2.9.4