Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752505AbbDCLWd (ORCPT ); Fri, 3 Apr 2015 07:22:33 -0400 Received: from mail.skyhub.de ([78.46.96.112]:50832 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752244AbbDCLWa (ORCPT ); Fri, 3 Apr 2015 07:22:30 -0400 Date: Fri, 3 Apr 2015 13:20:27 +0200 From: Borislav Petkov To: Ingo Molnar Cc: LKML , Denys Vlasenko , Andy Lutomirski , Alexei Starovoitov , Frederic Weisbecker , "H. Peter Anvin" , Kees Cook , Linus Torvalds , Oleg Nesterov , Steven Rostedt , Will Drewry Subject: Re: [PATCH] x86/asm/entry/64: Fix MSR_IA32_SYSENTER_CS MSR value Message-ID: <20150403112027.GA3418@pd.tnic> References: <1428054130-25847-1-git-send-email-bp@alien8.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1428054130-25847-1-git-send-email-bp@alien8.de> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1969 Lines: 59 On Fri, Apr 03, 2015 at 11:42:10AM +0200, Borislav Petkov wrote: > From: Borislav Petkov > > Commit > > d56fe4bf5f3c ("x86/asm/entry/64: Always set up SYSENTER MSRs") > > missed to add "ULL" to the 0 and wrmsrl_safe() complains: > > arch/x86/kernel/cpu/common.c: In function ‘syscall_init’: > arch/x86/kernel/cpu/common.c:1226:2: warning: right shift count >= width of type > wrmsrl_safe(MSR_IA32_SYSENTER_CS, 0); > > Fix it. > > Signed-off-by: Borislav Petkov > Cc: Denys Vlasenko > Cc: Andy Lutomirski > Cc: Alexei Starovoitov > Cc: Frederic Weisbecker > Cc: H. Peter Anvin > Cc: Kees Cook > Cc: Linus Torvalds > Cc: Oleg Nesterov > Cc: Steven Rostedt > Cc: Will Drewry > Cc: Ingo Molnar > --- > arch/x86/kernel/cpu/common.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c > index bb6633a87a19..2c249b57e4b5 100644 > --- a/arch/x86/kernel/cpu/common.c > +++ b/arch/x86/kernel/cpu/common.c > @@ -1223,7 +1223,7 @@ void syscall_init(void) > wrmsrl_safe(MSR_IA32_SYSENTER_EIP, (u64)ia32_sysenter_target); > #else > wrmsrl(MSR_CSTAR, ignore_sysret); > - wrmsrl_safe(MSR_IA32_SYSENTER_CS, 0); > + wrmsrl_safe(MSR_IA32_SYSENTER_CS, 0ULL); Btw, we probably should define an invalid segment #define GDT_ENTRY_INVALID_SEGMENT 0ULL and use that value instead of the naked 0. -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply. -- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/