[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aSQrI9RlZDyvfQtC@r1chard>
Date: Mon, 24 Nov 2025 17:53:39 +0800
From: Richard Lyu <richard.lyu@...e.com>
To: Sean Christopherson <seanjc@...gle.com>,
Paolo Bonzini <pbonzini@...hat.com>
Cc: kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
Kai Huang <kai.huang@...el.com>
Subject: Re: [PATCH] KVM: VMX: Always reflect SGX EPCM #PFs back into the
guest
Reviewed-by: Richard Lyu <richard.lyu@...e.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@...el.com>
> > Signed-off-by: Sean Christopherson <seanjc@...gle.com>
> >
>
> Reviewed-by: Kai Huang <kai.huang@...el.com>
Powered by blists - more mailing lists