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

Re: [PATCH v5 07/12] xen: enable Dom0 to use SVE feature


  • To: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 20 Apr 2023 09:56:41 +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=PYRTsVNVhfNdly8bLCccYcXLH0JdvZ06DV7MsVJEYg8=; b=IYrym91VIv4I5DoQpsa+2KthozYKniXekZFu4ko4/RtZhxMgQQt1gZ/2kNOkQV00YKINmd6Ivmmcf1c4q7fEPi33j1YQFrRM+sZ+BkGT/jttn3ck/oNbztVpqsaTMv3+Y7qZNGPr1fFLv50cAgRE+Se+ZaE2fW+tSOvp3hdcuTMkFPcLnvBmzRX39si7sTO5igozzKmD+2y+jCf05Rd3xl2m70BMbpjZZdir7h3PfA0eimeUdlFNEb8AebvqYkxwK9sgJvvEwR6TURDjPVUdQ835W74huLORs9J/vNTnpMmRzfBVltlYTLWH+1T/A8ooKm9+jzwa3hRuydk1c/jPkA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NqSlsWBxmxJbD6Aqdb1K/prhdwldMdYfiwqLUmUxXcTkrm3oqtybWMjk4GBOmJE+N1Aii/g8VKM7q6cvYgLgQVbFGMhpsca/7ZooLr0DH/UPIGt2XnWj+HkKF/1DmpIBjXedr3IHTt3beyz1BLX3Rj9WQ9dhKl1MAI4WMCr/A29bMPKUG3pTmK6iPdt3Mo/RNlPcxZczi/W9Cr9cNsvL27y1gl0vLO+ifxgLwQp9jXkxR/ES8Yz2g8GWteJWTpqkHwTdq9MLrTpd46VuGJuzuzGeSDDoKTLXAgF4ZeZvSMX5dOpPvdi9dDMwjG1/GYZqG2sTxGHzNUTtCKx3KlKbQw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Wei Chen <Wei.Chen@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 20 Apr 2023 07:57:00 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 20.04.2023 08:25, Luca Fancellu wrote:
>> On 17 Apr 2023, at 10:41, Jan Beulich <jbeulich@xxxxxxxx> wrote:
>> On 12.04.2023 11:49, Luca Fancellu wrote:
>>> --- a/xen/common/kernel.c
>>> +++ b/xen/common/kernel.c
>>> @@ -314,6 +314,31 @@ int parse_boolean(const char *name, const char *s, 
>>> const char *e)
>>>     return -1;
>>> }
>>>
>>> +int __init parse_signed_integer(const char *name, const char *s, const 
>>> char *e,
>>> +                                long long *val)
>>> +{
>>> +    size_t slen, nlen;
>>> +    const char *str;
>>> +    long long pval;
>>
>> What use is this extra variable?
> 
> I’m using pval to avoid using *val in the case we find that the parsed number 
> is not good,
> I think it’s better to don’t change the *val if any error come out, what do 
> you think?

Caller ought to check the return value before even considering to look
at the value. Then again I can see how, if the address of a global
variable was passed in, that global may be unduly affected. So I guess
what you have is actually okay.

>>> +    slen = e ? ({ ASSERT(e >= s); e - s; }) : strlen(s);
>>> +    nlen = strlen(name);
>>> +
>>> +    /* Does s start with name or contains only the name? */
>>> +    if ( (slen <= nlen) || strncmp(s, name, nlen) || (s[nlen] != '=') )
>>> +        return -1;
>>
>> The comment imo wants wording consistently positive or consistently
>> negative. IOW either you say what you're looking for, or you say
>> what you're meaning to reject.
> 
> Ok I’ll rephrase to:
> 
> /* Check that this is the name we are looking for and the syntax is right */
> 
> Is that better?

It is, thanks. Alternatively how about "... and a value was provided"?

Jan



 


Rackspace

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