From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 64E79C43602 for ; Mon, 6 Jul 2026 08:31:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: References:In-Reply-To:Subject:Cc:To:From:Message-ID:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ftrLsqu++GYsTvYMWLm8Y7QLGGFZ5ynbHWmKJ1XFxKo=; b=lUHE4O5jDD5TCWMFgi3RG4lsvh fuXP3pL2QyaEiDxwfFqPpMhSvn6Z/Mb5eT+x/XhXrbvVEfrfeDYhwf6L1BQpj4LP98FDNvtdEw/Eg uKbMGk96pKFniO+7ShMUFa5dCgrMBXWNrpnrSPFIuyPHLCF9mJ7rLcmiNXRwHKz1CsjBTRrbP61q7 cpUt21GSFwP09O9AsHuIfxbcPi09iO2GDr7r5LRlgf6onFIz9NMVanhAnxqQA71mhNppoblmXnZb5 EAIB+g6+VmfP8pkc8PnJYJn1LK3pe+gfIAI0KDi2qxuBmGHLkQvUctUh2xaTZeoimzJsG0ouIC0p7 5pIPU9/A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wgejw-0000000Bpt3-1Zzx; Mon, 06 Jul 2026 08:31:44 +0000 Received: from sea.source.kernel.org ([172.234.252.31]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wgejv-0000000Bpsp-0DjG for linux-arm-kernel@lists.infradead.org; Mon, 06 Jul 2026 08:31:43 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 8E89E4181C; Mon, 6 Jul 2026 08:31:42 +0000 (UTC) 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) 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 X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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.