From: "Huang, Kai" <kai.huang@intel.com>
To: "pbonzini@redhat.com" <pbonzini@redhat.com>,
"seanjc@google.com" <seanjc@google.com>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] KVM: VMX: Always reflect SGX EPCM #PFs back into the guest
Date: Mon, 24 Nov 2025 00:28:14 +0000 [thread overview]
Message-ID: <4311158801c41117a13afe0136c2807f6d9afbcd.camel@intel.com> (raw)
In-Reply-To: <20251121222018.348987-1-seanjc@google.com>
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>
next prev parent reply other threads:[~2025-11-24 0:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-21 22:20 Sean Christopherson
2025-11-24 0:28 ` Huang, Kai [this message]
2025-11-24 9:53 ` Richard Lyu
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=4311158801c41117a13afe0136c2807f6d9afbcd.camel@intel.com \
--to=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
all inboxes | Powered by JetHome®