qemu-patch-raspberry4/target
Sean Christopherson db88806523 i386: Add get/set/migrate support for SGX_LEPUBKEYHASH MSRs
On real hardware, on systems that supports SGX Launch Control, those
MSRs are initialized to digest of Intel's signing key; on systems that
don't support SGX Launch Control, those MSRs are not available but
hardware always uses digest of Intel's signing key in EINIT.

KVM advertises SGX LC via CPUID if and only if the MSRs are writable.
Unconditionally initialize those MSRs to digest of Intel's signing key
when CPU is realized and reset to reflect the fact. This avoids
potential bug in case kvm_arch_put_registers() is called before
kvm_arch_get_registers() is called, in which case guest's virtual
SGX_LEPUBKEYHASH MSRs will be set to 0, although KVM initializes those
to digest of Intel's signing key by default, since KVM allows those MSRs
to be updated by Qemu to support live migration.

Save/restore the SGX Launch Enclave Public Key Hash MSRs if SGX Launch
Control (LC) is exposed to the guest. Likewise, migrate the MSRs if they
are writable by the guest.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Kai Huang <kai.huang@intel.com>
Signed-off-by: Yang Zhong <yang.zhong@intel.com>
Message-Id: <20210719112136.57018-11-yang.zhong@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-09-30 14:50:20 +02:00
..
alpha hw/core: Make do_unaligned_access noreturn 2021-09-21 19:36:44 -07:00
arm hw/core: Make do_unaligned_access noreturn 2021-09-21 19:36:44 -07:00
avr include/exec: Move cpu_signal_handler declaration 2021-09-21 19:36:44 -07:00
cris include/exec: Move cpu_signal_handler declaration 2021-09-21 19:36:44 -07:00
hexagon include/exec: Move cpu_signal_handler declaration 2021-09-21 19:36:44 -07:00
hppa hw/core: Make do_unaligned_access noreturn 2021-09-21 19:36:44 -07:00
i386 i386: Add get/set/migrate support for SGX_LEPUBKEYHASH MSRs 2021-09-30 14:50:20 +02:00
m68k include/exec: Move cpu_signal_handler declaration 2021-09-21 19:36:44 -07:00
microblaze hw/core: Make do_unaligned_access noreturn 2021-09-21 19:36:44 -07:00
mips hw/core: Make do_unaligned_access noreturn 2021-09-21 19:36:44 -07:00
nios2 hw/core: Make do_unaligned_access noreturn 2021-09-21 19:36:44 -07:00
openrisc include/exec: Move cpu_signal_handler declaration 2021-09-21 19:36:44 -07:00
ppc hw/core: Make do_unaligned_access noreturn 2021-09-21 19:36:44 -07:00
riscv hw/core: Make do_unaligned_access noreturn 2021-09-21 19:36:44 -07:00
rx include/exec: Move cpu_signal_handler declaration 2021-09-21 19:36:44 -07:00
s390x hw/core: Make do_unaligned_access noreturn 2021-09-21 19:36:44 -07:00
sh4 hw/core: Make do_unaligned_access noreturn 2021-09-21 19:36:44 -07:00
sparc include/exec: Move cpu_signal_handler declaration 2021-09-21 19:36:44 -07:00
tricore include/exec: Move cpu_signal_handler declaration 2021-09-21 19:36:44 -07:00
xtensa hw/core: Make do_unaligned_access noreturn 2021-09-21 19:36:44 -07:00
Kconfig meson: Introduce target-specific Kconfig 2021-07-09 18:21:34 +02:00
meson.build Drop the deprecated unicore32 target 2021-05-12 18:20:52 +02:00