From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45208) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9xTq-0000vb-3S for qemu-devel@nongnu.org; Fri, 18 Dec 2015 11:02:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9xTp-00013x-8e for qemu-devel@nongnu.org; Fri, 18 Dec 2015 11:02:06 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49772) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9xTp-00013t-4L for qemu-devel@nongnu.org; Fri, 18 Dec 2015 11:02:05 -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> From: Paolo Bonzini Message-ID: <56742DF7.9000902@redhat.com> Date: Fri, 18 Dec 2015 17:01:59 +0100 MIME-Version: 1.0 In-Reply-To: <01cc01d139a7$7baad550$73007ff0$@samsung.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v4 5/5] kvm/x86: Hyper-V kvm exit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pavel Fedin , 'Andrey Smetanin' , kvm@vger.kernel.org Cc: 'Gleb Natapov' , "'Denis V. Lunev'" , Peter Hornyack , 'Roman Kagan' , qemu-devel@nongnu.org On 18/12/2015 16:19, Pavel Fedin wrote: > As far as i understand this code, KVM_EXIT_HYPERV is called when one > of three MSRs are accessed. But, shouldn't we have implemented=20 > instead something more generic, like KVM_EXIT_REG_IO, which would > work similar to KVM_EXIT_PIO or KVM_EXIT_MMIO, but carry register=20 > code and value? Yes, we considered that. There were actually patches for this as well. However, in this case the register is still emulated in the kernel, and userspace just gets informed of the new value. > This would allow us to solve the same task which we have done here, > but this solution would be reusable for other devices and other=20 > archirectures. What if in future we have more system registers to > emulate in userspace? If we do get that, we will just rename KVM_EXIT_HYPERV to KVM_EXIT_MSR_ACCESS, and KVM_EXIT_HYPERV_SYNIC to KVM_EXIT_MSR_HYPERV_SYNIC, and struct kvm_hyperv_exit to kvm_msr_exit. Actually, we can do it now. What do you guys think? Peter? I might even be convinced to document the capability (in Documentation/ and uapi/) even if the upstream kernel doesn't provide it. We still have a lot of time until 4.5 is out, it can be done after the merge window even. Paolo > I write this because at one point i suggested similar thing for ARM64 > (but i never actually wrote it), to emulate physical CP15 timer. And > it would require exactly the same capability - process some trapped > system register accesses in userspace.