diff mbox series

[V2,7/7] x86/kvm/vmx: Use native read/write_cr2()

Message ID 20200708195322.344731916@linutronix.de (mailing list archive)
State New, archived
Headers show
Series x86/kvm: RCU/context tracking and instrumentation protections | expand

Commit Message

Thomas Gleixner July 8, 2020, 7:52 p.m. UTC
From: Thomas Gleixner <tglx@linutronix.de>

read/write_cr2() go throuh the paravirt XXL indirection, but nested VMX in
a XEN_PV guest is not supported.

Use the native variants.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 arch/x86/kvm/vmx/vmx.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Jürgen Groß July 9, 2020, 4:13 a.m. UTC | #1
On 08.07.20 21:52, Thomas Gleixner wrote:
> From: Thomas Gleixner <tglx@linutronix.de>
> 
> read/write_cr2() go throuh the paravirt XXL indirection, but nested VMX in
> a XEN_PV guest is not supported.
> 
> Use the native variants.
> 
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen
diff mbox series

Patch

--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -6683,13 +6683,13 @@  static noinstr void vmx_vcpu_enter_exit(
 	else if (static_branch_unlikely(&mds_user_clear))
 		mds_clear_cpu_buffers();
 
-	if (vcpu->arch.cr2 != read_cr2())
-		write_cr2(vcpu->arch.cr2);
+	if (vcpu->arch.cr2 != native_read_cr2())
+		native_write_cr2(vcpu->arch.cr2);
 
 	vmx->fail = __vmx_vcpu_run(vmx, (unsigned long *)&vcpu->arch.regs,
 				   vmx->loaded_vmcs->launched);
 
-	vcpu->arch.cr2 = read_cr2();
+	vcpu->arch.cr2 = native_read_cr2();
 
 	/*
 	 * VMEXIT disables interrupts (host state), but tracing and lockdep