[Devel,RHEL7,COMMIT] ms/kvm:vmx: more complete state update on APICv on/off: lost hunk

Submitted by Konstantin Khorenko on Jan. 9, 2017, 4:22 p.m.

Details

Message ID 201701091622.v09GMtng017174@finist_cl7.x64_64.work.ct
State New
Series "KVM: Missing hunk for ms commit 3ce424e"
Headers show

Commit Message

Konstantin Khorenko Jan. 9, 2017, 4:22 p.m.
The commit is pushed to "branch-rh7-3.10.0-514.vz7.27.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-514.vz7.27.6
------>
commit 8e6dc095dd5d4494f8ecf1e4a1b3209e55910fd3
Author: Evgeny Yakovlev <eyakovlev@virtuozzo.com>
Date:   Mon Jan 9 20:22:54 2017 +0400

    ms/kvm:vmx: more complete state update on APICv on/off: lost hunk
    
    Fixes: 54b01f8 ("ms/kvm:vmx: more complete state update on APICv on/off")
    ms commit: 3ce424e
    
    This part of mentioned commit has been lost, restore it.
    
    Fixes https://jira.sw.ru/browse/PSBM-57821
    
    Signed-off-by: Evgeny Yakovlev <eyakovlev@virtuozzo.com>
---
 arch/x86/kvm/vmx.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index d2d52c3..3d39923 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -2329,7 +2329,9 @@  static void vmx_set_msr_bitmap(struct kvm_vcpu *vcpu)
 
 	if (is_guest_mode(vcpu))
 		msr_bitmap = vmx_msr_bitmap_nested;
-	else if (vcpu->arch.apic_base & X2APIC_ENABLE) {
+    else if (cpu_has_secondary_exec_ctrls() &&
+             (vmcs_read32(SECONDARY_VM_EXEC_CONTROL) &
+              SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE)) {
 		if (is_long_mode(vcpu))
 			msr_bitmap = vmx_msr_bitmap_longmode_x2apic;
 		else