From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44497) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aB0q6-0008ON-N7 for qemu-devel@nongnu.org; Mon, 21 Dec 2015 08:49:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aB0q1-00039p-UO for qemu-devel@nongnu.org; Mon, 21 Dec 2015 08:49:26 -0500 Received: from relay.parallels.com ([195.214.232.42]:44757) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aB0q1-00038S-LN for qemu-devel@nongnu.org; Mon, 21 Dec 2015 08:49:21 -0500 References: <1447158995-21919-1-git-send-email-asmetanin@virtuozzo.com> <1447158995-21919-6-git-send-email-asmetanin@virtuozzo.com> <01cc01d139a7$7baad550$73007ff0$@samsung.com> <56742DF7.9000902@redhat.com> <20151218183911.GF3050@rkaganb.sw.ru> <5677F7C5.5040404@virtuozzo.com> <003201d13bf3$714edae0$53ec90a0$@samsung.com> From: Andrey Smetanin Message-ID: <56780340.6050507@virtuozzo.com> Date: Mon, 21 Dec 2015 16:48:48 +0300 MIME-Version: 1.0 In-Reply-To: <003201d13bf3$714edae0$53ec90a0$@samsung.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v4 5/5] kvm/x86: Hyper-V kvm exit Reply-To: asmetanin@virtuozzo.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pavel Fedin , 'Roman Kagan' , 'Peter Hornyack' , 'Paolo Bonzini' , 'kvm list' , "'Denis V. Lunev'" , 'Gleb Natapov' , qemu-devel@nongnu.org On 12/21/2015 04:28 PM, Pavel Fedin wrote: > Hello! > >> Yes, we can use KVM_EXIT_REG_IO/MSR_IO for Hyper-V SynIC MSRS's changes >> and can even use only one MSR value . So union inside struct >> kvm_hyperv_exit is excessive. >> >> But we still need Vcpu exit to handle VMBus hypercalls by QEMU to >> emulate VMBus devices inside QEMU. >> >> And currently we are going to extend struct kvm_hyperv_exit >> to store Hyper-V VMBus hypercall parameters. > > Hm... Hypercalls, you say? > We already have KVM_EXIT_HYPERCALL. Documentation says it's currently unused. Is it a leftover from ia64 KVM? Could we reuse it for > the purpose? > >> but could we replace Hyper-V VMBus hypercall and it's parameters >> by KVM_EXIT_REG_IO/MSR_IO too? > > It depends. Can i read about these hypercalls somewhere? Is there any documentation? I don't know about a documentation, but you can look at the code of Hyper-V hypercall handling inside KVM: https://github.com/torvalds/linux/blob/master/arch/x86/kvm/hyperv.c#L346 The code simply decodes hypercall parameters from vcpu registers then handle hypercall code in switch and encode return code inside vcpu registers. Probably encode and decode of hypercall parameters/return code can be done in QEMU so we need only some exit with parameter that this is Hyper-V hypercall and probably KVM_EXIT_HYPERCALL is good for it. But KVM_EXIT_HYPERCALL is not used inside KVM/QEMU so requires implementation. > > Kind regards, > Pavel Fedin > Expert Engineer > Samsung Electronics Research center Russia > >