Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Akihiko Odaki" <odaki@rsg.ci.i.u-tokyo.ac.jp>
Cc: "Oliver Upton" <oupton@kernel.org>,
	kvm@vger.kernel.org, kvmarm@lists.linux.dev,
	"Marc Zyngier" <maz@kernel.org>
Subject: Re: [PATCH v8 04/11] arm64: errata: Require Apple IMPDEF PMUv3 traps on all CPUs
Date: Fri, 10 Jul 2026 11:40:22 +0000	[thread overview]
Message-ID: <20260710114023.4F8F21F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260710-hybrid-v8-4-621409f3a592@rsg.ci.i.u-tokyo.ac.jp>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Hardware/Arch: CPU Capability Constraint Violation for Erratum Workaround
--

--- Patch [4]: [PATCH v8 04/11] arm64: errata: Require Apple IMPDEF PMUv3 traps on all CPUs ---
commit 050c419823146065deb90e25a8ad6df622e115c7
Author: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>

arm64: errata: Require Apple IMPDEF PMUv3 traps on all CPUs

This commit changes the capability type of the Apple IMPDEF PMUv3 workaround
from a local CPU erratum to an early local CPU feature. It aims to require
the workaround system-wide and reject late CPUs that miss the workaround
once it is enabled.

> diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c
> index 5377e4c2eba2b..01bc990b2200f 100644
> --- a/arch/arm64/kernel/cpu_errata.c
> +++ b/arch/arm64/kernel/cpu_errata.c
> @@ -964,7 +964,7 @@ const struct arm64_cpu_capabilities arm64_errata[] = {
>  	{
>  		.desc = "Apple IMPDEF PMUv3 Traps",
>  		.capability = ARM64_WORKAROUND_PMUV3_IMPDEF_TRAPS,
> -		.type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM,
> +		.type = ARM64_CPUCAP_EARLY_LOCAL_CPU_FEATURE,

[Severity: High]
Does changing this capability type inadvertently permit an unmitigated late
CPU to boot?

The ARM64_CPUCAP_EARLY_LOCAL_CPU_FEATURE type includes the
ARM64_CPUCAP_PERMITTED_FOR_LATE_CPU flag. If the system does not enable the
workaround initially (for example, if early CPUs do not all match), this
flag explicitly allows a late CPU that does require the erratum to boot
without triggering a panic.

Because the capability was not enabled system-wide, the .cpu_enable callback
is bypassed for that late CPU, meaning SYS_HACR_EL2 bit 56 is never set.

Could a guest executing on this unmitigated late CPU then directly access
the hardware PMU, leading to guest-to-host privilege escalation or an
information leak?

>  		.matches = has_impdef_pmuv3,
>  		.cpu_enable = cpu_enable_impdef_pmuv3_traps,
>  	},

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260710-hybrid-v8-0-621409f3a592@rsg.ci.i.u-tokyo.ac.jp?part=4

  reply	other threads:[~2026-07-10 11:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-10 11:14 [PATCH v8 00/11] KVM: arm64: PMU: Use multiple host PMUs Akihiko Odaki
2026-07-10 11:14 ` [PATCH v8 01/11] KVM: arm64: Serialize userspace MDCR_EL2 access Akihiko Odaki
2026-07-10 11:36   ` sashiko-bot
2026-07-10 11:14 ` [PATCH v8 02/11] tools headers: Sync bitfield.h with the kernel Akihiko Odaki
2026-07-10 11:14 ` [PATCH v8 03/11] KVM: arm64: selftests: Cover PMU state in MDCR_EL2 Akihiko Odaki
2026-07-10 11:14 ` [PATCH v8 04/11] arm64: errata: Require Apple IMPDEF PMUv3 traps on all CPUs Akihiko Odaki
2026-07-10 11:40   ` sashiko-bot [this message]
2026-07-10 11:14 ` [PATCH v8 05/11] KVM: arm64: Don't clear vcpu->cpu in kvm_arch_vcpu_put() Akihiko Odaki
2026-07-10 11:15 ` [PATCH v8 06/11] KVM: arm64: PMU: Protect the list of PMUs with RCU Akihiko Odaki
2026-07-10 11:15 ` [PATCH v8 07/11] KVM: arm64: PMU: Pass the pPMU to kvm_map_pmu_event() Akihiko Odaki
2026-07-10 11:15 ` [PATCH v8 08/11] KVM: arm64: PMU: Pass the target CPU to kvm_pmu_probe_armpmu() Akihiko Odaki
2026-07-10 11:15 ` [PATCH v8 09/11] KVM: arm64: PMU: Implement fixed-counters-only emulation Akihiko Odaki
2026-07-10 11:48   ` sashiko-bot
2026-07-10 11:15 ` [PATCH v8 10/11] KVM: arm64: PMU: Introduce FIXED_COUNTERS_ONLY Akihiko Odaki
2026-07-10 11:15 ` [PATCH v8 11/11] KVM: arm64: selftests: Test PMU_V3_FIXED_COUNTERS_ONLY Akihiko Odaki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260710114023.4F8F21F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.linux.dev \
    --cc=maz@kernel.org \
    --cc=odaki@rsg.ci.i.u-tokyo.ac.jp \
    --cc=oupton@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox