Bug#637424: Implement i386_get_gsbase i386_get_fsbase i386_set_gsbase i386_set_fsbase amd64_get_gsbase amd64_get_fsbase amd64_set_gsbase amd64_set_fsbase
2011/8/11 Robert Millan r...@debian.org: 2011/8/11 Aurelien Jarno aurel...@aurel32.net: In any case, they will have to wait for 2.14. Anyway, what are the uses cases for these? wine needs amd64_set_gsbase and i386_set_fsbase. Here's a new patch which only implements the syscall stubs needed by wine (amd64_set_gsbase and i386_set_fsbase). This patch also corrects a critical mistake: in setters, the pointers are passed by reference just like with getters (this confusion led me to report non-bug #637528, more details there). -- Robert Millan Index: i386/Makefile === --- i386/Makefile (revision 3681) +++ i386/Makefile (working copy) @@ -15,5 +15,5 @@ # For sys/vm86.h. sysdep_routines += i386_vm86 # For machine/sysarch.h. -sysdep_routines += i386_get_ldt i386_set_ldt +sysdep_routines += i386_get_ldt i386_set_ldt i386_set_fsbase endif Index: i386/Versions === --- i386/Versions (revision 3681) +++ i386/Versions (working copy) @@ -4,4 +4,7 @@ ioperm; iopl; i386_get_ldt; i386_set_ldt; } + GLIBC_2.13 { +i386_set_fsbase; + } } Index: i386/i386_set_fsbase.c === --- i386/i386_set_fsbase.c (revision 0) +++ i386/i386_set_fsbase.c (revision 0) @@ -0,0 +1,25 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include machine/sysarch.h + +int +i386_set_fsbase (void *addr) +{ + return __sysarch (I386_SET_FSBASE, addr); +} Index: x86_64/Makefile === --- x86_64/Makefile (revision 3681) +++ x86_64/Makefile (working copy) @@ -14,4 +14,6 @@ ifeq ($(subdir),misc) # For sys/io.h and sys/perm.h. sysdep_routines += iopl ioperm +# For machine/sysarch.h. +sysdep_routines += amd64_set_gsbase endif Index: x86_64/amd64_set_gsbase.c === --- x86_64/amd64_set_gsbase.c (revision 0) +++ x86_64/amd64_set_gsbase.c (revision 0) @@ -0,0 +1,25 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include machine/sysarch.h + +int +amd64_set_gsbase (void *addr) +{ + return __sysarch (AMD64_SET_GSBASE, addr); +} Index: x86_64/Versions === --- x86_64/Versions (revision 3681) +++ x86_64/Versions (working copy) @@ -5,4 +5,7 @@ GLIBC_2.10 { ioperm; } + GLIBC_2.13 { +amd64_set_gsbase; + } }
Bug#637424: Implement i386_get_gsbase i386_get_fsbase i386_set_gsbase i386_set_fsbase amd64_get_gsbase amd64_get_fsbase amd64_set_gsbase amd64_set_fsbase
On Tue, Aug 16, 2011 at 06:36:08PM +0200, Robert Millan wrote: 2011/8/11 Robert Millan r...@debian.org: 2011/8/11 Aurelien Jarno aurel...@aurel32.net: In any case, they will have to wait for 2.14. Anyway, what are the uses cases for these? wine needs amd64_set_gsbase and i386_set_fsbase. Here's a new patch which only implements the syscall stubs needed by wine (amd64_set_gsbase and i386_set_fsbase). This patch also corrects a critical mistake: in setters, the pointers are passed by reference just like with getters (this confusion led me to report non-bug #637528, more details there). This new patch still doesn't answer my question: why wine can't use the sysarch interface for that? I am really worried by so much requests of adding BSD specific functions. If we want all the FreeBSD libc functions, why don't we use the FreeBSD libc instead of the GNU libc? -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurel...@aurel32.net http://www.aurel32.net -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#637424: Implement i386_get_gsbase i386_get_fsbase i386_set_gsbase i386_set_fsbase amd64_get_gsbase amd64_get_fsbase amd64_set_gsbase amd64_set_fsbase
On Thu, Aug 11, 2011 at 09:48:48PM +0200, Robert Millan wrote: 2011/8/11 Aurelien Jarno aurel...@aurel32.net: In any case, they will have to wait for 2.14. Anyway, what are the uses cases for these? wine needs amd64_set_gsbase and i386_set_fsbase. amd64_set_fsbase and i386_set_gsbase are not used by any program that I know of. Also, they should be considered carefully: since our TLS implementation relies on them, programs shouldn't mess with these functions AFAICT. The getters are neither needed by wine nor dangerous. So what do we do at the end? Couldn't wine simply use the sysarch() function? -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurel...@aurel32.net http://www.aurel32.net -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#637424: Implement i386_get_gsbase i386_get_fsbase i386_set_gsbase i386_set_fsbase amd64_get_gsbase amd64_get_fsbase amd64_set_gsbase amd64_set_fsbase
2011/8/12 Aurelien Jarno aurel...@aurel32.net: wine needs amd64_set_gsbase and i386_set_fsbase. So what do we do at the end? Couldn't wine simply use the sysarch() function? I can't answer that, we'd have to ask wine developers. -- Robert Millan -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#637424: Implement i386_get_gsbase i386_get_fsbase i386_set_gsbase i386_set_fsbase amd64_get_gsbase amd64_get_fsbase amd64_set_gsbase amd64_set_fsbase
Package: libc0.1 Version: 2.13-15 Severity: wishlist Tags: patch This patch implements the following syscall stubs: i386_get_gsbase i386_get_fsbase i386_set_gsbase i386_set_fsbase amd64_get_gsbase amd64_get_fsbase amd64_set_gsbase amd64_set_fsbase -- System Information: Debian Release: wheezy/sid APT prefers unstable APT policy: (500, 'unstable'), (1, 'experimental') Architecture: kfreebsd-amd64 (x86_64) Kernel: kFreeBSD 8.1-1-amd64 Locale: LANG=ca_AD.utf8, LC_CTYPE=ca_AD.utf8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Versions of packages libc0.1 depends on: ii libc-bin 2.13-15Embedded GNU C Library: Binaries ii libgcc1 1:4.6.1-4 GCC support library libc0.1 recommends no packages. Versions of packages libc0.1 suggests: ii debconf [debconf-2.0] 1.5.41 Debian configuration management sy pn glibc-doc none (no description available) ii locales 2.13-14Embedded GNU C Library: National L -- debconf information excluded Index: i386/i386_get_gsbase.c === --- i386/i386_get_gsbase.c (revision 0) +++ i386/i386_get_gsbase.c (revision 0) @@ -0,0 +1,25 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include machine/sysarch.h + +int +i386_get_gsbase (void **addr) +{ + return __sysarch (I386_GET_GSBASE, addr); +} Index: i386/i386_set_gsbase.c === --- i386/i386_set_gsbase.c (revision 0) +++ i386/i386_set_gsbase.c (revision 0) @@ -0,0 +1,25 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include machine/sysarch.h + +int +i386_set_gsbase (void *addr) +{ + return __sysarch (I386_SET_GSBASE, addr); +} Index: i386/Makefile === --- i386/Makefile (revision 3681) +++ i386/Makefile (working copy) @@ -15,5 +15,5 @@ # For sys/vm86.h. sysdep_routines += i386_vm86 # For machine/sysarch.h. -sysdep_routines += i386_get_ldt i386_set_ldt +sysdep_routines += i386_get_ldt i386_set_ldt i386_get_fsbase i386_set_fsbase i386_get_gsbase i386_set_gsbase endif Index: i386/i386_get_fsbase.c === --- i386/i386_get_fsbase.c (revision 0) +++ i386/i386_get_fsbase.c (revision 0) @@ -0,0 +1,25 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include machine/sysarch.h + +int +i386_get_fsbase (void **addr) +{ + return __sysarch
Bug#637424: Implement i386_get_gsbase i386_get_fsbase i386_set_gsbase i386_set_fsbase amd64_get_gsbase amd64_get_fsbase amd64_set_gsbase amd64_set_fsbase
2011/8/11 Robert Millan r...@debian.org: Package: libc0.1 Version: 2.13-15 Severity: wishlist Tags: patch This patch implements the following syscall stubs: i386_get_gsbase i386_get_fsbase i386_set_gsbase i386_set_fsbase amd64_get_gsbase amd64_get_fsbase amd64_set_gsbase amd64_set_fsbase On second thought, these calls may interact badly with TLS if application code uses them. Maybe it's better not to export them. -- Robert Millan -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#637424: Implement i386_get_gsbase i386_get_fsbase i386_set_gsbase i386_set_fsbase amd64_get_gsbase amd64_get_fsbase amd64_set_gsbase amd64_set_fsbase
On Thu, Aug 11, 2011 at 10:02:18AM +, Robert Millan wrote: Package: libc0.1 Version: 2.13-15 Severity: wishlist Tags: patch This patch implements the following syscall stubs: i386_get_gsbase i386_get_fsbase i386_set_gsbase i386_set_fsbase amd64_get_gsbase amd64_get_fsbase amd64_set_gsbase amd64_set_fsbase In any case, they will have to wait for 2.14. Anyway, what are the uses cases for these? They only looks like wrappers (which means they don't necessarily need to be in glibc) to already existing functions, and they are not present in upstream glibc. I am not sure we really want these functions. -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurel...@aurel32.net http://www.aurel32.net -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#637424: Implement i386_get_gsbase i386_get_fsbase i386_set_gsbase i386_set_fsbase amd64_get_gsbase amd64_get_fsbase amd64_set_gsbase amd64_set_fsbase
2011/8/11 Aurelien Jarno aurel...@aurel32.net: In any case, they will have to wait for 2.14. Anyway, what are the uses cases for these? wine needs amd64_set_gsbase and i386_set_fsbase. amd64_set_fsbase and i386_set_gsbase are not used by any program that I know of. Also, they should be considered carefully: since our TLS implementation relies on them, programs shouldn't mess with these functions AFAICT. The getters are neither needed by wine nor dangerous. -- Robert Millan -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org