On Mon, 16 Feb 2015 13:16:41 +0100
Thomas Huth <[email protected]> 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 <[email protected]>
> ---
>  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?

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to