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

Re: [Minios-devel] [UNIKRAFT PATCH v3 3/7] plat/kvm: arm64: Enable the fp/simd at the starting point


  • To: Sharan Santhanam <sharan.santhanam@xxxxxxxxx>, "minios-devel@xxxxxxxxxxxxxxxxxxxx" <minios-devel@xxxxxxxxxxxxxxxxxxxx>, Simon Kuenzer <simon.kuenzer@xxxxxxxxx>, Felipe Huici <felipe.huici@xxxxxxxxx>
  • From: Justin He <Justin.He@xxxxxxx>
  • Date: Tue, 7 Apr 2020 02:35:37 +0000
  • Accept-language: en-US, zh-CN
  • 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=+TfG9nNdKPijLmIh0r1sU7DBYc50AQrdzbCfxd92cz0=; b=Vl/MNwB+A/xGgEbFW/OD0Sm+v4i+Quep/vCuw7/wxn9xZ83UinSARDb4XLEkrnM1himiQEln0ahhQ0j8AMIyzbIiUhfI6N0WdqsCShi52S/8NQ67thXWdyc1zQCoR5q4H5Lcy0XkxZdeWBfiHRa1cPVdGpCjm4OjzfFarkRO1Y03sab8uhaGVykeIpIYRsPIdbavfcIV/YTQKdPul9ykPb5ucARvSCrShWjdHmtgd6iYWDTenCVRlyKourx8gUDe4oHyaBiCrjdQ3KjSiKkaOavEC808VNTa5Hd+l5rEWVTqoeMWjLp5eYS1rWV7+snxfYiXASqX3vMyd7xtddo6RQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M1eSmL2EaNOqeZhj/PM1nxx4ODBckpv+j8FGLkYzxDXoH5JV/cX8iF3SfobIRlnFjSqxSUSf+zWHmibMsZRDmmLIDI0MPNyCxF8aRnr5oC9yQvb2cXVfbmO6UFlxC6GRxaVK9uulJ+/5cAm+irySJW9cjH6dygrW2GJdFrszrWSpX1N++muhE7UR6JVW64S81PovZeTcZwxCQc1s6K8UpIhEE780lRvFdYsMEIOtRlfJ/G8r/R3ddJnxong7Zjrf9QIOBqJ0kaCBrWNeL9UiV+NHp6XU5ic96K9fkWsrmd139TegSLuLpXylVLFY/3FrNCNhgfqZjGyJb13AwxIfVw==
  • Authentication-results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=bestguesspass action=none header.from=arm.com;
  • Authentication-results-original: spf=none (sender IP is ) smtp.mailfrom=Justin.He@xxxxxxx;
  • Cc: Kaly Xin <Kaly.Xin@xxxxxxx>, nd <nd@xxxxxxx>
  • Delivery-date: Tue, 07 Apr 2020 02:35:53 +0000
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: spf=none (sender IP is ) smtp.mailfrom=Justin.He@xxxxxxx;
  • Thread-index: AQHWCKXcDmLmOieENUqHUIrfTWpmn6hr3LWAgAEaugA=
  • Thread-topic: [UNIKRAFT PATCH v3 3/7] plat/kvm: arm64: Enable the fp/simd at the starting point

Hi Sharan

> -----Original Message-----
> From: Sharan Santhanam <sharan.santhanam@xxxxxxxxx>
> Sent: Monday, April 6, 2020 5:38 PM
> To: Justin He <Justin.He@xxxxxxx>; minios-devel@xxxxxxxxxxxxxxxxxxxx;
> Simon Kuenzer <simon.kuenzer@xxxxxxxxx>; Felipe Huici
> <felipe.huici@xxxxxxxxx>
> Cc: Kaly Xin <Kaly.Xin@xxxxxxx>; nd <nd@xxxxxxx>
> Subject: Re: [UNIKRAFT PATCH v3 3/7] plat/kvm: arm64: Enable the fp/simd
> at the starting point
> 
> 
> On 4/2/20 6:18 AM, Jia He wrote:
> > Write the sys reg to enable the fp/simd feature, otherwise it will
> > cause floating point/simd exception when touching q0-q31.
> >
> > Signed-off-by: Jia He <justin.he@xxxxxxx>
> > ---
> >   plat/kvm/arm/entry64.S | 8 ++++++++
> >   1 file changed, 8 insertions(+)
> >
> > diff --git a/plat/kvm/arm/entry64.S b/plat/kvm/arm/entry64.S
> > index 359a310..1e32268 100644
> > --- a/plat/kvm/arm/entry64.S
> > +++ b/plat/kvm/arm/entry64.S
> > @@ -36,6 +36,7 @@
> >   #include <kvm-arm/mm.h>
> >   #include <arm/cpu_defs.h>
> >   #include <uk/plat/common/sections.h>
> > +#include <uk/config.h>
> >
> >   .global page_table_size
> >   .data
> > @@ -49,6 +50,13 @@ page_table_size:
> >
> >   .text
> >   ENTRY(_libkvmplat_entry)
> > +#ifdef CONFIG_FLOAT_POINT
> > +   /* Enable fp/simd support */
> > +   ldr        x0, =(3 << 20)
> > +   msr        cpacr_el1, x0
> > +   isb
> > +#endif
> 
> Do we need to enable the floating point upon entry?
> 
> It might be better to do it at the setup phase in `setup.c` and
> implement this as inline assembly
If we don't enable fpsimd upon entry, we need to carefully NOT invoking
any uk_pr_*/printf debugging interface before enabling fpsimd. Otherwise
the guest will be trapped into floatingpoint exception and hang forever. 
Please note that we can't prevent the uk_pr_* or printf from using q0-q31.

What do you think of it?

--
Cheers,
Justin (Jia He)

 
> Since it is a cpu feature, it might be better to provide functions to
> enable and disable it.
> 
> > +
> >     /* Calculate the image size */
> >     ldr x25, =_dtb
> >     ldr x26, =_end
_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

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