Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753393AbcCUIJm (ORCPT ); Mon, 21 Mar 2016 04:09:42 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:45816 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753019AbcCUIIu (ORCPT ); Mon, 21 Mar 2016 04:08:50 -0400 To: , From: Chen Feng Subject: Delete flush cache all in arm64 platform. CC: , , , , , , , , Message-ID: <56EFABD3.7060700@hisilicon.com> Date: Mon, 21 Mar 2016 16:07:47 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.142.193.64] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090201.56EFABFA.0089,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 6e55a7b83fdb1eb0a7bf941340519fa3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1369 Lines: 32 Hi Mark, With 68234df4ea7939f98431aa81113fbdce10c4a84b arm64: kill flush_cache_all() The documented semantics of flush_cache_all are not possible to provide for arm64 (short of flushing the entire physical address space by VA), and there are currently no users; KVM uses VA maintenance exclusively, cpu_reset is never called, and the only two users outside of arch code cannot be built for arm64. While cpu_soft_reset and related functions (which call flush_cache_all) were thought to be useful for kexec, their current implementations only serve to mask bugs. For correctness kexec will need to perform maintenance by VA anyway to account for system caches, line migration, and other subtleties of the cache architecture. As the extent of this cache maintenance will be kexec-specific, it should probably live in the kexec code. This patch removes flush_cache_all, and related unused components, preventing further abuse. This patch delete the flush_cache_all interface. But if we use VA to flush cache to do cache-coherency with other master(eg:gpu) We must iterate over the sg-list to flush by va to pa. In this way, the iterate of sg-list may cost too much time(sg-table to sg-list) if the sglist is too long. Take a look at the ion_pages_sync_for_device in ion. The driver(eg: ION) need to use this interface(flush cache all) to *improve the efficiency*.