Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp145035imm; Thu, 27 Sep 2018 17:54:45 -0700 (PDT) X-Google-Smtp-Source: ACcGV61JYv1SL0imWkL0j/S2S5YWUQRDLuBPR6MyiGIcILFMglyh/KvkJyiZDeIHqiRaI0Ui5ska X-Received: by 2002:a17:902:c85:: with SMTP id 5-v6mr13570693plt.141.1538096085803; Thu, 27 Sep 2018 17:54:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538096085; cv=none; d=google.com; s=arc-20160816; b=UPopTWp4847jC+SdTEKCjMCnlh38lcBfbkx13iAqRrdGqlCpg+0YP+jcHqI5KgJuzp CJKD2jpXS/zt8qVrnTKg1TLau92UskILFKAVmQwpyeBIZkhtfPpYCrOwbGGYncNoOr9V VIyjqFG9u6lCHpObyUSq9BlrDNLwxURjypeRd6M+wIKNWkAtOimulItipGqypRK3J5nt zQ+ajAM5ShUMIn2u77T5Zas3D4JHOyk16LKCPNG+geTn0mGVBpaapj2lBlvsEF0iYhtt jF4c7R7AyHDJuJaRG1/KgtEhUh+u3JHOUC8Sr0v4Z6YWIuPfZ31PrdWfyh/nzmYzqfF7 felw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from; bh=lpNzSLbTNWuC9FzYhHj+SH+dut3Qdlq025sCqNgS0cw=; b=FDUSHrD+n8/Xh0PoEsBM7MTC5XcGWNkEWxLUjrXW56IJqlziHfyEqsmhi5xTgmFtNu qToiIlgCWyma2SSLujbLcfds3BeMkfLYEm6Kyg1Bc42Y4RS3L61kLO1G5ThxBifrVD+6 aJRiqf4kibf0abbw9rHqKeBx1Ia06TzaeiFa8i6MyB6Con2LUew0qwMQxeKJgG1R91R0 Es95hPORL7mqJrTzOCSMs49W2SN1IbVvz9JE1ZFvWnuMsf+HKsLQ4hmc0PlmOpBELiSA NIxAAdZBm27ECZkzJqITxmrp8EcxkyqZoLrC3rf+mvsHK9iPLWzSifJjHz2aOHjFaEqc E+Rg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n190-v6si3433252pfn.358.2018.09.27.17.54.30; Thu, 27 Sep 2018 17:54:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728871AbeI1HOv (ORCPT + 99 others); Fri, 28 Sep 2018 03:14:51 -0400 Received: from smtp2200-217.mail.aliyun.com ([121.197.200.217]:57518 "EHLO smtp2200-217.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728742AbeI1HNr (ORCPT ); Fri, 28 Sep 2018 03:13:47 -0400 X-Alimail-AntiSpam: AC=CONTINUE;BC=0.08640236|-1;CH=blue;FP=1691684883534943193|1|1|12|0|-1|-1|-1;HT=e01e01546;MF=ren_guo@c-sky.com;NM=1;PH=DS;RN=18;RT=18;SR=0;TI=SMTPD_---.CwkXlEv_1538095950; Received: from localhost(mailfrom:ren_guo@c-sky.com fp:SMTPD_---.CwkXlEv_1538095950) by smtp.aliyun-inc.com(10.147.41.143); Fri, 28 Sep 2018 08:52:30 +0800 From: Guo Ren To: akpm@linux-foundation.org, arnd@arndb.de, daniel.lezcano@linaro.org, davem@davemloft.net, gregkh@linuxfoundation.org, jason@lakedaemon.net, marc.zyngier@arm.com, mark.rutland@arm.com, mchehab+samsung@kernel.org, peterz@infradead.org, robh@kernel.org, robh+dt@kernel.org, tglx@linutronix.de Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, devicetree@vger.kernel.org, green.hu@gmail.com, Guo Ren Subject: [PATCH V6 32/33] csky: fix flush_cache_range and tlb_start_vma Date: Fri, 28 Sep 2018 08:51:29 +0800 Message-Id: <33f94d1b44080b4dd39759443a8c4704c70cab01.1538058840.git.ren_guo@c-sky.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <62098e7d0a7fbdd09f44d7e23333dad258a01bd2.1538058840.git.ren_guo@c-sky.com> References: <62098e7d0a7fbdd09f44d7e23333dad258a01bd2.1538058840.git.ren_guo@c-sky.com> In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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