[PATCH 0/4] i386: Clean up SGX for microvm, completely

Zhao Liu posted 4 patches 3 months, 3 weeks ago
hw/i386/sgx-stub.c        |  5 ++++
hw/i386/sgx.c             |  8 +++++++
include/hw/i386/sgx-epc.h |  1 +
target/i386/cpu.c         | 50 ++++++++++++++++++++++++---------------
4 files changed, 45 insertions(+), 19 deletions(-)
[PATCH 0/4] i386: Clean up SGX for microvm, completely
Posted by Zhao Liu 3 months, 3 weeks ago
Hi,

Currently, only PC machine supports SGX and microvm doesn't.

The commit 13be929aff80 ("target/i386: do not crash if microvm guest
uses SGX CPUID leaves") has cleaned up the CPUID 0x12.{0x2..N} for
microvm to avoid Guest crash.

Per my comment on that commit [1], microvm deserves more cleanup to
mask off CPUID 0x12.{0x0,0x1} subleaves as well. But once I actually got
my hands on this, I realized not only we need to clean up CPUID 0x12,
but also we should clean up CPUID 0x7.0.ebx[SGX] for microvm.

Thus, I have this series to completely clean up SGX for microvm.

[1]: https://lore.kernel.org/qemu-devel/Zpcz0cFjW8extm9T@intel.com/

Thanks and Best Regards,
Zhao
---
Zhao Liu (4):
  target/i386/cpu: Remove unnecessary SGX feature words checks
  target/i386/cpu: Explicitly express SGX_LC and SGX feature words
    dependency
  target/i386/cpu: Add dependencies of CPUID 0x12 leaves
  target/i386/cpu: Mask off SGX/SGX_LC feature words for non-PC machine

 hw/i386/sgx-stub.c        |  5 ++++
 hw/i386/sgx.c             |  8 +++++++
 include/hw/i386/sgx-epc.h |  1 +
 target/i386/cpu.c         | 50 ++++++++++++++++++++++++---------------
 4 files changed, 45 insertions(+), 19 deletions(-)

-- 
2.34.1
Re: [PATCH 0/4] i386: Clean up SGX for microvm, completely
Posted by Paolo Bonzini 3 months, 3 weeks ago
Queued, thanks.

Paolo
Re: [PATCH 0/4] i386: Clean up SGX for microvm, completely
Posted by Zhao Liu 3 months, 3 weeks ago
On Tue, Jul 30, 2024 at 05:44:30PM +0200, Paolo Bonzini wrote:
> Date: Tue, 30 Jul 2024 17:44:30 +0200
> From: Paolo Bonzini <pbonzini@redhat.com>
> Subject: Re: [PATCH 0/4] i386: Clean up SGX for microvm, completely
> X-Mailer: git-send-email 2.45.2
> 
> Queued, thanks.
> 

Thanks Paolo! BTW, could you please have a look at another 2 cleanup
seriess from me? :)

https://lore.kernel.org/qemu-devel/20240716161015.263031-1-zhao1.liu@intel.com/

and

https://lore.kernel.org/qemu-devel/20240619144215.3273989-1-zhao1.liu@intel.com/

Best Regards,
Zhao