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

Re: [PATCH] x86/cmdline: Interpret 'vpmu' as a positive boolean


  • To: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 3 Mar 2022 12:40:44 +0100
  • 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=SRw1SjXvQzn3T21RYtLxvIlmfYzmHraSIKOrgV2TF8s=; b=JEVwWI0OygkYoFJxQXestDsNghaHCFy8yeDLQUBP0sJsMZ0Vdx3rjsnTh1EguaHoG2PvV15Rf1fg51JgGO5dZCj0pLDsDAAo/9t0HGIYQMQ2O0PYsxOq1oL84CQyiNOG+V+VRoAhj88Gkdh83azkaYTeDq0jcJRxht01fXIE/o77nO+c36ZO3hw4n2AYCPYsxMmQUF5sWbv2hrYpXYyeYpMtfY9GtTqofNh8UIYMMcz3WVCpDAdWOFpIASra//KgQeqGm0DQsXjUPKaYKBIIqFPqqaLUFD6U02CoCOzE2yYc1NvmdgI4x3dQuKDafGdQA0SRce/3dRxDR70vLYr2sw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lpPlnrL8Tnmj8cL1Osv4OYMzFlkqdwl+ZzUHUi6sS+pUQIsHYyByCMGrJ6A5lBlthOupp5AVjF3hWKbuwtrbujLLMC9S3h17wHTIYtYFKNhJlnjVCIrEnPB55CuhW8/DujbFJwJsdtkNrDgHPwmZlQMsOfQ0o+VxmzdrSe/dVNsCkJpJuiNd5Dd4P5E8cjfeG4qN2CQv2FkX0Aq/aG4DVFJJi9/aJHXwylyQyO9hATlguT5aaRQxhZ5nu4N8DFcTkSJjSyfcxnRXd1HS/rwsZGj8uDKls808k/LqHCxaZAIsRokD7wzw9/QhrNSlVFbVsaTDojo0XeiEViws+PUjOQ==
  • 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: Thu, 03 Mar 2022 11:40:51 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 03.03.2022 12:15, Andrew Cooper wrote:
> On 03/03/2022 11:04, Jan Beulich wrote:
>> On 03.03.2022 11:48, Andrew Cooper wrote:
>>> On 03/03/2022 07:44, Jan Beulich wrote:
>>>> On 02.03.2022 23:11, Andrew Cooper wrote:
>>>>> This makes it behave slightly more like a regular boolean option.
>>>>>
>>>>> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
>>>> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
>>>>
>>>>> Slightly RFC, because there is no easy way of making the opposite "normal
>>>>> boolean" case work for no-vpmu.
>>>> There's nothing to do to make this work afaict: Generic command line
>>>> handling converts "no-<option>" to "<option>=no" for custom params.
>>> Oh - I'd forgotten that, in which case this patch actually wants to be
>>> simply:
>>>
>>> diff --git a/xen/common/kernel.c b/xen/common/kernel.c
>>> index adff2d2c77f3..2cea1da781ac 100644
>>> --- a/xen/common/kernel.c
>>> +++ b/xen/common/kernel.c
>>> @@ -162,6 +162,11 @@ static int parse_params(const char *cmdline, const
>>> struct kernel_param *start,
>>>                      safe_strcpy(opt, "no");
>>>                      optval = opt;
>>>                  }
>>> +                else if ( !*optval )
>>> +                {
>>> +                    safe_strcpy(opt, "1");
>>> +                    optval = opt;
>>> +                }
>>>                  rctmp = param->par.func(optval);
>>>                  break;
>>>              case OPT_IGNORE:
>>>
>>> to turn "option\0" into "option=1", no?
>> Iirc extending this to the positive case was deliberately not done, for
>> the risk of breaking custom handlers not expecting the standard boolean
>> forms. We could likely go this route, but only after auditing all custom
>> handlers, I'm afraid.
> 
> Well - I've already audited them all once recently.  What's once more...

Of course if you did an audit (for this particular property) recently,
that's definitely enough. Feel free to apply my earlier provided R-b
also to this alternative change then.

Jan

> I'll have a go in due course; I'd definitely prefer to avoid special
> casing the positive boolean form in individual handlers.
> 
> ~Andrew




 


Rackspace

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