Received: by 2002:a05:7412:a9a3:b0:f9:327e:43ab with SMTP id o35csp13382rdh; Mon, 18 Dec 2023 02:54:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IFeVsm8Axa0ZDpvSxp7PI6FRkGB5rQF0jM6luHgnB9FS8PjBaNTXUmr1ZhVUmMxMG2CS4wG X-Received: by 2002:a05:6a20:8e15:b0:18a:da5a:3b17 with SMTP id y21-20020a056a208e1500b0018ada5a3b17mr8391093pzj.5.1702896897094; Mon, 18 Dec 2023 02:54:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702896897; cv=none; d=google.com; s=arc-20160816; b=jAncATzudsHvcrYYaXa6bhC+xjdxbLBxpFBntn37qNys0qMU4Nj6czyjUJjAlLZw1n w8RgDZZZ6HtvFIURqEICmyAbEX3AYgQCJqVQTV3wTxoovxS2AjFc/87R1CdV3EH8Ywm1 ceQBgLqiJkj7ySoTcSDxMJH5on2rF8CFBtJXKNJNgUobYFQlDKpmpW/3NDH1u63y5719 7/xVrXBpR05XyNxZPpkKD6Tjg88sIS10yPEojFwebJ207Mly1qwkwZyf1APE03NigFdI Z7lg0/ub3EOPcnoDiMiTxYgqWsaaeSRduu4rt1rvCI/fwTQjVG6ma1mCx9QhjTgvA/z4 +lEw== ARC-Message-Signature: i=1; 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; bh=3XWNUf0y+LoNhJb/OvSX6jZDQxYAWNT/5GVeo+DL1UM=; fh=a3gZESXuO1ptbCtzvzEnZL5xUl+WC4Vy5hoF2yaOXSs=; b=SPHzaOJoM/TzVKTy/iJ6uELc+1tp9lFY4Mu2rSlD56vhgayu/7PlcgsdNOQFC0c/D7 YwKe4dBZoLrwrIC8RqclXw5YmOqbUGVMoOMNegbSIc111EGXyB1FwEJwNRyxW92v6cF0 DSl3kH3pGtTZorMzt86Y7S0Oysk0mre6Kxcy+mhHiuP3mb/+use/NEFAEjLq8xig56vO 8CTJvCg0zHG9uteHDobMoZHNM5L6AAd1GTK4AB2OELTB3vdl8ZoCVZ6wkJ3p9xRdYEbD rF5UsYie1LBLIa/B/bGw6/RkzJfT4CIKheeb0AcYN9pxUpJK8exY9gg96ztE4bfkQnOe Y2Kg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-3382-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3382-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id h13-20020a17090aa88d00b0028b3b39a1ebsi4828790pjq.125.2023.12.18.02.54.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 02:54:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-3382-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-3382-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3382-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 41686B20D22 for ; Mon, 18 Dec 2023 10:54:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1190C374E1; Mon, 18 Dec 2023 10:52:10 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EFB4A34CEB for ; Mon, 18 Dec 2023 10:52:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 000181FB; Mon, 18 Dec 2023 02:52:49 -0800 (PST) Received: from e125769.cambridge.arm.com (e125769.cambridge.arm.com [10.1.196.26]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 26B0F3F738; Mon, 18 Dec 2023 02:52:02 -0800 (PST) From: Ryan Roberts To: Catalin Marinas , Will Deacon , Ard Biesheuvel , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Andrey Ryabinin , Alexander Potapenko , Andrey Konovalov , Dmitry Vyukov , Vincenzo Frascino , Andrew Morton , Anshuman Khandual , Matthew Wilcox , Yu Zhao , Mark Rutland , David Hildenbrand , Kefeng Wang , John Hubbard , Zi Yan , Barry Song <21cnbao@gmail.com>, Alistair Popple , Yang Shi Cc: Ryan Roberts , linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 13/16] arm64/mm: Split __flush_tlb_range() to elide trailing DSB Date: Mon, 18 Dec 2023 10:50:57 +0000 Message-Id: <20231218105100.172635-14-ryan.roberts@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231218105100.172635-1-ryan.roberts@arm.com> References: <20231218105100.172635-1-ryan.roberts@arm.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 Split __flush_tlb_range() into __flush_tlb_range_nosync() + __flush_tlb_range(), in the same way as the existing flush_tlb_page() arrangement. This allows calling __flush_tlb_range_nosync() to elide the trailing DSB. Forthcoming "contpte" code will take advantage of this when clearing the young bit from a contiguous range of ptes. Tested-by: John Hubbard Signed-off-by: Ryan Roberts --- arch/arm64/include/asm/tlbflush.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/arch/arm64/include/asm/tlbflush.h b/arch/arm64/include/asm/tlbflush.h index bb2c2833a987..925ef3bdf9ed 100644 --- a/arch/arm64/include/asm/tlbflush.h +++ b/arch/arm64/include/asm/tlbflush.h @@ -399,7 +399,7 @@ do { \ #define __flush_s2_tlb_range_op(op, start, pages, stride, tlb_level) \ __flush_tlb_range_op(op, start, pages, stride, 0, tlb_level, false) -static inline void __flush_tlb_range(struct vm_area_struct *vma, +static inline void __flush_tlb_range_nosync(struct vm_area_struct *vma, unsigned long start, unsigned long end, unsigned long stride, bool last_level, int tlb_level) @@ -431,10 +431,19 @@ static inline void __flush_tlb_range(struct vm_area_struct *vma, else __flush_tlb_range_op(vae1is, start, pages, stride, asid, tlb_level, true); - dsb(ish); mmu_notifier_arch_invalidate_secondary_tlbs(vma->vm_mm, start, end); } +static inline void __flush_tlb_range(struct vm_area_struct *vma, + unsigned long start, unsigned long end, + unsigned long stride, bool last_level, + int tlb_level) +{ + __flush_tlb_range_nosync(vma, start, end, stride, + last_level, tlb_level); + dsb(ish); +} + static inline void flush_tlb_range(struct vm_area_struct *vma, unsigned long start, unsigned long end) { -- 2.25.1