* [PATCH][REPOST] KVM: VMX: Fix a wrong usage of vmcs_config
@ 2008-06-25 8:41 Yang, Sheng
2008-06-25 12:05 ` Avi Kivity
0 siblings, 1 reply; 2+ messages in thread
From: Yang, Sheng @ 2008-06-25 8:41 UTC (permalink / raw)
To: kvm
[-- Attachment #1: Type: text/plain, Size: 1551 bytes --]
From a1c929709718c015686b0c23046cc08b8bc47a62 Mon Sep 17 00:00:00 2001
From: Sheng Yang <sheng.yang@intel.com>
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.
Signed-off-by: Sheng Yang <sheng.yang@intel.com>
---
arch/x86/kvm/vmx.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 6e4278d..6a31406 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -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
[-- Attachment #2: 0001-KVM-VMX-Fix-a-wrong-usage-of-vmcs_config.patch --]
[-- Type: text/x-diff, Size: 1548 bytes --]
From a1c929709718c015686b0c23046cc08b8bc47a62 Mon Sep 17 00:00:00 2001
From: Sheng Yang <sheng.yang@intel.com>
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.
Signed-off-by: Sheng Yang <sheng.yang@intel.com>
---
arch/x86/kvm/vmx.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 6e4278d..6a31406 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH][REPOST] KVM: VMX: Fix a wrong usage of vmcs_config
2008-06-25 8:41 [PATCH][REPOST] KVM: VMX: Fix a wrong usage of vmcs_config Yang, Sheng
@ 2008-06-25 12:05 ` Avi Kivity
0 siblings, 0 replies; 2+ messages in thread
From: Avi Kivity @ 2008-06-25 12:05 UTC (permalink / raw)
To: Yang, Sheng; +Cc: kvm
Yang, Sheng wrote:
> From a1c929709718c015686b0c23046cc08b8bc47a62 Mon Sep 17 00:00:00 2001
> From: Sheng Yang <sheng.yang@intel.com>
> 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.
>
>
Applied, thanks.
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-06-25 12:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-25 8:41 [PATCH][REPOST] KVM: VMX: Fix a wrong usage of vmcs_config Yang, Sheng
2008-06-25 12:05 ` Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox