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

RE: [PATCH] xen/arm: Missing N1/A76/A75 FP registers in vCPU context switch


  • To: Julien Grall <julien@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>
  • From: Wei Chen <Wei.Chen@xxxxxxx>
  • Date: Fri, 21 Aug 2020 05:46:12 +0000
  • Accept-language: 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=ByHW+tbO5O1mB4jJAHc/BbCyBMYxzNLs8D4Nouin0N0=; b=TQBMe0oxULVhYcXnb1lIKlj4NekpQE1nbCDe1KHN4guPZyCrzM4W4OFi2Y9Gx0Px6ieL2GOfQheQBsOLqixaocOk9xbe1tPeV8arqFASd5uwLJQrogpvE6Wlyv9KykXqrF6jb8pNhGu+zdSf/1sur8RVOGldN/dmdRX26gy5EUfsqCad5M2wYIPPl3ledsMAFhhhLxrNAPovnmrSL7XuY6hu0x4GWedUFJKjm6pumgNiwvsiJAbeXdqvYEhMmlWyvmxA2cKmuoc0utPVMRKZt/MgXXWSKzJimfy242ujJzUowzDBYEnZhBAsh8Ik22gTzuz6mpPtpxHJAqVqsbbndg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nuPWXe4lB7IE9pkFkuamv9n5TaMhD2R7muQ/R++QUi0moAXkmtYhW3FCd5LQor1+c3x9dW00SWdMH2bAhLBNZpH6hpyZq2vM92sQIk9wc6L5kjuF6MVSpIquiLzkM3AcymEcl6sWXOYp9Zcw4aLEZsatRikMoveLq1HxrNELUvYhd4jJk/UM5ECFYFhoksxlVBCHcjh09cu3qQpzfqZBVGz2UfL27xqjSWzRAY4KuX3qKmg1EQdHsyKvCyHbqGcttFHUtyS9piIUPt2nJBmZPuXDZQn7Q3c7Z3l0Jr26PlTzJA7mf961kCS8w0nanVtiigJLbkcYI44r9b5Uox6NFQ==
  • Authentication-results-original: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=arm.com;
  • Cc: Andre Przywara <Andre.Przywara@xxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Steve Capper <Steve.Capper@xxxxxxx>, Kaly Xin <Kaly.Xin@xxxxxxx>, nd <nd@xxxxxxx>
  • Delivery-date: Fri, 21 Aug 2020 05:46:47 +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: AQHWdQ1DU6QzTrGCRkmVmocCo7wV0qk9oBCAgARr4uA=
  • Thread-topic: [PATCH] xen/arm: Missing N1/A76/A75 FP registers in vCPU context switch

Hi Julien,

> -----Original Message-----
> From: Julien Grall <julien@xxxxxxx>
> Sent: 2020年8月18日 17:51
> To: Wei Chen <Wei.Chen@xxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx;
> sstabellini@xxxxxxxxxx
> Cc: Andre Przywara <Andre.Przywara@xxxxxxx>; Bertrand Marquis
> <Bertrand.Marquis@xxxxxxx>; Steve Capper <Steve.Capper@xxxxxxx>;
> Kaly Xin <Kaly.Xin@xxxxxxx>
> Subject: Re: [PATCH] xen/arm: Missing N1/A76/A75 FP registers in vCPU
> context switch
> 
> Hi Wei,
> 
> On 18/08/2020 04:11, Wei Chen wrote:
> > Xen has cpu_has_fp/cpu_has_simd to detect whether the CPU supports
> > FP/SIMD or not. But currently, this two MACROs only consider value 0
> 
> s/this/these/


Got it

> 
> > of ID_AA64PFR0_EL1.FP/SIMD as FP/SIMD features enabled. But for CPUs
> > that support FP/SIMD and half-precision floating-point features, the
> > ID_AA64PFR0_EL1.FP/SIMD are 1. For these CPUs, xen will treat them as
> > no FP/SIMD support. In this case, the vfp_save/restore_state will not
> > take effect.
> >
> > Unfortunately, Cortex-N1/A76/A75 are the CPUs support FP/SIMD and
> > half-precision floatiing-point.
> 
> I am not sure to understand this sentence. Could you clarify?
> 

Sorry about my  unclear express. From the TRM documents (Cortex-A75/A76/N1), I 
found
their ID_AA64PFR0_EL1.FP and ID_AA64PFR0_EL1.SIMD fields are 0x1.  It's because 
except
basic Advanced SIMD/FP supports, these CPUs also support half-precision 
floating-point
arithmetic.

> > Their ID_AA64PFR0_EL1.FP/SMID are 1
> > (see Arm ARM DDI0487F.b, D13.2.64). In this case, on N1/A76/A75
> > platforms, Xen will always miss the float pointer registers save/restore.
> 
> s/float pointer/floating point/?
> 

Yes

> > If different vCPUs are running on the same pCPU, the float pointer
> 
> Likewise?
>

Yes, I will fix these typos in next version.
 
> > registers will be corrupted randomly.
> >
> > This patch fixes Xen on these new cores.
> >
> > Signed-off-by: Wei Chen <wei.chen@xxxxxxx>
> > ---
> >   xen/include/asm-arm/cpufeature.h | 4 ++--
> >   1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/xen/include/asm-arm/cpufeature.h b/xen/include/asm-
> arm/cpufeature.h
> > index 674beb0353..588089e5ae 100644
> > --- a/xen/include/asm-arm/cpufeature.h
> > +++ b/xen/include/asm-arm/cpufeature.h
> > @@ -13,8 +13,8 @@
> >   #define cpu_has_el2_64    (boot_cpu_feature64(el2) >= 1)
> >   #define cpu_has_el3_32    (boot_cpu_feature64(el3) == 2)
> >   #define cpu_has_el3_64    (boot_cpu_feature64(el3) >= 1)
> > -#define cpu_has_fp        (boot_cpu_feature64(fp) == 0)
> > -#define cpu_has_simd      (boot_cpu_feature64(simd) == 0)
> > +#define cpu_has_fp        (boot_cpu_feature64(fp) <= 1)
> > +#define cpu_has_simd      (boot_cpu_feature64(simd) <= 1)
> >   #define cpu_has_gicv3     (boot_cpu_feature64(gic) == 1)
> >   #endif
> >
> > --
> > 2.17.1
> >
> > IMPORTANT NOTICE: The contents of this email and any attachments are
> confidential and may also be privileged. If you are not the intended 
> recipient,
> please notify the sender immediately and do not disclose the contents to any
> other person, use it for any purpose, or store or copy the information in any
> medium. Thank you.
> 
> Please configure your e-mail client to remove the disclaimer.
> 

Thanks for this reminder. I have done.

> Cheers,
> 
> --
> Julien Grall

 


Rackspace

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