Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753914Ab1EPWCP (ORCPT ); Mon, 16 May 2011 18:02:15 -0400 Received: from www.linutronix.de ([62.245.132.108]:38457 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752259Ab1EPWCO (ORCPT ); Mon, 16 May 2011 18:02:14 -0400 Date: Tue, 17 May 2011 00:01:55 +0200 (CEST) From: Thomas Gleixner To: Fenghua Yu cc: Ingo Molnar , H Peter Anvin , Asit K Mallick , Linus Torvalds , Avi Kivity , Arjan van de Ven , Andrew Morton , Andi Kleen , linux-kernel Subject: Re: [PATCH v2 4/4] x86/kernel/common.c: Disable SMEP by kernel option nosmep In-Reply-To: <1305581685-5144-5-git-send-email-fenghua.yu@intel.com> Message-ID: References: <1305581685-5144-1-git-send-email-fenghua.yu@intel.com> <1305581685-5144-5-git-send-email-fenghua.yu@intel.com> User-Agent: Alpine 2.02 (LFD 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 792 Lines: 25 On Mon, 16 May 2011, Fenghua Yu wrote: > +/* > + * If SMEP is supported by the processor, SMEP has been enabled in CR4 earlier. > + * But if kernel option "nosmep" is given, we disable SMEP here. > + */ > +static __init void config_smep(struct cpuinfo_x86 *c) > +{ > + if (cpu_has(c, X86_FEATURE_SMEP) && unlikely(disable_smep)) { That unlikely() is completely pointless. This is init code and inside of a if() already. Where is the point ? > + setup_clear_cpu_cap(X86_FEATURE_SMEP); > + clear_in_cr4(X86_CR4_SMEP); > + } > +} Thanks, tglx -- 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/