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

Re: [Xen-devel] [PATCH v3 08/38] arm/p2m: Free p2m entries only in the hostp2m



Hi Julien,

On 09/01/2016 07:08 PM, Julien Grall wrote:
> Hello Sergej,
> 
> On 16/08/16 23:16, Sergej Proskurin wrote:
>> Freeing p2m entries of arbitrary p2m's (in particular in alternate
>> p2m's) will lead to unpredicted behavior as the entries might still be
>> used within the host's p2m. The host's p2m should, however, free the
>> entries, as it is the main instance responsible for their management. If
>> entries were freed in the host's p2m, but still reside in one or more of
>> the alternate p2m's, the change will be propagated to these functions as
>> will be shown in the following commits.
>>
>> Signed-off-by: Sergej Proskurin <proskurin@xxxxxxxxxxxxx>
>> ---
>> Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>
>> Cc: Julien Grall <julien.grall@xxxxxxx>
>> ---
>>  xen/arch/arm/p2m.c | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
>> index 02e9ee7..bfbccca 100644
>> --- a/xen/arch/arm/p2m.c
>> +++ b/xen/arch/arm/p2m.c
>> @@ -1004,7 +1004,9 @@ static int __p2m_set_entry(struct p2m_domain *p2m,
>>       * Free the entry only if the original pte was valid and the base
>>       * is different (to avoid freeing when permission is changed).
>>       */
>> -    if ( p2m_valid(orig_pte) && entry->p2m.base != orig_pte.p2m.base )
>> +    if ( p2m_valid(orig_pte) &&
>> +         entry->p2m.base != orig_pte.p2m.base &&
>> +         p2m_is_hostp2m(p2m) )
> 
> With this change, intermediate page table will not be freed which will
> lead to keep the memory used (and therefore unavailable for others)
> until the p2m is effectively destroyed.
> 

Makes sense. I will come back to this comment after I have done more
testing.

Best regards,
~Sergej

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

 


Rackspace

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