[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v3] x86/altp2m: Add a new hypercall to get the active altp2m index



>>> On 07.06.19 at 12:55, <aisaila@xxxxxxxxxxxxxxx> wrote:
> @@ -4735,6 +4736,28 @@ static int do_altp2m_op(
>                      _gfn(a.u.change_gfn.old_gfn),
>                      _gfn(a.u.change_gfn.new_gfn));
>          break;
> +
> +    case HVMOP_altp2m_get_p2m_idx:
> +    {
> +        struct vcpu *v;
> +
> +        if ( !altp2m_active(d) )
> +        {
> +            rc = -EOPNOTSUPP;
> +            break;
> +        }
> +
> +        if ( (v = domain_vcpu(d, a.u.get_vcpu_p2m_idx.vcpu_id)) == NULL )
> +        {
> +            rc = -EINVAL;
> +            break;
> +        }

The order of return values was the other way around before, but
I suppose this doesn't matter much?

> +        a.u.get_vcpu_p2m_idx.altp2m_idx = altp2m_vcpu_idx(v);
> +        rc = __copy_to_guest(arg, &a, 1) ? -EFAULT : 0;

Just as remark for the future (I didn't pay attention before,
and the difference isn't overly meaningful for operations that
don't occur frequently) - __copy_field_to_guest() would be
less overhead here. Oh, right - this is once again not possible
because of arg (still) being a handle of void.

Jan



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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.