From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43405) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YkqAM-000421-Jv for qemu-devel@nongnu.org; Wed, 22 Apr 2015 04:37:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YkqAH-00040V-Dj for qemu-devel@nongnu.org; Wed, 22 Apr 2015 04:37:54 -0400 Received: from e06smtp14.uk.ibm.com ([195.75.94.110]:56549) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YkqAH-000404-4l for qemu-devel@nongnu.org; Wed, 22 Apr 2015 04:37:49 -0400 Received: from /spool/local by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 22 Apr 2015 09:37:47 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 622E417D8059 for ; Wed, 22 Apr 2015 09:38:24 +0100 (BST) Received: from d06av11.portsmouth.uk.ibm.com (d06av11.portsmouth.uk.ibm.com [9.149.37.252]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t3M8bjrh50331684 for ; Wed, 22 Apr 2015 08:37:45 GMT Received: from d06av11.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t3M8bjGu015371 for ; Wed, 22 Apr 2015 02:37:45 -0600 Date: Wed, 22 Apr 2015 10:37:43 +0200 From: Cornelia Huck Message-ID: <20150422103743.4e9fb1fb.cornelia.huck@de.ibm.com> In-Reply-To: <5536A972.3070708@de.ibm.com> References: <1428569498-27393-1-git-send-email-cornelia.huck@de.ibm.com> <1428569498-27393-10-git-send-email-cornelia.huck@de.ibm.com> <55351366.9000600@de.ibm.com> <5536A11E.5020609@suse.de> <5536A65E.5090204@de.ibm.com> <5536A6C8.5010504@suse.de> <5536A972.3070708@de.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 09/10] s390x/mmu: Use ioctl for reading and writing from/to guest memory List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christian Borntraeger Cc: jfrei@linux.vnet.ibm.com, Thomas Huth , Alexander Graf , qemu-devel@nongnu.org On Tue, 21 Apr 2015 21:48:02 +0200 Christian Borntraeger wrote: > Am 21.04.2015 um 21:36 schrieb Alexander Graf: > > On 04/21/2015 09:34 PM, Christian Borntraeger wrote: > >> Am 21.04.2015 um 21:12 schrieb Alexander Graf: > >>> On 04/20/2015 04:55 PM, Christian Borntraeger wrote: > >>>> Am 09.04.2015 um 10:51 schrieb Cornelia Huck: > >>>>> From: Thomas Huth > >>>>> > >>>>> Add code to make use of the new ioctl for reading from / writing to > >>>>> virtual guest memory. By using the ioctl, the memory accesses are now > >>>>> protected with the so-called ipte-lock in the kernel. > >>>>> > >>>>> Signed-off-by: Thomas Huth > >>>>> Signed-off-by: Cornelia Huck > >>>> Acked-by: Christian Borntraeger > >>>>> @@ -450,6 +450,15 @@ int s390_cpu_virt_mem_rw(S390CPU *cpu, vaddr laddr, void *hostbuf, > >>>>> target_ulong *pages; > >>>>> int ret; > >>>>> > >>>>> + if (kvm_enabled()) { > >>>>> + ret = kvm_s390_mem_op(cpu, laddr, hostbuf, len, is_write); > >>>>> + if (ret >= 0) { > >>>>> + return ret; > >>>>> + } else if (ret != -ENOSYS) { > >>>>> + error_printf("kvm_s390_mem_op() failed: %s\n", strerror(-ret)); > >>> Won't this spill the logs like crazy when running new qemu on old kernels? > >> kvm_s390_mem_op will return -ENOSYS if cap_mem_op is not set. > > > > Oh, I see the logic now. Can you think of any way to make it more obvious to a reader what's going on? > > > We could move the error_printf into kvm_s390_mem_op. > Well Conny has to do it as Thomas has left IBM. I can certainly do that, if that makes the code easier to follow.