[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <9fffb30d-fc9c-4e2e-94d2-c724e81ae3ac@app.fastmail.com>
Date: Fri, 07 Nov 2025 12:52:38 +0100
From: "Arnd Bergmann" <arnd@...db.de>
To: "Yeoreum Yun" <yeoreum.yun@....com>,
"Catalin Marinas" <catalin.marinas@....com>, "Will Deacon" <will@...nel.org>,
"Marc Zyngier" <maz@...nel.org>, "Mark Brown" <broonie@...nel.org>,
"Oliver Upton" <oliver.upton@...ux.dev>, miko.lenczewski@....com,
"Kevin Brodsky" <kevin.brodsky@....com>, "Ard Biesheuvel" <ardb@...nel.org>,
"Suzuki K Poulose" <suzuki.poulose@....com>,
"Lorenzo Pieralisi" <lpieralisi@...nel.org>, yangyicong@...ilicon.com,
scott@...amperecomputing.com, "Joey Gouly" <joey.gouly@....com>,
"Zenghui Yu" <yuzenghui@...wei.com>, "Paolo Bonzini" <pbonzini@...hat.com>,
shuah <shuah@...nel.org>, "Mark Rutland" <mark.rutland@....com>
Cc: linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
kvmarm@...ts.linux.dev, kvm@...r.kernel.org, linux-kselftest@...r.kernel.org
Subject: Re: [PATCH v11 9/9] arm64: armv8_deprecated: apply FEAT_LSUI for swpX
emulation.
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 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.
> + curval.var = newval.var = oldval;
> + newval.raw[idx] = *data;
> +
> + asm volatile("// __lsui_user_swpb_asm\n"
> + __LSUI_PREAMBLE
> + "1: cast %x2, %x3, %1\n"
> + "2:\n"
> + _ASM_EXTABLE_UACCESS_ERR(1b, 2b, %w0)
> + : "+r" (err), "+Q" (*addr_al), "+r" (curval.var)
> + : "r" (newval.var)
> + : "memory");
I see that you fixed the race now. I had written an email about
it earlier when I saw the same mistake you found as well, but
it got stuck in my drafts folder. The new version looks correct
to me, I'm just not sure we need the added complexity.
Arnd
Powered by blists - more mailing lists