From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavel Fedin Subject: RE: [PATCH v4 5/5] kvm/x86: Hyper-V kvm exit Date: Fri, 18 Dec 2015 18:19:25 +0300 Message-ID: <01cc01d139a7$7baad550$73007ff0$@samsung.com> References: <1447158995-21919-1-git-send-email-asmetanin@virtuozzo.com> <1447158995-21919-6-git-send-email-asmetanin@virtuozzo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: "'Denis V. Lunev'" , 'Gleb Natapov' , 'Paolo Bonzini' , 'Roman Kagan' , qemu-devel@nongnu.org To: 'Andrey Smetanin' , kvm@vger.kernel.org Return-path: Received: from mailout3.w1.samsung.com ([210.118.77.13]:59652 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752677AbbLRPT3 (ORCPT ); Fri, 18 Dec 2015 10:19:29 -0500 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NZK00EYK7WF3W80@mailout3.w1.samsung.com> for kvm@vger.kernel.org; Fri, 18 Dec 2015 15:19:27 +0000 (GMT) In-reply-to: <1447158995-21919-6-git-send-email-asmetanin@virtuozzo.com> Content-language: ru Sender: kvm-owner@vger.kernel.org List-ID: Hello! I realize that it's perhaps too late, because patches are already on Linux-next, but i have one concern... May be it's not too late... I dislike implementing architecture-dependent exit code where we could implement an architecture-independent one. 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 instead something more generic, like KVM_EXIT_REG_IO, which would work similar to KVM_EXIT_PIO or KVM_EXIT_MMIO, but carry register code and 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 archirectures. What if in future we have more system registers to emulate in userspace? 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. Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33476) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9woj-0002f4-AD for qemu-devel@nongnu.org; Fri, 18 Dec 2015 10:19:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9woe-0006uN-AP for qemu-devel@nongnu.org; Fri, 18 Dec 2015 10:19:37 -0500 Received: from mailout3.w1.samsung.com ([210.118.77.13]:59655) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9woe-0006uH-3j for qemu-devel@nongnu.org; Fri, 18 Dec 2015 10:19:32 -0500 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NZK00EYK7WF3W80@mailout3.w1.samsung.com> for qemu-devel@nongnu.org; Fri, 18 Dec 2015 15:19:27 +0000 (GMT) From: Pavel Fedin References: <1447158995-21919-1-git-send-email-asmetanin@virtuozzo.com> <1447158995-21919-6-git-send-email-asmetanin@virtuozzo.com> In-reply-to: <1447158995-21919-6-git-send-email-asmetanin@virtuozzo.com> Date: Fri, 18 Dec 2015 18:19:25 +0300 Message-id: <01cc01d139a7$7baad550$73007ff0$@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit Content-language: ru 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: 'Andrey Smetanin' , kvm@vger.kernel.org Cc: 'Gleb Natapov' , "'Denis V. Lunev'" , qemu-devel@nongnu.org, 'Roman Kagan' , 'Paolo Bonzini' Hello! I realize that it's perhaps too late, because patches are already on Linux-next, but i have one concern... May be it's not too late... I dislike implementing architecture-dependent exit code where we could implement an architecture-independent one. 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 instead something more generic, like KVM_EXIT_REG_IO, which would work similar to KVM_EXIT_PIO or KVM_EXIT_MMIO, but carry register code and 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 archirectures. What if in future we have more system registers to emulate in userspace? 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. Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia