From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Otte Subject: Re: [PATCH 0/9] S390x KVM support Date: Thu, 22 Oct 2009 12:43:54 +0200 Message-ID: <4AE0376A.4070803@de.ibm.com> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: carsteno@linux.vnet.ibm.com, Alexander Graf , qemu-devel , uli@suse.de, Carsten Otte , hare@suse.de, KVM list To: Avi Kivity Return-path: Received: from mtagate3.de.ibm.com ([195.212.17.163]:58850 "EHLO mtagate3.de.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753203AbZJVKnp (ORCPT ); Thu, 22 Oct 2009 06:43:45 -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 n9MAhhi3030591 for ; Thu, 22 Oct 2009 10:43:43 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 n9MAhhZa2949226 for ; Thu, 22 Oct 2009 12:43:43 +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 n9MAhgVk021903 for ; Thu, 22 Oct 2009 12:43:43 +0200 In-Reply-To: <4AE033E2.5090902@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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.