acrn-hypervisor/hypervisor/arch/x86
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
..
boot hv: Let trampoline execution use 1GB pages 2019-10-28 13:44:32 +08:00
configs HV: fix misra violation on platform clos array 2019-11-08 16:40:14 +08:00
guest hv: ept: disable execute right on large pages 2019-11-13 08:00:36 +08:00
lib hv: move 3 files to lib & arch folder 2019-06-14 14:22:51 +08:00
seed hv: fixed by replace ull to ul. 2019-10-31 09:02:59 +08:00
Kconfig HV: link CONFIG_MAX_IOMMU_NUM and MAX_DRHDS to DRHD_COUNT 2019-11-08 16:40:14 +08:00
cat.c HV: fix misra violation on platform clos array 2019-11-08 16:40:14 +08:00
cpu.c hv:refine 'uint64_t' string print format in comm moudle 2019-11-09 11:42:38 +08:00
cpu_caps.c hv:fixed compilation error in Ubuntu 2019-09-26 14:03:51 +08:00
cpu_state_tbl.c HV: add board specific cpu state table to support Px Cx 2019-07-29 20:25:16 +08:00
e820.c hv: refine 'uint64_t' string print format in x86 moudle 2019-11-09 11:42:38 +08:00
gdt.c hv:cleanup header files for arch folder 2019-02-22 13:14:36 +08:00
idt.S move idt.S and idt.h out of boot component 2018-12-12 09:07:43 +08:00
init.c hv: sched: decouple idle stuff from schedule module 2019-10-23 12:47:08 +08:00
ioapic.c HV: fix violations touched type conversion 2019-07-11 09:16:09 +08:00
irq.c hv: fix Violations touched ACRN Coding Guidelines 2019-08-15 09:47:11 +08:00
lapic.c hv: fix some potential array overflow risk 2019-07-12 09:41:15 +08:00
mmu.c hv:refine 'uint64_t' string print format in comm moudle 2019-11-09 11:42:38 +08:00
notify.c hv: fix some potential array overflow risk 2019-07-12 09:41:15 +08:00
page.c hv: ept: disable execute right on large pages 2019-11-13 08:00:36 +08:00
pagetable.c hv: ept: disable execute right on large pages 2019-11-13 08:00:36 +08:00
pm.c hv: save/restore TSC in host's suspend/resume path 2019-09-19 13:50:50 +08:00
sched.S hv: sched: rename schedule related structs and vars 2019-10-16 10:25:53 +08:00
security.c HV: check security mitigation support for SSBD 2019-07-10 10:55:34 +08:00
sgx.c hv: sgx: add basic support to init sgx resource for vm 2019-05-29 11:24:13 +08:00
timer.c softirq: disable interrupt when modify timer_list 2019-08-01 15:45:02 +08:00
trampoline.c hv: refine 'uint64_t' string print format in x86 moudle 2019-11-09 11:42:38 +08:00
vmx.c hv:fix "no prototype for non-static function" 2019-07-09 10:36:03 +08:00
vtd.c hv: refine 'uint64_t' string print format in x86 moudle 2019-11-09 11:42:38 +08:00
wakeup.S hv: pm: correct the function name 2019-09-11 17:30:24 +08:00