mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
Avoid some unnecessary TLB flushes. This will probably make no real
difference on any sensible guest operating system. Signed-off-by: Steven Smith, sos22@cl.cam.ac.uk.
This commit is contained in:
1 parent
6b2d3de1ce
commit
6a368fe8aa
1 file changed
+15
-11
+15
-11
@@ -1352,18 +1352,22 @@ int get_page_type(struct pfn_info *page, u32 type)
|
||||
{
|
||||
if ( (x & (PGT_type_mask|PGT_va_mask)) != type )
|
||||
{
|
||||
/*
|
||||
* On type change we check to flush stale TLB entries. This
|
||||
* may be unnecessary (e.g., page was GDT/LDT) but those
|
||||
* circumstances should be very rare.
|
||||
*/
|
||||
cpumask_t mask = page_get_owner(page)->cpumask;
|
||||
tlbflush_filter(mask, page->tlbflush_timestamp);
|
||||
|
||||
if ( unlikely(!cpus_empty(mask)) )
|
||||
if ( (x & PGT_type_mask) != (type & PGT_type_mask) )
|
||||
{
|
||||
perfc_incrc(need_flush_tlb_flush);
|
||||
flush_tlb_mask(mask);
|
||||
/*
|
||||
* On type change we check to flush stale TLB
|
||||
* entries. This may be unnecessary (e.g., page
|
||||
* was GDT/LDT) but those circumstances should be
|
||||
* very rare.
|
||||
*/
|
||||
cpumask_t mask = page_get_owner(page)->cpumask;
|
||||
tlbflush_filter(mask, page->tlbflush_timestamp);
|
||||
|
||||
if ( unlikely(!cpus_empty(mask)) )
|
||||
{
|
||||
perfc_incrc(need_flush_tlb_flush);
|
||||
flush_tlb_mask(mask);
|
||||
}
|
||||
}
|
||||
|
||||
/* We lose existing type, back pointer, and validity. */
|
||||
|
||||