From bcefd673631cfd3fdc10becc8b827e35bc230b0d Mon Sep 17 00:00:00 2001 From: Binbin Wu Date: Wed, 13 Nov 2019 10:09:44 +0800 Subject: [PATCH] hv: config: add an option to disable mce on psc workaround Add a option MCE_ON_PSC_WORKAROUND_DISABLED to disable the software workaround for the issue Machine Check Error on Page Size Change. Tracked-On: #4121 Signed-off-by: Binbin Wu Acked-by: Eddie Dong --- hypervisor/arch/x86/Kconfig | 13 +++++++++++-- hypervisor/arch/x86/security.c | 7 +++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/hypervisor/arch/x86/Kconfig b/hypervisor/arch/x86/Kconfig index f59f414c31..e34f2c2b91 100644 --- a/hypervisor/arch/x86/Kconfig +++ b/hypervisor/arch/x86/Kconfig @@ -21,10 +21,10 @@ config LOGICAL_PARTITION help This scenario will run two pre-launched VMs. -config INDUSTRY +config INDUSTRY bool "Industry VMs" help - This scenario is a typical scenario for industry usage with 4 VMs: + This scenario is a typical scenario for industry usage with 4 VMs: one pre-launched SOS VM, one post-launched Standard VM for HMI, one or two post-launched RT VM for real-time control. @@ -303,3 +303,12 @@ config MAX_KATA_VM_NUM int "Maximum number of Kata Containers in SOS" range 0 1 default 0 + +config MCE_ON_PSC_WORKAROUND_DISABLED + bool "Force to disable software workaround for Machine Check Error on Page Size Change" + default n + help + By default, software workaround for Machine Check Error on Page Size Change is + conditionally applied to the models that may be affected by the issue. However, + the software workaround has negative impact on performance. If all the guest VMs + are trusted, for performance, this option can be set. diff --git a/hypervisor/arch/x86/security.c b/hypervisor/arch/x86/security.c index 39fec50567..28a7655434 100644 --- a/hypervisor/arch/x86/security.c +++ b/hypervisor/arch/x86/security.c @@ -185,6 +185,12 @@ void set_fs_base(void) } #endif +#ifdef CONFIG_MCE_ON_PSC_WORKAROUND_DISABLED +bool is_ept_force_4k_ipage(void) +{ + return false; +} +#else bool is_ept_force_4k_ipage(void) { bool force_4k_ipage = true; @@ -229,3 +235,4 @@ bool is_ept_force_4k_ipage(void) return force_4k_ipage; } +#endif