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 2AD5FC3DA49 for ; Fri, 26 Jul 2024 20:53:23 +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: Message-ID:Date:References:In-Reply-To:Subject:Cc:To:From: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=UJjVTOzPMOKO8sf3WAcIuIk+edxQ6cfoXcc37dmsV38=; b=SRmLImyaPi8qA+256KvjI6ex08 /LLWT7cbPZ0VNHmBlt/CvqXPXA2gNniDgsdPZGv8oG6YYAUcYnelsrS2wdDoweFPmCFXv7XQVh+vO VFUK4YRrqO2aft5dsEcUo3IfVh3Tfqi8FAPdazPnuDkS6bZUWyNw2aRhSCn2ZM2Ax998AaV/qHcPU JMZTgbPXLdQrV+QRXsjMmyn3yw1Iz4F3zko57LiofDRuu8oZVjiclTVz08VoYw3YE0joVvCMdWcvE KkmCobrSMht/IH1ez8g/fp5rX54GtH/tjUDFyyEOLFQTh3mAeBarAQEhSQzMuSydJsd8Ci7gjZLYp aq46QGcw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sXRw8-00000004yqm-2oQd; Fri, 26 Jul 2024 20:53:12 +0000 Received: from galois.linutronix.de ([2a0a:51c0:0:12e:550::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sXRvf-00000004yi8-1Np6 for linux-arm-kernel@lists.infradead.org; Fri, 26 Jul 2024 20:52:46 +0000 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1722027160; 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: in-reply-to:in-reply-to:references:references; bh=UJjVTOzPMOKO8sf3WAcIuIk+edxQ6cfoXcc37dmsV38=; b=rcN9XJs9fYG1k+rNZ0j1nuJT+ODX3Yg26vWj79uJNUCNMoQASKocndv19OxFiPjM8j0naD 2f94Tg8HpVrV/T+4dHP5FvIafGdWcpD7U3VdxxH9ZnB3qiyJ1jPBSBeB3qKGs8uFQrkVuP A+LWweAJYUxL2ojius1Uf377zSCAy6onD0MOyZbnIb9I4vjn9zir831yKFBaZaF6M4tgly ab5uumybmRVaMV7gpEtRDtDnqMYREgb+No+6h4fQUughoMytr2mTuo+c9I1tblFKiEFDgu T+l5mEF59a3S86GQgLLh7kN5Oujw+tldGk01VkeSM/kuEE4ZOhkAaki606h/Fg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1722027160; 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: in-reply-to:in-reply-to:references:references; bh=UJjVTOzPMOKO8sf3WAcIuIk+edxQ6cfoXcc37dmsV38=; b=cOCSwCuDpVIr2TFJhTo9QOqGQazUa67NFkTnED5AMxpTB1ZGtvCwJV90R3vv0MLfqAw0rF CK1+yAOd0bsl/6CQ== To: Marc Zyngier , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Zhou Wang Subject: Re: [PATCH] irqchip/gic-v4: Fix ordering between vmapp and vpe locks In-Reply-To: <20240723175203.3193882-1-maz@kernel.org> References: <20240723175203.3193882-1-maz@kernel.org> Date: Fri, 26 Jul 2024 22:52:40 +0200 Message-ID: <875xsrvpt3.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240726_135243_533243_9C6D800F X-CRM114-Status: GOOD ( 13.46 ) 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 Tue, Jul 23 2024 at 18:52, Marc Zyngier wrote: > @@ -3808,7 +3802,7 @@ static int its_vpe_set_affinity(struct irq_data *d, > struct its_vpe *vpe = irq_data_get_irq_chip_data(d); > unsigned int from, cpu = nr_cpu_ids; > struct cpumask *table_mask; > - unsigned long flags; > + unsigned long flags, vmapp_flags; What's this flags business for? its_vpe_set_affinity() is called with interrupts disabled, no? > /* > * Changing affinity is mega expensive, so let's be as lazy as > @@ -3822,7 +3816,14 @@ static int its_vpe_set_affinity(struct irq_data *d, > * protect us, and that we must ensure nobody samples vpe->col_idx > * during the update, hence the lock below which must also be > * taken on any vLPI handling path that evaluates vpe->col_idx. > + * > + * Finally, we must protect ourselves against concurrent > + * updates of the mapping state on this VM should the ITS list > + * be in use. > */ > + if (its_list_map) > + raw_spin_lock_irqsave(&vpe->its_vm->vmapp_lock, vmapp_flags); Confused. This changes the locking from unconditional to conditional. What's the rationale here? Thanks, tglx