acrn-hypervisor/hypervisor/include/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 hv:Move severl variable declaration for boot code 2019-01-25 21:32:21 +08:00
guest hv: Build mptable for guest if VM type is Pre-Launched 2019-04-15 15:51:02 +08:00
apicreg.h hv: Use Interrupt Remapping format for programming interrupt sources 2019-02-01 15:54:55 +08:00
board.h hv: remove CONFIG_PARTITION_MODE for pre-launched VM vE820 creation 2019-03-19 14:28:43 +08:00
cat.h HV: CAT: support config CAT from acrn_vm_config 2019-02-28 11:22:29 +08:00
cpu_caps.h hv: vlapic: add combined constraint for APICv 2019-03-12 20:37:06 +08:00
cpu.h hv: Remove CONFIG_PARTITION_MODE used to compile out irq enable/disable 2019-04-08 13:10:44 +08:00
cpufeatures.h HV: CAT: capability enumaration 2019-02-28 11:22:29 +08:00
cpuid.h hv: disable mpx capability for guest 2019-03-20 13:07:31 +08:00
default_acpi_info.h HV: refine location of platform_acpi_info header 2019-03-08 10:34:14 +08:00
e820.h hv: remove CONFIG_PARTITION_MODE for pre-launched VM vE820 creation 2019-03-19 14:28:43 +08:00
gdt.h hv: coding style: remove no real declaration for external variable 2018-12-20 20:20:08 +08:00
host_pm.h hv:Move pm state structure to pm.h 2019-01-07 11:23:22 +08:00
hv_arch.h hv: rename io_emul.c to vmx_io.c 2019-04-12 10:09:26 +08:00
idt.h hv:cleanup header files for arch folder 2019-02-22 13:14:36 +08:00
init.h hv: init: minor fix related to header file 2019-01-11 21:53:09 +08:00
io.h hv:modulization for IO Emulation 2019-01-21 13:49:54 +08:00
ioapic.h hv:cleanup header files for arch folder 2019-02-22 13:14:36 +08:00
irq.h hv: Remove separate interrupt routine for pre-launched VMs 2019-04-04 17:51:36 +08:00
lapic.h HV: Remove the check pcpu active status when sending INIT 2019-04-04 00:27:55 +08:00
mmu.h hv: vtd: export iommu_flush_cache 2019-11-19 09:06:21 +08:00
msr.h HV: CAT: add platform specified info for CLOS 2019-02-28 11:22:29 +08:00
multiboot.h HV: Remove hypervisor.h from bsp folder 2019-03-25 11:13:57 +08:00
page.h hv: ept: disable execute right on large pages 2019-11-19 09:06:21 +08:00
per_cpu.h hv:move instr_emul_ctxt instance to struct vcpu 2019-03-13 14:04:20 +08:00
pgtable.h hv: ept: flush cache for modified ept entries 2019-11-19 09:06:21 +08:00
security.h Make ibrs_type as internal variable 2018-12-19 09:07:14 +08:00
seed.h hv: seed: refine header file 2019-03-15 14:09:56 +08:00
timer.h hv:move 'udelay' to timer.c 2019-03-22 08:38:13 +08:00
trampoline.h hv:Move severl variable declaration for boot code 2019-01-25 21:32:21 +08:00
vm_config.h hv: Build mptable for guest if VM type is Pre-Launched 2019-04-15 15:51:02 +08:00
vmx.h hv: rename MACROs 'VMX_CRx_MASK" 2019-02-01 16:49:39 +08:00
vtd.h hv: vtd: export iommu_flush_cache 2019-11-19 09:06:21 +08:00
zeropage.h hv: minimize the case of "identifier reuse" 2018-12-07 15:21:39 +08:00