lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YCFuBu3O/U6pP0yr@hirez.programming.kicks-ass.net>
Date:   Mon, 8 Feb 2021 17:59:50 +0100
From:   Peter Zijlstra <peterz@...radead.org>
To:     Sean Christopherson <seanjc@...gle.com>
Cc:     Andi Kleen <ak@...ux.intel.com>,
        Kuppuswamy Sathyanarayanan 
        <sathyanarayanan.kuppuswamy@...ux.intel.com>,
        Andy Lutomirski <luto@...nel.org>,
        Dave Hansen <dave.hansen@...el.com>,
        Kirill Shutemov <kirill.shutemov@...ux.intel.com>,
        Kuppuswamy Sathyanarayanan <knsathya@...nel.org>,
        Dan Williams <dan.j.williams@...el.com>,
        Raj Ashok <ashok.raj@...el.com>, linux-kernel@...r.kernel.org,
        Sean Christopherson <sean.j.christopherson@...el.com>
Subject: Re: [RFC v1 05/26] x86/traps: Add #VE support for TDX guest

On Mon, Feb 08, 2021 at 08:46:23AM -0800, Sean Christopherson wrote:
> On Mon, Feb 08, 2021, Peter Zijlstra wrote:
> > On Mon, Feb 08, 2021 at 08:23:01AM -0800, Andi Kleen wrote:
> > > > > +#ifdef CONFIG_INTEL_TDX_GUEST
> > > > > +DEFINE_IDTENTRY(exc_virtualization_exception)
> > > > > +{
> > > > > +	struct ve_info ve;
> > > > > +	int ret;
> > > > > +
> > > > > +	RCU_LOCKDEP_WARN(!rcu_is_watching(), "entry code didn't wake RCU");
> > > > > +
> > > > > +	/* Consume #VE info before re-enabling interrupts */
> > > > 
> > > > So what happens if NMI happens here, and triggers a nested #VE ?
> > > 
> > > Yes that's a gap. We should probably bail out and reexecute the original
> > > instruction. The VE handler would need to set a flag for that.
> 
> No, NMI cannot happen here.  The TDX-Module "blocks" NMIs until the #VE info is
> consumed by the guest.

'cute', might be useful to have that mentioned somewhere.

> > > Or alternatively the NMI always gets the VE information and puts
> > > it on some internal stack, but that would seem clunkier.
> > 
> > The same is possible with MCE and #DB I imagine.
> 
> The MCE "architecture" for a TDX guest is rather stupid.  The guest is required
> to keep CR4.MCE=1, but at least for TDX 1.0 the VMM is not allowed to inject #MC.
> So, for better or worse, #MC is a non-issue.
> 
> #VE->#DB->#VE would be an issue, presumably this needs to be noinstr (or whatever
> it is that prevents #DBs on functions).

Ah, it is that already ofcourse, so yeah #DB can't happen here.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ