Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp1482628lqh; Mon, 6 May 2024 08:58:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU/GI6Jck3dzyXqGLS53vE+X2gqI5i7+PJeK0ucQEJKgOEF6x6Uy/LyvaJBYS0pT/hYAeUwpkZX0pmEFYqIFIO5hVNAtd/pTQA1w88H8Q== X-Google-Smtp-Source: AGHT+IF/9UlrWbEQaBgE4H0V/LBBRf+UY5dXoHl4jOqXX2Ug3GvR+u+exjm1rRTWlmOe5sl101Dv X-Received: by 2002:a17:906:894:b0:a59:ae6e:486f with SMTP id n20-20020a170906089400b00a59ae6e486fmr3250779eje.65.1715011095566; Mon, 06 May 2024 08:58:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715011095; cv=pass; d=google.com; s=arc-20160816; b=O8IVIc0u5f6X1e/2MW311R36B+m2/uIqIyRYZrtc2HRarOZ4D5vRbAXPBUOiyvil8Z D/W+fUn4N0OagKyBocyInBNeqEZUUvJUQ9XGvoUiMWtQygLEHALSVhB75mmwumX4c8dA 8wSvVjwZ/qD87weUoY7J3h9sIs5UZUsOmc1jByVnTneir7VPyNIXVFl54NzsVzDQmRnn HpXph05UMBHIjl9gxm5Aj5hYww7IvNWiWCfzYF0x5zzLjRQWQRTsv/hCXtqO7awuS2Hw 8ZcXk56JJaMHrNeUt3ububAYC6Lk83wRgh4wk4wfl6aSW/g2Njb204JgrnDGeyeRIOPQ 66xw== 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=fZLMp0zX1lVO/AMMqpo0KyiatSIXbG3CSPTawlIjnSU=; fh=ZaPvTvk3greVAhtlw/faBL7y/bcze5JBULOYO1tsevI=; b=vEJM6do5f9ZXGN2oZzQyTtziXvBe2HvbQCU1X/m2E79vghiWG2v14CcJiLZpb2tWwH Ouq/Ju4Al2hl4FqNATNJ5ICrrAGjHEZ6x8PyuSRZ01VfxpQAATfA18VzMIvS5iWNokYP bpJ8n0h/oB5HuFA8VCDG++O3s9vM4OIaTX1DlcjCPK019b8/F0Qy8NDWe9Ej7IW6Vmyh x1WnMsttojv3FbJgdIMpuIOd1VhORQ9qO9etYMRfaOwH7rCV817ugoPjN9upxRivjsIU o7lJ7F4wLNWXY2HfzLR61ysZREAniW8/cYzmbZAwRoB3y22r2STgPf65F0Zq8S587fCt aXfg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@antgroup.com header.s=default header.b=qDceAnEA; 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-170109-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170109-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=antgroup.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id gu20-20020a170906f29400b00a59af0c5e1bsi2687426ejb.921.2024.05.06.08.58.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 08:58:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-170109-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@antgroup.com header.s=default header.b=qDceAnEA; 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-170109-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170109-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 3B7D71F23172 for ; Mon, 6 May 2024 15:58:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6325615664A; Mon, 6 May 2024 15:57:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=antgroup.com header.i=@antgroup.com header.b="qDceAnEA" Received: from out187-17.us.a.mail.aliyun.com (out187-17.us.a.mail.aliyun.com [47.90.187.17]) (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 33E7D15575D for ; Mon, 6 May 2024 15:57:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=47.90.187.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715011059; cv=none; b=rMT9pAEVbni7JeOlGfrKjkgnDswTxkwWCjeHzF7Nh1iHLoIaZt+DXwAUOVkjaCbqeqTbwj9Zsi0yp6+1Udx+lofa2zjmz5Xu7oQexmTuRGJsLcX3Q1n6eVffSvXe4WUvjJZwn94No8hVF12caEK5e4KG+qmcItJFcqr0A2R6DDo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715011059; c=relaxed/simple; bh=HuCGta02kYZoOPnIDyqaTZyalnCbKeZWEKYWZVof4MA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=DD5xtIhLgZo9B1PlLAm5GdlGI5x5wnGasvkJw1p/tJ0MoqBWiORC4ZEE7t/JlUwWhyoyAy9DJkKryp9EWBHZbBszz4DhO6OvxQ5ifQPoi60K5ldcAG5ufkQMKldfViNEcafH5s9xFN4cN1eyALfPRCtIeLmW+Aenkha6oeIWYtg= 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=qDceAnEA; arc=none smtp.client-ip=47.90.187.17 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=1715011046; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=fZLMp0zX1lVO/AMMqpo0KyiatSIXbG3CSPTawlIjnSU=; b=qDceAnEAF3MzzYPlofjvl4gHUhttJKT7L08pjDxKVU0NUEgl8GiKwIkvXDfvHZXdkKhmp8K8KwDvABc6E2o4pd83mAUJ5P0vE91UscupQXZWMldK0PmW3z/pnwEUBkv4isr3Ea4BzxzvxwBoJ7V+NFZ1Az4khL+2vzUWNtgK7AY= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R331e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018047192;MF=libang.li@antgroup.com;NM=1;PH=DS;RN=16;SR=0;TI=SMTPD_---.XTcewEm_1715010727; Received: from localhost(mailfrom:libang.li@antgroup.com fp:SMTPD_---.XTcewEm_1715010727) by smtp.aliyun-inc.com; Mon, 06 May 2024 23:52:08 +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 4/5] xtensa: Add update_mmu_tlb_range() Date: Mon, 06 May 2024 23:51:19 +0800 Message-Id: <20240506155120.83105-5-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> 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 | 4 ++++ arch/xtensa/mm/tlb.c | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/arch/xtensa/include/asm/pgtable.h b/arch/xtensa/include/asm/pgtable.h index 9a7e5e57ee9a..57f97e7e06d0 100644 --- a/arch/xtensa/include/asm/pgtable.h +++ b/arch/xtensa/include/asm/pgtable.h @@ -414,6 +414,10 @@ void update_mmu_tlb(struct vm_area_struct *vma, unsigned long address, pte_t *ptep); #define __HAVE_ARCH_UPDATE_MMU_TLB +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_RANGE + #endif /* !defined (__ASSEMBLY__) */ #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG 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