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

Re: [PATCH v4 08/12] xen/physinfo: encode Arm SVE vector length in arch_capabilities


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Thu, 30 Mar 2023 10:41:35 +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=uSAEO2x3X3MlmRd359r+k61fgH3bIwm7sU+bGyYrVSE=; b=Q2dergyF4nRfiquYV1Q/77W5lTyBL43hlZuHY+tlSMVo/kAPhLMFBbmvsBv58dQLS1ds/VZ4VZfIde9qMFfMVqVHtZysOs1cUpzy5YYBupu6mjyYIHwvGVKau4lAP9QNgDoOL5kjSzriBCEFTRdxPs/1FWRSdmhAWYkaa/jULJq4VGyzpZsmsCEjEIgILmLec6m8PCSnmFLrQ9rqUYrwGYHSOuhcqXboOAadW9dXyKYYVcpHAf5xyWNSKD4RSLCAPhvVT05yJIohltj+G4mzfyG2oLG8R++0llMfoROPafNyhV1L0k8xeG4fsCo1KMHV7wideT3mf+0rOVfijBS05A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bzc0NDdc4RxFw/3chQqAyLbFJxnyFhPy+LHVUd6pHoIF70C169YnCv0B/zsPOML44YvaPu54/DdL0LitWdeP0ZxjI0/ji68jbX6dg/tl1oM+p3CBVwuPyfi8XjzvSiUHBRN3v/q7kh/Mykx70YVCjp95Fy+2e1mZcpnsyDFqNpCIF9FYIyxJTjOsfCZaK7YAjox9/vYcYbdJP3r2AjtYi/MKs+r4QgYzKDaX31Yee2QAd3BAMn9fd0bmpHwBcBywh6GNQgWAmViFjgp11ZZiuA28THnLDIN6qOkHyzndNtjAtCuiUy7ga6t1i3sA240dnZqSG+vrG8s0QmTuPTZoKw==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.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: Thu, 30 Mar 2023 10:41:57 +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: AQHZYJtgTfBLBphVFEKpZ9zmMHKmq68P+xMAgAMsEIA=
  • Thread-topic: [PATCH v4 08/12] xen/physinfo: encode Arm SVE vector length in arch_capabilities


> On 28 Mar 2023, at 11:14, Jan Beulich <jbeulich@xxxxxxxx> wrote:
> 
> On 27.03.2023 12:59, Luca Fancellu wrote:
>> --- a/xen/arch/arm/arm64/sve.c
>> +++ b/xen/arch/arm/arm64/sve.c
>> @@ -124,3 +124,15 @@ int __init sve_parse_dom0_param(const char *str_begin, 
>> const char *str_end)
>> {
>>     return parse_integer("sve", str_begin, str_end, (int*)&opt_dom0_sve);
>> }
>> +
>> +void sve_arch_cap_physinfo(uint32_t *arch_capabilities)
>> +{
>> +    if ( cpu_has_sve )
>> +    {
>> +        /* Vector length is divided by 128 to save some space */
>> +        uint32_t sve_vl = MASK_INSR(sve_encode_vl(get_sys_vl_len()),
>> +                                    XEN_SYSCTL_PHYSCAP_ARM_SVE_MASK);
>> +
>> +        *arch_capabilities |= sve_vl;
>> +    }
>> +}
> 
> I'm again wondering why a separate function is needed, when everything
> that's needed is ...
> 
>> --- a/xen/arch/arm/sysctl.c
>> +++ b/xen/arch/arm/sysctl.c
>> @@ -11,11 +11,14 @@
>> #include <xen/lib.h>
>> #include <xen/errno.h>
>> #include <xen/hypercall.h>
>> +#include <asm/arm64/sve.h>
> 
> ... becoming available here for use ...
> 
>> #include <public/sysctl.h>
>> 
>> void arch_do_physinfo(struct xen_sysctl_physinfo *pi)
>> {
>>     pi->capabilities |= XEN_SYSCTL_PHYSCAP_hvm | XEN_SYSCTL_PHYSCAP_hap;
>> +
>> +    sve_arch_cap_physinfo(&pi->arch_capabilities);
> 
> ... here. That would be even more so if, like suggested before,
> get_sys_vl_len() returned 0 when !cpu_has_sve.

I’ve had a look on this, I can do everything In arch_do_physinfo if in 
xen/include/public/sysctl.h
the XEN_SYSCTL_PHYSCAP_ARM_SVE_MASK is protected by __aarch64__ or __arm__ .

Do you agree on that?

> 
> Jan


 


Rackspace

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