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 76850C47422 for ; Fri, 26 Jan 2024 10:19:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2EgDV1QQiRgrQVuG1Rjev/1iY65ERa50RMyZq65eAV4=; b=stjCN2BPJf0ZlF 6IyTze7Rao1bwxfvkAU9nFcFXxyHKDzhu4AV8mEkAQ+tna7ZMJn5itYwpHsxu/t8T1spSmV1ORFJA fPW2AJF6e7tQJ1I7URpuQAHD8VHuqER9GZqeP+6l2rirlMMV1xM0E61HCsVttPozHEip9eDePxT+D azT53lGivbyumHZqTqGtFgUfE63fwvFxfQlkymlbBpaLBI2/tNRlBTfznN1K4IolvecFy42XItF3U 16/2H5jgd9IHMrilLzbgNVuaCy29ETgdQPAux79pQ9VC5UiIccmEfSos9CIw0kv8Eg4rb8Qd0/068 tkX/RkaYMcKPfpnKBSpA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rTJJF-00000003pPP-2yoT; Fri, 26 Jan 2024 10:19:41 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rTJJB-00000003pN5-3hYX for linux-arm-kernel@lists.infradead.org; Fri, 26 Jan 2024 10:19:40 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 1DC5DCE3681; Fri, 26 Jan 2024 10:19:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6F33FC43390; Fri, 26 Jan 2024 10:19:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706264374; bh=4I2oton0SUgmocgQVYV9z59NA8ybatyLZQMiNLrugkk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=BdINcwAy0ZxLMWwoVDPV2wgxhc6q5y4Qpf0azslwvvj8LSFZCThjXzokBC5G+ekCs X54qIEnlCkEAOUvLECKkf4CefbUCa2dMiHeY4V/LIijSXEvx/dfL+ynNhhpLIfKypQ FI5eZ2chyQXEJ+kmbKIW5jET73LZOa8Wju5wRxKExH1nf55Qjet1gCI3CHPgXTnioY LgEkXBV+EezzE812ZXD2uCCCPAtWati4808IuFRNcSE8lOms9TpDcbqayDVA29wk3A vRB3tObr3A6msmrln7KEmZzGeA8184Ww6oFAnPcr91TPE19P+GKE2P2pbrMV53P0oU U3gVd7lD0VCzA== 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 1rTJJ4-00F15s-Oe; Fri, 26 Jan 2024 10:19:30 +0000 Date: Fri, 26 Jan 2024 10:19:30 +0000 Message-ID: <86v87g75xp.wl-maz@kernel.org> From: Marc Zyngier To: Kunkun Jiang Cc: Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Thomas Gleixner , , , Subject: Re: [PATCH] irqchip/gic-v4.1: Fix GICv4.1 doorbell affinity In-Reply-To: <20240126091752.1102-1-jiangkunkun@huawei.com> References: <20240126091752.1102-1-jiangkunkun@huawei.com> 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/29.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: jiangkunkun@huawei.com, oliver.upton@linux.dev, james.morse@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, tglx@linutronix.de, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240126_021938_301600_CFBDCABC X-CRM114-Status: GOOD ( 26.16 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, 26 Jan 2024 09:17:52 +0000, Kunkun Jiang wrote: > > commit dd3f050a216e ("irqchip/gic-v4.1: Implement the v4.1 flavour > of VMOVP") make an optimization, VMOVP can be skipped if moving > VPE to a cpu whose RD is sharing its VPE table with the current one. > But when skipping VMOVP, the affinity recorded in irq_data is still > updated. This causes the doorbell affinity recorfed in the irq_data > to be inconsistent with the actual. > > In corner case, this may result in lost interrupts: > 0. Each cpu die shares a VPE table and contains 32 CPUs > die0(CPU0-31) die1(CPU32-63)... > 1. VPE resides on CPU32, doorbell affinity to CPU32. > 2. Move VPE to CPU33, skip VMOVP, doorbell still affinity to CPU32. > The affinity recorded in irq_data is CPU33. > 3. Manually offline CPU32 on the host side: > 'echo 0 > /sys/devices/system/cpu/cpu32/online' > 4. Core code cannot move the doorbell affinity to CPU32, since the > record in irq_data is CPU33. > 5. Subsequent doorbell interrupts will be lost. > > So affinity recoreded in irq_data should not be updated when skipping > VMOVP. > > Fixes: dd3f050a216e ("irqchip/gic-v4.1: Implement the v4.1 flavour of VMOVP") > Signed-off-by: Kunkun Jiang > --- > drivers/irqchip/irq-gic-v3-its.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c > index d097001c1e3e..4b1dbb697959 100644 > --- a/drivers/irqchip/irq-gic-v3-its.c > +++ b/drivers/irqchip/irq-gic-v3-its.c > @@ -3850,8 +3850,9 @@ static int its_vpe_set_affinity(struct irq_data *d, > its_send_vmovp(vpe); > its_vpe_db_proxy_move(vpe, from, cpu); > > -out: > irq_data_update_effective_affinity(d, cpumask_of(cpu)); > + > +out: That looks wrong. You are lying to the core code by saying that it's all OK, and yet haven't done *anything*. This stuff is obviously buggy, but I don't think this is right. In your example, you don't even solve the problem: if CPUs 32 and 33 are part of the same ITS affinity group, you won't issue a VMOVP either, so this doesn't fix anything. At this stage, I think the VMOVP optimisation is wrong and that we should drop it. M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel