mbox series

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

Message ID 20240730045544.2516284-1-zhao1.liu@intel.com (mailing list archive)
Headers show
Series i386: Clean up SGX for microvm, completely | expand

Message

Zhao Liu July 30, 2024, 4:55 a.m. UTC
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(-)

Comments

Paolo Bonzini July 30, 2024, 3:44 p.m. UTC | #1
Queued, thanks.

Paolo
Zhao Liu July 30, 2024, 4:07 p.m. UTC | #2
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