All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Razvan Cojocaru <rcojocaru@bitdefender.com>
Cc: andrew.cooper3@citrix.com, tamas@tklengyel.com,
	wei.liu2@citrix.com, ian.jackson@eu.citrix.com,
	xen-devel@lists.xen.org
Subject: Re: [PATCH V2] x86/altp2m: Added xc_altp2m_set_mem_access_multi()
Date: Thu, 09 Mar 2017 09:56:25 -0700	[thread overview]
Message-ID: <58C197490200007800141BE0@prv-mh.provo.novell.com> (raw)
In-Reply-To: <1489052332-4983-1-git-send-email-rcojocaru@bitdefender.com>

>>> On 09.03.17 at 10:38, <rcojocaru@bitdefender.com> wrote:
> @@ -4535,6 +4536,30 @@ static int do_altp2m_op(
>                                      a.u.set_mem_access.view);
>          break;
>  
> +    case HVMOP_altp2m_set_mem_access_multi:
> +        if ( a.u.set_mem_access_multi.pad ||
> +             a.u.set_mem_access_multi.opaque >= a.u.set_mem_access_multi.nr )
> +        {
> +            rc = -EINVAL;
> +            break;
> +        }
> +        rc = p2m_set_mem_access_multi(d, a.u.set_mem_access_multi.pfn_list,
> +                                      a.u.set_mem_access_multi.access_list,
> +                                      a.u.set_mem_access_multi.nr,
> +                                      a.u.set_mem_access_multi.opaque,
> +                                      MEMOP_CMD_MASK,
> +                                      a.u.set_mem_access_multi.view);
> +        if ( rc > 0 )
> +        {
> +            a.u.set_mem_access_multi.opaque = rc;
> +            if ( __copy_to_guest(arg, &a, 1) )
> +                rc = -EFAULT;
> +            else
> +                rc = hypercall_create_continuation(__HYPERVISOR_hvm_op, "lh",
> +                                                   HVMOP_altp2m, arg);
> +        }
> +        break;

Okay, so this is a hvmop, in which case I'm fine with the continuation
model used.

However - is this interface supposed to be usable by a guest on itself?
Arguably the same question would apply to some of the other sub-ops
too, but anyway.

> --- a/xen/include/public/hvm/hvm_op.h
> +++ b/xen/include/public/hvm/hvm_op.h
> @@ -231,6 +231,23 @@ struct xen_hvm_altp2m_set_mem_access {
>  typedef struct xen_hvm_altp2m_set_mem_access xen_hvm_altp2m_set_mem_access_t;
>  DEFINE_XEN_GUEST_HANDLE(xen_hvm_altp2m_set_mem_access_t);
>  
> +struct xen_hvm_altp2m_set_mem_access_multi {
> +    /* view */
> +    uint16_t view;
> +    uint16_t pad;
> +    /* Number of pages */
> +    uint32_t nr;
> +    /* Used for continuation purposes */
> +    uint64_t opaque;
> +    /* List of pfns to set access for */
> +    XEN_GUEST_HANDLE(const_uint64) pfn_list;
> +    /* Corresponding list of access settings for pfn_list */
> +    XEN_GUEST_HANDLE(const_uint8) access_list;

I'm afraid these handles aren't going to work for a 32-bit guest. Note
how no other hvmop uses handles.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2017-03-09 16:56 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-09  9:38 [PATCH V2] x86/altp2m: Added xc_altp2m_set_mem_access_multi() Razvan Cojocaru
2017-03-09 16:56 ` Jan Beulich [this message]
2017-03-09 17:15   ` Razvan Cojocaru
2017-03-10  7:31     ` Jan Beulich
2017-03-10  8:04       ` Razvan Cojocaru
2017-03-09 17:29   ` Tamas K Lengyel
2017-03-10  7:34     ` Jan Beulich
2017-03-10 11:21       ` Andrew Cooper
2017-03-10 19:01         ` Tamas K Lengyel
2017-03-13 12:01           ` Razvan Cojocaru
2017-03-13 12:19             ` Jan Beulich
2017-03-13 12:29               ` Razvan Cojocaru
2017-03-13 12:40                 ` Jan Beulich
2017-03-13 12:44                   ` Razvan Cojocaru
2017-03-13 17:17                 ` Tamas K Lengyel
2017-03-15 13:12                   ` Razvan Cojocaru
2017-08-03  7:09   ` Razvan Cojocaru

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=58C197490200007800141BE0@prv-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=rcojocaru@bitdefender.com \
    --cc=tamas@tklengyel.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.