[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Debian's 32-bit glibc vs AT_SYSINFO




On Sep 25, 2015 12:03 AM, "Aurelien Jarno" <aurelien@aurel32.net> wrote:
>
> On 2015-09-24 15:15, Andy Lutomirski wrote:
> > On Thu, Sep 24, 2015 at 3:12 PM, Aurelien Jarno <aurelien@aurel32.net> wrote:
> > > On 2015-09-24 14:19, Andy Lutomirski wrote:
> > >> Hi-
> > >>
> > >> It looks like 32-bit x86 Debian glibc doesn't use AT_SYSINFO.  This
> > >> kills syscall performance.  Upstream glibc as well as Fedora's glibc
> > >> work fine.
> > >>
> > >> This test:
> > >>
> > >> https://git.kernel.org/cgit/linux/kernel/git/luto/linux.git/commit/?h=x86/entry_compat&id=9d742073d4c0449b262dbe0a3dab4a7c1d831500
> > >>
> > >> inadvertently found this issue.
> > >>
> > >> Any ideas?  I'm only barely a Debian user -- I have a Debian-based test VM.
> > >
> > > By default, the 32-bit glibc on Debian is built for i586, which does not
> > > have the sysenter/syscall instructions. Therefore it doesn't use
> > > AT_SYSINFO.
> >
> > I find this a bit odd.  glibc isn't supposed to have those
> > instructions, and i586 kernels will still provide AT_SYSINFO (I
> > think), and it'll still work.  Is this a Debian-specific thing?
>
> Yes, i586 kernels provide AT_SYSINFO, but it can't be used by the glibc,
> as int 0x80 has to be used for syscall on i586 processors. It's nothing
> specific to Debian, it's like that in upstream glibc. See:
>
>   https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
> and
>   https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/i386/dl-sysdep.h
>

OK, that's weird.  I really hope the kernel never had a bug in which AT_SYSINFO pointed at SYSENTER on a system that didn't support SYSENTER.

--Andy


Reply to: