[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YKWi1iR4weMzpeC2@google.com>
Date: Wed, 19 May 2021 23:44:22 +0000
From: Sean Christopherson <seanjc@...gle.com>
To: Andy Lutomirski <luto@...nel.org>
Cc: Borislav Petkov <bp@...en8.de>,
Ashish Kalra <Ashish.Kalra@....com>,
Paolo Bonzini <pbonzini@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>, Joerg Roedel <joro@...tes.org>,
thomas.lendacky@....com, the arch/x86 maintainers <x86@...nel.org>,
kvm list <kvm@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
srutherford@...gle.com, venu.busireddy@...cle.com,
brijesh.singh@....com
Subject: Re: [PATCH v2 2/4] mm: x86: Invoke hypercall when page encryption
status is changed
On Wed, May 19, 2021, Andy Lutomirski wrote:
> On Wed, May 12, 2021, at 6:15 AM, Borislav Petkov wrote:
> > On Fri, Apr 23, 2021 at 03:58:43PM +0000, Ashish Kalra wrote:
> > > +static inline void notify_page_enc_status_changed(unsigned long pfn,
> > > + int npages, bool enc)
> > > +{
> > > + PVOP_VCALL3(mmu.notify_page_enc_status_changed, pfn, npages, enc);
> > > +}
> >
> > Now the question is whether something like that is needed for TDX, and,
> > if so, could it be shared by both.
>
> The TDX MapGPA call can fail, and presumably it will fail if the page is not
> sufficiently quiescent from the host's perspective.
Barring a guest bug, e.g. requesting a completely non-existent page, MapGPA
shouldn't fail. The example in the the GHCI:
Invalid operand – for example, the GPA may be already mapped as a shared page.
makes no sense to me. An already-mapped page would be an -EBUSY style error,
not an invalid operand, and IIRC, I explicitly lobbied against allowing the VMM
to return "try again" precisely because it's impossible for the guest to handle
in a sane manner. If the physical page is in a state that requires stalling the
vCPU, then the VMM is supposed to do exactly that, not punt the problem to the
guest.
Maybe we should get stronger language into the GHCI?
> It seems like a mistake to me to have a KVM-specific hypercall for this that
> cannot cleanly fail.
Powered by blists - more mailing lists