Re: [patch 01/10] x86/fpu/signal: Clarify exception handling in restore_fpregs_from_user()

From: Dave Hansen
Date: Wed Sep 01 2021 - 15:23:04 EST


On 9/1/21 9:47 AM, Sean Christopherson wrote:
> As for SGX consuming the trap number in general, it's correct. For non-KVM usage,
> it's nice to have but not strictly necessary. Any fault except #PF on ENCLS is
> guaranteed to be a kernel or hardware bug; SGX uses the trap number to WARN on a
> !#PF exception, e.g. on #GP or #UD. Not having the trap number would mean losing
> those sanity checks, which have been useful in the past.

Yeah, for bare-metal SGX, the trap number only determines if we get a
warning or not. There's no attempt at recovery or any consequential
change in behavior due to the trap number (other than the warning).