acrn-hypervisor/hypervisor/arch/x86/guest
Binbin Wu fa3888c12a hv: ept: disable execute right on large pages
Issue description:
-----------------
Machine Check Error on Page Size Change
Instruction fetch may cause machine check error if page size
and memory type was changed without invalidation on some
processors[1][2]. Malicious guest kernel could trigger this issue.

This issue applies to both primary page table and extended page
tables (EPT), however the primary page table is controlled by
hypervisor only. This patch mitigates the situation in EPT.

Mitigation details:
------------------
Implement non-execute huge pages in EPT.
This patch series clears the execute permission (bit 2) in the
EPT entries for large pages. When EPT violation is triggered by
guest instruction fetch, hypervisor converts the large page to
smaller 4 KB pages and restore the execute permission, and then
re-execute the guest instruction.

The current patch turns on the mitigation by default.
The follow-up patches will conditionally turn on/off the feature
per processor model.

[1] Refer to erratum KBL002 in "7th Generation Intel Processor
Family and 8th Generation Intel Processor Family for U Quad Core
Platforms Specification Update"
https://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/7th-gen-core-family-spec-update.pdf
[2] Refer to erratum SKL002 in "6th Generation Intel Processor
Family Specification Update"
https://www.intel.com/content/www/us/en/products/docs/processors/core/desktop-6th-gen-core-family-spec-update.html

Tracked-On: #4101
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
2019-11-13 08:00:36 +08:00
..
assign.c hv: refine 'uint64_t' string print format in x86 moudle 2019-11-09 11:42:38 +08:00
ept.c hv: refine 'uint64_t' string print format in x86 moudle 2019-11-09 11:42:38 +08:00
guest_memory.c hv: refine 'uint64_t' string print format in x86 moudle 2019-11-09 11:42:38 +08:00
hyperv.c hv: refine 'uint64_t' string print format in x86 moudle 2019-11-09 11:42:38 +08:00
instr_emul.c hv: instr_emul: use cs segment when fetching instructions 2019-11-11 13:55:24 +08:00
pm.c hv:Wrap some APIs related with guest pm 2019-10-21 10:13:02 +08:00
trusty.c hv: sched: support vcpu context switch on one pcpu 2019-10-23 12:47:08 +08:00
ucode.c hv:cleanup header file for guest folder 2019-02-21 10:38:30 +08:00
vcpu.c HV: Fix poweroff issue of hard RTVM 2019-11-04 10:28:16 +08:00
vcpuid.c hv: support minimum set of TLFS 2019-10-22 10:09:16 +08:00
virq.c hv: sched: add kick_thread to support notification 2019-10-25 13:00:21 +08:00
virtual_cr.c hv: refine 'uint64_t' string print format in x86 moudle 2019-11-09 11:42:38 +08:00
vlapic.c hv: refine 'uint64_t' string print format in x86 moudle 2019-11-09 11:42:38 +08:00
vlapic_priv.h hv: add ops to vlapic structure 2019-07-19 16:47:06 +08:00
vm.c hv: refine 'uint64_t' string print format in x86 moudle 2019-11-09 11:42:38 +08:00
vm_reset.c hv: fixed by replace ull to ul. 2019-10-31 09:02:59 +08:00
vmcall.c hv: refine 'uint64_t' string print format in x86 moudle 2019-11-09 11:42:38 +08:00
vmcs.c hv: refine 'uint64_t' string print format in x86 moudle 2019-11-09 11:42:38 +08:00
vmexit.c hv: refine 'uint64_t' string print format in x86 moudle 2019-11-09 11:42:38 +08:00
vmsr.c hv: refine 'uint64_t' string print format in x86 moudle 2019-11-09 11:42:38 +08:00
vmtrr.c hv: refine 'uint64_t' string print format in x86 moudle 2019-11-09 11:42:38 +08:00
vmx_asm.S hv:remove some unnecessary includes 2019-05-07 09:10:13 +08:00
vmx_io.c hv: ept: disable execute right on large pages 2019-11-13 08:00:36 +08:00