Bug 247327 - i386 linuxulator doesn't support more than one LDT
Summary: i386 linuxulator doesn't support more than one LDT
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-emulation (Nobody)
URL:
Keywords:
Depends on:
Blocks: 247219
  Show dependency treegraph
 
Reported: 2020-06-16 20:25 UTC by Edward Tomasz Napierala
Modified: 2020-08-15 02:27 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Edward Tomasz Napierala freebsd_committer 2020-06-16 20:25:46 UTC
Alex S reported that Proton (which is Wine distribution integrated with Steam) depends on functionality mentioned at https://github.com/freebsd/freebsd/blob/8989bc4581101acb0dda31d9c4f9b6ec4732c5cf/sys/i386/linux/linux_machdep.c#L582:

/*
 * Semantics of Linux version: every thread in the system has array of
 * 3 tls descriptors. 1st is GLIBC TLS, 2nd is WINE, 3rd unknown. This
 * syscall loads one of the selected tls decriptors with a value and
 * also loads GDT descriptors 6, 7 and 8 with the content of the
 * per-thread descriptors.
 *
 * Semantics of FreeBSD version: I think we can ignore that Linux has 3
 * per-thread descriptors and use just the 1st one. The tls_array[]
 * is used only in set/get-thread_area() syscalls and for loading the
 * GDT descriptors. In FreeBSD we use just one GDT descriptor for TLS
 * so we will load just one.
 *
 * XXX: this doesn't work when a user space process tries to use more
 * than 1 TLS segment. Comment in the Linux sources says wine might do
 * this.
 */