From ff870e6d145e4ee5fb542949670348fc6571fc8e Mon Sep 17 00:00:00 2001 From: Knut Omang Date: Tue, 19 Jul 2016 07:54:45 +0200 Subject: [PATCH] sif: fmr: call sif_post_flush_tlb with ptw flush and in SR/IOV cases MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- drivers/infiniband/hw/sif/sif_fmr.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) 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; } } -- 2.50.1