From patchwork Mon May 6 15:51:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bang Li X-Patchwork-Id: 13655672 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5CCD5C10F16 for ; Mon, 6 May 2024 15:52:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7990C6B0095; Mon, 6 May 2024 11:52:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6F6DD6B0096; Mon, 6 May 2024 11:52:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4FC356B0098; Mon, 6 May 2024 11:52:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 2D6256B0095 for ; Mon, 6 May 2024 11:52:13 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id D5B42C05F8 for ; Mon, 6 May 2024 15:52:12 +0000 (UTC) X-FDA: 82088412504.17.D5D9BC0 Received: from out0-209.mail.aliyun.com (out0-209.mail.aliyun.com [140.205.0.209]) by imf06.hostedemail.com (Postfix) with ESMTP id 5F78818002A for ; Mon, 6 May 2024 15:52:10 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=antgroup.com header.s=default header.b=S9oTuP+n; spf=pass (imf06.hostedemail.com: domain of libang.li@antgroup.com designates 140.205.0.209 as permitted sender) smtp.mailfrom=libang.li@antgroup.com; dmarc=pass (policy=quarantine) header.from=antgroup.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1715010731; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=V5hA+ZyI44gZD58G2AfJieyG2gwT3Fy83Cv7WPpLrX0=; b=ri9ZSt38/CxLg3F22Vb86mZrZMkmeYDbpQHSCkSmZmo2xKcem+ITFA889hxtv+TsIkA/Vw yN/hRs5jkIIzBcXMN6aldZWggRZkGdcyxY2SYW5VvwqFH3Awn5OhaSt3+S/Z1bfUywhFHs iGiMiZ+rreDbKH0TC0Ar9NzN2wSSzYI= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=antgroup.com header.s=default header.b=S9oTuP+n; spf=pass (imf06.hostedemail.com: domain of libang.li@antgroup.com designates 140.205.0.209 as permitted sender) smtp.mailfrom=libang.li@antgroup.com; dmarc=pass (policy=quarantine) header.from=antgroup.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1715010731; a=rsa-sha256; cv=none; b=PRJ2K0jWm029o8r2VoU/SahfZLic8iVT+KEhhLAQ36YLF1w+1KOBpsAf0OtuxX6Sb2oWRX qsV66P2y+u1NU/oCUNXLaJG8vmJqzKKHaE7AB47qW1eYVPbF/Q09qWYeGQfbsTu+itngCK 86qJNLGBTZAapogF6p0qdig8DxUpTPM= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=antgroup.com; s=default; t=1715010727; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=V5hA+ZyI44gZD58G2AfJieyG2gwT3Fy83Cv7WPpLrX0=; b=S9oTuP+nQD10do/2vkQ3olR0poUtTfOxwDHVI2RZVzDa/xJtKK27IhmdocDtfjzR8PtRCveERAcTKN8siXTh+ZyMHWnoFhhOtwGPAQORJTXU924L0CoodAdKqnDipXyJmi9pAGCe7hHcBcUfBbKaeL0IPtR20CGXuVjaVX35lls= X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R161e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018047202;MF=libang.li@antgroup.com;NM=1;PH=DS;RN=16;SR=0;TI=SMTPD_---.XTd3Clf_1715010725; Received: from localhost(mailfrom:libang.li@antgroup.com fp:SMTPD_---.XTd3Clf_1715010725) by smtp.aliyun-inc.com; Mon, 06 May 2024 23:52:06 +0800 From: "Bang Li" To: akpm@linux-foundation.org, chenhuacai@kernel.org, tsbogend@alpha.franken.de, paul.walmsley@sifive.com, palmer@dabbelt.com, chris@zankel.net, jcmvbkbc@gmail.com Cc: , , , , , , , , "Bang Li" Subject: [PATCH v2 3/5] riscv: Add update_mmu_tlb_range() Date: Mon, 06 May 2024 23:51:18 +0800 Message-Id: <20240506155120.83105-4-libang.li@antgroup.com> X-Mailer: git-send-email 2.19.1.6.gb485710b In-Reply-To: <20240506155120.83105-1-libang.li@antgroup.com> References: <20240506155120.83105-1-libang.li@antgroup.com> MIME-Version: 1.0 X-Stat-Signature: 5fc8ke6khq9rwut9e6bmgpi5ea3x6qqp X-Rspamd-Queue-Id: 5F78818002A X-Rspamd-Server: rspam10 X-Rspam-User: X-HE-Tag: 1715010730-528448 X-HE-Meta: U2FsdGVkX1/8FVXC+AQFfznHhIY8EdSdd4+aAk/GmeEOV/tW4tDgjHVsC9ve8ylTrygdjKepGtwlMwAYp6S8owNEzOFhaPP02nJPWTnv30kki96MKnWf0Yfa8bJIyQ/6LFK19UgHKpNimo2H6nef0ZrMiMiSS9jKFvatVikhBKNVAQ+MVLkZiIpznAgigJv3pHJU7FbslcWQvSlbpPT1iVyc23eNbQWLbA1pGYm8iTBpFBUaezIC5nvNMSpUOnYCRoMgiPL2QQGmmmBU86OAHkgk1jlkawb8o2GYhV8uA+McmTCYd/7y/ZJl5Gk7HjqL/8NSUgSIEQPYB5VDO4Rtgr3jqSgpEGsipEWB7Us2FpHV1xgHsSsNc6OaDo61v8nvx93kYgdTesogvRZFJUkCAdSuXXnE5lFqE7oihEiYNWnlgZDft3t+X67IiI27YTqJ16Y+OKW5eXJQY8mSNpUCs0MEoAqIR0IyCyj0tJBL5Bf/hPRy7C3DrdumiDC9OI4kixO4BQ2MvWQVn15rsRjQk9HVvNmX0e0vmiC9P5J1ngQQzSqAGyZSr/TBIfKm5pUpwN+YWFgmqsYxB3OLnTICAP/IisvO6cViYpx4kltKcf1pZcSHWJ/CZ8TiHHeK6dULwq5DRz87CuFLawrarh3weHZMuurY+JtDF57WefYhD6Q+Cdqrlfr8UmGzgw34qpNWzd4vJF+upeTMTrpEB6w/2Ycw0035navrCPEcrwhCZxHqoSnf0KjMaaTsJBg5i20RWpRJ+h6vrI/lpCvEKVe1kVYZDkF4MQS3Oc3O38UO1rfUJCvC/zLQrgp0ifhP1DqkgcE8hgi157SzL6PMvwfZZcAq6cvnpl/ndbLyn5iGypAaL3ranj3pID2rgSo9TxMwheG4qYxFfT37BYesfpiF63VOXb8GpR7wGvYVuPKqkg/KrCCiMUr2Ka8Jg6uoh7FhyFtYhOWv6Qx4e84eW8z D4F/9mJZ H+duuLND7QbUWYxUNAqlDL70Ek7j2MqYQuUb5Z4u8irm/25o5hAlcMkzxRjR66pVvSA4rqRSrLt7MyzVoZ8folwOS00mFoQX3xyEGGWXYhGDuvdM+/mPKomOtcnfeEpxlpESOIp//T0RXEEU+iO4y/baS2ec/omhM4nb/DpwEeyxjh0pDKUmkfR1W9oPRuz6Mc2sXspMPBEdqd7O6ReJ48sCwG0etkHjqQOaSzW0L2g3Y/p52f4H/aGy8M9pFtmlUYSSLTssZ/i+2Bcmt+B3nhe176tVZkJFOkNMoGjfEpmrZ/gn3G+p7l3EsdjGZVIkY5h19jf62I5J3Au0lOmWDAOH0WYs9LjmAkAbiUpW67PMYR4c= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000022, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Added update_mmu_tlb_range function, we can batch update tlb of an address range. Signed-off-by: Bang Li Reviewed-by: Alexandre Ghiti --- arch/riscv/include/asm/pgtable.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h index 661b2b4fe758..f784c6dd2c66 100644 --- a/arch/riscv/include/asm/pgtable.h +++ b/arch/riscv/include/asm/pgtable.h @@ -489,6 +489,10 @@ static inline void update_mmu_cache_range(struct vm_fault *vmf, #define __HAVE_ARCH_UPDATE_MMU_TLB #define update_mmu_tlb update_mmu_cache +#define __HAVE_ARCH_UPDATE_MMU_TLB_RANGE +#define update_mmu_tlb_range(vma, addr, ptep, nr) \ + update_mmu_cache_range(NULL, vma, addr, ptep, nr) + static inline void update_mmu_cache_pmd(struct vm_area_struct *vma, unsigned long address, pmd_t *pmdp) {