Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F131499365
D34708.id104404.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D34708.id104404.diff
View Options
Index: share/man/man4/linux.4
===================================================================
--- share/man/man4/linux.4
+++ share/man/man4/linux.4
@@ -145,6 +145,12 @@
does not emulate the Linux environment completely, and missed features
may result in security vulnerabilities.
Defaults to 1.
+.It Va compat.linux32.emulate_i386
+In the x86_64 (amd64) world enable the real i386 Linuxulator behavior.
+For example, when set to 0, Linux uname -m will return "x86_64" even if
+uname itself is a i386 Linux executable. When set to 1, Linux i386
+uname -m will return "i686".
+Defaults to 0.
.El
.Sh FILES
.Bl -tag -width /compat/linux/dev/shm -compact
Index: sys/amd64/linux32/linux.h
===================================================================
--- sys/amd64/linux32/linux.h
+++ sys/amd64/linux32/linux.h
@@ -637,4 +637,6 @@
void bsd_to_linux_regset32(const struct reg32 *b_reg,
struct linux_pt_regset32 *l_regset);
+extern bool linux32_emulate_i386;
+
#endif /* !_AMD64_LINUX_H_ */
Index: sys/amd64/linux32/linux32_sysvec.c
===================================================================
--- sys/amd64/linux32/linux32_sysvec.c
+++ sys/amd64/linux32/linux32_sysvec.c
@@ -885,6 +885,9 @@
static u_long linux32_maxvmem = LINUX32_MAXVMEM;
SYSCTL_ULONG(_compat_linux32, OID_AUTO, maxvmem, CTLFLAG_RW,
&linux32_maxvmem, 0, "");
+bool linux32_emulate_i386 = false;
+SYSCTL_BOOL(_compat_linux32, OID_AUTO, emulate_i386, CTLFLAG_RWTUN,
+ &linux32_emulate_i386, 0, "Emulate the real i386");
static void
linux32_fixlimit(struct rlimit *rl, int which)
Index: sys/compat/linux/linux_misc.c
===================================================================
--- sys/compat/linux/linux_misc.c
+++ sys/compat/linux/linux_misc.c
@@ -720,6 +720,11 @@
* the string returned by getauxval(AT_PLATFORM) needs
* to remain "i686", though.
*/
+#if defined(COMPAT_LINUX32)
+ if (linux32_emulate_i386)
+ strlcpy(utsname.machine, "i686", LINUX_MAX_UTSNAME);
+ else
+#endif
strlcpy(utsname.machine, "x86_64", LINUX_MAX_UTSNAME);
#elif defined(__aarch64__)
strlcpy(utsname.machine, "aarch64", LINUX_MAX_UTSNAME);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Oct 9, 4:02 PM (18 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
23501074
Default Alt Text
D34708.id104404.diff (2 KB)
Attached To
Mode
D34708: linux(4): Add compat.linux32.true_i386_emulation knob.
Attached
Detach File
Event Timeline
Log In to Comment