From: Mark Brown <broonie@kernel.org>
To: Fuad Tabba <fuad.tabba@linux.dev>
Cc: Marc Zyngier <maz@kernel.org>, Oliver Upton <oupton@kernel.org>,
Fuad Tabba <tabba@google.com>, Joey Gouly <joey.gouly@arm.com>,
Steffen Eiden <seiden@linux.ibm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Zenghui Yu <yuzenghui@huawei.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
Peter Maydell <peter.maydell@linaro.org>,
linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] KVM: arm64: selftests: Check ID regs are immutable after a failed run
Date: Wed, 5 Aug 2026 15:15:23 +0100 [thread overview]
Message-ID: <d2a0c43e-6ed4-432f-ba08-e4e076d17253@sirena.org.uk> (raw)
In-Reply-To: <20260805064740.3013538-1-fuad.tabba@linux.dev>
[-- Attachment #1: Type: text/plain, Size: 1118 bytes --]
On Wed, Aug 05, 2026 at 07:47:40AM +0100, Fuad Tabba wrote:
> Add a set_id_regs case covering ID register immutability when a vCPU's
> first KVM_RUN fails after finalization but before
> KVM_ARCH_FLAG_HAS_RAN_ONCE is set. The test provokes such a failure with
> a PMUv3-enabled vCPU whose PMU is left uninitialized, then checks that
> KVM_SET_ONE_REG on the feature and implementation ID registers, and
> KVM_CREATE_DEVICE for a vGIC, are all rejected with -EBUSY.
> + /*
> + * A PMUv3 vCPU left without PMU init is rejected by
> + * kvm_arm_pmu_v3_enable(), which runs after sysreg finalization.
> + */
> + r = _vcpu_run(vcpu);
> + TEST_ASSERT(r < 0 && errno == EINVAL,
> + "first KVM_RUN should fail post-finalization: r=%d errno=%d",
> + r, errno);
As mentioned on the prior version TEST_ASSERT() is not good practice for
something reporting individual kselftest results, and while there's a
bunch of bad practice in this file we do also have some attempts at
doing better (although not currently entirely successful).
Otherwise this looks fine so I guess
Acked-by: Mark Brown <broonie@kernel.org>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
prev parent reply other threads:[~2026-08-05 14:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-05 6:47 [PATCH v2] KVM: arm64: selftests: Check ID regs are immutable after a failed run Fuad Tabba
2026-08-05 14:15 ` Mark Brown [this message]
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=d2a0c43e-6ed4-432f-ba08-e4e076d17253@sirena.org.uk \
--to=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=fuad.tabba@linux.dev \
--cc=joey.gouly@arm.com \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maz@kernel.org \
--cc=oupton@kernel.org \
--cc=peter.maydell@linaro.org \
--cc=seiden@linux.ibm.com \
--cc=suzuki.poulose@arm.com \
--cc=tabba@google.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