Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1109712pxf; Fri, 26 Mar 2021 00:59:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymK5YMKB4UmZI2cMMy5T2J//5/FXCt2+YFz6SF4pU7iIhrMiPTZRKjtBRSy0/b57UUOhV5 X-Received: by 2002:a05:6402:4242:: with SMTP id g2mr13302149edb.329.1616745581968; Fri, 26 Mar 2021 00:59:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616745581; cv=none; d=google.com; s=arc-20160816; b=YcZ78BsMpLVQAmkjLq8uzB19h0KU0SsVzpGBanRC4XKocz07WLlxFkXcmYdrWybfCv Uc6RHX8Ejjc2R1c8j8iYknFKzIwGEeqXl/rn5UuND4a+hiOwi8zsOJfK2H3Pl27csmFH sE0Q6/Qns/re3fVShKKcpbc0jN+FztyjyKt156g31uyonr6Pl+dTKY4ojeknpBq2bHqe 8p9cMK8S+ZEepqUWvHwv6L8hXvtM+MXXPkI5aGuo5VOQM2lOSubfzVKXaC0ZN1Ylj4aY NkeqTwtw28dAoUDpPbsZM/s+EAcTQRQEidiSpRojs8X8DD5iJOllFTF1DHBvwHRnD7dH E1oQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=OoV6Z7L2MShnfDf+R+FIxPrseg2mj2AF+q/HUXJrDWQ=; b=rVxRc1GW/dKRmNprCncV6r1YB7oePAmib8XozcTXv3yO0oqnAn9fTdY+9NzwVgtHmo e+OoDYOkKOqVNcX0G81kA60QAW9/B9+UTVJRC1UOYTPvBwR54TDVgXqLnQQeFy5sNXWH pGXJEx2hRaylDqs5RaUj+4phX32y/ltnLuLloaaNw2T9buFIPHdsVpoNX2saVxyzjQJ9 4ikjOrdLIjit0zSwvgQVgZ9HjoQ65Hiy3rEQE7IkUbjds0ibxNohmW2GKGtzeA/Uxz9K c2PXTn6NpR4IqjoRO2I+02vxBx/sT7B2EZnHImlev42ZmmZgCHLpMBK7CnoKWXDRy8nn UA8Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=marcan.st Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ds7si7353722ejc.598.2021.03.26.00.59.19; Fri, 26 Mar 2021 00:59:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=marcan.st Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230098AbhCZH6A (ORCPT + 99 others); Fri, 26 Mar 2021 03:58:00 -0400 Received: from marcansoft.com ([212.63.210.85]:41058 "EHLO mail.marcansoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229798AbhCZH5k (ORCPT ); Fri, 26 Mar 2021 03:57:40 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: marcan@marcan.st) by mail.marcansoft.com (Postfix) with ESMTPSA id 40EB041982; Fri, 26 Mar 2021 07:57:31 +0000 (UTC) Subject: Re: [RFT PATCH v3 16/27] irqchip/apple-aic: Add support for the Apple Interrupt Controller To: Marc Zyngier Cc: linux-arm-kernel@lists.infradead.org, Rob Herring , Arnd Bergmann , Olof Johansson , Krzysztof Kozlowski , Mark Kettenis , Tony Lindgren , Mohamed Mediouni , Stan Skowronek , Alexander Graf , Will Deacon , Linus Walleij , Mark Rutland , Andy Shevchenko , Greg Kroah-Hartman , Jonathan Corbet , Catalin Marinas , Christoph Hellwig , "David S. Miller" , devicetree@vger.kernel.org, linux-serial@vger.kernel.org, linux-doc@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org References: <20210304213902.83903-1-marcan@marcan.st> <20210304213902.83903-17-marcan@marcan.st> <874khlzsa3.wl-maz@kernel.org> From: Hector Martin Message-ID: <7a7363cd-01e9-645c-e9b8-a81005210253@marcan.st> Date: Fri, 26 Mar 2021 16:57:29 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <874khlzsa3.wl-maz@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: es-ES Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/03/2021 22.31, Marc Zyngier wrote: >> + if ((read_sysreg_s(SYS_ICH_HCR_EL2) & ICH_HCR_EN) && >> + read_sysreg_s(SYS_ICH_MISR_EL2) != 0) { >> + pr_err("vGIC IRQ fired, disabling.\n"); > > Please add a _ratelimited here. Whilst debugging KVM on this machine, > I ended up with this firing at such a rate that it was impossible to > do anything useful. Ratelimiting it allowed me to pinpoint the > problem. Ouch. Done for v4. >> +static void aic_fiq_eoi(struct irq_data *d) >> +{ >> + /* We mask to ack (where we can), so we need to unmask at EOI. */ >> + if (!irqd_irq_disabled(d) && !irqd_irq_masked(d)) > > Ah, be careful here: irqd_irq_masked() doesn't do what you think it > does for per-CPU interrupts. It's been on my list to fix for the rVIC > implementation, but I never got around to doing it, and all decent ICs > hide this from SW by having a HW-managed mask, similar to what is on > the IRQ side. > > I can see two possibilities: > > - you can track the masked state directly and use that instead of > these predicates > > - you can just drop the masking altogether as this is only useful to a > hosted hypervisor (KVM), which will have to do its own masking > behind the scenes anyway > Since you're using the masking in KVM after all, I'm tracking the mask state in a percpu variable now. Also folded in your two minor bugfixes from the KVM series. Cheers! -- Hector Martin (marcan@marcan.st) Public Key: https://mrcn.st/pub