[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6781e62221ecd5a61ef4982c191cbf9ea97f59ac.camel@kernel.org>
Date: Fri, 03 Sep 2021 09:05:51 +0300
From: Jarkko Sakkinen <jarkko@...nel.org>
To: Thomas Gleixner <tglx@...utronix.de>,
Sean Christopherson <seanjc@...gle.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Al Viro <viro@...iv.linux.org.uk>,
Dan Williams <dan.j.williams@...el.com>,
Borislav Petkov <bp@...en8.de>,
LKML <linux-kernel@...r.kernel.org>,
the arch/x86 maintainers <x86@...nel.org>,
Dave Hansen <dave.hansen@...ux.intel.com>
Subject: Re: [patch 01/10] x86/fpu/signal: Clarify exception handling in
restore_fpregs_from_user()
On Fri, 2021-09-03 at 09:00 +0300, Jarkko Sakkinen wrote:
> On Thu, 2021-09-02 at 16:08 +0200, Thomas Gleixner wrote:
> > On Thu, Sep 02 2021 at 16:08, Jarkko Sakkinen wrote:
> > > On Wed, 2021-09-01 at 16:47 +0000, 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.
> > >
> > > AFAIK, we do not consider #UD as a bug. Agree with the conclusion that SGX
> > > should never #MC, I just did not get this part. #UD is something that is
> > > useful for SGX run-time.
> >
> > I understood that storing the trap number is useful. I was just
> > questioning the #MC angle. I.e. pretending that the #MC caused by ENCLS
> > is recoverable.
>
> Absolutely not.
>
> I mixed up #UD caused by CPU executing inside enclave and ENCLS causing
> #UD. Sorry about that.
>
> Because of KVM we have to catch #PF's, given that a new power cycle
> in the host resets the state of SGX protected memory in the guest.
.. catching #PF's makes also quite a lot of sense for the bare
metal case because otherwise we would have to have hook for
power state change that would have invalidate all enclaves
running in the system.
/Jarkko
Powered by blists - more mailing lists