qemu-e2k/include/hw/i386
Sean Christopherson dfce81f1b9 vl: Add sgx compound properties to expose SGX EPC sections to guest
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).

So even though EPC sections could be realized through the generic
-devices command, they need to be created much earlier for them to
actually be usable by the guest.  Place all EPC sections in a
contiguous block, somewhat arbitrarily starting after RAM above 4g.
Ensuring EPC is in a contiguous region simplifies calculations, e.g.
device memory base, PCI hole, etc..., allows dynamic calculation of the
total EPC size, e.g. exposing EPC to guests does not require -maxmem,
and last but not least allows all of EPC to be enumerated in a single
ACPI entry, which is expected by some kernels, e.g. Windows 7 and 8.

The new compound properties command for sgx like below:
 ......
 -object memory-backend-epc,id=mem1,size=28M,prealloc=on \
 -object memory-backend-epc,id=mem2,size=10M \
 -M sgx-epc.0.memdev=mem1,sgx-epc.1.memdev=mem2

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Yang Zhong <yang.zhong@intel.com>
Message-Id: <20210719112136.57018-6-yang.zhong@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-09-30 14:50:20 +02:00
..
apic_internal.h nomaintainer: Fix Lesser GPL version number 2020-11-15 17:04:40 +01:00
apic-msidef.h
apic.h
hostmem-epc.h hostmem: Add hostmem-epc as a backend for SGX EPC 2021-09-30 14:50:19 +02:00
ich9.h hw: Replace anti-social QOM type names 2021-03-19 15:18:43 +01:00
intel_iommu.h Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
ioapic_internal.h x86: add support for second ioapic 2020-12-10 08:47:44 +01:00
ioapic.h x86: add support for second ioapic 2020-12-10 08:47:44 +01:00
microvm.h acpi: Move setters/getters of oem fields to X86MachineState 2021-03-22 18:58:19 -04:00
pc.h vl: Add sgx compound properties to expose SGX EPC sections to guest 2021-09-30 14:50:20 +02:00
sgx-epc.h vl: Add sgx compound properties to expose SGX EPC sections to guest 2021-09-30 14:50:20 +02:00
topology.h
vmport.h
x86-iommu.h Use OBJECT_DECLARE_TYPE when possible 2020-09-18 14:12:32 -04:00
x86.h vl: Add sgx compound properties to expose SGX EPC sections to guest 2021-09-30 14:50:20 +02:00