public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Richard Lyu <richard.lyu@suse.com>
To: Sean Christopherson <seanjc@google.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Kai Huang <kai.huang@intel.com>
Subject: Re: [PATCH] KVM: VMX: Always reflect SGX EPCM #PFs back into the guest
Date: Mon, 24 Nov 2025 17:53:39 +0800	[thread overview]
Message-ID: <aSQrI9RlZDyvfQtC@r1chard> (raw)
In-Reply-To: <4311158801c41117a13afe0136c2807f6d9afbcd.camel@intel.com>

Reviewed-by: Richard Lyu <richard.lyu@suse.com>

On 2025/11/24 00:28, Huang, Kai wrote:
> On Fri, 2025-11-21 at 14:20 -0800, Sean Christopherson wrote:
> > When handling intercepted #PFs, reflect EPCM (Enclave Page Cache Map)
> > violations, i.e. #PFs with the SGX flag set, back into the guest.  KVM
> > doesn't shadow EPCM entries (the EPCM deals only with virtual/linear
> > addresses), and so EPCM violation cannot be due to KVM interference,
> > and more importantly can't be resolved by KVM.
> > 
> > On pre-SGX2 hardware, EPCM violations are delivered as #GP(0) faults, but
> > on SGX2+ hardware, they are delivered as #PF(SGX).  Failure to account for
> > the SGX2 behavior could put a vCPU into an infinite loop due to KVM not
> > realizing the #PF is the guest's responsibility.
> > 
> > Take care to deliver the EPCM violation as a #GP(0) if the _guest_ CPU
> > model is only SGX1.
> > 
> > Fixes: 72add915fbd5 ("KVM: VMX: Enable SGX virtualization for SGX1, SGX2 and LC")
> > Cc: Kai Huang <kai.huang@intel.com>
> > Signed-off-by: Sean Christopherson <seanjc@google.com>
> > 
> 
> Reviewed-by: Kai Huang <kai.huang@intel.com>

  reply	other threads:[~2025-11-24  9:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-21 22:20 [PATCH] KVM: VMX: Always reflect SGX EPCM #PFs back into the guest Sean Christopherson
2025-11-24  0:28 ` Huang, Kai
2025-11-24  9:53   ` Richard Lyu [this message]
2026-01-12 17:39 ` Sean Christopherson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aSQrI9RlZDyvfQtC@r1chard \
    --to=richard.lyu@suse.com \
    --cc=kai.huang@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox