From: Yeoreum Yun <yeoreum.yun@arm.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>, Marc Zyngier <maz@kernel.org>,
Mark Brown <broonie@kernel.org>,
Oliver Upton <oliver.upton@linux.dev>,
miko.lenczewski@arm.com, Kevin Brodsky <kevin.brodsky@arm.com>,
Ard Biesheuvel <ardb@kernel.org>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Lorenzo Pieralisi <lpieralisi@kernel.org>,
yangyicong@hisilicon.com, scott@os.amperecomputing.com,
Joey Gouly <joey.gouly@arm.com>,
Zenghui Yu <yuzenghui@huawei.com>,
Paolo Bonzini <pbonzini@redhat.com>, shuah <shuah@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, kvmarm@lists.linux.dev,
kvm@vger.kernel.org, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH v11 9/9] arm64: armv8_deprecated: apply FEAT_LSUI for swpX emulation.
Date: Fri, 7 Nov 2025 14:19:11 +0000 [thread overview]
Message-ID: <aQ3/35146HkAqM+I@e129823.arm.com> (raw)
In-Reply-To: <9fffb30d-fc9c-4e2e-94d2-c724e81ae3ac@app.fastmail.com>
Hi Arnd.
> On Thu, Nov 6, 2025, at 10:40, Yeoreum Yun wrote:
> > apply FEAT_LSUI instruction to emulate deprecated swpX instruction.
>
> Can you explain in the changrelog why you do this?
>
> In particular, is this a performance optimization or is this required
> for correctness in some scenario?
I think the main purpose using for this is to "remove the toggling the
PSTATE.PAN" bit. so that remove some *potential* problem which can
happen when PAN bit is cleared.
also, though swpb might add some complexity, but swp can get
a little bit of benifit by removing the ll/sc way and reduce
the amount of instructions.
> I would have expected that there is very little benefit in
> changing the swp/swpb emulation here if the existing code
> has to remain compiled into the kernel and the overhead of
> the trap is so much larger than the uaccess_enable_privileged()
> overhead.
Yeap. since the *trap* overhead is much larger than the
uaccess_enable_privileged() in the performnace perspecitve,
It would has a little effect. However, as I mention above,
the main purpose of this is to remove toggling the PSTATE.PAN
if possible. there would be a little bit of additional commplexity
for swpb but it seems affordable.
Thanks.
[...]
--
Sincerely,
Yeoreum Yun
next prev parent reply other threads:[~2025-11-07 14:19 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-06 9:40 [PATCH v11 0/9] support FEAT_LSUI Yeoreum Yun
2025-11-06 9:40 ` [PATCH v11 1/9] arm64: cpufeature: add FEAT_LSUI Yeoreum Yun
2025-11-06 9:40 ` [PATCH v11 2/9] KVM: arm64: expose FEAT_LSUI to guest Yeoreum Yun
2025-11-06 9:40 ` [PATCH v11 3/9] KVM: arm64: kselftest: set_id_regs: add test for FEAT_LSUI Yeoreum Yun
2025-11-06 9:40 ` [PATCH v11 4/9] arm64: Kconfig: Detect toolchain support for LSUI Yeoreum Yun
2025-11-06 9:40 ` [PATCH v11 5/9] arm64: futex: refactor futex atomic operation Yeoreum Yun
2025-11-06 9:40 ` [PATCH v11 6/9] arm64: futex: support futex with FEAT_LSUI Yeoreum Yun
2025-11-06 9:40 ` [PATCH v11 7/9] arm64: separate common LSUI definitions into lsui.h Yeoreum Yun
2025-11-06 9:40 ` [PATCH v11 8/9] arm64: armv8_deprecated: convert user_swpX to inline function Yeoreum Yun
2025-11-06 9:40 ` [PATCH v11 9/9] arm64: armv8_deprecated: apply FEAT_LSUI for swpX emulation Yeoreum Yun
2025-11-07 11:52 ` Arnd Bergmann
2025-11-07 14:19 ` Yeoreum Yun [this message]
2025-11-07 14:24 ` Arnd Bergmann
2025-11-07 15:57 ` Yeoreum Yun
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=aQ3/35146HkAqM+I@e129823.arm.com \
--to=yeoreum.yun@arm.com \
--cc=ardb@kernel.org \
--cc=arnd@arndb.de \
--cc=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=joey.gouly@arm.com \
--cc=kevin.brodsky@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=linux-kselftest@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=mark.rutland@arm.com \
--cc=maz@kernel.org \
--cc=miko.lenczewski@arm.com \
--cc=oliver.upton@linux.dev \
--cc=pbonzini@redhat.com \
--cc=scott@os.amperecomputing.com \
--cc=shuah@kernel.org \
--cc=suzuki.poulose@arm.com \
--cc=will@kernel.org \
--cc=yangyicong@hisilicon.com \
--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