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

Re: [Xen-devel] [PATCH 20/22] xen/arm: Don't export flush_tlb_domain




On 07/22/2016 12:34 PM, Julien Grall wrote:
> 
> 
> On 22/07/16 11:25, Sergej Proskurin wrote:
>> Hi Julien,
>>
>> On 07/22/2016 11:30 AM, Julien Grall wrote:
>>>
>>>
>>> On 22/07/16 09:54, Sergej Proskurin wrote:
>>>> Hi Julien,
>>>
>>> Hello Sergej,
>>>
>>>> On 07/20/2016 06:11 PM, Julien Grall wrote:
>>>>> The function flush_tlb_domain is not used outside of the file where it
>>>>> has been declared.
>>>>>
>>>>
>>>> As for patch #15, the same applies here too:
>>>> For altp2m, flush_tlb_domain/p2m_flush_tlb should be made available to
>>>> ./xen/arch/arm/altp2m.c.
>>>
>>> Based on your previous version, I don't see any reason to flush call
>>> flush_tlb_domain/p2m_flush_tlb in altp2m.
>>>
>>> Please justify why you would need it.
>>>
>>
>> The new version considers changes that are made to the hostp2m and
>> propagates them to all affected altp2m views by either changing
>> individual altp2m entries or even flushing (but not destroying) the
>> entire altp2m-tables. This idea has been borrowed from the x86 altp2m
>> implementation.
>>
>> To prevent access to old/invalid GPAs, the current implementation
>> flushes the TLBs associated with the affected altp2m view after such
>> propagation.
> 
> There is already a flush in apply_p2m_changes and removing all the
> mapping in a p2m could be implemented in p2m.c. So I still don't see why
> you need the flush outside.
> 

Yes, the flush you are referring to flushes the hostp2m - not the
individual altp2m views.

> I looked at the x86 version of the propagation and I was not able to
> spot any explicit flush. Maybe you can provide some code to show what
> you mean.
>  

Sure thing:

...

static void p2m_reset_altp2m(struct p2m_domain *p2m)
{
    p2m_flush_table(p2m);
    /* Uninit and reinit ept to force TLB shootdown */
    ept_p2m_uninit(p2m);
    ept_p2m_init(p2m);
    p2m->min_remapped_gfn = INVALID_GFN;
    p2m->max_remapped_gfn = 0;
}

...

On x86, the uninit- and re-initialization of the EPTs force the TLBs
associated with the configured VMID of the EPTs to flush.

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