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: Matthew Wilcox <willy at infradead dot org>
- To: Peter Maydell <peter dot maydell at linaro dot org>
- Cc: 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 at sourceware dot org, Arnd Bergmann <arnd at arndb dot de>, Eric Van Hensbergen <ericvh at gmail dot com>, 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>, rminnich at sandia dot gov, v9fs-developer at lists dot sourceforge dot net
- Date: Fri, 28 Dec 2018 17:54:54 -0800
- 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>
On Sat, Dec 29, 2018 at 12:12:27AM +0000, Peter Maydell wrote:
> On Fri, 28 Dec 2018 at 23:16, Andreas Dilger <adilger@dilger.ca> wrot
> > On Dec 28, 2018, at 4:18 AM, Peter Maydell <peter.maydell@linaro.org> wrote:
> > > The problem is that there is no 32-bit API in some cases
> > > (unless I have misunderstood the kernel code) -- not all
> > > host architectures implement compat syscalls or allow them
> > > to be called from 64-bit processes or implement all the older
> > > syscall variants that had smaller offets. If there was a guaranteed
> > > "this syscall always exists and always gives me 32-bit offsets"
> > > we could use it.
> >
> > The "32bitapi" mount option would use 32-bit hash for seekdir
> > and telldir, regardless of what kernel API was used. That would
> > just set the FMODE_32BITHASH flag in the file->f_mode for all files.
>
> A mount option wouldn't be much use to QEMU -- we can't tell
> our users how to mount their filesystems, which they're
> often doing lots of other things with besides running QEMU.
> (Otherwise we could just tell them "don't use ext4", which
> would also solve the problem :-)) We need something we can
> use at the individual-syscall level.
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?