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 <jbeul...@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 via email to