From: Sascha Bischoff <Sascha.Bischoff@arm.com>
To: "linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: nd <nd@arm.com>, Catalin Marinas <Catalin.Marinas@arm.com>,
"will@kernel.org" <will@kernel.org>,
Mark Rutland <Mark.Rutland@arm.com>,
"lpieralisi@kernel.org" <lpieralisi@kernel.org>,
"maz@kernel.org" <maz@kernel.org>,
"oupton@kernel.org" <oupton@kernel.org>,
"kvmarm@lists.linux.dev" <kvmarm@lists.linux.dev>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: [PATCH 0/2] arm64: Make write_sysreg_s() select XZR reliably
Date: Fri, 4 Sep 2026 17:48:55 +0000 [thread overview]
Message-ID: <20260904174855.76185-1-sascha.bischoff@arm.com> (raw)
Hi all,
Sashiko spotted the original tools-side CDEOI encoding issue while
reviewing the GICv5 KVM IRS series [1]. While updating the tools copy to
match the kernel header, I noticed that the existing kernel workaround
relies on constant propagation to recognise that its local value was
initialised with zero. With optimisation disabled, compilers instead
select an arbitrary general-purpose register.
Compiling the kernel or tools without optimisation is uncommon, but the
fix is small and removes this dependency entirely.
This matters for instructions such as GIC CDEOI, where Rt must select
XZR rather than a register containing zero. Patch 1 removes the
reliance on constant propagation and instead tests the macro argument
directly. Patch 2 mirrors the change in the tools copy, fixing the
GICv5 KVM selftest.
After these changes, both GCC and LLVM emit the correct encoding when
using -O0.
[1] https://lore.kernel.org/r/20260807173928.3F6731F000E9@smtp.kernel.org
Thanks,
Sascha
Sascha Bischoff (2):
arm64: sysreg: Make write_sysreg_s() select XZR without optimisation
arm64: tools: Fix GIC CDEOI instruction encoding
arch/arm64/include/asm/sysreg.h | 2 +-
tools/arch/arm64/include/asm/sysreg.h | 11 ++++++++++-
2 files changed, 11 insertions(+), 2 deletions(-)
--
2.34.1
next reply other threads:[~2026-09-04 17:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-04 17:48 Sascha Bischoff [this message]
2026-09-04 17:49 ` [PATCH 1/2] arm64: sysreg: Make write_sysreg_s() select XZR without optimisation Sascha Bischoff
2026-09-04 17:49 ` [PATCH 2/2] arm64: tools: Fix GIC CDEOI instruction encoding Sascha Bischoff
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=20260904174855.76185-1-sascha.bischoff@arm.com \
--to=sascha.bischoff@arm.com \
--cc=Catalin.Marinas@arm.com \
--cc=Mark.Rutland@arm.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=maz@kernel.org \
--cc=nd@arm.com \
--cc=oupton@kernel.org \
--cc=will@kernel.org \
/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