From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrey Smetanin Subject: [PATCH v1 5/5] kvm/x86: Reject Hyper-V hypercall continuation Date: Tue, 12 Jan 2016 13:50:42 +0300 Message-ID: <1452595842-20880-6-git-send-email-asmetanin@virtuozzo.com> References: <1452595842-20880-1-git-send-email-asmetanin@virtuozzo.com> Cc: Gleb Natapov , Paolo Bonzini , Joerg Roedel , "K. Y. Srinivasan" , Haiyang Zhang , Roman Kagan , "Denis V. Lunev" , qemu-devel@nongnu.org To: kvm@vger.kernel.org Return-path: Received: from mailhub.sw.ru ([195.214.232.25]:43536 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934787AbcALKwB (ORCPT ); Tue, 12 Jan 2016 05:52:01 -0500 In-Reply-To: <1452595842-20880-1-git-send-email-asmetanin@virtuozzo.com> Sender: kvm-owner@vger.kernel.org List-ID: Currently we do not support Hyper-V hypercall continuation so reject it. Signed-off-by: Andrey Smetanin Reviewed-by: Roman Kagan CC: Gleb Natapov CC: Paolo Bonzini CC: Joerg Roedel CC: "K. Y. Srinivasan" CC: Haiyang Zhang CC: Roman Kagan CC: Denis V. Lunev CC: qemu-devel@nongnu.org --- 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 76c9ec4..bc4884e 100644 --- a/arch/x86/kvm/hyperv.c +++ b/arch/x86/kvm/hyperv.c @@ -1083,6 +1083,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 HV_X64_HCALL_NOTIFY_LONG_SPIN_WAIT: kvm_vcpu_on_spin(vcpu); @@ -1099,6 +1105,7 @@ int kvm_hv_hypercall(struct kvm_vcpu *vcpu) break; } +set_result: ret = res | (((u64)rep_done & 0xfff) << 32); kvm_hv_hypercall_set_result(vcpu, ret); return 1; -- 2.4.3 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58982) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIwYP-000725-I5 for qemu-devel@nongnu.org; Tue, 12 Jan 2016 05:51:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aIwYM-0007bD-Ad for qemu-devel@nongnu.org; Tue, 12 Jan 2016 05:51:57 -0500 Received: from mailhub.sw.ru ([195.214.232.25]:48988 helo=relay.sw.ru) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIwYL-0007b9-Tr for qemu-devel@nongnu.org; Tue, 12 Jan 2016 05:51:54 -0500 From: Andrey Smetanin Date: Tue, 12 Jan 2016 13:50:42 +0300 Message-Id: <1452595842-20880-6-git-send-email-asmetanin@virtuozzo.com> In-Reply-To: <1452595842-20880-1-git-send-email-asmetanin@virtuozzo.com> References: <1452595842-20880-1-git-send-email-asmetanin@virtuozzo.com> Subject: [Qemu-devel] [PATCH v1 5/5] kvm/x86: Reject Hyper-V hypercall continuation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: kvm@vger.kernel.org Cc: Gleb Natapov , Joerg Roedel , qemu-devel@nongnu.org, Roman Kagan , "Denis V. Lunev" , Paolo Bonzini , "K. Y. Srinivasan" , Haiyang Zhang Currently we do not support Hyper-V hypercall continuation so reject it. Signed-off-by: Andrey Smetanin Reviewed-by: Roman Kagan CC: Gleb Natapov CC: Paolo Bonzini CC: Joerg Roedel CC: "K. Y. Srinivasan" CC: Haiyang Zhang CC: Roman Kagan CC: Denis V. Lunev CC: qemu-devel@nongnu.org --- 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 76c9ec4..bc4884e 100644 --- a/arch/x86/kvm/hyperv.c +++ b/arch/x86/kvm/hyperv.c @@ -1083,6 +1083,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 HV_X64_HCALL_NOTIFY_LONG_SPIN_WAIT: kvm_vcpu_on_spin(vcpu); @@ -1099,6 +1105,7 @@ int kvm_hv_hypercall(struct kvm_vcpu *vcpu) break; } +set_result: ret = res | (((u64)rep_done & 0xfff) << 32); kvm_hv_hypercall_set_result(vcpu, ret); return 1; -- 2.4.3