From patchwork Mon Apr 29 10:33:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bang Li X-Patchwork-Id: 13646590 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 D2637C4345F for ; Mon, 29 Apr 2024 10:36:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7045A6B0089; Mon, 29 Apr 2024 06:36:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 669186B008A; Mon, 29 Apr 2024 06:36:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 494156B008C; Mon, 29 Apr 2024 06:36:05 -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 1EEB86B0089 for ; Mon, 29 Apr 2024 06:36:05 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 93571C19B4 for ; Mon, 29 Apr 2024 10:36:04 +0000 (UTC) X-FDA: 82062214248.16.6AA0DA7 Received: from out0-201.mail.aliyun.com (out0-201.mail.aliyun.com [140.205.0.201]) by imf19.hostedemail.com (Postfix) with ESMTP id 90F931A000B for ; Mon, 29 Apr 2024 10:36:01 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=antgroup.com header.s=default header.b=hQRNZFKo; dmarc=pass (policy=quarantine) header.from=antgroup.com; spf=pass (imf19.hostedemail.com: domain of libang.li@antgroup.com designates 140.205.0.201 as permitted sender) smtp.mailfrom=libang.li@antgroup.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1714386962; 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=L9Nnq3jHrztC2V1l+aPsgS97TA5W6U5sPTcwdSCKib4=; b=3zSgppFIWCMpCiabcFzy6nudCJ4DCUBgWibhHORt8WWzVTlUqWK1b1PBLWumejQmNA1JDR JMUAmD3SSH3eufpxpRClgQlUPUIt0bmCDpOYsZmLDp9Kf/cyOsU5lpwDps2MFc4yuel4DB w9FSQcuE7WmWNuoqmTULk/IEuvC90Qo= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=antgroup.com header.s=default header.b=hQRNZFKo; dmarc=pass (policy=quarantine) header.from=antgroup.com; spf=pass (imf19.hostedemail.com: domain of libang.li@antgroup.com designates 140.205.0.201 as permitted sender) smtp.mailfrom=libang.li@antgroup.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1714386962; a=rsa-sha256; cv=none; b=0tsPSDBXj3kMmN9z2p5Hf1e8T0+BcmzhHY6gZB/Mk8J5Cs0JPxaJuDeoXPCkT/iW+++A0d 4j5RmfEfprgR/aakH2rwLTFU1mjN7s2Bk2QOG5+9Q65kSnFu5oTNZ5Q1u957N3fXjP1UT0 GsSBAd2xYxPZB2l2zvR+eAxhV0+uBdM= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=antgroup.com; s=default; t=1714386958; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=L9Nnq3jHrztC2V1l+aPsgS97TA5W6U5sPTcwdSCKib4=; b=hQRNZFKoJR/Z6J/Mdjz/Rrc9wQNL40mP544JZi0WALMiuztrxwSk1dFqXvJAwaSMEccrE6bUsigtJFDjuiAHW8rxrtMjGCE1VUj2EAI6oWMIAf65hhwy9BocdI5bYn1D/FqrZvfd2wDHdULwl2LtfZXW8wQF/ZM2aXgSHix13kg= X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R831e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018047207;MF=libang.li@antgroup.com;NM=1;PH=DS;RN=17;SR=0;TI=SMTPD_---.XOEanMa_1714386956; Received: from localhost(mailfrom:libang.li@antgroup.com fp:SMTPD_---.XOEanMa_1714386956) by smtp.aliyun-inc.com; Mon, 29 Apr 2024 18:35:57 +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 v1 4/5] xtensa: Add update_mmu_tlb_range() Date: Mon, 29 Apr 2024 18:33:45 +0800 Message-Id: <20240429103346.59115-5-libang.li@antgroup.com> X-Mailer: git-send-email 2.19.1.6.gb485710b In-Reply-To: <20240429103346.59115-1-libang.li@antgroup.com> References: <20240429103346.59115-1-libang.li@antgroup.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 90F931A000B X-Stat-Signature: gpt8kxbjusmhkmg3uy5hxitmwgyp1gqq X-HE-Tag: 1714386961-379805 X-HE-Meta: U2FsdGVkX1/fxHAsPcMvz5+ymaFRNUEv8iIXpalqO/guRmR0Tco4jNVcQE09dAYuE12F3ah+KtQ0av5b0isJJFoPEO1/2pbXMNbPNHwQs5AUqU73cvm+hYs3DeWf1iLyv0reJNEfRvGVPYo/pe1GRuHGAvsc75oqipBQSkVbf20j6cxWhs/NT0eTmfAYJfPcK55tB12MYNsjY8jRE27z5uBlx7yDh1qOaKXhueToJ/5KBbyZkCHejT+i6iI8UzU48wsbAIZW6S8/gFZK2Tm1BMtvx5f3tI3l/S5Z8toN308AmN9lPA5NHvRhv3/gnVv6fQhy0Nqbb1fdxbNSf0UWVU+kQKreb/PUR6yRyO+hqjTv9GugDlZaECG9wZLK3gr4vGCiLAE7mX+FbFqQXBNrwkhi6t0nYwFAr9WC5wZxYlbUr1qhsy4ESRowzH/GJ/lkXELyx8SjZpsrcu+/urahkAKcVWNPS1f6BM4RoCJShr5UOiFMt1EJSaCeQzqn5ad8xo0LpwuZf7jTdl4ftmqiV/eciNLxGDQok7N4qY+wkaSEReO72SzGBigbyZhgM3kqrm54jTD+icOZ0r3+u/dDjCiMpnGHbM05ncJweKss1e0/AHf21wRzSe3oFESqTDddx0IgppHApIgeoNFkqzxpAlbN3TtnOQmAG3r3f6e50EbrpqiEC0WcoPG/CpUSMRSSqBW84/ouU8U3ybUSOi2agrGVUZ4VzG/wbHklknuYBWZicT/1C/YuIPraiqAHTSLY0j3r8DNZAT0ZMjvXepTmu4niLkKehG/J3FF525KViEY4Bs8Qc4YPQsH+3ADJ2+8DsmIuRB8iHHpBNtepCgRjsDiKqlct1XrCu1dofKdEshzSAdX8Mq78IIr3XqzisEoF5gZM0nQ0LfipMceR22FscHabPAcLSOOjwu4ShGCLdLa+W/NGN6VJ4zD5+2bnQGDFRGRsucnN+Na8yloE4d9 Ic3dunF2 mSXU7ttO8Qh5o1rv5XQIxgSNzwCAI5dpnKBCpv7oKftKxYaCUxJDCf79J0ISP0sVny00YZZJDGq3LDPTGaapx9T/o2uNEQHrd4QgEYEkOI6ZWYNtALNtXaW+byQiVWbJDT1CBZ/s9e+up0fPSYg7CFQhrMR7l9Che6NId5KJSn+q5RNPOUU9v4iN1HE+YPY/mCj6BDGHKLYHMtiMJ1Mwf/caOTcPCbtdCtJqNRke8JiVrqypchN7ckG+4k6VJVnGG9G6r0Mpbw4jw3ATE8Fmb8e6A1lCMBQ7IdYUVATi32h4QdCxJXKeM7+xy1VwNNH2IPGCSV4jT8XqBG0a6OxijE74Kcws2P+mHky1VZNDAesuMvto= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, 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 --- arch/xtensa/include/asm/pgtable.h | 2 ++ arch/xtensa/mm/tlb.c | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/arch/xtensa/include/asm/pgtable.h b/arch/xtensa/include/asm/pgtable.h index 9a7e5e57ee9a..50ccfc988256 100644 --- a/arch/xtensa/include/asm/pgtable.h +++ b/arch/xtensa/include/asm/pgtable.h @@ -412,6 +412,8 @@ typedef pte_t *pte_addr_t; void update_mmu_tlb(struct vm_area_struct *vma, unsigned long address, pte_t *ptep); +void update_mmu_tlb_range(struct vm_area_struct *vma, + unsigned long address, pte_t *ptep, unsigned int nr); #define __HAVE_ARCH_UPDATE_MMU_TLB #endif /* !defined (__ASSEMBLY__) */ diff --git a/arch/xtensa/mm/tlb.c b/arch/xtensa/mm/tlb.c index d8b60d6e50a8..05efba86b870 100644 --- a/arch/xtensa/mm/tlb.c +++ b/arch/xtensa/mm/tlb.c @@ -169,6 +169,12 @@ void update_mmu_tlb(struct vm_area_struct *vma, local_flush_tlb_page(vma, address); } +void update_mmu_tlb_range(struct vm_area_struct *vma, + unsigned long address, pte_t *ptep, unsigned int nr) +{ + local_flush_tlb_range(vma, address, address + PAGE_SIZE * nr); +} + #ifdef CONFIG_DEBUG_TLB_SANITY static unsigned get_pte_for_vaddr(unsigned vaddr)