[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <33952c0e-737d-4170-9b25-d5818e9fc05b@igalia.com>
Date: Mon, 4 Nov 2024 18:49:34 -0300
From: André Almeida <andrealmeid@...lia.com>
To: Florian Weimer <fweimer@...hat.com>
Cc: Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>, Darren Hart <dvhart@...radead.org>,
Davidlohr Bueso <dave@...olabs.net>, Arnd Bergmann <arnd@...db.de>,
sonicadvance1@...il.com, linux-kernel@...r.kernel.org,
kernel-dev@...lia.com, linux-api@...r.kernel.org,
Nathan Chancellor <nathan@...nel.org>
Subject: Re: [PATCH v2 0/3] futex: Create set_robust_list2
Hi Florian,
Em 02/11/2024 18:58, Florian Weimer escreveu:
> * André Almeida:
>
>> 1) x86 apps can have 32bit pointers robust lists. For a x86-64 kernel
>> this is not a problem, because of the compat entry point. But there's
>> no such compat entry point for AArch64, so the kernel would do the
>> pointer arithmetic wrongly. Is also unviable to userspace to keep
>> track every addition/removal to the robust list and keep a 64bit
>> version of it somewhere else to feed the kernel. Thus, the new
>> interface has an option of telling the kernel if the list is filled
>> with 32bit or 64bit pointers.
>
> The size is typically different for 32-bit and 64-bit mode (12 vs 24
> bytes). Why isn't this enough to disambiguate?
>
Right, so the idea would be to use `size_t len` from the syscall
arguments for that?
>> 2) Apps can set just one robust list (in theory, x86-64 can set two if
>> they also use the compat entry point). That means that when a x86 app
>> asks FEX-Emu to call set_robust_list(), FEX have two options: to
>> overwrite their own robust list pointer and make the app robust, or
>> to ignore the app robust list and keep the emulator robust. The new
>> interface allows for multiple robust lists per application, solving
>> this.
>
> Can't you avoid mixing emulated and general userspace code on the same
> thread? On emulator threads, you have full control over the TCB.
>
FEX can't avoid that because it doesn't do a full system emulation, it
just does instructions translation. FEX doesn't have full control over
the TCB, that's still all glibc, or whatever other dynamic linker is used.
Powered by blists - more mailing lists