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

[Xen-changelog] [xen stable-4.3] x86: don't use VA for cache flush when also flushing TLB



commit 7db17e89d11470e0bbcb145273279e3d5537a491
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Tue Jun 3 12:16:52 2014 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Jun 3 12:16:52 2014 +0200

    x86: don't use VA for cache flush when also flushing TLB
    
    Doing both flushes at once is a strong indication for the address
    mapping to either having got dropped (in which case the cache flush,
    when done via INVLPG, would fault) or its physical address having
    changed (in which case the cache flush would end up being done on the
    wrong address range). There is no adverse effect (other than the
    obvious performance one) using WBINVD in this case regardless of the
    range's size; only map_pages_to_xen() uses combined flushes at present.
    
    This problem was observed with the 2nd try backport of d6cb14b3 ("VT-d:
    suppress UR signaling for desktop chipsets") to 4.2 (where ioremap()
    needs to be replaced with set_fixmap_nocache(); the now commented out
    __set_fixmap(, 0, 0) there to undo the mapping resulted in the first of
    the above two scenarios).
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    master commit: 50df6f7429f73364bbddb0970a3a34faa01a7790
    master date: 2014-05-28 09:51:07 +0200
---
 xen/arch/x86/flushtlb.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/flushtlb.c b/xen/arch/x86/flushtlb.c
index e0388e7..1b75652 100644
--- a/xen/arch/x86/flushtlb.c
+++ b/xen/arch/x86/flushtlb.c
@@ -152,7 +152,8 @@ void flush_area_local(const void *va, unsigned int flags)
         if ( order < (BITS_PER_LONG - PAGE_SHIFT) )
             sz = 1UL << (order + PAGE_SHIFT);
 
-        if ( c->x86_clflush_size && c->x86_cache_size && sz &&
+        if ( !(flags & (FLUSH_TLB|FLUSH_TLB_GLOBAL)) &&
+             c->x86_clflush_size && c->x86_cache_size && sz &&
              ((sz >> 10) < c->x86_cache_size) )
         {
             va = (const void *)((unsigned long)va & ~(sz - 1));
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.