On Wed, Sep 08, 2021 at 12:03:56PM +0200, Paolo Bonzini wrote: > From: Sean Christopherson <sean.j.christopher...@intel.com> > > Because SGX EPC is enumerated through CPUID, EPC "devices" need to be > realized prior to realizing the vCPUs themselves, i.e. long before > generic devices are parsed and realized. From a virtualization > perspective, the CPUID aspect also means that EPC sections cannot be > hotplugged without paravirtualizing the guest kernel (hardware does > not support hotplugging as EPC sections must be locked down during > pre-boot to provide EPC's security properties). >
> qapi/machine.json | 26 +++++++++++++++ > qemu-options.hx | 10 ++++-- > 9 files changed, 166 insertions(+), 8 deletions(-) > create mode 100644 hw/i386/sgx.c ... > +++ b/qapi/machine.json > @@ -1194,6 +1194,32 @@ > } > } > > +## > +# @SgxEPC: > +# > +# Sgx EPC cmdline information > +# > +# @memdev: memory backend linked with device > +# > +# Since: 6.1 Another instance where we'll want the followup patch to correct things to 6.2. > +## > +{ 'struct': 'SgxEPC', > + 'data': { 'memdev': 'str' } > +} > + > +## > +# @SgxEPCProperties: > +# > +# Properties for SgxEPC objects. > +# > +# @sgx-epc: sgx epc section properties. > +# > +# Since: 6.1 > +## > +{ 'struct': 'SgxEPCProperties', > + 'data': { 'sgx-epc': ['SgxEPC'] } > +} > + > ## > # @MemoryDeviceInfo: > # > diff --git a/qemu-options.hx b/qemu-options.hx > index 8f603cc7e6..ceca52818a 100644 > --- a/qemu-options.hx -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org