From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966306AbcCPMT4 (ORCPT ); Wed, 16 Mar 2016 08:19:56 -0400 Received: from mail.skyhub.de ([78.46.96.112]:51600 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965443AbcCPMTz (ORCPT ); Wed, 16 Mar 2016 08:19:55 -0400 From: Borislav Petkov To: X86 ML Cc: Andy Lutomirski , LKML Subject: [PATCH] x86/cpu: Do the feature test first in enable_sep_cpu() Date: Wed, 16 Mar 2016 13:19:29 +0100 Message-Id: <1458130769-24963-1-git-send-email-bp@alien8.de> X-Mailer: git-send-email 2.7.3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Borislav Petkov ... before assigning local vars. Kill out label too and simplify. No functionality change. Signed-off-by: Borislav Petkov --- arch/x86/kernel/cpu/common.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 249461f95851..63658d23d3dd 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -1030,12 +1030,12 @@ void enable_sep_cpu(void) struct tss_struct *tss; int cpu; + if (!boot_cpu_has(X86_FEATURE_SEP)) + return; + cpu = get_cpu(); tss = &per_cpu(cpu_tss, cpu); - if (!boot_cpu_has(X86_FEATURE_SEP)) - goto out; - /* * We cache MSR_IA32_SYSENTER_CS's value in the TSS's ss1 field -- * see the big comment in struct x86_hw_tss's definition. @@ -1050,7 +1050,6 @@ void enable_sep_cpu(void) wrmsr(MSR_IA32_SYSENTER_EIP, (unsigned long)entry_SYSENTER_32, 0); -out: put_cpu(); } #endif -- 2.7.3