Use the helper vmcs_set_bits() to update CPU_EXEC_CTRL0. Signed-off-by: Xin Li --- x86/vmx_tests.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c index bb61610d..da925baf 100644 --- a/x86/vmx_tests.c +++ b/x86/vmx_tests.c @@ -369,14 +369,8 @@ static void vmx_pae_free_page_tables_cb(void *pdpt_) static void msr_bmp_init(void) { - void *msr_bitmap; - u32 ctrl_cpu0; - - msr_bitmap = alloc_page(); - ctrl_cpu0 = vmcs_read(CPU_EXEC_CTRL0); - ctrl_cpu0 |= CPU_MSR_BITMAP; - vmcs_write(CPU_EXEC_CTRL0, ctrl_cpu0); - vmcs_write(MSR_BITMAP, (u64)msr_bitmap); + vmcs_set_bits(CPU_EXEC_CTRL0, CPU_MSR_BITMAP); + vmcs_write(MSR_BITMAP, (u64)alloc_page()); } static void *get_msr_bitmap(void) -- 2.54.0