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 C38B8606A322 for ; Tue, 1 Dec 2026 20:45:23 +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=octlNpCc; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Wn69Pmg4 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-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Unsubscribe-Post:List-Owner; bh=YfWOWX0NBlZYv0GkI2WVTxHccskh6v9enc8LmHtTotQ=; b=octlNpCcLXw5IqiUDM5mAhIrmW TM5tFkiewat2F5e3oBrE8CTN0llm9e42othwqddtgO9lIOasvyz7G30+qoX6tdvJuXqJHbIViVqfi uqzMjNGV084LbefTk259bSUqb4ukDqpUJukx6xFYty8ImzK4gfXIHyRuf1Gq8Gh8aKBIFZmn4AD4i 37schbYAqEd6ZOfbzRLltLWAQHf2xaTLdHR8bx4MLXcWF6V2q/M9oTJTfFQJDBhDmgUn2zYlzqp89 d2fdMzv9ZDAJCkehqNFyGZ7NzQoKbs14yeSPtZd5y42C2rWImDIjjz/8Q0aKYpdGlb7lGknUIef8j 9aWmDP0A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYUiv-00000009OEz-1UIQ; Tue, 01 Dec 2026 20:45:13 +0000 Received: from sea.source.kernel.org ([172.234.252.31]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYUit-00000009OE8-0n2H for linux-arm-kernel@lists.infradead.org; Tue, 01 Dec 2026 20:45:11 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id D9B7A40699; Tue, 1 Dec 2026 20:45:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5B0621F00893; Tue, 1 Dec 2026 20:45:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796157909; bh=YfWOWX0NBlZYv0GkI2WVTxHccskh6v9enc8LmHtTotQ=; h=From:To:Cc:Subject:Date; b=Wn69Pmg4RRW/141NN95Xairsvs7ah1Sbg3YoXnnufMbI4jZ20NQE9YNqxNAl6QIfE SiNerYq1eiV7UvBx5nCf/UCvL+87+iQRZQu/h3/XUFO1xxapRZMH8coDx+FK6H0645 XktSSrEYSCFCegdJOpiwxzLqrDVtU3D76xif1Xn0b2cQJNl1mLZMekBMnWY7fTDhj/ rZ7I+z6cXL4/ybBIo1kqPXykisA2njiBBuU8vOgcSoTY930rkKXZgyOmiLYDyvtFFQ a+xGktheo4XUfv1OvKSlkdIT2MDWI/Y8RgzixfD+kcaGIXwFelK8n9Zhavc1XC0zO6 Xj4IuIs099lcQ== From: Oliver Upton To: Marc Zyngier , Oliver Upton , Catalin Marinas , Will Deacon , Sven Peter , Janne Grunau , Thomas Gleixner , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim Cc: 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: [PATCH 0/4] KVM: arm64: Fixes for guest-only PMU event overflows on Apple Silicon Date: Tue, 1 Dec 2026 12:44:58 -0800 Message-ID: <20261201204502.1813335-1-oupton@kernel.org> X-Mailer: git-send-email 2.47.3 X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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=-13.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,USER_AGENT_GIT 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 A rather annoying detail of the Apple CPU PMU is that the FIQ appears to depend on the event filter configuration / value of HCR_EL2.TGE. Events that filter out the host ELs do not appear to drive the FIQ line when HCR_EL2.TGE=1. This manifests when using the vPMU for sampling inside of a KVM guest, as the overflowed PMU generates a storm of FIQs that are no longer pending by the time interrupts are unmasked. This series performs a rather disgusting hack to work around the issue, forcing a pending FIQ by performing a self-IPI when exiting due to a FIQ and the PMU is in an interrupt condition. The mitigation works on all implementations that support PMUv3 traps as the 'fast' IPI feature (IPIs taken as a FIQ) long predates vPMU support. Applies to 7.4-rc3, tested with various perf record invocations in an L1 KVM guest. Oliver Upton (4): KVM: arm64: Track IRQ and FIQ exceptions separately perf kvm stat: Add new 'ARM_EXCEPTION_FIQ' exception type KVM: arm64: Let the irqchip provide a fixup for FIQs taken to EL2 irqchip/apple-aic: Work around FIQ storms upon vPMU counter overflow arch/arm64/include/asm/kvm_asm.h | 12 ++++--- arch/arm64/kvm/arm.c | 5 ++- arch/arm64/kvm/handle_exit.c | 1 + arch/arm64/kvm/hyp/entry.S | 6 ++++ arch/arm64/kvm/hyp/hyp-entry.S | 6 +++- arch/arm64/kvm/hyp/include/hyp/switch.h | 4 +-- arch/arm64/kvm/hyp/nvhe/hyp-main.c | 2 ++ arch/arm64/kvm/vgic/vgic-init.c | 6 ++++ arch/arm64/kvm/vgic/vgic.h | 9 +++++ drivers/irqchip/irq-apple-aic.c | 33 +++++++++++++++++-- include/kvm/arm_vgic.h | 4 +++ include/linux/irqchip/arm-vgic-info.h | 3 ++ .../kvm-stat-arch/arm64_exception_types.h | 2 ++ 13 files changed, 83 insertions(+), 10 deletions(-) base-commit: aebb7274476403040d582c61478df8f4a7bf9cd3 -- 2.47.3