From: Marc Zyngier <maz@kernel.org>
To: Akihiko Odaki <akihiko.odaki@daynix.com>
Cc: Oliver Upton <oliver.upton@linux.dev>,
Joey Gouly <joey.gouly@arm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Zenghui Yu <yuzenghui@huawei.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
Andrew Jones <andrew.jones@linux.dev>,
linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev,
linux-kernel@vger.kernel.org, devel@daynix.com,
stable@vger.kernel.org
Subject: Re: [PATCH v5 0/5] KVM: arm64: PMU: Fix SET_ONE_REG for vPMC regs
Date: Sun, 16 Mar 2025 10:33:10 +0000 [thread overview]
Message-ID: <86a59lnu3d.wl-maz@kernel.org> (raw)
In-Reply-To: <20250315-pmc-v5-0-ecee87dab216@daynix.com>
On Sat, 15 Mar 2025 09:12:09 +0000,
Akihiko Odaki <akihiko.odaki@daynix.com> wrote:
>
> Prepare vPMC registers for user-initiated changes after first run. This
> is important specifically for debugging Windows on QEMU with GDB; QEMU
> tries to write back all visible registers when resuming the VM execution
> with GDB, corrupting the PMU state. Windows always uses the PMU so this
> can cause adverse effects on that particular OS.
>
> This series also contains patch "KVM: arm64: PMU: Set raw values from
> user to PM{C,I}NTEN{SET,CLR}, PMOVS{SET,CLR}", which reverts semantic
> changes made for the mentioned registers in the past. It is necessary
> to migrate the PMU state properly on Firecracker, QEMU, and crosvm.
>
> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
> ---
> Changes in v5:
> - Rebased.
> - Link to v4: https://lore.kernel.org/r/20250313-pmc-v4-0-2c976827118c@daynix.com
>
> Changes in v4:
> - Reverted changes for functions implementing ioctls in patch
> "KVM: arm64: PMU: Assume PMU presence in pmu-emul.c".
> - Removed kvm_pmu_vcpu_reset().
> - Reordered function calls in kvm_vcpu_reload_pmu() for better style.
> - Link to v3: https://lore.kernel.org/r/20250312-pmc-v3-0-0411cab5dc3d@daynix.com
>
> Changes in v3:
> - Added patch "KVM: arm64: PMU: Assume PMU presence in pmu-emul.c".
> - Added an explanation of this path series' motivation to each patch.
> - Explained why userspace register writes and register reset should be
> covered in patch "KVM: arm64: PMU: Reload when user modifies
> registers".
> - Marked patch "KVM: arm64: PMU: Set raw values from user to
> PM{C,I}NTEN{SET,CLR}, PMOVS{SET,CLR}" for stable.
> - Reoreded so that patch "KVM: arm64: PMU: Set raw values from user to
> PM{C,I}NTEN{SET,CLR}, PMOVS{SET,CLR}" would come first.
> - Added patch "KVM: arm64: PMU: Call kvm_pmu_handle_pmcr() after masking
> PMCNTENSET_EL0".
> - Added patch "KVM: arm64: Reload PMCNTENSET_EL0".
> - Link to v2: https://lore.kernel.org/r/20250307-pmc-v2-0-6c3375a5f1e4@daynix.com
>
> Changes in v2:
> - Changed to utilize KVM_REQ_RELOAD_PMU as suggested by Oliver Upton.
> - Added patch "KVM: arm64: PMU: Reload when user modifies registers"
> to cover more registers.
> - Added patch "KVM: arm64: PMU: Set raw values from user to
> PM{C,I}NTEN{SET,CLR}, PMOVS{SET,CLR}".
> - Link to v1: https://lore.kernel.org/r/20250302-pmc-v1-1-caff989093dc@daynix.com
>
> ---
> Akihiko Odaki (5):
> KVM: arm64: PMU: Set raw values from user to PM{C,I}NTEN{SET,CLR}, PMOVS{SET,CLR}
> KVM: arm64: PMU: Assume PMU presence in pmu-emul.c
> KVM: arm64: PMU: Fix SET_ONE_REG for vPMC regs
> KVM: arm64: PMU: Reload when user modifies registers
> KVM: arm64: PMU: Reload when resetting
>
> arch/arm64/kvm/arm.c | 17 ++++++++-----
> arch/arm64/kvm/emulate-nested.c | 6 +++--
> arch/arm64/kvm/pmu-emul.c | 56 +++++++++++------------------------------
> arch/arm64/kvm/reset.c | 3 ---
> arch/arm64/kvm/sys_regs.c | 52 ++++++++++++++++++++++----------------
> include/kvm/arm_pmu.h | 4 +--
> 6 files changed, 62 insertions(+), 76 deletions(-)
Reviewed-by: Marc Zyngier <maz@kernel.org>
M.
--
Without deviation from the norm, progress is not possible.
next prev parent reply other threads:[~2025-03-16 10:36 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-15 9:12 [PATCH v5 0/5] KVM: arm64: PMU: Fix SET_ONE_REG for vPMC regs Akihiko Odaki
2025-03-15 9:12 ` [PATCH v5 1/5] KVM: arm64: PMU: Set raw values from user to PM{C,I}NTEN{SET,CLR}, PMOVS{SET,CLR} Akihiko Odaki
2025-03-15 9:12 ` [PATCH v5 2/5] KVM: arm64: PMU: Assume PMU presence in pmu-emul.c Akihiko Odaki
2025-03-15 9:12 ` [PATCH v5 3/5] KVM: arm64: PMU: Fix SET_ONE_REG for vPMC regs Akihiko Odaki
2025-03-17 13:02 ` kernel test robot
2025-03-17 14:49 ` Marc Zyngier
2025-03-15 9:12 ` [PATCH v5 4/5] KVM: arm64: PMU: Reload when user modifies registers Akihiko Odaki
2025-03-15 9:12 ` [PATCH v5 5/5] KVM: arm64: PMU: Reload when resetting Akihiko Odaki
2025-03-16 10:33 ` Marc Zyngier [this message]
2025-03-17 20:01 ` [PATCH v5 0/5] KVM: arm64: PMU: Fix SET_ONE_REG for vPMC regs Oliver Upton
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=86a59lnu3d.wl-maz@kernel.org \
--to=maz@kernel.org \
--cc=akihiko.odaki@daynix.com \
--cc=andrew.jones@linux.dev \
--cc=catalin.marinas@arm.com \
--cc=devel@daynix.com \
--cc=joey.gouly@arm.com \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oliver.upton@linux.dev \
--cc=stable@vger.kernel.org \
--cc=suzuki.poulose@arm.com \
--cc=will@kernel.org \
--cc=yuzenghui@huawei.com \
/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;
as well as URLs for NNTP newsgroup(s).