[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] x86/cet: Support cet=<bool> on the command line


  • To: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 29 Apr 2022 14:19:13 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=CMJl31QMUmWvI3ZVEWFpCoZWm8sYiGkGGdC+ZWzrNog=; b=YJpveBf6UHkLhgJbwSa/DV/ve4B1AFlAx82ghcldKKTi+cXJjaIiGlllDinPCRG5bP46CcQdoG2gyRFODjc8BqYZZ7bF6oe69JovNH43BXaArHZESyEQuh3droL1iW3qM7WG3dvGYKCRmv4CcYWQdWEKZEseOVMHugKCAUObQZ4a7lllrBbcPLqaXLt1A4t6X9dcGaNppN72zbNythnV6ImIS0sklJ/2D/FvN64GaUqAWRtuIuJp8I+8ReE+x/+GPiDShjb6X/1WuzZHkh3rikpaj8i2+GxPY++7DjMUJkQXhRpu2vunZ4e3Jxh80pcLNrBjvRBih6z3XBtmz7Jhow==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gHfZ+Kpsbx7sVs0Hs0GWsOPMe18TNmbQf7jI5n42hMHVrzc18KQvoluQ0kbrmixjwx5glC43o78LTzx5OyN9vw9TSZg1rzoH4+u0F9i+fPnz66LAYwhDlFAOTNmZ6mudHLVHwZOGFBiMFJzWgXU1+xmI1/+meZ4lXO5rZ9gwqe9CxTOhDPxCm4yGPUhSKi+6Ygm7KmZWaNdIEMjTUVPJ/0RlBo4m4/417eY+0hDCVDmknmEAmHdp2zv4VexhuyPzlivY4lgtkQD7d/5UBZOHXl/NkrMbRbJafgKDFd1Iw7U24brUGGqYScN5LQ+1YFT9wHmDdWg97maT+SrxIJFJ4w==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Roger Pau Monne <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 29 Apr 2022 12:19:27 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 29.04.2022 12:13, Andrew Cooper wrote:
> On 28/04/2022 11:13, Jan Beulich wrote:
>>> --- a/xen/arch/x86/setup.c
>>> +++ b/xen/arch/x86/setup.c
>>> @@ -117,7 +117,20 @@ static int __init cf_check parse_cet(const char *s)
>>>          if ( !ss )
>>>              ss = strchr(s, '\0');
>>>  
>>> -        if ( (val = parse_boolean("shstk", s, ss)) >= 0 )
>>> +        if ( (val = parse_bool(s, ss)) >= 0 )
>>> +        {
>>> +#ifdef CONFIG_XEN_SHSTK
>>> +            opt_xen_shstk = val;
>>> +#else
>>> +            no_config_param("XEN_SHSTK", "cet", s, ss);
>>> +#endif
>>> +#ifdef CONFIG_XEN_IBT
>>> +            opt_xen_ibt = val;
>>> +#else
>>> +            no_config_param("XEN_IBT", "cet", s, ss);
>>> +#endif
>> There shouldn't be two invocations of no_config_param() here; imo if
>> either CONFIG_* is defined, use of the option shouldn't produce any
>> warning at all.
> 
> It's this, or:
> 
>         if ( (val = parse_bool(s, ss)) >= 0 )
>         {
> #if !defined(CONFIG_XEN_SHSTK) && !defined(CONFIG_XEN_IBT)
>             no_config_param("XEN_{SHSTK,IBT}", "cet", s, ss);
> #endif
> #ifdef CONFIG_XEN_SHSTK
>             opt_xen_shstk = val;
> #endif
> #ifdef CONFIG_XEN_IBT
>             opt_xen_ibt = val;
> #endif
>         }
> 
> I'm not terribly fussed.

I'd prefer the alternative variant; hopefully Roger doesn't strongly
prefer the other one. And then
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

Jan




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.