On Tue, Feb 02, 2021, Edgecombe, Rick P wrote: > On Tue, 2021-01-26 at 23:10 +1300, Kai Huang wrote: > > This series adds KVM SGX virtualization support. The first 15 patches > > starting > > with x86/sgx or x86/cpu.. are necessary changes to x86 and SGX > > core/driver to > > support KVM SGX virtualization, while the rest are patches to KVM > > subsystem. > > Do we need to restrict normal KVM host kernel access to EPC (i.e. via > __kvm_map_gfn() and friends)? As best I can tell the exact behavior of > this kind of access is undefined. The concern would be if any HW ever > treated it as an error, the guest could subject the host kernel to it. > Is it worth a check in those? I don't think so. The SDM does state that the exact behavior is uArch specific, but it also explicitly states that the access will be altered, which IMO doesn't leave any wiggle room for a future CPU to fault instead of using some form of abort semantics. Attempts to execute, read, or write to linear addresses mapped to EPC pages when not inside an enclave will result in the processor altering the access to preserve the confidentiality and integrity of the enclave. The exact behavior may be different between implementations.