lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <33f94d1b44080b4dd39759443a8c4704c70cab01.1538058840.git.ren_guo@c-sky.com>
Date:   Fri, 28 Sep 2018 08:51:29 +0800
From:   Guo Ren <ren_guo@...ky.com>
To:     akpm@...ux-foundation.org, arnd@...db.de,
        daniel.lezcano@...aro.org, davem@...emloft.net,
        gregkh@...uxfoundation.org, jason@...edaemon.net,
        marc.zyngier@....com, mark.rutland@....com,
        mchehab+samsung@...nel.org, peterz@...radead.org, robh@...nel.org,
        robh+dt@...nel.org, tglx@...utronix.de
Cc:     linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org,
        devicetree@...r.kernel.org, green.hu@...il.com,
        Guo Ren <ren_guo@...ky.com>
Subject: [PATCH V6 32/33] csky: fix flush_cache_range and tlb_start_vma

In flush_cache_range(vma, ...) cache_wbinv_range() couldn't deal with
vma->mm's asid for cache_flush_line. So we use cache_wbinv_all() first
and we'll improve with cache_flush(vma, start, end) in future.

For tlb_start_vma, we make it the same as other arch.

Signed-off-by: Guo Ren <ren_guo@...ky.com>
---
 arch/csky/abiv1/inc/abi/cacheflush.h | 6 +++++-
 arch/csky/abiv1/inc/abi/tlb.h        | 2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/csky/abiv1/inc/abi/cacheflush.h b/arch/csky/abiv1/inc/abi/cacheflush.h
index f0de49c..4ae81b0 100644
--- a/arch/csky/abiv1/inc/abi/cacheflush.h
+++ b/arch/csky/abiv1/inc/abi/cacheflush.h
@@ -15,7 +15,11 @@ extern void flush_dcache_page(struct page *);
 #define flush_cache_page(vma,page,pfn)	cache_wbinv_all()
 #define flush_cache_dup_mm(mm)		cache_wbinv_all()
 
-#define flush_cache_range(mm,start,end)	cache_wbinv_range(start, end)
+/*
+ * if (current_mm != vma->mm) cache_wbinv_range(start, end) will be broken.
+ * Use cache_wbinv_all() here and need to be improved in future.
+ */
+#define flush_cache_range(vma,start,end)	cache_wbinv_all()
 #define flush_cache_vmap(start, end)	cache_wbinv_range(start, end)
 #define flush_cache_vunmap(start, end)  cache_wbinv_range(start, end)
 
diff --git a/arch/csky/abiv1/inc/abi/tlb.h b/arch/csky/abiv1/inc/abi/tlb.h
index 6d461f3..3b9d6d9 100644
--- a/arch/csky/abiv1/inc/abi/tlb.h
+++ b/arch/csky/abiv1/inc/abi/tlb.h
@@ -7,6 +7,6 @@
 #define tlb_start_vma(tlb, vma) \
 	do { \
 		if (!tlb->fullmm) \
-			cache_wbinv_all(); \
+			flush_cache_range(vma, vma->vm_start, vma->vm_end); \
 	}  while (0)
 #endif /* __ABI_CSKY_TLB_H */
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ