|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 04/11] x86/MM: Improve p2m type checks.
On 01/12/2015 09:48 AM, Andrew Cooper wrote:
> On 09/01/15 21:26, Ed White wrote:
>> diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
>> index 5f7fe71..8193901 100644
>> --- a/xen/include/asm-x86/p2m.h
>> +++ b/xen/include/asm-x86/p2m.h
>> @@ -193,6 +193,9 @@ struct p2m_domain {
>> * threaded on in LRU order. */
>> struct list_head np2m_list;
>>
>> + /* Does this p2m belong to the altp2m code? */
>> + bool_t alternate;
>> +
>> /* Host p2m: Log-dirty ranges registered for the domain. */
>> struct rangeset *logdirty_ranges;
>>
>> @@ -290,7 +293,9 @@ struct p2m_domain *p2m_get_nestedp2m(struct vcpu *v,
>> uint64_t np2m_base);
>> */
>> struct p2m_domain *p2m_get_p2m(struct vcpu *v);
>>
>> -#define p2m_is_nestedp2m(p2m) ((p2m) != p2m_get_hostp2m((p2m->domain)))
>> +#define p2m_is_hostp2m(p2m) ((p2m) == p2m_get_hostp2m((p2m->domain)))
>> +#define p2m_is_altp2m(p2m) ((p2m)->alternate)
>> +#define p2m_is_nestedp2m(p2m) (!p2m_is_altp2m(p2m) && !p2m_ishostp2m(p2m))
>
> Might this be better expressed as a p2m type, currently of the set
> {host, alt, nested} ? p2m_is_nestedp2m() is starting to hide some
> moderately complicated calculations.
>
Any suggestions for the name? Unfortunately, p2m_type is already
taken, and I can't think of a good alternative.
Ed
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |