aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSean Christopherson <sean.j.christopherson@intel.com>2021-07-19 19:21:15 +0800
committerPaolo Bonzini <pbonzini@redhat.com>2021-09-30 14:50:20 +0200
commit1dec2e1f19fdb39a0340356ec2d77233837b3d68 (patch)
treea75b0ad171517dafb49696c7e0f991bd99b032ab /include
parenta04835414b8d1ba1af980692d5cf20f8fe4156a0 (diff)
downloadqemu-1dec2e1f19fdb39a0340356ec2d77233837b3d68.zip
qemu-1dec2e1f19fdb39a0340356ec2d77233837b3d68.tar.gz
qemu-1dec2e1f19fdb39a0340356ec2d77233837b3d68.tar.bz2
i386: Update SGX CPUID info according to hardware/KVM/user input
Expose SGX to the guest if and only if KVM is enabled and supports virtualization of SGX. While the majority of ENCLS can be emulated to some degree, because SGX uses a hardware-based root of trust, the attestation aspects of SGX cannot be emulated in software, i.e. ultimately emulation will fail as software cannot generate a valid quote/report. The complexity of partially emulating SGX in Qemu far outweighs the value added, e.g. an SGX specific simulator for userspace applications can emulate SGX for development and testing purposes. Note, access to the PROVISIONKEY is not yet advertised to the guest as KVM blocks access to the PROVISIONKEY by default and requires userspace to provide additional credentials (via ioctl()) to expose PROVISIONKEY. Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com> Signed-off-by: Yang Zhong <yang.zhong@intel.com> Message-Id: <20210719112136.57018-13-yang.zhong@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/hw/i386/pc.h3
-rw-r--r--include/hw/i386/sgx-epc.h2
2 files changed, 5 insertions, 0 deletions
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 668e48b..5748d7c 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -195,6 +195,9 @@ void pc_system_parse_ovmf_flash(uint8_t *flash_ptr, size_t flash_size);
void pc_madt_cpu_entry(AcpiDeviceIf *adev, int uid,
const CPUArchIdList *apic_ids, GArray *entry);
+/* sgx.c */
+void pc_machine_init_sgx_epc(PCMachineState *pcms);
+
extern GlobalProperty pc_compat_6_1[];
extern const size_t pc_compat_6_1_len;
diff --git a/include/hw/i386/sgx-epc.h b/include/hw/i386/sgx-epc.h
index 8326997..75b19f4 100644
--- a/include/hw/i386/sgx-epc.h
+++ b/include/hw/i386/sgx-epc.h
@@ -55,4 +55,6 @@ typedef struct SGXEPCState {
int nr_sections;
} SGXEPCState;
+int sgx_epc_get_section(int section_nr, uint64_t *addr, uint64_t *size);
+
#endif