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

Re: [PATCH v2 02/10] xen/arm: add sve_vl_bits field to domain


  • To: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 15 Mar 2023 14:32:45 +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=bAclPMKtriJj7HeddeDmW/AaZLDrldwXJXHTtf3cXVY=; b=PSmQSGNbjl/BjX/KjD0yNcb6PVz4EGYjRr/8ST3xr1PQ4DyZGjiWdsJBrWPODelI5QyFshbKyd7tJf7V7s6uWoK+UDRWIK5+YaNVhYAKM92liG/zctWRyJEpyqLG2uvTBrjSJuLzWbMVfvuHcVt78t4wteE9rdmdmiTT2tH712cwAlC+dd68Yi0li8hnfSAgrTRjUZk+2ssVrC6BIo0uU4By7LQa0CwwHae04lSCD6KF1aXxuHjHuMXNv8EW84VhYdOHy3MfsIDgvuD5HFftwPWlQ36zKM9GgOAuf6B+NvMvaLcxN6DVhseg4LP9003INhc6T2l+tntx8wMgdDYcgg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n08l1mHMuLyCPglz2fuemHRtZFgKDdzAjsqVe36fL3D7mDqzP3QFY+jO9tzPs7xp1VUISrSKrYoWT2JwbQxl9V4gHGSqBuGS7Hb9wBg7/pbzQMyKHxbq4+cvywKBJLF3Z4SMdac+ZwbQ05MOYSoacKxf6jzHmT4LLNHdy11jZz7wPSgYlbUGIxfZ9r2q0xkDFSeYeKHLYaFO7TP7phbGrzVVRFZHH0YiyCQTPPzx+Za8S7BNrE3HtFc91GimZsnrS6Hhb2luXukLjwxzcwc9FP50puuv18jExDuj53/hat3DCRkx4u/fm+5dAwmwLpqwIXMvZrPz6T1gAjDWCkuJVA==
  • 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>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 15 Mar 2023 13:33:01 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 15.03.2023 11:09, Luca Fancellu wrote:
>> On 15 Mar 2023, at 09:27, Jan Beulich <jbeulich@xxxxxxxx> wrote:
>> On 15.03.2023 10:05, Luca Fancellu wrote:
>>> --- a/xen/include/public/arch-arm.h
>>> +++ b/xen/include/public/arch-arm.h
>>> @@ -304,6 +304,9 @@ struct xen_arch_domainconfig {
>>>     uint16_t tee_type;
>>>     /* IN */
>>>     uint32_t nr_spis;
>>> +    /* IN */
>>> +    uint16_t sve_vl_bits;
>>> +    uint16_t _pad1;
>>
>> Can register sizes be a non-power-of-2 in size?

>From logic in later patches I infer the answer is "yes" here.

>> If not, by representing
>> the value here as log2(bits) the existing 8-bit padding field could be
>> used instead. Sadly, because of it not having been checked to be zero,
>> that wouldn't avoid ...
>>
>>> --- a/xen/include/public/domctl.h
>>> +++ b/xen/include/public/domctl.h
>>> @@ -21,7 +21,7 @@
>>> #include "hvm/save.h"
>>> #include "memory.h"
>>>
>>> -#define XEN_DOMCTL_INTERFACE_VERSION 0x00000015
>>> +#define XEN_DOMCTL_INTERFACE_VERSION 0x00000016
>>
>> ... the need for the bump here. Yet you want to avoid repeating that
>> mistake and hence check that the new padding field you introduce (if
>> the value needs to remain 16 bits wide) is zero on input.
> 
> Hi Jan,
> 
> Thank you for your suggestion, just to be sure we are on the same page:
> 
> I can store the vector length as VL/128, doing that I can use just 8 bits, so
> I can do this:
> 
> struct xen_arch_domainconfig {
> /* IN/OUT */
> uint8_t gic_version;
> /* IN */
> uint16_t tee_type;
> /* IN */
> uint8_t sve_vl_bits_enc;
> /* IN */
> uint32_t nr_spis;
> [...]
> 
> To take advantage of the existing not explicit padding.
> 
> Is that what you meant? 

Almost:

struct xen_arch_domainconfig {
/* IN/OUT */
uint8_t gic_version;
/* IN */
uint8_t sve_vl_bits_enc;
/* IN */
uint16_t tee_type;
/* IN */
uint32_t nr_spis;
[...]

I'm inclined to suggest to name the new field "sve_vl" only, with the
comment extended to clarify in what units the value is.

Jan



 


Rackspace

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