From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2E70A606A332 for ; Wed, 2 Dec 2026 17:45:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=kTyTuM47; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=QWAb8h6i 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:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=4ZkhSSRnEd2HtiEaE5CgweGeYsYeu14+xni5EMIBRwg=; b=kTyTuM47JYtV05ZMPWxw2LkMz6 EaWL7g7m5BaeHKSFUU0bVu2DQWENgP7L9WSKvmYfOGD73CgV74Q9B1UL4puGYcV92N3+HQXCDHSvc tgc/EzkFQBlSZAvw/Qv5gCZ5VgWsUmc+ytWh9CdSJI85HxJksWECIOYx3ri0Bs//XKKOkzldNbdL5 TkvMhajyt8z34sU9sjVsvGHEghySZmUKZ8HKSGNXCzpvzRx9tDyp6FS1ao6z8Nq2xmleQHXtSIDTq rmzp87RxwwMEhUUrjmoRpORjaEDbT4OvJdSiaIwkbFxn+oEUbPz+E/W1hGduz9LBRKFkZMIpwEJlg t81yyBNA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYoO1-0000000CQIj-1HRV; Wed, 02 Dec 2026 17:44:57 +0000 Received: from tor.source.kernel.org ([172.105.4.254]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYoNz-0000000CQI7-2qGX for linux-arm-kernel@lists.infradead.org; Wed, 02 Dec 2026 17:44:55 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id CF30F601D6; Wed, 2 Dec 2026 17:44:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 319D91F000C1; Wed, 2 Dec 2026 17:44:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796233494; bh=4ZkhSSRnEd2HtiEaE5CgweGeYsYeu14+xni5EMIBRwg=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=QWAb8h6iqJnYcFqDaUg9Ct8pkQ9erHeqj/TY9y8K+1ANV91QJbqA2/q9fSDEqJb2r pYnSQj9+7k8KS2O5msOdIdEDCXOyldWPFoP+3Hkz+FlpPj4pOl4si5peRsCZuGRnBL gFCTmAuUPPFtZBdXKJ0MyGU0XlGTG7UZEHr2+EnxbLuh0f5nTYZfFM5REKjzELiD6g PAn0ywiEFNmgF4zyLVG8oZJRQImgRvpQWsXBLTJFL7VfdCDjqT4bQi8E/5vmB3uOTm k3tm6/MrxLutSvdukVG1NmQfVdpfyrdPxB7OOPsM7hMAqlIEWta0RXLyAhFYdtVLg3 NkwRQJcwn3NrQ== Date: Wed, 2 Dec 2026 09:44:52 -0800 From: Oliver Upton To: Marc Zyngier Cc: Catalin Marinas , Will Deacon , Sven Peter , Janne Grunau , Thomas Gleixner , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Fuad Tabba , Joey Gouly , Steffen Eiden , Suzuki K Poulose , Zenghui Yu , Mark Rutland , Neal Gompa , Radu Rendec , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , James Clark , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, asahi@lists.linux.dev, linux-perf-users@vger.kernel.org Subject: Re: [PATCH 1/4] KVM: arm64: Track IRQ and FIQ exceptions separately Message-ID: References: <20261201204502.1813335-1-oupton@kernel.org> <20261201204502.1813335-2-oupton@kernel.org> <86cxrjyfld.wl-maz@kernel.org> X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <86cxrjyfld.wl-maz@kernel.org> X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-10.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Wed, Dec 02, 2026 at 01:30:54PM +0000, Marc Zyngier wrote: > On Tue, 01 Dec 2026 20:44:59 +0000, > Oliver Upton wrote: > > [...] > > > diff --git a/arch/arm64/kvm/hyp/entry.S b/arch/arm64/kvm/hyp/entry.S > > index 9709905f21b5..7d38bae49d31 100644 > > --- a/arch/arm64/kvm/hyp/entry.S > > +++ b/arch/arm64/kvm/hyp/entry.S > > @@ -48,7 +48,13 @@ alternative_else_nop_endif > > // synchronization event so that callers don't need ISBs for anything > > // that would usually be synchronized by the ERET. > > isb > > + > > + // Both a FIQ and IRQ could be pending. Arbitrarily give precedence > > + // to reporting a pending FIQ. > > mov x0, #ARM_EXCEPTION_IRQ > > + mov x2, #ARM_EXCEPTION_FIQ > > + tst x1, #ISR_EL1_F > > + csel x0, x2, x0, ne > > I think this has the potential of going wrong on an NMI capable > platform. Not that we support that yet, but it is around the corner. > I also wonder if we should simply re-encode the exception types to > better align with ISR_EL1. In any case, something like: > > orr x1, x1, x1, lsr #(ISR_EL1_FS_SHIFT - ISR_EL1_F_SHIFT) > tst x1, #ISR_EL1_F > csel x0, x2, x0, ne > > should do the trick. Yep, works for me. I've got this applied locally, will include it in a respin if that proves necessary. Thanks, Oliver