Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1267973lqa; Mon, 29 Apr 2024 03:38:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUVPrkk3FEsdAe3GJqSH6C/VKkIrAr0ni2sLcGc8NNVfUNna1yiHQMsa4Ea4bu57SAJriKTObjCzG09kbbVGeeCKb6N02LCAAWpslb62A== X-Google-Smtp-Source: AGHT+IHeD2hNMSSnxVpj2cwtIn3lPMFx9/prjJ/8xUVbjNLPYrJixGeBHuXcDX1LQQoz8ZB/tF/R X-Received: by 2002:ac8:5813:0:b0:43a:b15c:e9cd with SMTP id g19-20020ac85813000000b0043ab15ce9cdmr6627733qtg.29.1714387121446; Mon, 29 Apr 2024 03:38:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714387121; cv=pass; d=google.com; s=arc-20160816; b=yBTvJN/RKZIQZ5BwGED4nhZ7MdPLk+waJdD/kOLbjnE5UQrkTMyLbXD9+bzXQNVCkN uvI7zFzkDUeAdWUb0pDIFkpMgcka6xzRDeppcwPICDYe8cNpkKGLWWVYd92obxPq03QI afXHqT8NL5uXZBuE7Nt9WyovZ4i6Hk7chi+uNl/ubzbmbQa2n7Xt+D6ZqXZubq48BvT9 EQOxEDWK8pf7Zc/JuQu1KngxJGUFJXI2o5aXBMo72qI8EQT7cjsmQiLL8G9s9jpIT8OG kmQH5GIpKe/lcOwQL8N7SAFh4TxDx0z9EYU0SyGGI2lQvHtiYozccj9fyfttcX5Fufg/ FEXQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=L9Nnq3jHrztC2V1l+aPsgS97TA5W6U5sPTcwdSCKib4=; fh=9xlVfU6l1eaRMALSOTbrulKFFu6LW6R2I2OsjpORYlM=; b=AmeTqSqupY/DuDtr58O+rR5yqphO+Tj2IQ+Ao1llmerUDLSGbZ+JS2MTuoXHGtw9R7 8Gi98MXHlMnD0TH/g6/aTeKEFJgJVP+UKVan6vjGVohFkEfcWwhu2S6cj4llJnLXrLzG gffVzw7F9IPPopNk/Aq6bpS1tfxc/on4P9zloSkU8fd+7cIBx7FOUIARdEehUQnpGmSM yPsvASbZ//RASHf+rYFXLZEKVF0qFZiw6qImbU/b4/SpAdhKLwK7OsAC36TgtQMlFhr9 1Vy9K5PU4YpECbvhHvrVVkqK34Qw4lez5dcW+cxRD5B43g+xBD7+BnYokAdhKDlilgkE GSbA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@antgroup.com header.s=default header.b=rLohAmKf; arc=pass (i=1 spf=pass spfdomain=antgroup.com dkim=pass dkdomain=antgroup.com dmarc=pass fromdomain=antgroup.com); spf=pass (google.com: domain of linux-kernel+bounces-162074-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162074-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=antgroup.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id o1-20020ac87c41000000b0043af7faad59si1314802qtv.159.2024.04.29.03.38.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 03:38:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-162074-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@antgroup.com header.s=default header.b=rLohAmKf; arc=pass (i=1 spf=pass spfdomain=antgroup.com dkim=pass dkdomain=antgroup.com dmarc=pass fromdomain=antgroup.com); spf=pass (google.com: domain of linux-kernel+bounces-162074-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162074-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=antgroup.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 2D5351C21EBC for ; Mon, 29 Apr 2024 10:38:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 018B853378; Mon, 29 Apr 2024 10:36:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=antgroup.com header.i=@antgroup.com header.b="rLohAmKf" 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 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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) -- 2.19.1.6.gb485710b