Thread (12 messages) 12 messages, 3 authors, 2025-06-18

Re: [PATCH RESEND v4 0/7] futex: Create set_robust_list2

From: "Arnd Bergmann" <arnd@arndb.de>
Date: 2025-06-18 17:04:01
Also in: linux-kselftest, lkml

On Wed, Jun 18, 2025, at 18:56, Sebastian Andrzej Siewior wrote:
On 2025-06-18 13:39:46 [-0300], André Almeida wrote:
quoted
Ops, I forgot to address them. I will do it for v5.
quoted
- You say 64bit x86-64 does not have the problem due the compat syscall.
   Arm64 has this problem. New arm64 do not provide arm32 facility. You
   introduce the syscall here. Why not introduce the compat syscall
   instead? I'm sorry if this has been answered somewhere below but this
   was one question I had while I initially skimmed over the patches.
The main target for this new syscall is Arm64, that can't handle 32 pointers
in the current syscall, so this new interface allows the robust list
mechanism to know if it needs to do 64 or 32 bit pointer arithmetic
operations to walk in the list.

Introducing a compat syscall won't fix this, giving that it only works in
x86-64. We need an entry point for Arm64 that can handle 32 bit pointers.
I would need to dig into details to figure out why it won't work for
arm64 and works only for x86-64. 
There is the set_robust_list syscall as compat which sets
::compat_robust_list. And non-compat sets ::robust_list. The 32bit
application on 64bit kernel should set ::compat_robust_list which what
your syscall provides.
That is why I don't understand the need for it so far. Maybe I am
missing a detail.
We have other architectures with 64 bit kernel and a possible 32bit
userland such as mips, s390 or powerpc which would have the same issue
then. Or there is something special about arm64 in this case which makes
it unique.
x86 is the special case here, since it allows applications to
call both the 32-bit (compat) and 64-bit syscalls directly on
a 64-bit kernel. I think MIPS may do that as well, but the other
architectures only allow a process to call syscalls for its native
ABI, so the only way to call a compat syscall is from a 32-bit
task. On Arm and RISC-V it's also common to have CPUs that cannot
run 32-bit tasks at all, so even running your x86-32 emulator as
an arm32 or rv32 task won't work.

      Arnd
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help