From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from sinmsgout02.his.huawei.com (sinmsgout02.his.huawei.com [119.8.177.37]) (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 A91732264CF for ; Tue, 27 Jan 2026 11:38:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=119.8.177.37 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769513888; cv=none; b=ToDf1zM1M1oT+PfBQgYeb7Kt74PlnjFCtvsJkppOfdaPiBnhAcK4Mmxy35xNEr7albHioolxiJvbfrxkxBbfbzSk53tk257hJOT7xD8rU4y9WgPHHdcGoS8Sy/oe0BS2w11/Glm1R92klcglSV6aKVwDxbC8FEGtE6ur9CONVoA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769513888; c=relaxed/simple; bh=PhjMu2oMMDTiVP4SqlrqBJnlpGnaLm2n5jZa7Y5KBlw=; h=Date:From:To:CC:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=rNTyN/GgQop6c3/zeuUBS58prdjqeaf/WG5X2o/6o0KYUYTWZ5wswBOhSjMQFn4Tn0FGUvrddWPajN4OKPV45n3mfXcy1mz5UJjCkCFJ+Wf+2f8hXXf/QilpXDLWWqd0wwfX/i3KCvcgKcpCHvZA4dbxdoxPOMtdIp5J7SvlsTQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b=ahKSiTsk; arc=none smtp.client-ip=119.8.177.37 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b="ahKSiTsk" dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=c8Qf93RX7VEHMbBpA5pIJBA5s/lMrQt5oBh+YBjXjfs=; b=ahKSiTskLWSTmZTdccVc0LMMcFMd6Rq/4jlbCOt8pgjJpmIZaaiBXTXxmGP6463UlBeysIW+C 9ybS8YDkXMMZAT0vcA53S+dhINlYXAScuaNfBQPTYRuUVDmDQjsd/SA1mQRjiIoLJ6/tO9F4zHr GxWDyKU/i3PjaEQFO5za8b8= Received: from frasgout.his.huawei.com (unknown [172.18.146.33]) by sinmsgout02.his.huawei.com (SkyGuard) with ESMTPS id 4f0jyD271mz1vnKH; Tue, 27 Jan 2026 19:35:32 +0800 (CST) Received: from mail.maildlp.com (unknown [172.18.224.83]) by frasgout.his.huawei.com (SkyGuard) with ESMTPS id 4f0k0N5QdfzJ46n9; Tue, 27 Jan 2026 19:37:24 +0800 (CST) Received: from dubpeml500005.china.huawei.com (unknown [7.214.145.207]) by mail.maildlp.com (Postfix) with ESMTPS id 94C9140086; Tue, 27 Jan 2026 19:38:00 +0800 (CST) Received: from localhost (10.203.177.15) by dubpeml500005.china.huawei.com (7.214.145.207) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 27 Jan 2026 11:37:59 +0000 Date: Tue, 27 Jan 2026 11:37:58 +0000 From: Jonathan Cameron To: Ryan Roberts CC: Will Deacon , Ard Biesheuvel , Catalin Marinas , Mark Rutland , Linus Torvalds , Oliver Upton , Marc Zyngier , "Dev Jain" , Linu Cherian , , Subject: Re: [PATCH v2 04/13] arm64: mm: Push __TLBI_VADDR() into __tlbi_level() Message-ID: <20260127113758.00005bea@huawei.com> In-Reply-To: <20260119172202.1681510-5-ryan.roberts@arm.com> References: <20260119172202.1681510-1-ryan.roberts@arm.com> <20260119172202.1681510-5-ryan.roberts@arm.com> X-Mailer: Claws Mail 4.3.0 (GTK 3.24.42; x86_64-w64-mingw32) 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="US-ASCII" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: lhrpeml500010.china.huawei.com (7.191.174.240) To dubpeml500005.china.huawei.com (7.214.145.207) On Mon, 19 Jan 2026 17:21:51 +0000 Ryan Roberts wrote: > From: Will Deacon > > The __TLBI_VADDR() macro takes an ASID and an address and converts them > into a single argument formatted correctly for a TLB invalidation > instruction. > > Rather than have callers worry about this (especially in the case where > the ASID is zero), push the macro down into __tlbi_level() via a new > __tlbi_level_asid() helper. > > Signed-off-by: Will Deacon > Reviewed-by: Linu Cherian > Signed-off-by: Ryan Roberts One comment inline, but not particularly important given it's about reducing readability of a workaround a little Reviewed-by: Jonathan Cameron > @@ -674,6 +679,7 @@ static inline bool huge_pmd_needs_flush(pmd_t oldpmd, pmd_t newpmd) > #define huge_pmd_needs_flush huge_pmd_needs_flush > > #undef __tlbi_user > +#undef __TLBI_VADDR > #endif > > #endif > diff --git a/arch/arm64/kernel/sys_compat.c b/arch/arm64/kernel/sys_compat.c > index 4a609e9b65de..ad4857df4830 100644 > --- a/arch/arm64/kernel/sys_compat.c > +++ b/arch/arm64/kernel/sys_compat.c > @@ -36,7 +36,7 @@ __do_compat_cache_op(unsigned long start, unsigned long end) > * The workaround requires an inner-shareable tlbi. > * We pick the reserved-ASID to minimise the impact. > */ > - __tlbi(aside1is, __TLBI_VADDR(0, 0)); > + __tlbi(aside1is, 0UL); Dropping the explicit ASID sort of looses some meaning here vs the comment just above it. Meh, it's in a work around so most folk will ignore it anyway if reading this code, so I don't mind that much. > dsb(ish); > } >