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

Re: [PATCH v4 10/12] xen/tools: add sve parameter in XL configuration


  • To: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Thu, 6 Apr 2023 05:53:57 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.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=oY4jx1GTbRwnlCdCm9O33GMybE9G6DdERn2IfAZfgFw=; b=GXrMu+W94DMnFE1sX23cZWTeGOznRY8o7HXB7WR+OVckROmZ5UqO/etVtGlSiIMffsT1iB1y0s7n5b42Y31ZNMOcGNke7yG0QFwg5P0+q/09kduMbgd2YDLJlRLJaUrDBROc7rDoJZODnVhH/O4swFz8tZDxQ5Bmp79Zqmhk8R80bNH4T+bDc2709X3dTpTST7gkc+O5lB4B2WVBwAW6qPFzRyEldtbm+qTTZDlbQgCuFotYXgI8TmD/yxpcbbiRtoKxNhRE8zB+TDDQFwyAqtXDmnsZ1ik1/GM9sN8xiJczfKsCvMlIDgVRk5Y0W9uYSNNmU8b2Iwdn3MKq1kEzyw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R+ui8UZbw7a/YVI/klLz5RrvgL8pEzPkNOamcMK0MT7T5/lRjVL2/JVAx2RmQQ81Ij4JEE5UTUEbIH/VQdAE34TTvKOwNw1rdfnjRnf9E5zVn8Fispc6LF6MaOfsMi5m8UulsFCSKPquh+Tom44lVMeHwEbpGD4HHLDerXuJYXlYgs7tTqS/UOvT2uVXc9Tjw4x++MIpRpjnbAPQwoo5W9sz3cgZjSEtyTelYqGgDQSDpnAe5pEyUomDODpwfsEDh35JatM41dR6AH4sqY8IIcARH9nUAxGJx0Xa0XJgky/AM7og8p5NQUiGwotARNdCxxKs8tSf7em9b9WSXdPJ8w==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Wei Chen <Wei.Chen@xxxxxxx>, Wei Liu <wl@xxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Nick Rosbrook <rosbrookn@xxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxx>
  • Delivery-date: Thu, 06 Apr 2023 05:54:48 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHZYJtmX5JG1Zpok0mjr+irvDjf6q8U92AAgAY/qICAAap2gIAA9ZmA
  • Thread-topic: [PATCH v4 10/12] xen/tools: add sve parameter in XL configuration

Hi Anthony,

>> 
>> Yes I can change it, a need to do it anyway because I think also here, the 
>> suggestion
>> From Jan can apply and we could pass a negative value that means “max VL 
>> supported
>> by the platform"
> 
> Well, it's a config file, not a C ABI, so max allowed here doesn't have to be
> spelled "-1", it could also be "max", "max-allowed",
> "max-size-supported", ... So fill free deviate from the restricted C
> ABI. But "-1" works as long as it's the only allowed negative number.

Yes while working on the patch I’ve found that I could declare this type in 
Libxl:

libxl_sve_type = Enumeration("sve_type", [
    (0, "disabled"),
    (128, "128"),
    (256, "256"),
    (384, "384"),
    (512, "512"),
    (640, "640"),
    (768, "768"),
    (896, "896"),
    (1024, "1024"),
    (1152, "1152"),
    (1280, "1280"),
    (1408, "1408"),
    (1536, "1536"),
    (1664, "1664"),
    (1792, "1792"),
    (1920, "1920"),
    (2048, "2048"),
    (-1, "hw")
    ], init_val = "LIBXL_SVE_TYPE_DISABLED”)

So that in xl I can just use libxl_sve_type_from_string

> 
>>> 
>>>> +supported bits value, then the domain creation will fail.
>>>> +A value equal to zero is the default and it means this guest is not 
>>>> allowed to
>>>> +use SVE.
>>>> +
>>>> +=back
>>>> +
>>>> =head3 x86
>>>> 
>>>> =over 4
>>>> diff --git a/tools/libs/light/libxl_arm.c b/tools/libs/light/libxl_arm.c
>>>> index ddc7b2a15975..16a49031fd51 100644
>>>> --- a/tools/libs/light/libxl_arm.c
>>>> +++ b/tools/libs/light/libxl_arm.c
>>>> @@ -211,6 +211,8 @@ int libxl__arch_domain_prepare_config(libxl__gc *gc,
>>>>        return ERROR_FAIL;
>>>>    }
>>>> 
>>>> +    config->arch.sve_vl = d_config->b_info.arch_arm.sve;
>>> 
>>> This truncate a 16bit value into an 8bit value, I think you should check
>>> that the value can actually fit.
>>> 
>>> And maybe check `d_config->b_info.arch_arm.sve` value here instead of
>>> `xl` as commented later.
>> 
>> Yes I can do it, one question, can I use here xc_physinfo to retrieve the 
>> maximum
>> Vector length from arch_capabilities?
>> I mean, is there a better way or I can go for that?
> 
> Yeah, there might be a "better" way. I think me suggestion to check the
> sve value here was wrong. I still want to have it checked in libxl, but
> it might be better to do that in the previous step, that is
> "libxl__domain_config_setdefault". libxl__arch_domain_build_info_setdefault()
> will have `physinfo` so you won't have to call xc_physinfo().

Right, I’ve seen it before but I was unsure if it was the right way, now that 
you
suggested it, I will go for that.

Thank you.

Cheers,
Luca




 


Rackspace

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