This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [Qemu-devel] d_off field in struct dirent and 32-on-64 emulation
- From: Peter Maydell <peter dot maydell at linaro dot org>
- To: Andy Lutomirski <luto at kernel dot org>
- Cc: Matthew Wilcox <willy at infradead dot org>, Andreas Dilger <adilger at dilger dot ca>, Florian Weimer <fw at deneb dot enyo dot de>, linux-fsdevel <linux-fsdevel at vger dot kernel dot org>, Linux API <linux-api at vger dot kernel dot org>, Ext4 Developers List <linux-ext4 at vger dot kernel dot org>, Latchesar Ionkov <lucho at ionkov dot net>, libc-alpha <libc-alpha at sourceware dot org>, Arnd Bergmann <arnd at arndb dot de>, Eric Van Hensbergen <ericvh at gmail dot com>, "H. Peter Anvin" <hpa at zytor dot com>, lkml - Kernel Mailing List <linux-kernel at vger dot kernel dot org>, QEMU Developers <qemu-devel at nongnu dot org>, Ron Minnich <rminnich at sandia dot gov>, V9FS Developers <v9fs-developer at lists dot sourceforge dot net>
- Date: Sun, 30 Dec 2018 13:59:17 +0000
- Subject: Re: [Qemu-devel] d_off field in struct dirent and 32-on-64 emulation
- References: <87bm56vqg4.fsf@mid.deneb.enyo.de> <CAFEAcA92m4vhzjJ+B=mP_o6Wfhx1XSKo3uWxah3osh=u5UXFuw@mail.gmail.com> <9C6A7D45-CF53-4C61-B5DD-12CA0D419972@dilger.ca> <CAFEAcA9W+JK7_TrtTnL1P2ES1knNPJX9wcUvhfLwxLq9augq1w@mail.gmail.com> <1EF1B31A-83D8-4642-BEBF-F56E45485223@dilger.ca> <CAFEAcA8Yq=CEyAUer1TcaSzuzcdNi3OUi4c67B6e+OkhmcKvbg@mail.gmail.com> <20181229015453.GA6310@bombadil.infradead.org> <CALCETrUJn4cV+o3scP1EzYS=JA--5KUXvjuxZDbsnhXra1vrwA@mail.gmail.com>
On Sat, 29 Dec 2018 at 16:49, Andy Lutomirski <luto@kernel.org> wrote:
> > Could you use a prctl to set whether you were running in 32 or 64 bit
> > mode? Or do you change which kind of task you're emulating too often
> > to make this a good idea?
QEMU's linux-user mode always only runs the single process,
which is a fixed guest architecture. But it also wants to
make system calls on its own behalf, as well as the ones it
is passing through from the guest, and I suspect it would
confuse the host libc if we changed the semantics of those
under its feet.
> How would this work? We already have the separate
> COMPAT_DEFINE_SYSCALL entries *and* in_compat_syscall(). Now we’d have
> a third degree of freedom.
>
> Either the arches people care about should add reasonable ways to
> issue 32-bit syscalls from 64-bit mode or there should be an explicit
> way to ask for the 32-bit directory offsets.
The first of those is not sufficient for QEMU if done
as a per-architecture thing, because there may not even be
a 32-bit syscall interface on the host kernel. The second
sounds better -- there's nothing conceptually architecture
specific about what we want to do or which is tied to the
idea of whether there's a 32-bit compat mode in the host
architecture or not.
thanks
-- PMM