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

Re: [Xen-devel] [PATCH V8 3/7] x86/p2m: allocate logdirty_ranges for altp2ms



On 11/21/18 12:45 PM, Jan Beulich wrote:
>>>> On 21.11.18 at 11:19, <rcojocaru@xxxxxxxxxxxxxxx> wrote:
>> +static int p2m_activate_altp2m(struct domain *d, unsigned int idx)
>> +{
>> +    struct p2m_domain *hostp2m, *p2m;
>> +    int rc;
>> +
>> +    ASSERT(idx < MAX_ALTP2M);
>> +
>> +    p2m = d->arch.altp2m_p2m[idx];
>> +    hostp2m = p2m_get_hostp2m(d);
>> +
>> +    p2m_lock(p2m);
>> +
>> +    rc = p2m_init_logdirty(p2m);
>> +
>> +    if ( rc )
>> +        goto out;
>> +
>> +    /* The following is really just a rangeset copy. */
>> +    rc = rangeset_merge(p2m->logdirty_ranges, hostp2m->logdirty_ranges);
> 
> Is p2m != hostp2m guaranteed here (recalling the discussion about
> array slot 0)? The function may happen to work with both rangesets
> the same, but I don't think this is guaranteed.

Yes, it is. We're "wasting" altp2m[0], as previously discussed.

>> +    if ( rc )
>> +    {
>> +        p2m_free_logdirty(p2m);
>> +        goto out;
>> +    }
>> +
>> +    p2m_init_altp2m_ept(d, idx);
>> +
>> +out:
> 
> Labels indented by at least one blank please.

Right, will change it in the next version.


Thanks,
Razvan

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