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

Re: [PATCH v2 2/2] xen/arm: Throw messages for unknown FP/SIMD implement ID


  • To: Julien Grall <julien@xxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Mon, 24 Aug 2020 16:57:25 +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-SenderADCheck; bh=k0FlwJELG53bRwdhKluepWoZ2uTK0+rOQ9V5twN6I2E=; b=SA3IeAM0/tVq/W7w0Zu9UgREwabryO4wqVth3w/6h+yU3HH1ABgXnfY2WKwsdK2UI6VRPNashNcTv8P4OiGTrnmQyOf985bl2QCJegC4rfW80YUS49AzKVgLdBLBCu/8Gopr30hPflpZ13T2JkcIaeFnP+O10hHHlOcsNAMi4kDUSHpQZeKbRjStDUO+ElwXfMllfa7PdWbfEjqCXImtA6Nb3CeJqqRX+zvRNA/7fr4eH3SvZRRegiQSWxuO1IKfAiP9TV/f9BP354z40NsW9Sieg6lX6rviRmqC8+Za4hza3uzsFZHFDi/kNrJfAGR4gvHpwSPJGzNs5Z6Ci4YIuQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aMTsKrHx6QbnvgD9Zc3YhKcc/9n1uNHNBPIZ3h5AOikDi6XFezovpsoGkkq7SVEKuMEbBbeli+9SETEGmplCBQphVOY5SKIUCw8DsJESHuXJAVWO5iaZYym5mIS5peLL7gSmT2KCNvzDeyZPzCgetkZ0+Q0NdWnVwtdYREZuh95jzCk4YeLEEZuk4lxjpOsfg2i2HGOB3R7mtDk/vHXY9gy5b2k1W3s4Dnkex1QsLC5yuTMFfbYGmHUaKWl4aQykzlDy1WeFR508iLtGuzZxLhvfYS6FeZOMoNi7/pcrA1gIfE4CYQafCbh/nhQXY0rloIEUU/y9y+qeH+Rl9OEWMA==
  • Authentication-results-original: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=arm.com;
  • Cc: Wei Chen <Wei.Chen@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>, Andre Przywara <Andre.Przywara@xxxxxxx>, Penny Zheng <Penny.Zheng@xxxxxxx>, Kaly Xin <Kaly.Xin@xxxxxxx>, nd <nd@xxxxxxx>
  • Delivery-date: Mon, 24 Aug 2020 16:57:46 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHWecazJFpryBm0PEiL+drgXPmkLqlHQwyAgAA4rQA=
  • Thread-topic: [PATCH v2 2/2] xen/arm: Throw messages for unknown FP/SIMD implement ID

Hi Julien,

> On 24 Aug 2020, at 14:34, Julien Grall <julien@xxxxxxx> wrote:
> 
> Hi Wei,
> 
> On 24/08/2020 04:28, Wei Chen wrote:
>> Arm ID_AA64PFR0_EL1 register provides two fields to describe CPU
>> FP/SIMD implementations. Currently, we exactly know the meaning of
>> 0x0, 0x1 and 0xf of these fields. Xen treats value < 8 as FP/SIMD
>> features presented. If there is a value 0x2 bumped in the future,
>> Xen behaviors for value <= 0x1 can also take effect. But what Xen
>> done for value <= 0x1 may not always cover new value 0x2 required.
> 
> Right, but this will also happen with all the other features. This may 
> actually confuse the users as they may think the rest of the features are 
> fully supported which is not correct. For instance, dom0 will crash if you 
> boot Xen on a SVE-capable hardware.

I would see this as an improvement already.
More could be done for SVE (and other bits) but this should be in another patch 
set.

> 
>> We throw these messages to break the silence when Xen detected
>> unknown FP/SIMD IDs to notice user to check.
> 
> It feels a bit odd to me to print unknown for the FP/SIMD feature but not for 
> all the rest.
> 
> IMHO, the right approach is to sanitize ID registers exposed to domains and 
> only expose features we know are correctly handled.

I actually started to look into this last week because I came to an issue 
comparable to SVE with pointer authentication.
Maybe we should discuss this subject separately as clearing TID3 bit in HCR and 
emulating all ID registers is possible
but I want to check first if this could have big impacts on performances and 
see discuss how to design this as there
could be a huge amount of cases for example if we want to allow different 
parameters for different domains.

Cheers

Bertrand

> 
>> Signed-off-by: Wei Chen <wei.chen@xxxxxxx>
>> ---
>>  xen/arch/arm/setup.c | 26 ++++++++++++++++++++++++--
>>  1 file changed, 24 insertions(+), 2 deletions(-)
>> diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
>> index 7968cee47d..c7802d0e49 100644
>> --- a/xen/arch/arm/setup.c
>> +++ b/xen/arch/arm/setup.c
>> @@ -99,6 +99,28 @@ static const char * __initdata processor_implementers[] = 
>> {
>>      ['i'] = "Intel Corporation",
>>  };
>>  +static const char * __initdata fp_implements[] = {
>> +    "Floating-point",
>> +    "Floating-point + half-precision floating-point arithmetic",
>> +    "Floating-point Unknown ID 0x2",
>> +    "Floating-point Unknown ID 0x3",
>> +    "Floating-point Unknown ID 0x4",
>> +    "Floating-point Unknown ID 0x5",
>> +    "Floating-point Unknown ID 0x6",
>> +    "Floating-point Unknown ID 0x7",
>> +};
>> +
>> +static const char * __initdata advsimd_implements[] = {
>> +    "AdvancedSIMD",
>> +    "AdvancedSIMD + half-precision floating-point arithmetic",
>> +    "AdvancedSIMD Unknown ID 0x2",
>> +    "AdvancedSIMD Unknown ID 0x3",
>> +    "AdvancedSIMD Unknown ID 0x4",
>> +    "AdvancedSIMD Unknown ID 0x5",
>> +    "AdvancedSIMD Unknown ID 0x6",
>> +    "AdvancedSIMD Unknown ID 0x7",
>> +};
>> +
>>  static void __init processor_id(void)
>>  {
>>      const char *implementer = "Unknown";
>> @@ -129,8 +151,8 @@ static void __init processor_id(void)
>>             cpu_has_el1_32 ? "64+32" : cpu_has_el1_64 ? "64" : "No",
>>             cpu_has_el0_32 ? "64+32" : cpu_has_el0_64 ? "64" : "No");
>>      printk("    Extensions:%s%s%s\n",
>> -           cpu_has_fp ? " FloatingPoint" : "",
>> -           cpu_has_simd ? " AdvancedSIMD" : "",
>> +           cpu_has_fp ? fp_implements[boot_cpu_feature64(fp)] : "",
>> +           cpu_has_simd ? advsimd_implements[boot_cpu_feature64(simd)] : "",
> So far, each extension name are just a word and they are all separated with 
> spaces. With this change, there will be multiple words per extension which is 
> quite confusion.
> 
> If we decide to go ahead printing the "unknown", then we want to provide a 
> full description of the extension on a separate line. Maybe:
> 
> "AdvancedSIMD: With half-precision floating-point arithmetic".
> 
> 
>>             cpu_has_gicv3 ? " GICv3-SysReg" : "");
>>        printk("  Debug Features: %016"PRIx64" %016"PRIx64"\n",
> 
> Cheers,
> 
> -- 
> Julien Grall




 


Rackspace

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