Skip to contentSkip to conversation

x86/HAP: also flush TLB when altering a present 1G entry

PATCH Superseded Jan Beulich 2 participants 2 messages Apr 11, 2014 – Apr 13, 2014

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/HAP: also flush TLB when altering a present 1G entry

I actually wonder whether it is really correct to avoid the flush when updating intermediate page table entries.

xen/arch/x86/mm/hap/hap.c +1 -1
@@ -712,7 +712,7 @@ hap_write_p2m_entry(struct vcpu *v, unsi
 
     safe_write_pte(p, new);
     if ( (old_flags & _PAGE_PRESENT)
-         && (level == 1 || (level == 2 && (old_flags & _PAGE_PSE))) )
+         && (level == 1 || (old_flags & _PAGE_PSE)) )
              flush_tlb_mask(d->domain_dirty_cpumask);
 
     paging_unlock(d);

x86/HAP: also flush TLB when altering a present 1G entry

I actually wonder whether it is really correct to avoid the flush when updating intermediate page table entries.

xen/arch/x86/mm/hap/hap.c +1 -1
@@ -712,7 +712,7 @@ hap_write_p2m_entry(struct vcpu *v, unsi
 
     safe_write_pte(p, new);
     if ( (old_flags & _PAGE_PRESENT)
-         && (level == 1 || (level == 2 && (old_flags & _PAGE_PSE))) )
+         && (level == 1 || (old_flags & _PAGE_PSE)) )
              flush_tlb_mask(d->domain_dirty_cpumask);
 
     paging_unlock(d);

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#1 lore raw
Quoted 2 lines · Jan Beulich

I actually wonder whether it is really correct to avoid the flush when updating intermediate page table entries.

It certainly used to be; now that we have, e.g. p2m_free_entry() it would be best to flush whenever (old_flags & _PAGE_PRESENT).

Tim.

Quoted 35 lines
xen/arch/x86/mm/hap/hap.c +1 -1
@@ -712,7 +712,7 @@ hap_write_p2m_entry(struct vcpu *v, unsi
 
     safe_write_pte(p, new);
     if ( (old_flags & _PAGE_PRESENT)
-         && (level == 1 || (level == 2 && (old_flags & _PAGE_PSE))) )
+         && (level == 1 || (old_flags & _PAGE_PSE)) )
              flush_tlb_mask(d->domain_dirty_cpumask);
 
     paging_unlock(d);

x86/HAP: also flush TLB when altering a present 1G entry

I actually wonder whether it is really correct to avoid the flush when updating intermediate page table entries.

xen/arch/x86/mm/hap/hap.c +1 -1
@@ -712,7 +712,7 @@ hap_write_p2m_entry(struct vcpu *v, unsi
 
     safe_write_pte(p, new);
     if ( (old_flags & _PAGE_PRESENT)
-         && (level == 1 || (level == 2 && (old_flags & _PAGE_PSE))) )
+         && (level == 1 || (old_flags & _PAGE_PSE)) )
              flush_tlb_mask(d->domain_dirty_cpumask);
 
     paging_unlock(d);