Skip to contentSkip to conversation

KVM: Fix EPT with WP bit change during paging

PATCH Applied Sheng Yang 2 participants 2 messages Aug 19, 2009

Subsystems (3)
lore
Share & tools
lore

Sheng Yang

author
#0 lore raw

PATCH 1/1 KVM: Fix EPT with WP bit change during paging

QNX update WP bit when paging enabled, which is not covered yet. This one fix QNX boot with EPT.

---

I think it's also necessary for 2.6.31?

 arch/x86/kvm/vmx.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
arch/x86/kvm/vmx.c +3 -3
index 2b7e7bd..1ee811c 100644
@@ -1642,7 +1642,6 @@ static void ept_update_paging_mode_cr0(unsigned long *hw_cr0,
 			      CPU_BASED_CR3_STORE_EXITING));
 		vcpu->arch.cr0 = cr0;
 		vmx_set_cr4(vcpu, vcpu->arch.cr4);
-		*hw_cr0 &= ~X86_CR0_WP;
 	} else if (!is_paging(vcpu)) {
 		/* From nonpaging to paging */
 		vmcs_write32(CPU_BASED_VM_EXEC_CONTROL,
@@ -1651,9 +1650,10 @@ static void ept_update_paging_mode_cr0(unsigned long *hw_cr0,
 			       CPU_BASED_CR3_STORE_EXITING));
 		vcpu->arch.cr0 = cr0;
 		vmx_set_cr4(vcpu, vcpu->arch.cr4);
-		if (!(vcpu->arch.cr0 & X86_CR0_WP))
-			*hw_cr0 &= ~X86_CR0_WP;
 	}
+
+	if (!(cr0 & X86_CR0_WP))
+		*hw_cr0 &= ~X86_CR0_WP;
 }
 
 static void ept_update_paging_mode_cr4(unsigned long *hw_cr4,
Signature · 1 line
1.5.4.5
Applied
#1 lore raw
Quoted 3 lines · Sheng Yang

QNX update WP bit when paging enabled, which is not covered yet. This one fix QNX boot with EPT.

Applied, thanks.

Quoted 2 lines

I think it's also necessary for 2.6.31?

It's not a recent regression, right? So I'll send it for 2.6.32 and afterwards to 2.6.31.stable.

Signature · 1 line
error compiling committee.c: too many arguments to function