All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xenproject.org>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	Tim Deegan <tim@xen.org>, Wei Liu <wei.liu2@citrix.com>
Subject: Re: [PATCH] x86: restrict HVMOP_pagetable_dying to current
Date: Fri, 5 Oct 2018 12:58:43 +0100	[thread overview]
Message-ID: <6acd9399-9e43-5f01-defd-068ee81ee479@citrix.com> (raw)
In-Reply-To: <5BB74B1A02000078001EECBE@prv1-mh.provo.novell.com>

On 05/10/18 12:29, Jan Beulich wrote:
> This is not used (and probably was never meant to be) by the tool stack.
> Limiting it to the current domain in particular allows to eliminate a
> bogus use of vCPU 0 in pagetable_dying().
>
> Remove the now unnecessary domain/vCPU parameters from the wrapper/hook
> functions at the same time.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>
> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -4895,10 +4895,12 @@ long do_hvm_op(unsigned long op, XEN_GUE
>              return -ESRCH;
>  
>          rc = -EINVAL;
> -        if ( is_hvm_domain(d) && paging_mode_shadow(d) )
> +        if ( unlikely(d != current->domain) )
> +            rc = -EOPNOTSUPP;
> +        else if ( is_hvm_domain(d) && paging_mode_shadow(d) )
>              rc = xsm_hvm_param(XSM_TARGET, d, op);

As we're switching to current-only, shouldn't this turn to XSM_HOOK ?

Everything else LGTM, with one small suggestion....

>          if ( !rc )
> -            pagetable_dying(d, a.gpa);
> +            pagetable_dying(a.gpa);
>  
>          rcu_unlock_domain(d);
>          break;
> --- a/xen/include/asm-x86/paging.h
> +++ b/xen/include/asm-x86/paging.h
> @@ -345,7 +345,7 @@ void paging_write_p2m_entry(struct p2m_d
>  
>  /* Called from the guest to indicate that the a process is being
>   * torn down and its pagetables will soon be discarded */
> -void pagetable_dying(struct domain *d, paddr_t gpa);
> +void pagetable_dying(paddr_t gpa);

Fix the comment style while in this area?

~Andrew

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

  reply	other threads:[~2018-10-05 11:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-05 11:29 [PATCH] x86: restrict HVMOP_pagetable_dying to current Jan Beulich
2018-10-05 11:58 ` Andrew Cooper [this message]
2018-10-05 12:03   ` Jan Beulich
2018-10-26 11:12     ` Ping: " Jan Beulich
2018-10-26 11:15       ` Andrew Cooper
2018-10-12 14:49 ` Wei Liu
2018-10-15 11:51 ` George Dunlap

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=6acd9399-9e43-5f01-defd-068ee81ee479@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=tim@xen.org \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.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.