[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aIlRONVnWJiVbcCv@google.com>
Date: Tue, 29 Jul 2025 15:54:48 -0700
From: Sean Christopherson <seanjc@...gle.com>
To: Rick P Edgecombe <rick.p.edgecombe@...el.com>
Cc: "maz@...nel.org" <maz@...nel.org>, "pbonzini@...hat.com" <pbonzini@...hat.com>,
"oliver.upton@...ux.dev" <oliver.upton@...ux.dev>, Vishal Annapurve <vannapurve@...gle.com>,
Xiaoyao Li <xiaoyao.li@...el.com>, "kvmarm@...ts.linux.dev" <kvmarm@...ts.linux.dev>,
Adrian Hunter <adrian.hunter@...el.com>,
"linux-arm-kernel@...ts.infradead.org" <linux-arm-kernel@...ts.infradead.org>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>, "nik.borisov@...e.com" <nik.borisov@...e.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/5] KVM: TDX: Exit with MEMORY_FAULT on unexpected
pending S-EPT Violation
On Tue, Jul 29, 2025, Rick P Edgecombe wrote:
> On Tue, 2025-07-29 at 12:33 -0700, Sean Christopherson wrote:
> > diff --git a/arch/x86/kvm/vmx/tdx.c b/arch/x86/kvm/vmx/tdx.c
> > index 3e0d4edee849..c2ef03f39c32 100644
> > --- a/arch/x86/kvm/vmx/tdx.c
> > +++ b/arch/x86/kvm/vmx/tdx.c
> > @@ -1937,10 +1937,8 @@ static int tdx_handle_ept_violation(struct kvm_vcpu *vcpu)
> >
> > if (vt_is_tdx_private_gpa(vcpu->kvm, gpa)) {
> > if (tdx_is_sept_violation_unexpected_pending(vcpu)) {
> > - pr_warn("Guest access before accepting 0x%llx on vCPU %d\n",
> > - gpa, vcpu->vcpu_id);
> > - kvm_vm_dead(vcpu->kvm);
> > - return -EIO;
> > + kvm_prepare_memory_fault_exit(vcpu, gpa, 0, true, false, true);
> > + return -EFAULT;
> > }
> > /*
> > * Always treat SEPT violations as write faults. Ignore the
>
> The vm_dead was added because mirror EPT will KVM_BUG_ON() if there is an
> attempt to set the mirror EPT entry when it is already present. And the
> unaccepted memory access will trigger an EPT violation for a mirror PTE that is
> already set. I think this is a better solution irrespective of the vm_dead
> changes.
In that case, this change will expose KVM to the KVM_BUG_ON(), because nothing
prevents userspace from re-running the vCPU. Which KVM_BUG_ON() exactly gets
hit?
Powered by blists - more mailing lists