From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:36285) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gd3vo-0005Pa-OO for qemu-devel@nongnu.org; Fri, 28 Dec 2018 21:00:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gd3qW-0002O7-1W for qemu-devel@nongnu.org; Fri, 28 Dec 2018 20:55:25 -0500 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]:56290) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gd3qU-0001Z3-0a for qemu-devel@nongnu.org; Fri, 28 Dec 2018 20:55:23 -0500 Date: Fri, 28 Dec 2018 17:54:54 -0800 From: Matthew Wilcox Message-ID: <20181229015453.GA6310@bombadil.infradead.org> References: <87bm56vqg4.fsf@mid.deneb.enyo.de> <9C6A7D45-CF53-4C61-B5DD-12CA0D419972@dilger.ca> <1EF1B31A-83D8-4642-BEBF-F56E45485223@dilger.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] d_off field in struct dirent and 32-on-64 emulation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Andreas Dilger , Florian Weimer , linux-fsdevel , Linux API , Ext4 Developers List , Latchesar Ionkov , libc-alpha@sourceware.org, Arnd Bergmann , Eric Van Hensbergen , hpa@zytor.com, lkml - Kernel Mailing List , QEMU Developers , rminnich@sandia.gov, v9fs-developer@lists.sourceforge.net On Sat, Dec 29, 2018 at 12:12:27AM +0000, Peter Maydell wrote: > On Fri, 28 Dec 2018 at 23:16, Andreas Dilger wrot > > On Dec 28, 2018, at 4:18 AM, Peter Maydell 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?