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

Re: [Minios-devel] [UNIKRAFT RFC PATCH 2/5] plat/kvm: arm64: Enable the fp/simd at the starting point



Hi,

On 21/01/2020 05:13, Jia He wrote:
Hi Julien

On 2019/12/20 15:50, Julien Grall wrote:


On 20/12/2019 01:14, Justin He wrote:
Hi Julien

Hello,


-----Original Message-----
From: Julien Grall <julien@xxxxxxx>
Sent: Thursday, December 19, 2019 10:35 PM
To: Justin He <Justin.He@xxxxxxx>; minios-devel@xxxxxxxxxxxxxxxxxxxx;
Simon Kuenzer <simon.kuenzer@xxxxxxxxx>; Santiago.Pagani@xxxxxxxxx
Cc: Felipe Huici <felipe.huici@xxxxxxxxx>; Kaly Xin <Kaly.Xin@xxxxxxx>;
Julien Grall <Julien.Grall@xxxxxxx>; Sharan.Santhanam@xxxxxxxxx
Subject: Re: [Minios-devel] [UNIKRAFT RFC PATCH 2/5] plat/kvm: arm64:
Enable the fp/simd at the starting point

Hi,

On 19/12/2019 14:27, 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.

In your first patch you say FPSIMD will be available for application
only. But here, you will allow Unikraft itself to use it.

So don't you want to turn this only when jumping to the application code?

Yes, this might be more graceful.
But there is a corner case in libukdebug of Unikraft.
If we removed -mgeneral-regs-only, some printf* family functions (especially those have variable length parameters, .e.g va_start/end) will be compiled to
use q0-q31.

I have already had a lenghty discussion in the past with Wei Chen (see [1]) about it.

If you tell GCC to enable floating point for the kernel, then your exception path (e.g interrupt) may also use floating. Therefore you would also have to save/restore them at *every* exception to prevent any corruption.

Maybe let me clarify it more clear. Sorry if it caused some misunderstanding.

In principle, unkraft kernel part can't use fpsimd, but -mgeneral-registers-only can be global

only. It mean currently I merely can enable/disable -mgeneral-registers-only globally for

every unikraft source file, even for application part and newlib part.


So to resovle it perfectly, seems we need to use different build flag to kernel, application/newlib
part? E.g.

1. for unikraft context switch .S file, it shoultn't use -mgeneral-registers-only because we need

to save/restore v0-v31 registers

2. for other unikraft kernel source file, we need to use -mgeneral-registers-only to forbid the

potential abuse.

3. for application and newlib source file, we need to use -mgeneral-registers-only

I am not sure to follow it. Did you intend to suggest that newlib and the application should be compiled with FPSIMD support (i.e. without -mgeneral-registers-only)?


What do you think of it? thanks

I will wait for more clarification before giving more feedback.

Cheers,

--
Julien Grall

_______________________________________________
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®.