From: Knut Omang Date: Tue, 19 Jul 2016 05:54:45 +0000 (+0200) Subject: sif: fmr: call sif_post_flush_tlb with ptw flush and in SR/IOV cases X-Git-Tag: v4.1.12-92~96^2~7 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=ff870e6d145e4ee5fb542949670348fc6571fc8e;p=users%2Fjedix%2Flinux-maple.git sif: fmr: call sif_post_flush_tlb with ptw flush and in SR/IOV cases Flush the ptw cache as part of the bulk tlb flush. With the introduction of more dynamic page tables, the code to distinguish between the two types of cases, simple page table entries and entries with interior nodes was simplified because we no longer always know if PTW entries have been consumed. Unfortunately the code was unified to the wrong case which does not flush the ptw cache possibly causing cache entries to remain in the cache and theoretically have sif look up pages that no longer exists or that has been reused for other purposes. Also now that the EPSC handles the tlb flushing, it is just fine to call that code even in virtualized setups. Remove tests for whether VFs exists or we are running in a VF. Orabug: 24315529 Signed-off-by: Knut Omang Reviewed-by: HÃ¥kon Bugge --- diff --git a/drivers/infiniband/hw/sif/sif_fmr.c b/drivers/infiniband/hw/sif/sif_fmr.c index 79ec9adc6926..bb88476fa5ba 100644 --- a/drivers/infiniband/hw/sif/sif_fmr.c +++ b/drivers/infiniband/hw/sif/sif_fmr.c @@ -169,15 +169,13 @@ int sif_unmap_phys_fmr_list(struct list_head *fmr_list) sdev->ki_spqp.pool_sz); } - if (!sdev->is_vf && sdev->num_vfs == 0) { - /* Check if we should do a brute force whole MMU caches flush (PF only) */ - list_for_each_entry(ib_fmr, fmr_list, list) { - cnt++; - if (cnt >= sif_fmr_cache_flush_threshold) { - ret = sif_post_flush_tlb(sdev, false); - flush_all = true; - goto key_to_invalid; - } + /* Check if we should do a brute force whole MMU caches flush */ + list_for_each_entry(ib_fmr, fmr_list, list) { + cnt++; + if (cnt >= sif_fmr_cache_flush_threshold) { + ret = sif_post_flush_tlb(sdev, true); + flush_all = true; + goto key_to_invalid; } }