From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35530) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YIumm-00067b-Dg for qemu-devel@nongnu.org; Wed, 04 Feb 2015 02:54:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YIumi-0001QD-D7 for qemu-devel@nongnu.org; Wed, 04 Feb 2015 02:54:08 -0500 Received: from e06smtp14.uk.ibm.com ([195.75.94.110]:50910) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YIumi-0001Pe-2v for qemu-devel@nongnu.org; Wed, 04 Feb 2015 02:54:04 -0500 Received: from /spool/local by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 4 Feb 2015 07:54:00 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 005332190023 for ; Wed, 4 Feb 2015 07:53:55 +0000 (GMT) Received: from d06av03.portsmouth.uk.ibm.com (d06av03.portsmouth.uk.ibm.com [9.149.37.213]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t147rwQO6488536 for ; Wed, 4 Feb 2015 07:53:58 GMT Received: from d06av03.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t147rwBF017086 for ; Wed, 4 Feb 2015 00:53:58 -0700 Date: Wed, 4 Feb 2015 08:53:55 +0100 From: Thomas Huth Message-ID: <20150204085355.17b78a60@oc7435384737.ibm.com> In-Reply-To: <54D0E7B8.2060501@redhat.com> References: <1422965498-11500-1-git-send-email-thuth@linux.vnet.ibm.com> <1422965498-11500-2-git-send-email-thuth@linux.vnet.ibm.com> <54D0C76B.70603@redhat.com> <20150203161601.1319f7ef@oc7435384737.ibm.com> <54D0E7B8.2060501@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH RFC 1/1] KVM: s390: Add MEMOP ioctl for reading/writing guest memory List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: cornelia.huck@de.ibm.com, borntraeger@de.ibm.com, qemu-devel@nongnu.org, kvm@vger.kernel.org, agraf@suse.de On Tue, 03 Feb 2015 16:22:32 +0100 Paolo Bonzini wrote: > > > On 03/02/2015 16:16, Thomas Huth wrote: > > Actually, I'd prefer to keep the "virtual" in the defines for the type > > of operation below: When it comes to s390 storage keys, we likely might > > need some calls for reading and writing to physical memory, too. Then > > we could simply extend this ioctl instead of inventing a new one. > > Can you explain why it is necessary to read/write physical addresses > from user space? In the case of QEMU, I'm worried that you would have > to invent your own memory read/write APIs that are different from > everything else. > > On real s390 zPCI, does bus-master DMA update storage keys? Ah, I was not thinking about bus-mastering/DMA here: AFAIK there are some CPU instructions that access a parameter block in physical memory, for example the SCLP instruction (see hw/s390x/sclp.c) - it's already doing a cpu_physical_memory_read and ..._write for the parameters. However, I haven't checked yet whether it is also supposed to touch the storage keys, so if not, we also might be fine without the ioctls for reading/writing to physical memory. > >> Not really true, as you don't check it. So "It is not used by KVM with > >> the currently defined set of flags" is a better explanation. > > > > ok ... and maybe add "should be set to zero" ? > > If you don't check it, it is misleading to document this. True... so I'll omit that. Thomas