[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] KVM: s390: Add MEMOP ioctls for reading/writing
From: |
Thomas Huth |
Subject: |
Re: [Qemu-devel] [PATCH] KVM: s390: Add MEMOP ioctls for reading/writing guest memory |
Date: |
Thu, 19 Feb 2015 10:53:56 +0100 |
On Thu, 19 Feb 2015 10:47:29 +0100
Cornelia Huck <address@hidden> wrote:
> On Mon, 16 Feb 2015 13:16:41 +0100
> Thomas Huth <address@hidden> 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 <address@hidden>
> > ---
> > 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?
I like the idea with the capability ... I think I'll add that feature.
Thomas