mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Avi Kivity <avi@qumranet.com>
To: kvm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Sheng Yang <sheng.yang@intel.com>
Subject: [PATCH 01/19] KVM: VMX: Fix a wrong usage of vmcs_config
Date: Tue, 15 Jul 2008 15:12:20 +0300	[thread overview]
Message-ID: <1216123958-10717-2-git-send-email-avi@qumranet.com> (raw)
In-Reply-To: <1216123958-10717-1-git-send-email-avi@qumranet.com>

From: Sheng Yang <sheng.yang@intel.com>

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>
Signed-off-by: Avi Kivity <avi@qumranet.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 332ed24..d7522aa 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -1441,7 +1441,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;
@@ -1451,7 +1451,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.6.1


  reply	other threads:[~2008-07-15 12:13 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-15 12:12 [PATCH 00/19] KVM Updates for the 2.6.27 (supplemental) Avi Kivity
2008-07-15 12:12 ` Avi Kivity [this message]
2008-07-15 12:12 ` [PATCH 02/19] KVM: VMX: Fake emulate Intel perfctr MSRs Avi Kivity
2008-07-15 12:12 ` [PATCH 03/19] KVM: move slots_lock acquision down to vapic_exit Avi Kivity
2008-07-15 12:12 ` [PATCH 04/19] KVM: s390: dont allocate dirty bitmap Avi Kivity
2008-07-15 12:12 ` [PATCH 05/19] KVM: Fix memory leak on guest exit Avi Kivity
2008-07-15 12:12 ` [PATCH 06/19] KVM: s390: Set guest storage limit and offset to sane values Avi Kivity
2008-07-15 12:12 ` [PATCH 07/19] KVM: s390: rename private structures Avi Kivity
2008-07-15 12:12 ` [PATCH 08/19] KVM: SVM: fix suspend/resume support Avi Kivity
2008-07-15 12:12 ` [PATCH 09/19] x86: KVM guest: make kvm_smp_prepare_boot_cpu() static Avi Kivity
2008-07-15 12:12 ` [PATCH 10/19] KVM: mmu_shrink: kvm_mmu_zap_page requires slots_lock to be held Avi Kivity
2008-07-15 12:12 ` [PATCH 11/19] KVM: VMX: Add ept_sync_context in flush_tlb Avi Kivity
2008-07-15 12:12 ` [PATCH 12/19] KVM: Apply the kernel sigmask to vcpus blocked due to being uninitialized Avi Kivity
2008-07-15 12:12 ` [PATCH 13/19] KVM: x86 emulator: Fix HLT instruction Avi Kivity
2008-07-15 12:12 ` [PATCH 14/19] KVM: check injected pic irq within valid pic irqs Avi Kivity
2008-07-15 12:12 ` [PATCH 15/19] KVM: Prefix some x86 low level function with kvm_, to avoid namespace issues Avi Kivity
2008-07-15 12:12 ` [PATCH 16/19] KVM: MMU: nuke shadowed pgtable pages and ptes on memslot destruction Avi Kivity
2008-07-15 12:12 ` [PATCH 17/19] KVM: MMU: improve invalid shadow root page handling Avi Kivity
2008-07-15 12:12 ` [PATCH 18/19] KVM: x86 emulator: emulate clflush Avi Kivity
2008-07-15 12:12 ` [PATCH 19/19] KVM: MMU: Fix potential race setting upper shadow ptes on nonpae hosts Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1216123958-10717-2-git-send-email-avi@qumranet.com \
    --to=avi@qumranet.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sheng.yang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®