Hello Sven,
On 12/15/23 15:41, Sven Anderson wrote:
[snip]
> I have two more questions: is this only a detection issue, so could I still
> run code with these instructions? Or is the XSAVE support necessary for the
> instructions to work / be enabled? (From my rough understanding I would
Strictly speaking, you can use the instructions without XSAVE. XSAVE
comes into play when you have multiple FPU contexts which need to be
saved/restored. This is the case with multiple processes/tasks and that
is what the Linux kernel does for its userspace.
However, if you e.g. have a (simple) native subject without tasking etc.
you should be able to just use the instructions and not run into issues,
as the SK keeps the per-subject FPU state separate and there is no other
code within the same subject which could corrupt your FPU state.
> guess the second is the case, but I’m not sure.) And is there any
> difference to mirage-os subjects?
I do not know in detail whether and/or how mirage-os subjects do
discovery of supported FPU features. It might even be the case that used
features are used are assumed to be present. If the discovery happens
via CPUID, then the SM changes related to FPU feature announcement are
also necessary. Alternatively, maybe there is a simpler (build-time) way
to configure the enabled FPU features of MirageOS unikernels. It is
worth checking someone knowledgeable from the MirageOS community, though.