KVM: VMX: Fix a wrong usage of vmcs_config
PATCH 1/1 KVM: VMX: Fix a wrong usage of vmcs_config
From a1c929709718c015686b0c23046cc08b8bc47a62 Mon Sep 17 00:00:00 2001
From: Sheng Yang <[email protected]>
Date: Wed, 18 Jun 2008 14:43:38 +0800
Subject: [PATCH] KVM: VMX: Fix a wrong usage of vmcs_config
The function ept_update_paging_mode_cr0() write to CPU_BASED_VM_EXEC_CONTROL based on vmcs_config.cpu_based_exec_ctrl. That's wrong because the variable may not consistent with the content in the CPU_BASE_VM_EXEC_CONTROL MSR.
--- arch/x86/kvm/vmx.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
arch/x86/kvm/vmx.c +0 -0
@@ -1438,7 +1438,7 @@ static void ept_update_paging_mode_cr0(unsigned long
*hw_cr0,
if (!(cr0 & X86_CR0_PG)) {
/* From paging/starting to nonpaging */ vmcs_write32(CPU_BASED_VM_EXEC_CONTROL,
- vmcs_config.cpu_based_exec_ctrl |
+ vmcs_read32(CPU_BASED_VM_EXEC_CONTROL) |
(CPU_BASED_CR3_LOAD_EXITING |
CPU_BASED_CR3_STORE_EXITING));
vcpu->arch.cr0 = cr0;
@@ -1448,7 +1448,7 @@ static void ept_update_paging_mode_cr0(unsigned long *hw_cr0,
} else if (!is_paging(vcpu)) {
/* From nonpaging to paging */ vmcs_write32(CPU_BASED_VM_EXEC_CONTROL,
- vmcs_config.cpu_based_exec_ctrl &
+ vmcs_read32(CPU_BASED_VM_EXEC_CONTROL) &
~(CPU_BASED_CR3_LOAD_EXITING |
CPU_BASED_CR3_STORE_EXITING));
vcpu->arch.cr0 = cr0;
--
1.5.5
From a1c929709718c015686b0c23046cc08b8bc47a62 Mon Sep 17 00:00:00 2001
From: Sheng Yang <[email protected]>
Date: Wed, 18 Jun 2008 14:43:38 +0800
Subject: [PATCH] KVM: VMX: Fix a wrong usage of vmcs_config
The function ept_update_paging_mode_cr0() write to CPU_BASED_VM_EXEC_CONTROL based on vmcs_config.cpu_based_exec_ctrl. That's wrong because the variable may not consistent with the content in the CPU_BASE_VM_EXEC_CONTROL MSR.
--- arch/x86/kvm/vmx.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
arch/x86/kvm/vmx.c +2 -2
@@ -1438,7 +1438,7 @@ static void ept_update_paging_mode_cr0(unsigned long *hw_cr0,if (!(cr0 &X86_CR0_PG )) {/* From paging/starting to nonpaging */ vmcs_write32 (CPU_BASED_VM_EXEC_CONTROL , - vmcs_config.cpu_based_exec_ctrl | +vmcs_read32 (CPU_BASED_VM_EXEC_CONTROL ) | (CPU_BASED_CR3_LOAD_EXITING |CPU_BASED_CR3_STORE_EXITING )); vcpu->arch.cr0 = cr0;
@@ -1448,7 +1448,7 @@ static void ept_update_paging_mode_cr0(unsigned long *hw_cr0, }else if (!is_paging (vcpu)) {/* From nonpaging to paging */ vmcs_write32 (CPU_BASED_VM_EXEC_CONTROL , - vmcs_config.cpu_based_exec_ctrl & +vmcs_read32 (CPU_BASED_VM_EXEC_CONTROL ) & ~(CPU_BASED_CR3_LOAD_EXITING |CPU_BASED_CR3_STORE_EXITING )); vcpu->arch.cr0 = cr0;
Signature · 1 line
1.5.5
Avi Kivity
AppliedQuoted 11 lines · Sheng
From
a1c929709718c015686b0c23046cc08b8bc47a62Mon Sep 17 00:00:00 2001
From: Sheng Yang <[email protected]>
Date: Wed, 18 Jun 2008 14:43:38 +0800
Subject: [PATCH] KVM: VMX: Fix a wrong usage ofvmcs_configThe function
ept_update_paging_mode_cr0()write toCPU_BASED_VM_EXEC_CONTROLbased on vmcs_config.cpu_based_exec_ctrl. That's wrong because the variable may not consistent with the content in theCPU_BASE_VM_EXEC_CONTROLMSR.
Applied, thanks.
Signature · 1 line
error compiling committee.c: too many arguments to function