[Devel] [PATCH RHEL7 COMMIT] ms/kvm/x86: Reject Hyper-V hypercall continuation

Konstantin Khorenko khorenko at virtuozzo.com
Sat Feb 20 08:11:48 PST 2016


The commit is pushed to "branch-rh7-3.10.0-327.4.5.vz7.11.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-327.4.5.vz7.11.5
------>
commit d0d017b56512cbd43a61aaac843748733a51e5ee
Author: Andrey Smetanin <asmetanin at virtuozzo.com>
Date:   Sat Feb 20 20:11:48 2016 +0400

    ms/kvm/x86: Reject Hyper-V hypercall continuation
    
    Series description:
    
    KVM: Hyper-V VMBus hypercalls
    
    The patch implements userspace exit 'KVM_EXIT_HYPERV'
    for Hyper-V VMBus hypercalls(postmsg, signalevent)
    to handle these hypercalls by QEMU.
    
    Changes v3:
    * use vcpu->arch.complete_userspace_io to setup hypercall
    result
    * rebase for 'next-20160211'
    
    Changes v2:
    * use KVM_EXIT_HYPERV for hypercalls
    
    https://jira.sw.ru/browse/PSBM-44419
    
    Andrey Smetanin (5):
    ms/kvm/x86: Rename Hyper-V long spin wait hypercall
    ms/drivers/hv: Move VMBus hypercall codes into Hyper-V UAPI header
    ms/kvm/x86: Pass return code of kvm_emulate_hypercall
    ms/kvm/x86: Reject Hyper-V hypercall continuation
    ms/kvm/x86: Hyper-V VMBus hypercall userspace exit
    
    Reviewed-by: Roman Kagan <rkagan at virtuozzo.com>
    ===============================================
    This patch description:
    
    Currently we do not support Hyper-V hypercall continuation
    so reject it.
    
    Signed-off-by: Andrey Smetanin <asmetanin at virtuozzo.com>
    
    Reviewed-by: Roman Kagan <rkagan at virtuozzo.com>
    CC: Gleb Natapov <gleb at kernel.org>
    CC: Paolo Bonzini <pbonzini at redhat.com>
    CC: Joerg Roedel <joro at 8bytes.org>
    CC: "K. Y. Srinivasan" <kys at microsoft.com>
    CC: Haiyang Zhang <haiyangz at microsoft.com>
    CC: Roman Kagan <rkagan at virtuozzo.com>
    CC: Denis V. Lunev <den at openvz.org>
    CC: qemu-devel at nongnu.org
    Signed-off-by: Paolo Bonzini <pbonzini at redhat.com>
    (cherry picked from commit b2fdc2570a6c4b1fe950c11a2e9ce949f5190765)
---
 arch/x86/kvm/hyperv.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
index c4c1a80..44a5e98 100644
--- a/arch/x86/kvm/hyperv.c
+++ b/arch/x86/kvm/hyperv.c
@@ -1085,6 +1085,12 @@ int kvm_hv_hypercall(struct kvm_vcpu *vcpu)
 
 	trace_kvm_hv_hypercall(code, fast, rep_cnt, rep_idx, ingpa, outgpa);
 
+	/* Hypercall continuation is not supported yet */
+	if (rep_cnt || rep_idx) {
+		res = HV_STATUS_INVALID_HYPERCALL_CODE;
+		goto set_result;
+	}
+
 	switch (code) {
 	case HVCALL_NOTIFY_LONG_SPIN_WAIT:
 		kvm_vcpu_on_spin(vcpu);
@@ -1094,6 +1100,7 @@ int kvm_hv_hypercall(struct kvm_vcpu *vcpu)
 		break;
 	}
 
+set_result:
 	ret = res | (((u64)rep_done & 0xfff) << 32);
 	if (longmode) {
 		kvm_register_write(vcpu, VCPU_REGS_RAX, ret);


More information about the Devel mailing list