acrn-hypervisor/hypervisor/arch/x86/guest
Binbin Wu a94b2a533e 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: #4120
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
2019-11-19 09:06:21 +08:00
..
assign.c hv: fix some potential array overflow risk 2019-07-19 16:39:01 +08:00
ept.c hv:cleanup header file for guest folder 2019-02-21 10:38:30 +08:00
guest_memory.c HV: Modularize boot folder 2019-03-14 09:05:53 +08:00
instr_emul.c hv: fix "Else alternative missing in if." 2019-04-03 09:20:55 +08:00
pm.c HV: Minor refinement about RTVM pm MACRO and comments 2019-04-04 00:27:55 +08:00
trusty.c hv: ept: flush cache for modified ept entries 2019-11-19 09:06:21 +08:00
ucode.c hv:cleanup header file for guest folder 2019-02-21 10:38:30 +08:00
vcpu.c HV: Using INIT to kick vCPUs off when RTVM poweroff by itself 2019-03-29 16:17:44 +08:00
vcpuid.c hv: disable mpx capability for guest 2019-03-20 13:07:31 +08:00
virq.c hv: Remove separate interrupt routine for pre-launched VMs 2019-04-04 17:51:36 +08:00
virtual_cr.c hv: vlapic: remove TPR set/get API 2019-03-25 13:31:51 -07:00
vlapic_priv.h hv: self-IPI APIC register in x2APIC mode of guest vLAPIC 2018-11-02 13:48:43 +08:00
vlapic.c hv: fix possible buffer overflow in vlapic.c 2019-04-23 13:45:28 +08:00
vm.c hv: ept: flush cache for modified ept entries 2019-11-19 09:06:21 +08:00
vmcall.c hv: add new hypercall to fetch platform configurations 2019-04-15 22:14:13 +08:00
vmcs.c hv: vlapic: add combined constraint for APICv 2019-03-12 20:37:06 +08:00
vmexit.c hv: rename io_emul.c to vmx_io.c 2019-04-12 10:09:26 +08:00
vmsr.c hv: vlapic: remove vlapic_rdmsr/wrmsr 2019-04-12 10:11:10 +08:00
vmtrr.c hv: vmtrr: hide mtrr if hide_mtrr is true 2019-03-16 17:14:12 +08:00
vmx_asm.S hv: refine guest.h 2019-02-03 13:00:42 +08:00
vmx_io.c hv: ept: disable execute right on large pages 2019-11-19 09:06:21 +08:00