From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 59351 invoked by alias); 29 Dec 2018 16:49:37 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 59341 invoked by uid 89); 29 Dec 2018 16:49:37 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: =?ISO-8859-1?Q?No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS autolearn=ham version=3.3.2 spammy=we, we=e2, matthew, Hx-languages-length:1856?= X-HELO: mail.kernel.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1546102174; bh=mMN6xBzLLeHIs79oTtJhx2Vtm0hgPai1doa5+uzb9ic=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=iwTeC8epy4/VrlO/x5hBZlgjcjHqThxDfP9I2Pk9vzdLZJustDPwMj4DlACfl16VH +vxuANxgZl0MKnyP+LYKWpjGqDmIisI8H7WsUazj4s04/tbZgJhNj5Sky7SQnlO3xI rmDNNLTXunK3X8ZLthccrdHlM8vRL9CX4Ij52Ysw= MIME-Version: 1.0 References: <87bm56vqg4.fsf@mid.deneb.enyo.de> <9C6A7D45-CF53-4C61-B5DD-12CA0D419972@dilger.ca> <1EF1B31A-83D8-4642-BEBF-F56E45485223@dilger.ca> <20181229015453.GA6310@bombadil.infradead.org> In-Reply-To: <20181229015453.GA6310@bombadil.infradead.org> From: Andy Lutomirski Date: Mon, 31 Dec 2018 00:26:00 -0000 Message-ID: Subject: Re: [Qemu-devel] d_off field in struct dirent and 32-on-64 emulation To: Matthew Wilcox Cc: Peter Maydell , Andreas Dilger , Florian Weimer , linux-fsdevel , Linux API , Ext4 Developers List , Latchesar Ionkov , libc-alpha , Arnd Bergmann , Eric Van Hensbergen , "H. Peter Anvin" , lkml - Kernel Mailing List , QEMU Developers , Ron Minnich , V9FS Developers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-SW-Source: 2018-12/txt/msg01032.txt.bz2 > On Dec 28, 2018, at 6:54 PM, Matthew Wilcox wrote: > >> 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 w= rote: >>>> 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? How would this work? We already have the separate COMPAT_DEFINE_SYSCALL entries *and* in_compat_syscall(). Now we=E2=80=99d h= ave 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.