From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH v1 3/6] x86: Enable Supervisor Mode Execution Prevention (SMAP) for Xen Date: Tue, 15 Apr 2014 14:46:42 +0100 Message-ID: <534D3842.70107@citrix.com> References: <1397566907-19710-1-git-send-email-feng.wu@intel.com> <534D0AD7.20306@citrix.com> <534D38B80200007800008F70@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <534D38B80200007800008F70@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: eddie.dong@intel.com, Feng Wu , Ian.Campbell@citrix.com, jun.nakajima@intel.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On 15/04/14 12:48, Jan Beulich wrote: >>>> On 15.04.14 at 12:32, wrote: >> On 15/04/14 14:01, Feng Wu wrote: >>> index e9c2c51..09c974d 100644 >>> --- a/xen/arch/x86/setup.c >>> +++ b/xen/arch/x86/setup.c >>> @@ -61,6 +61,10 @@ integer_param("maxcpus", max_cpus); >>> static bool_t __initdata disable_smep; >>> invbool_param("smep", disable_smep); >>> >>> +/* smap: Enable/disable Supervisor Mode Access Prevention (default on). */ >>> +static bool_t __initdata disable_smap; >>> +invbool_param("smap", disable_smap); >>> + >> Please use a positive boolean rather than negative. Convention is also >> to prefix the variable with opt_ >> >> static bool_t __initdata opt_smap = 1; >> boolean_param("smap", opt_smap); > Hmm, I'd go for consistency with SMAP here as a first step. > Converting both may later be an option, but I'm not really sure > why you think the invbool_param() is bad. > > Jan > Not invbool_param() per say, but with negative booleans in general. It is just unnecessary extra cognitive load when following code. This is admittedly a mild example. ~Andrew