acrn-hypervisor/hypervisor/include
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
..
arch/x86 hv: ept: disable execute right on large pages 2019-11-19 09:06:21 +08:00
common hv: add new hypercall to fetch platform configurations 2019-04-15 22:14:13 +08:00
debug HV: use term of UUID 2019-04-12 13:45:32 +08:00
dm hv: Build mptable for guest if VM type is Pre-Launched 2019-04-15 15:51:02 +08:00
hw hv: move pci.h to include/hw 2019-04-12 10:09:26 +08:00
lib hv:move 'udelay' to timer.c 2019-03-22 08:38:13 +08:00
public hv: add new hypercall to fetch platform configurations 2019-04-15 22:14:13 +08:00
hv_debug.h HV: Added Initial support for SEP/SOCWATCH profiling 2018-10-26 13:39:07 +08:00
hypervisor.h hv:move 2 APIs from hypervisor.h to guest_memory.c 2019-02-21 10:38:30 +08:00