FAILED: patch "[PATCH] KVM: x86: Move RDPID emulation intercept to its own enum" failed to apply to 4.9-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 4.9-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 2183de4161b90bd3851ccd3910c87b2c9adfc6ed Mon Sep 17 00:00:00 2001
From: Sean Christopherson <[email protected]>
Date: Tue, 4 May 2021 10:17:23 -0700
Subject: [PATCH] KVM: x86: Move RDPID emulation intercept to its own enum
Add a dedicated intercept enum for RDPID instead of piggybacking RDTSCP. Unlike VMX's ENABLE_RDTSCP, RDPID is not bound to SVM's RDTSCP intercept.
Fixes fb6d4d340e05 ("KVM: x86: emulate RDPID")
Signed-off-by Sean Christopherson <[email protected]>
Message-Id: <[email protected]>
Reviewed-by Jim Mattson <[email protected]>
Signed-off-by Paolo Bonzini <[email protected]>
arch/x86/kvm/emulate.c +1 -1
@@ -4502,7 +4502,7 @@ static const struct opcode group8[] = {* from the register case of group9. */ static const struct gprefix pfx_0f_c7_7 = { -N ,N ,N ,II (DstMem | ModRM | Op3264 | EmulateOnUD, em_rdpid, rdtscp), +N ,N ,N ,II (DstMem | ModRM | Op3264 | EmulateOnUD, em_rdpid, rdpid), };
arch/x86/kvm/kvm_emulate.h +1 -0
@@ -468,6 +468,7 @@ enum x86_intercept { x86_intercept_clgi, x86_intercept_skinit, x86_intercept_rdtscp, + x86_intercept_rdpid, x86_intercept_icebp, x86_intercept_wbinvd, x86_intercept_monitor,
arch/x86/kvm/vmx/vmx.c +2 -1
@@ -7437,8 +7437,9 @@ static int vmx_check_intercept(struct kvm_vcpu *vcpu,/* * RDPID causes #UD if disabled through secondary execution controls. * Because it is marked as EmulateOnUD, we need to intercept it here. +* Note, RDPID is hidden behind ENABLE_RDTSCP. */ -case x86_intercept_rdtscp: +case x86_intercept_rdpid:if (!nested_cpu_has2 (vmcs12,SECONDARY_EXEC_ENABLE_RDTSCP )) { exception->vector =UD_VECTOR ; exception->error_code_valid = false;