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

Re: [Xen-devel] [PATCH v2 1/3] x86/mem_access: Make the mem_access ops generic



>> diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index
>> 38c491e..eeaa72e 100644
>> --- a/xen/arch/x86/hvm/hvm.c
>> +++ b/xen/arch/x86/hvm/hvm.c
>> @@ -4589,79 +4589,10 @@ long do_hvm_op(unsigned long op,
>XEN_GUEST_HANDLE_PARAM(void) arg)
>>      }
>>
>>      case HVMOP_set_mem_access:
>> -    {
>> -        struct xen_hvm_set_mem_access a;
>> -        struct domain *d;
>> -
>> -        if ( copy_from_guest(&a, arg, 1) )
>> -            return -EFAULT;
>> -
>> -        rc = rcu_lock_remote_domain_by_id(a.domid, &d);
>> -        if ( rc != 0 )
>> -            return rc;
>> -
>> -        rc = -EINVAL;
>> -        if ( !is_hvm_domain(d) )
>> -            goto param_fail5;
>> -
>> -        rc = xsm_hvm_param(XSM_TARGET, d, op);
>> -        if ( rc )
>> -            goto param_fail5;
>> -
>> -        rc = -EINVAL;
>> -        if ( (a.first_pfn != ~0ull) &&
>> -             (a.nr < start_iter ||
>> -              ((a.first_pfn + a.nr - 1) < a.first_pfn) ||
>> -              ((a.first_pfn + a.nr - 1) > domain_get_maximum_gpfn(d))) )
>> -            goto param_fail5;
>> -
>> -        rc = p2m_set_mem_access(d, a.first_pfn, a.nr, start_iter,
>> -                                HVMOP_op_mask, a.hvmmem_access);
>> -        if ( rc > 0 )
>> -        {
>> -            start_iter = rc;
>> -            rc = -EAGAIN;
>> -        }
>> -
>> -    param_fail5:
>> -        rcu_unlock_domain(d);
>> -        break;
>> -    }
>> -
>>      case HVMOP_get_mem_access:
>>      {
>> -        struct xen_hvm_get_mem_access a;
>> -        struct domain *d;
>> -        hvmmem_access_t access;
>> -
>> -        if ( copy_from_guest(&a, arg, 1) )
>> -            return -EFAULT;
>> -
>> -        rc = rcu_lock_remote_domain_by_id(a.domid, &d);
>> -        if ( rc != 0 )
>> -            return rc;
>> -
>> -        rc = -EINVAL;
>> -        if ( !is_hvm_domain(d) )
>> -            goto param_fail6;
>> -
>> -        rc = xsm_hvm_param(XSM_TARGET, d, op);
>> -        if ( rc )
>> -            goto param_fail6;
>> -
>> -        rc = -EINVAL;
>> -        if ( (a.pfn > domain_get_maximum_gpfn(d)) && a.pfn != ~0ull )
>> -            goto param_fail6;
>> -
>> -        rc = p2m_get_mem_access(d, a.pfn, &access);
>> -        if ( rc != 0 )
>> -            goto param_fail6;
>> -
>> -        a.hvmmem_access = access;
>> -        rc = __copy_to_guest(arg, &a, 1) ? -EFAULT : 0;
>> -
>> -    param_fail6:
>> -        rcu_unlock_domain(d);
>> +        gdprintk(XENLOG_DEBUG, "Deprecated HVM op %ld.\n", op);
>
>Is this really sensible?  I suppose it should hopefully be a rare hypercall, 
>but it
>is hardly a useful message to print.

OK, I will get rid of the message.

>>
>>  /*
>>   * Internal functions, only called by other p2m code diff --git
>> a/xen/include/public/hvm/hvm_op.h b/xen/include/public/hvm/hvm_op.h
>> index 3204ec4..f00f6d2 100644
>> --- a/xen/include/public/hvm/hvm_op.h
>> +++ b/xen/include/public/hvm/hvm_op.h
>
>Changes here need to be in sync with libxc as well, also for build reasons.

That is correct. So how should I proceed? Should I submit one patch that has 
both the hypervisor and libxc changes?

Thanks,
Aravindh


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


 


Rackspace

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