[Devel,RHEL7,COMMIT] Revert "kvm/x86: do not clear hyperv synic pages when setting MSRs"

Submitted by Konstantin Khorenko on April 18, 2017, 12:56 p.m.

Details

Message ID 201704181256.v3ICuY1H031620@finist_cl7.x64_64.work.ct
State New
Series "Revert "kvm/x86: do not clear hyperv synic pages when setting MSRs""
Headers show

Commit Message

Konstantin Khorenko April 18, 2017, 12:56 p.m.
The commit is pushed to "branch-rh7-3.10.0-514.16.1.vz7.30.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-514.16.1.vz7.30.2
------>
commit 12ef8f93ff4c22492a7e3844d2a97bb7b8c98526
Author: Evgeny Yakovlev <eyakovlev@virtuozzo.com>
Date:   Tue Apr 18 16:56:34 2017 +0400

    Revert "kvm/x86: do not clear hyperv synic pages when setting MSRs"
    
    This reverts commit 9b97e5b0878dcf05bdb00c6054fb99125be46501,
    next patch "kvm/x86: clear hyperv synic pages only when guest modifies MSRs"
    contains a better fix for
    
    https://jira.sw.ru/browse/PSBM-63164
    https://jira.sw.ru/browse/PSBM-64657
    
    Signed-off-by: Evgeny Yakovlev <eyakovlev@virtuozzo.com>
    Reviewed-by: Roman Kagan <rkagan@virtuozzo.com>
---
 arch/x86/kvm/hyperv.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Patch hide | download patch | download mbox

diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
index 563c54fb..eae314b 100644
--- a/arch/x86/kvm/hyperv.c
+++ b/arch/x86/kvm/hyperv.c
@@ -219,11 +219,23 @@  static int synic_set_msr(struct kvm_vcpu_hv_synic *synic,
 		synic->version = data;
 		break;
 	case HV_X64_MSR_SIEFP:
+		if (data & HV_SYNIC_SIEFP_ENABLE)
+			if (kvm_clear_guest(vcpu->kvm,
+					    data & PAGE_MASK, PAGE_SIZE)) {
+				ret = 1;
+				break;
+			}
 		synic->evt_page = data;
 		if (!host)
 			synic_exit(synic, msr);
 		break;
 	case HV_X64_MSR_SIMP:
+		if (data & HV_SYNIC_SIMP_ENABLE)
+			if (kvm_clear_guest(vcpu->kvm,
+					    data & PAGE_MASK, PAGE_SIZE)) {
+				ret = 1;
+				break;
+			}
 		synic->msg_page = data;
 		if (!host)
 			synic_exit(synic, msr);