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

Re: [Xen-devel] [PATCH v1] x86/altp2m: Add xc_altp2m_get_vcpu_p2m_idx




On 06.06.2019 15:25, Jan Beulich wrote:
>>>> On 06.06.19 at 14:16, <aisaila@xxxxxxxxxxxxxxx> wrote:
>> @@ -4735,6 +4736,29 @@ 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 ( a.u.get_vcpu_p2m_idx.vcpu_id >= d->max_vcpus )
>> +        {
>> +            rc = -EINVAL;
>> +            break;
>> +        }
>> +
>> +        if ( !altp2m_active(d) )
>> +        {
>> +            rc = -EOPNOTSUPP;
>> +            break;
>> +        }
>> +
>> +        v = d->vcpu[a.u.get_vcpu_p2m_idx.vcpu_id];
> 
> Please can you avoid re-introducing this access pattern? We have
> domain_vcpu() now exactly for this purpose.

Ok, I will use domain_vcpu() in V2.

> 
>> --- a/xen/include/public/hvm/hvm_op.h
>> +++ b/xen/include/public/hvm/hvm_op.h
>> @@ -304,6 +304,14 @@ struct xen_hvm_altp2m_change_gfn {
>>   typedef struct xen_hvm_altp2m_change_gfn xen_hvm_altp2m_change_gfn_t;
>>   DEFINE_XEN_GUEST_HANDLE(xen_hvm_altp2m_change_gfn_t);
>>   
>> +struct xen_hvm_altp2m_get_vcpu_p2m_idx {
>> +    uint32_t vcpu_id;
>> +    uint16_t altp2m_idx;
>> +};
>> +typedef struct xen_hvm_altp2m_get_vcpu_p2m_idx
>> +               xen_hvm_altp2m_get_vcpu_p2m_idx_t;
>> +DEFINE_XEN_GUEST_HANDLE(xen_hvm_altp2m_get_vcpu_p2m_idx_t);
> 
> What do you need this type and handle for?
> 

You are right, this is useless here, I will drop it in v2.


Alex
_______________________________________________
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®.