From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 B8BCF3F6C4F for ; Mon, 6 Jul 2026 08:31:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783326718; cv=none; b=Rsbp+JZ6dUo6dYMDH+jsb73cUd26sR4m1jYUo0JaFo8GoLdUO/HVz3Mm98jjwrmQ6bbvfzXNBUHtlSG+CY1RyIe220IYBN1+qVxOfuiXD5hd4Gzje3captDjrgSWhZV1fgzT+Xq0fEbn3p6lF9nG3fOEeCE44hpnmq0MHmJsir8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783326718; c=relaxed/simple; bh=T+EyQ2Fu6vCfzW5bDqLjjBQnaQH/NXKYNyx3eaeh+rU=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=TeF9VvRQEcGRQoNlNY+9djbAFwGEbkugjzCiLE2lCv9CVIidayE6nuNh4vSbodmXEWb3c2uwRZf8hgC39QXEblr8h/agQ8Za+rY2E5HJ9e1KQJ+fEMlK00UyKDtvmQOfnoZne5qntYVKRZErgKVSdWEJphzIXLUnZ2dtIPnzkMg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Phh1N9Cm; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Phh1N9Cm" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 708211F000E9; Mon, 6 Jul 2026 08:31:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1783326702; bh=ftrLsqu++GYsTvYMWLm8Y7QLGGFZ5ynbHWmKJ1XFxKo=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=Phh1N9Cmbjwd6asxZ3S5CHfHgSBoLtesNpjZNwM7oOuIw+txufVXSNrMbMO8eqfpm 1f+xSPZvUl9XKd09Bo7/ADQLMdsjgGv8OnhXFgK8gFeT2WaWDrYRtAIdfyyTZKz/nu LFx9f7wfaavZ79cNsa0JxV/pHuPwkwRhclTjG0UjuBUEduLNO26bD6f3M0nlkeP02v Hz9dS9cYMI3dvrBs9J2lyCU/UM6oPwJCxqNMAf0VIRT+gtfgBR/qI/vSaR6wzjg9TF i/mMvM06WhwOqXF2n6WMqfq+4AoKtQ08+GX+AQyeRSJnjJ9u1nhvXzy6tOBCSSydks /kfODyzgTLvBw== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wgejs-00000001ohO-1sNs; Mon, 06 Jul 2026 08:31:40 +0000 Date: Mon, 06 Jul 2026 09:31:40 +0100 Message-ID: <86mrw4plhv.wl-maz@kernel.org> From: Marc Zyngier To: Radu Rendec Cc: Kemeng Shi , tglx@kernel.org, jason@lakedaemon.net, lpieralisi@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 6/6] irqchip/gic-v3-its: Remove redundant check in its_vpe_db_proxy_unmap_locked() In-Reply-To: <1d141ab4b472533ba728c65201ea7cb74047acba.camel@rendec.net> References: <20260702033050.1583-1-shikemeng@huaweicloud.com> <20260702033050.1583-7-shikemeng@huaweicloud.com> <1d141ab4b472533ba728c65201ea7cb74047acba.camel@rendec.net> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: radu@rendec.net, shikemeng@huaweicloud.com, tglx@kernel.org, jason@lakedaemon.net, lpieralisi@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false On Sat, 04 Jul 2026 17:32:44 +0100, Radu Rendec wrote: > > On Thu, 2026-07-02 at 11:30 +0800, Kemeng Shi wrote: > > The high level functions already ensure that gic_rdists->has_rvpeid > > is false before calling its_vpe_db_proxy_unmap_locked(), so we can > > remove the redundant check in its_vpe_db_proxy_unmap_locked() > > That's true for what the code is *today*. By removing the check, you're > setting up a trap in case a new call to its_vpe_db_proxy_unmap_locked() > is added in the future with the assumption that it will do "the right > thing". The way I see these functions, they are not really "high level" > and "low level". For example, its_vpe_db_proxy_map_locked() is called > both by its_vpe_db_proxy_move() (which is another db_proxy function) > and by its_vpe_send_cmd() directly. > > FWIW, the code you're removing is just this: > 0xffff8000806cf934 <+44>: adrp x0, 0xffff80008177e000 > 0xffff8000806cf938 <+48>: add x4, x0, #0x348 > 0xffff8000806cf93c <+52>: ldr x0, [x0, #840] > 0xffff8000806cf940 <+56>: ldrb w0, [x0, #45] > 0xffff8000806cf944 <+60>: tbnz w0, #0, 0xffff8000806cf9dc > > I would argue that the gain in terms of both code size and speed is > negligible (and these functions are subject to inlining anyway). The main issue is that there are implicit dependencies between multiple GIC features (RVPEID implies direct LPI), and the code is a maze of indirections to handle a case or another depending on the underlying HW quality of implementation. I'd rather not remove this, and instead have a big fat WARN_ONCE(), because we don't expect RVPEID without direct LPI (such HW should simply be ignored). M. -- Without deviation from the norm, progress is not possible.