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

RE: [PATCH v2 1/2] 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: Tue, 25 Aug 2020 02:31:43 +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=zjVogehV8ITbb2JbbEFo+ugEth5inCuHB6CFTE309u4=; b=UR9yzW5gs3nWcXOkXEvpjtzGgRzsHsCKP69dWdWvxy+EE/BQZaGtN1YpH26oBUJreEYM5mxxJ8IC+QOHClQrp+8AvzGj4e4NYfhNx0laN7aeF0Ah7Ux9Yp463gZa1ljipxuCjJRrbabggGOch7kPO2JRTbEweIiPfY84sAtoiYylYICq02GcYPerPAJG0VyZX9AUAByZpKiDuTeP4Y7EkB3safY7yosgJe8SddKlwr8tJ297Hg4/MKG2GhKoZgrZBN4UG3Y1a7AmS1N8lrvK/A6vP/t4Uer44/+70u9bn7Kg7XG9FslgF3a9CcWIlywP3heaEY/xjFrixDCtKMmTPw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R3tec/pqvSRpGMpKF4vAQIMgyIjvqccUBUPBbG3ZIUHkdvhgxPrqoasrYbMxWxbLE+ZS/6iAM4lw1hrS5pzKGNIqa5ZRTN1czB6w4yK/uSRRYHwN4pnhLtzWvV3FRhuUFp75nDSLmdFmhlPRJgxgZtb6OA1XjPN6YI5kJzIQfwMU6iJGYUdP4dC+bY+m/xPq+on1l28QbHO6OJWlbb9LXcr1L5JLkZKxOVSKkHdHzSjjkzaDDI5w2/mEFWZZHBs97LdE5ViDybeVIwHNXszSAJPgIYj2RSOR2c4iybdpMHEPI6PiXVLY72K7imXty12+BmUl4cYuqcgAmZjqYtoOHQ==
  • 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>, Penny Zheng <Penny.Zheng@xxxxxxx>, Kaly Xin <Kaly.Xin@xxxxxxx>, nd <nd@xxxxxxx>
  • Delivery-date: Tue, 25 Aug 2020 02:31:59 +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: AQHWecbQ1sBF1ew3NUWUNX3qV5XwE6lHPaIAgADebuA=
  • Thread-topic: [PATCH v2 1/2] xen/arm: Missing N1/A76/A75 FP registers in vCPU context switch

Hi,

> -----Original Message-----
> From: Julien Grall <julien@xxxxxxx>
> Sent: 2020年8月24日 21:15
> To: Wei Chen <Wei.Chen@xxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx;
> sstabellini@xxxxxxxxxx
> Cc: Andre Przywara <Andre.Przywara@xxxxxxx>; Bertrand Marquis
> <Bertrand.Marquis@xxxxxxx>; Penny Zheng <Penny.Zheng@xxxxxxx>;
> Kaly Xin <Kaly.Xin@xxxxxxx>; nd <nd@xxxxxxx>
> Subject: Re: [PATCH v2 1/2] xen/arm: Missing N1/A76/A75 FP registers in
> vCPU context switch
> 
> Hi,
> 
> On 24/08/2020 04:28, Wei Chen wrote:
> > Xen has cpu_has_fp/cpu_has_simd to detect whether the CPU supports
> > FP/SIMD or not. But currently, these two MACROs only consider value 0
> > of ID_AA64PFR0_EL1.FP/SIMD as FP/SIMD features enabled. But for CPUs
> > that support FP/SIMD and half-precision floating-point arithmetic, the
> > ID_AA64PFR0_EL1.FP/SIMD are 1 (see Arm ARM DDI0487F.b, D13.2.64).
> > For these CPUs, xen will treat them as no FP/SIMD supporti, the
> 
> s/supporti/support/

I will fix this typo in next version.

> 
> > vfp_save/restore_state will not take effect.
> >
> >  From the TRM documents of Cortex-A75/A76/N1, we know these CPUs
> support
> > basic Advanced SIMD/FP and half-precision floating-point arithmetic. In
> > this case, on N1/A76/A75 platforms, Xen will always miss the floating
> > pointer registers save/restore. If different vCPUs are running on the
> > same pCPU, the floating pointer registers will be corrupted randomly.
> >
> > This patch fixes Xen on these new cores.
> >
> > Signed-off-by: Wei Chen <wei.chen@xxxxxxx>
> > Reviewed-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>
> 
> Reviewed-by: Julien Grall <jgrall@xxxxxxxxxx>
> 
> Cheers,
> 
> > ---
> >   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..10878ead8a 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) < 8)
> > +#define cpu_has_simd      (boot_cpu_feature64(simd) < 8)
> >   #define cpu_has_gicv3     (boot_cpu_feature64(gic) == 1)
> >   #endif
> >
> >
> 
> --
> Julien Grall

 


Rackspace

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