Re: [PATCH 4/4] hv: change 'DISABLED' settings to 'ENABLED'


Eddie Dong
 

Acked-by: Eddie Dong <eddie.dong@...>

-----Original Message-----
From: acrn-dev@... <acrn-dev@...> On
Behalf Of Zhou, Wu
Sent: Thursday, August 4, 2022 2:04 AM
To: acrn-dev@...
Cc: Zhou, Wu <wu.zhou@...>
Subject: [acrn-dev] [PATCH 4/4] hv: change 'DISABLED' settings to 'ENABLED'

In order to improve DX, 'DISABLED' style configurator settings are changed to
'ENABLED' style. The meaning of the MACROs are reversed, so in the hv code
we have to change '#ifndef' -> '#ifdef' or '#ifdef' -> '#ifndef'.

Including:
- MCE_ON_PSC_DISABLED -> MCE_ON_PSC_ENABLED
- ENFORCE_TURNOFF_AC -> AC_ENABLED
- ENFORCE_TURNOFF_GP -> GP_ENABLED

Tracked-On: #7661

Signed-off-by: Wu Zhou <wu.zhou@...>
---
hypervisor/arch/x86/cpu.c | 8 ++++----
hypervisor/arch/x86/security.c | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/hypervisor/arch/x86/cpu.c b/hypervisor/arch/x86/cpu.c index
13ffb3f59..b17497589 100644
--- a/hypervisor/arch/x86/cpu.c
+++ b/hypervisor/arch/x86/cpu.c
@@ -110,7 +110,7 @@ uint64_t get_active_pcpu_bitmap(void)

static void enable_ac_for_splitlock(void) { -#ifndef
CONFIG_ENFORCE_TURNOFF_AC
+#ifdef CONFIG_AC_ENABLED
uint64_t test_ctl;

if (has_core_cap(CORE_CAP_SPLIT_LOCK)) { @@ -118,12 +118,12 @@
static void enable_ac_for_splitlock(void)
test_ctl |= MSR_TEST_CTL_AC_SPLITLOCK;
msr_write(MSR_TEST_CTL, test_ctl);
}
-#endif /*CONFIG_ENFORCE_TURNOFF_AC*/
+#endif /*CONFIG_AC_ENABLED*/
}

static void enable_gp_for_uclock(void)
{
-#ifndef CONFIG_ENFORCE_TURNOFF_GP
+#ifdef CONFIG_GP_ENABLED
uint64_t test_ctl;

if (has_core_cap(CORE_CAP_UC_LOCK)) {
@@ -131,7 +131,7 @@ static void enable_gp_for_uclock(void)
test_ctl |= MSR_TEST_CTL_GP_UCLOCK;
msr_write(MSR_TEST_CTL, test_ctl);
}
-#endif /*CONFIG_ENFORCE_TURNOFF_GP*/
+#endif /*CONFIG_GP_ENABLED*/
}

void init_pcpu_pre(bool is_bsp)
diff --git a/hypervisor/arch/x86/security.c b/hypervisor/arch/x86/security.c
index f4032b040..93d7ac1a9 100644
--- a/hypervisor/arch/x86/security.c
+++ b/hypervisor/arch/x86/security.c
@@ -221,7 +221,7 @@ void set_fs_base(void) } #endif

-#ifdef CONFIG_MCE_ON_PSC_WORKAROUND_DISABLED
+#ifndef CONFIG_MCE_ON_PSC_WORKAROUND_ENABLED
bool is_ept_force_4k_ipage(void)
{
return false;
--
2.25.1




Join {acrn-dev@lists.projectacrn.org to automatically receive all group messages.