From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: Thomas Huth <thuth@linux.vnet.ibm.com>
Cc: pbonzini@redhat.com, borntraeger@de.ibm.com,
qemu-devel@nongnu.org, kvm@vger.kernel.org, agraf@suse.de
Subject: Re: [Qemu-devel] [PATCH] KVM: s390: Add MEMOP ioctls for reading/writing guest memory
Date: Thu, 19 Feb 2015 10:47:29 +0100 [thread overview]
Message-ID: <20150219104729.5db2d2d1.cornelia.huck@de.ibm.com> (raw)
In-Reply-To: <1424089001-13876-1-git-send-email-thuth@linux.vnet.ibm.com>
On Mon, 16 Feb 2015 13:16:41 +0100
Thomas Huth <thuth@linux.vnet.ibm.com> wrote:
> On s390, we've got to make sure to hold the IPTE lock while accessing
> logical memory. So let's add an ioctl for reading and writing logical
> memory to provide this feature for userspace, too.
>
> Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
> ---
> Documentation/virtual/kvm/api.txt | 45 +++++++++++++++++++++++
> arch/s390/kvm/gaccess.c | 22 +++++++++++
> arch/s390/kvm/gaccess.h | 2 +
> arch/s390/kvm/kvm-s390.c | 70 +++++++++++++++++++++++++++++++++++++
> include/uapi/linux/kvm.h | 20 ++++++++++
> 5 files changed, 159 insertions(+), 0 deletions(-)
Looks good, except for one minor thing:
> +static long kvm_s390_guest_mem_op(struct kvm_vcpu *vcpu,
> + struct kvm_s390_mem_op *mop)
> +{
> + void __user *uaddr = (void __user *)mop->buf;
> + void *tmpbuf = NULL;
> + int r, srcu_idx;
> + const u64 supported_flags = KVM_S390_MEMOP_F_INJECT_EXCEPTION
> + | KVM_S390_MEMOP_F_CHECK_ONLY;
> +
> + if (mop->flags & ~supported_flags)
> + return -EINVAL;
> +
> + if (mop->size > 16 * PAGE_SIZE)
> + return -E2BIG;
Do you want to document this limit? Or make it discoverable by having
the capability check return the number of pages?
next prev parent reply other threads:[~2015-02-19 9:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-16 12:16 [Qemu-devel] [PATCH] KVM: s390: Add MEMOP ioctls for reading/writing guest memory Thomas Huth
2015-02-19 9:47 ` Cornelia Huck [this message]
2015-02-19 9:53 ` Thomas Huth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150219104729.5db2d2d1.cornelia.huck@de.ibm.com \
--to=cornelia.huck@de.ibm.com \
--cc=agraf@suse.de \
--cc=borntraeger@de.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=thuth@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).