From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N0v99-00080Z-Ta for qemu-devel@nongnu.org; Thu, 22 Oct 2009 06:43:55 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N0v95-000806-SJ for qemu-devel@nongnu.org; Thu, 22 Oct 2009 06:43:55 -0400 Received: from [199.232.76.173] (port=47494 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N0v95-000803-Jo for qemu-devel@nongnu.org; Thu, 22 Oct 2009 06:43:51 -0400 Received: from mtagate3.de.ibm.com ([195.212.17.163]:58855) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N0v95-0004t4-2K for qemu-devel@nongnu.org; Thu, 22 Oct 2009 06:43:51 -0400 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate3.de.ibm.com (8.13.1/8.13.1) with ESMTP id n9MAhnRd030674 for ; Thu, 22 Oct 2009 10:43:49 GMT Received: from d12av03.megacenter.de.ibm.com (d12av03.megacenter.de.ibm.com [9.149.165.213]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id n9MAhhZA3035352 for ; Thu, 22 Oct 2009 12:43:49 +0200 Received: from d12av03.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av03.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n9MAhgVe021903 for ; Thu, 22 Oct 2009 12:43:42 +0200 Message-ID: <4AE0376A.4070803@de.ibm.com> Date: Thu, 22 Oct 2009 12:43:54 +0200 From: Carsten Otte MIME-Version: 1.0 References: <1255963059-10298-1-git-send-email-agraf@suse.de> <4ADDE7E3.9090601@de.ibm.com> <4AE0210D.9020409@redhat.com> <98DC9E4C-7FFA-4F05-A2E8-0B5DF546891C@suse.de> <4AE02B8E.6070202@redhat.com> <8D99A5FD-8A2E-4DA9-90A5-6935F677F9FD@suse.de> <4AE02DE2.7010803@redhat.com> <4AE0327D.7010809@de.ibm.com> <4AE033E2.5090902@redhat.com> In-Reply-To: <4AE033E2.5090902@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 0/9] S390x KVM support List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: Carsten Otte , carsteno@linux.vnet.ibm.com, KVM list , Alexander Graf , qemu-devel , hare@suse.de Avi Kivity wrote: > On x86 we avoid emulating instructions in userspace. Instead the kernel > requests userspace to do something (triggered by the instruction), and > the kernel does anything which might be implied by the instruction (like > copying the result into a register, or updating pc). > > An example is port I/O. instead of userspace reading %edx to query the > port number and setting %eax to indicate the result, userspace reads a > port number struct field and writes an I/O result struct field. Only > the kernel accesses registers. > > I don't know whether that model makes sense or not for s390, but please > consider it. We do the same for many instructions (arch/s390/kvm/instruction.c). User exits are only performed for isntructions that cannot be handled in kernel. Also, we do exit with requests to userspace, see the s390_reset exit reason. I think in this regard, our implementation is very similar to x86. Btw: this is something I did copycat from your implementation on integration into kvm. The original zlive code did handle all instructions in userland.