Move the flush after the pagetable entry has actually been written to
avoid races with other vcpus refreshing the same entriy.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
paddr_t maddr,
int mattr)
{
- int rc;
+ int rc, flush;
struct p2m_domain *p2m = &d->arch.p2m;
lpae_t *first = NULL, *second = NULL, *third = NULL;
paddr_t addr;
third = map_domain_page(second[second_table_offset(addr)].p2m.base);
cur_second_offset = second_table_offset(addr);
}
- /* else: third already valid */
- if ( third[third_table_offset(addr)].p2m.valid )
- flush_tlb_all_local();
+ flush = third[third_table_offset(addr)].p2m.valid;
/* Allocate a new RAM page and attach */
switch (op) {
}
break;
}
+
+ if ( flush )
+ flush_tlb_all_local();
}
rc = 0;