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

Re: [Xen-devel] [PATCH v7 1/3] x86/tlb: introduce a flush HVM ASIDs flag



On Fri, Mar 20, 2020 at 02:27:36PM +0000, Julien Grall wrote:
> 
> 
> On 20/03/2020 14:22, Roger Pau Monné wrote:
> > static inline void filtered_flush_tlb_mask(uint32_t tlbflush_timestamp)
> > {
> >      cpumask_t mask;
> > 
> >      cpumask_copy(&mask, &cpu_online_map);
> >      tlbflush_filter(&mask, tlbflush_timestamp);
> >      if ( !cpumask_empty(&mask) )
> >      {
> >          perfc_incr(need_flush_tlb_flush);
> > #if CONFIG_X86
> >          /*
> >           * filtered_flush_tlb_mask is used after modifying the p2m in
> >           * populate_physmap, Xen needs to trigger an ASID tickle as this 
> > is a
> >           * requirement on AMD hardware.
> >           */
> 
> I don't think this comment is correct. populate_physmap() is only going to
> add entry in the P2M and therefore flush should not be needed.

Since this is strictly only adding entries I think you are right and
the ASID tickle could be avoided, as long as we can assert the gfn was
empty (or didn't have the valid bit set) previous to being populated.

Or that the nested page tables code already handles all this and
perform the necessary flushes.

> The only reason the flush would happen in populate_physmap() is because we
> allocated a page that was required to be flush (see free.need_tbflush).

I think this is related to PV guests rather than HVM ones? For HVM we
would always flush whatever is needed after removing an entry from the
page tables.

Thanks, Roger.

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