Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753293AbbDCOIP (ORCPT ); Fri, 3 Apr 2015 10:08:15 -0400 Received: from terminus.zytor.com ([198.137.202.10]:48185 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753246AbbDCOIB (ORCPT ); Fri, 3 Apr 2015 10:08:01 -0400 Date: Fri, 3 Apr 2015 07:07:25 -0700 From: tip-bot for Borislav Petkov Message-ID: Cc: oleg@redhat.com, tglx@linutronix.de, bp@alien8.de, fweisbec@gmail.com, keescook@chromium.org, bp@suse.de, mingo@kernel.org, hpa@zytor.com, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, luto@amacapital.net, rostedt@goodmis.org, ast@plumgrid.com, dvlasenk@redhat.com, wad@chromium.org Reply-To: bp@suse.de, bp@alien8.de, tglx@linutronix.de, oleg@redhat.com, fweisbec@gmail.com, keescook@chromium.org, ast@plumgrid.com, rostedt@goodmis.org, dvlasenk@redhat.com, wad@chromium.org, hpa@zytor.com, torvalds@linux-foundation.org, mingo@kernel.org, luto@amacapital.net, linux-kernel@vger.kernel.org In-Reply-To: <1428054130-25847-1-git-send-email-bp@alien8.de> References: <1428054130-25847-1-git-send-email-bp@alien8.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/asm] x86/asm/entry/64: Use a define for an invalid segment selector Git-Commit-ID: 6b51311c976593fb7311322b1647a912cd456ec4 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2272 Lines: 60 Commit-ID: 6b51311c976593fb7311322b1647a912cd456ec4 Gitweb: http://git.kernel.org/tip/6b51311c976593fb7311322b1647a912cd456ec4 Author: Borislav Petkov AuthorDate: Fri, 3 Apr 2015 14:25:28 +0200 Committer: Ingo Molnar CommitDate: Fri, 3 Apr 2015 15:29:13 +0200 x86/asm/entry/64: Use a define for an invalid segment selector ... instead of a naked number, for better readability. Signed-off-by: Borislav Petkov Cc: Alexei Starovoitov Cc: Andy Lutomirski Cc: Denys Vlasenko Cc: Frederic Weisbecker Cc: H. Peter Anvin Cc: Kees Cook Cc: Linus Torvalds Cc: Oleg Nesterov Cc: Steven Rostedt Cc: Will Drewry Link: http://lkml.kernel.org/r/1428054130-25847-1-git-send-email-bp@alien8.de Signed-off-by: Ingo Molnar --- arch/x86/include/asm/segment.h | 2 ++ arch/x86/kernel/cpu/common.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/x86/include/asm/segment.h b/arch/x86/include/asm/segment.h index d394899..5a9856e 100644 --- a/arch/x86/include/asm/segment.h +++ b/arch/x86/include/asm/segment.h @@ -39,6 +39,8 @@ /* ... GDT has it cleared */ #define SEGMENT_GDT 0x0 +#define GDT_ENTRY_INVALID_SEG 0 + #ifdef CONFIG_X86_32 /* * The layout of the per-CPU GDT under Linux: diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index d56d307..3f70538 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -1184,7 +1184,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, 0ULL); + wrmsrl_safe(MSR_IA32_SYSENTER_CS, (u64)GDT_ENTRY_INVALID_SEG); wrmsrl_safe(MSR_IA32_SYSENTER_ESP, 0ULL); wrmsrl_safe(MSR_IA32_SYSENTER_EIP, 0ULL); #endif -- 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/