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: 13646585 Received: from out187-3.us.a.mail.aliyun.com (out187-3.us.a.mail.aliyun.com [47.90.187.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 642D24F891; Mon, 29 Apr 2024 10:36:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=47.90.187.3 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714386973; cv=none; b=iscVzIfGEPWfGiyukyvddWXThPUSAqKWDVQt+3PlYCH7mCnYf5bpyJT6is5xbxFf3Pj4OpLNUEqv1JLekEwuzMqb8YSXBE4Tc7qaP42KfxD0KlO6mjFXp6oMJqs/Jm/UmIfCTER1YX2GlDPWgu4L3HI41c24O/baGSSUp5M7P9w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714386973; c=relaxed/simple; bh=PPzTdu8GHUSCZuJDiTQr/ewx5LKlmshWf3qQHg5D1RQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=XASQPAqLFZvFwW7ExWpA2UyqoZ++x4JBEITjxjqwrqzGvtLrOx8fRfICEftDaG+QrpaeG5MsqmmaaPbscU1Vjf0nOzQzE4SyUNfQjDA8kDnrW0EnZnuNh9r1fE56E518Vj0yNna/c56NTgQLITudg5FcBOA3BBCF7zsyqAeLnvQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=antgroup.com; spf=pass smtp.mailfrom=antgroup.com; dkim=pass (1024-bit key) header.d=antgroup.com header.i=@antgroup.com header.b=rLohAmKf; arc=none smtp.client-ip=47.90.187.3 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=antgroup.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=antgroup.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=antgroup.com header.i=@antgroup.com header.b="rLohAmKf" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=antgroup.com; s=default; t=1714386959; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=L9Nnq3jHrztC2V1l+aPsgS97TA5W6U5sPTcwdSCKib4=; b=rLohAmKf4SrixuQnHlrxT++B6o0m4L2zDIthfDKSFqfKyzTipMDIIOixCW9vJBJ4L2/Y/QHPBgjl2mdPKNGZIcgwZ1bJBeSy3P6Pk38aZPA3ZFObZxMExxIx3bwaR7sX/aZi7y4QRpNEthyaXmLYoUwKnlf9phi0ZR40Wgcs+AQ= 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> Precedence: bulk X-Mailing-List: linux-mips@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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)