acrn-hypervisor/hypervisor/arch/x86
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
..
boot function name change in init.c 2018-12-19 09:07:14 +08:00
configs HV:config:Add config to enable logic partition on KBL NUC i7 2019-04-16 12:07:58 +08:00
guest hv: ept: disable execute right on large pages 2019-11-19 09:06:21 +08:00
seed hv: seed: fix potential NULL pointer dereferencing 2019-04-23 10:23:54 +08:00
cat.c HV: CAT: support config CAT from acrn_vm_config 2019-02-28 11:22:29 +08:00
cpu_caps.c hv: fix "Else alternative missing in if." 2019-04-03 09:20:55 +08:00
cpu_state_tbl.c hv:cleanup header files for arch folder 2019-02-22 13:14:36 +08:00
cpu.c HV: return bool in sanitize_vm_config 2019-04-12 13:45:32 +08:00
e820.c hv: cleanup some hva/hpa conversion code 2019-03-15 09:03:14 +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: refactor seed management 2019-03-14 10:38:17 +08:00
ioapic.c hv:cleanup header files for arch folder 2019-02-22 13:14:36 +08:00
irq.c hv: Remove separate interrupt routine for pre-launched VMs 2019-04-04 17:51:36 +08:00
Kconfig HV: move CONFIG_MAX_VM_NUM to vm configurations 2019-04-08 13:08:55 +08:00
lapic.c hv: fix some potential array overflow risk 2019-07-19 16:39:01 +08:00
mmu.c hv: ept: flush cache for modified ept entries 2019-11-19 09:06:21 +08:00
notify.c hv: fix some potential array overflow risk 2019-07-19 16:39:01 +08:00
page.c hv: ept: disable execute right on large pages 2019-11-19 09:06:21 +08:00
pagetable.c hv: ept: disable execute right on large pages 2019-11-19 09:06:21 +08:00
pm.c hv:move instr_emul_ctxt instance to struct vcpu 2019-03-13 14:04:20 +08:00
retpoline-thunk.S license: Replace license text with SPDX tag 2018-06-01 10:43:06 +08:00
sched.S replace arch_switch_to with pure asm code instead of inline asm 2019-01-25 11:39:47 +08:00
security.c hv: fix "Else alternative missing in if." 2019-04-03 09:20:55 +08:00
static_checks.c hv:cleanup header files for arch folder 2019-02-22 13:14:36 +08:00
timer.c hv:move 'udelay' to timer.c 2019-03-22 08:38:13 +08:00
trampoline.c hv: merge SBL and UEFI related stuff under bsp 2019-03-13 10:26:55 +08:00
vmx.c hv:move instr_emul_ctxt instance to struct vcpu 2019-03-13 14:04:20 +08:00
vtd.c hv: vtd: remove global cache invalidation per vm 2019-11-19 09:06:21 +08:00
wakeup.S HV: modularization to refine pm related code. 2018-12-19 13:02:09 +08:00