Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp26635431rwd; Mon, 3 Jul 2023 12:30:13 -0700 (PDT) X-Google-Smtp-Source: APBJJlFfHwtrXTv7IQ5aI0YsWw8Qy6TH2LxX3e5lnx+HrAh0mkolLRr2jhJVYWGPme6f2fJHq7A8 X-Received: by 2002:a05:6a21:78a9:b0:12e:5007:de18 with SMTP id bf41-20020a056a2178a900b0012e5007de18mr6618213pzc.16.1688412613357; Mon, 03 Jul 2023 12:30:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688412613; cv=none; d=google.com; s=arc-20160816; b=n9o1NE4tioWUWGBsp4X0V6ZkWs+T1q5YNJ0P3xV9RRzXjur0n+blVr/p4sFoEU/6jO ajXlBPcOLZMQQ311yNXU9BMAPl12WgXC0bYGsjwhgIOWlrdIcVQhHgPQcdIyeV7jee0t n+013zYuw21F6TtkVYQwlD6+ZyYQdf6OqsL3y2hccN7fmrucrtMbg68EJQxYPdFb452G o2UE38M7YEjw6bez29G5cV2wUOI7B/TNTys/4KoR0AypE4YbXO45rY/V8JrqpYYN1Ve5 diQY3XBjCHL39E5XWWn67PfkBJ7t4aZVk+56CnSPKqH+kYEiKCyD9HKAH/Yqorijf90L 2iTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature; bh=3VOVuAg82mmnnQWdvMP4MMeTmNwdIOoxW/jdBy4XqFs=; fh=wcE8niMljJ/v1F3lMmklkjme5nUP7hecqIyA+OMhrZo=; b=v0uK8Czcos2T7+jYDJ26Ef2LdLzBmvpgbMalV6btdXSqeh1FPDI7hwPrKhzq4IPkNc PZ75g4jwUwJ6XT8/NnN8LggbpSgq1LxIznHnxL6QPM7gSzMoWTfq57xwOopJKemYacTc qrsJtxKOSC/GKbrvii/0YIxevojCzeEHIAqBw3FWwqrHAUHmSEV2lhW0u+ATWpiyAOH6 IaFvtX3ecQEeyvToesqusvlwaRAVZ4dFrA/s0hoJcvsfyzLMOMLmkQaZmOJwmbm2YqHG epbhndTHHKhGAzFqxM/NUQtxvflmAoem91mN7+owzlM4XQLA53u4b1qT2fqxHEfUJcHm Oh4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XTfoCo0q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z26-20020aa79f9a000000b0066a66144278si5568426pfr.108.2023.07.03.12.29.56; Mon, 03 Jul 2023 12:30:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XTfoCo0q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230459AbjGCSzM (ORCPT + 99 others); Mon, 3 Jul 2023 14:55:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230250AbjGCSzL (ORCPT ); Mon, 3 Jul 2023 14:55:11 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93DA110D9 for ; Mon, 3 Jul 2023 11:54:54 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5615F60FFA for ; Mon, 3 Jul 2023 18:54:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B02FFC433C8; Mon, 3 Jul 2023 18:54:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688410443; bh=SEKBMg3chV7met+vgORs+906H4nzp+RO5Hm59v64Jj0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=XTfoCo0qlatCxo8uhhtnUeVPZLr0bGhBxDrJX2o9GnhcJnHEas3iQjs3v0Ssji9Fr d3xt/nAG6UjEn2KoFHkVpT4YstgavD3Ef5cQaB+9XalmjxkmkmiIUFzwASJEUD4au5 bUmAJnOn8MfI1uMHMWtOxoxipPU8a7bdl4+pY9uI0l/2TVWKkVPoMr3yiLEkR0RvPt 6qYr/GhvnHwdnHzMza9fZJG37l9H3b73O2e6pk6aTCnBMmdeVMUIt/aJ1MHUF3A+kt JntiL04FWn5q6rNJpLaSx2lDJrfRgV8Tpmxw7FeEzLDovMDqbnKmlhKMb7B2T9LIXL EBHyUnFrIC7/g== 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.95) (envelope-from ) id 1qGOgT-00AFAN-Hq; Mon, 03 Jul 2023 19:54:01 +0100 Date: Mon, 03 Jul 2023 19:54:01 +0100 Message-ID: <86wmzgx1va.wl-maz@kernel.org> From: Marc Zyngier To: Zenghui Yu Cc: , Thomas Gleixner , Kunkun Jiang , Subject: Re: [PATCH] irqchip/gic-v4.1: Properly lock VPEs when doing a directLPI invalidation In-Reply-To: References: <20230617073242.3199746-1-maz@kernel.org> 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/28.2 (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: yuzenghui@huawei.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, jiangkunkun@huawei.com, wanghaibin.wang@huawei.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 29 Jun 2023 15:52:24 +0100, Zenghui Yu wrote: > > Hi Marc, > > On 2023/6/17 15:32, Marc Zyngier wrote: > > We normally rely on the irq_to_cpuid_[un]lock() primitives to make > > sure nothing will change col->idx while performing a LPI invalidation. > > "change col_idx while performing a vLPI invalidation"? > > > However, these primitives do not cover VPE doorbells, and we have > > some open-coded locking for that. Unfortunately, this locking is > > pretty bogus. > > > > Instead, extend the above primitives to cover VPE doorbells and > > convert the whole thing to it. > > > > Fixes: f3a059219bc7 ("irqchip/gic-v4.1: Ensure mutual exclusion between vPE affinity change and RD access") > > Reported-by: Kunkun Jiang > > Signed-off-by: Marc Zyngier > > Cc: Zenghui Yu > > Cc: wanghaibin.wang@huawei.com > > Reviewed-by: Zenghui Yu Thanks! > > Nit: I think the Subject header can be changed to 'irqchip/gic-v4' as > the bug it fixes only affects GICv4 HW. v4.1 is unaffected. I'm not so sure. v4.0 didn't allow direct invalidation of VPE doorbells (we had to use the fake device hack), except for the HiSi special that implemented DirectLPI despite the presence of multiple ITSs. It was a violation of the architecture, but it really saved the day by making invalidations cheap enough. Only with v4.1 did we get architectural support for doorbell invalidation via a register instead of a command for a fake device. So as far as the architecture is concerned, this should only affect v4.1. As a side effect, it also affect HiSi's v4.0 implementations. Or am I missing something? Cheers, M. -- Without deviation from the norm, progress is not possible.