Received: by 2002:ab2:7a55:0:b0:1f4:4a7d:290d with SMTP id u21csp463615lqp; Thu, 4 Apr 2024 21:08:06 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWoeBqyRc6A04Vr3a9K2cVzG3GiRjKAUH5qRgkoqHe9hhYEwRnWHSRlm4CEwwFbxpsvC1cL+Zx3LZ+iSxOrJD2j+ogXXJXNxQsNhC93PQ== X-Google-Smtp-Source: AGHT+IG4Wg4Qd+S/5yQvZ4WDS2k7LcQsakKVdoms1FpS2pUQVV54vDYfh/Ab4xAh61jzEr2vBvUV X-Received: by 2002:a17:903:2781:b0:1df:fda8:e0ef with SMTP id jw1-20020a170903278100b001dffda8e0efmr377403plb.20.1712290086300; Thu, 04 Apr 2024 21:08:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712290086; cv=pass; d=google.com; s=arc-20160816; b=plqU9xMr3ervJqJ4qW3TiH3n77Vehjwb1x8J4FDbkW5nrVxvNN46vdrff7G++O3S66 +7IKb/Alw1zGYxk8V9E14gpuvqU1hPGlQaL9903AF64lIg1vfi2u63GLqRcC8wtfdMi7 EcXvJ/+Q4vCAM8cz1Dl8hwjHURu5m0yvquGDshkFH6rSeskQEVqMzvPfJn3OqOnvAAPT JNwpdCz28SypyitcnuI+q7puDaBvm5zDbmScLzZd6/JGDaBblZboTg+YPfH40sX/9w1K U2d/oyaGugXURpf35E0xYA7cNc6myIO6Ily7+n7+RzeHBplAeggkjk6W/yk5YfbWwEBP 4S9A== 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=WkWvcTbJzSkExYMycNfVCal76y0x/9U7Vke5yfGSfCI=; fh=WlmP0pmC0jXI2SFTfiwpcTrKgQzQ8yuYrT1kUbicq8M=; b=m22aUQ1Jk7G2MiE0lWdlogKaTfvsDpVerxe3loQ4bF7xptMfgx7FgKiuP8akT+ZXDs 6/mnLBrlTo6XNC58i3leCNC6dnCJEFMDHmOgdeDB6W4dN5h3U5e42g7k7SZ0sswmRUyC dGCrHnuxdTgvx8tDCG7fJy/GQtf/gk8rEYncMdjZwz1i54MFKLLEHFBkVzrC5PY0ZWzz 2B3qXSWcPktLvuAirHQyCVG+XRltKaYA/fDvSer7IWRRwxQOg+dSWsbol8axm/kK/spe IFbwvkoCtdmq69Kx0YBVCt0r1AcO734T3TNIw8OxtHI4r4uWEttt/kxHLNEWsrOpCJme FoeA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AiJkjqAL; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-132396-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-132396-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id j4-20020a170903028400b001e2bc443753si627940plr.241.2024.04.04.21.08.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 21:08:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-132396-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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AiJkjqAL; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-132396-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-132396-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.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 7229BB25EB9 for ; Fri, 5 Apr 2024 04:00:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A41B51CD23; Fri, 5 Apr 2024 03:59:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="AiJkjqAL" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 51C84224DD for ; Fri, 5 Apr 2024 03:59:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712289582; cv=none; b=QxNBL14Z9hjuS21Wz1KTWBSPxw+M7N0msgl223gm0pWbNmdcM4dm9sTHGaAgDvJLgwm7KIzo+U2xnlStUK0pZCtzTIxgw1TfRnwpCGX8bqv49VPw0JWl/d3xuCuq2YNf6Z1nODS/n8SWsyXPukPdNrD3BqX4YSAW45p1VsSJPug= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712289582; c=relaxed/simple; bh=eexRtYaYPi0C1DSitKbERuKeE88vQCPBmPp0sBPAu1o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=kQgdatVYNyVs+R+7a1dKGEjFrjzRcaAzjTqSy8euxy9TIcuFocKkkmaWTNSvCIUVvUKyq7GGxKJr5PzC4VALQ14kvQktSV1ZydusaLLI3QD15zFkiqaOcHDlTH6QOzpapWUJUHSy/EGNBQGgdukiz8puBLwlZVgfSMrSsXZnt9g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=AiJkjqAL; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712289580; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WkWvcTbJzSkExYMycNfVCal76y0x/9U7Vke5yfGSfCI=; b=AiJkjqAL0LMgJQewmtP1hvy4wfazzuKM2/8+U4fom3SR8fizSGMYgZ5TPalUM8SN8JuWoA AXWHkP1LCrnBEmjQzQZWh9DJ/fmBz5da2ZZla+KN8fkdPmQrCnrOhoDjmoA3L7c+MsZa9F 7FAAaFrNxywf33k6+mJR8by63V6TuKM= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-463-TR7JNRopNS-Cp8U1D4Uj8w-1; Thu, 04 Apr 2024 23:59:34 -0400 X-MC-Unique: TR7JNRopNS-Cp8U1D4Uj8w-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8BF88101A520; Fri, 5 Apr 2024 03:59:33 +0000 (UTC) Received: from gshan-thinkpadx1nanogen2.remote.csb (unknown [10.64.136.81]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7176B1074E; Fri, 5 Apr 2024 03:59:28 +0000 (UTC) From: Gavin Shan To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: catalin.marinas@arm.com, will@kernel.org, gshan@redhat.com, akpm@linux-foundation.org, maz@kernel.org, oliver.upton@linux.dev, ryan.roberts@arm.com, apopple@nvidia.com, rananta@google.com, mark.rutland@arm.com, v-songbaohua@oppo.com, yangyicong@hisilicon.com, shahuang@redhat.com, yihyu@redhat.com, shan.gavin@gmail.com Subject: [PATCH v3 3/3] arm64: tlb: Allow range operation for MAX_TLBI_RANGE_PAGES Date: Fri, 5 Apr 2024 13:58:52 +1000 Message-ID: <20240405035852.1532010-4-gshan@redhat.com> In-Reply-To: <20240405035852.1532010-1-gshan@redhat.com> References: <20240405035852.1532010-1-gshan@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 MAX_TLBI_RANGE_PAGES pages is covered by SCALE#3 and NUM#31 and it's supported now. Allow TLBI RANGE operation when the number of pages is equal to MAX_TLBI_RANGE_PAGES in __flush_tlb_range_nosync(). Suggested-by: Marc Zyngier Signed-off-by: Gavin Shan --- arch/arm64/include/asm/tlbflush.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/include/asm/tlbflush.h b/arch/arm64/include/asm/tlbflush.h index 243d71f7bc1f..95fbc8c05607 100644 --- a/arch/arm64/include/asm/tlbflush.h +++ b/arch/arm64/include/asm/tlbflush.h @@ -446,11 +446,11 @@ static inline void __flush_tlb_range_nosync(struct vm_area_struct *vma, * When not uses TLB range ops, we can handle up to * (MAX_DVM_OPS - 1) pages; * When uses TLB range ops, we can handle up to - * (MAX_TLBI_RANGE_PAGES - 1) pages. + * MAX_TLBI_RANGE_PAGES pages. */ if ((!system_supports_tlb_range() && (end - start) >= (MAX_DVM_OPS * stride)) || - pages >= MAX_TLBI_RANGE_PAGES) { + pages > MAX_TLBI_RANGE_PAGES) { flush_tlb_mm(vma->vm_mm); return; } -- 2.44.0