Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8831661imu; Sat, 29 Dec 2018 04:48:56 -0800 (PST) X-Google-Smtp-Source: AFSGD/WU67MzTCDvFrrBdb6Ge62H/9z1TWvcTHqu3+JzqQsDEnxBzznRQ0pCHC97jZQL6cQnE8dc X-Received: by 2002:a62:1b83:: with SMTP id b125mr32767331pfb.42.1546087736811; Sat, 29 Dec 2018 04:48:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546087736; cv=none; d=google.com; s=arc-20160816; b=BPFErhv2abyFh6+BQGcg+Hb7KKHWU3lEEkSPmqTrea3dmMBlo7zagflpCJGz54vltV nh7NidIAjPktewC5TIkXZ2BZShg+/Bhf1i6QknQkg+G6g+ym3A9EgJxNPueVj2NHRli2 GM6h1BtPFUbv494g2Jvf1gn+OOx16MUscoOEdd4Q2wahciurQoUsmNbgAxC7wVt6+qpb XJwIi6psKCu7thAA+VEYFSsgjKn1aVKSH6qcJMxpNbZRpzABfIB/VKlT7wbI3JYKVh0r cb/6I6Uc+W8xxLkEC3AZ6DI6DjNNNZfarV/knPBIfN5WCzMEe26vYiVxnGjrYoKpCXIu 3SAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=nTTS0Oxnwwq7zyBs96gq67nFjAvmBAPzbWc9nnfvnC4=; b=aeCSlvdHtHyGyvszqKHWGaaAsH+ICTSJsQNlVhu2yNps3XK2pvb4eyOXkcVubv4QTj ztDHlz+SaBqDe3ZQII+eoMR+gnTHnJ9cuIWwsFfYc291IspPtwqBTt/GsKI/IiKkFV3f Jboa8HNwU2jzI/BWIHN1jRehSVZFdOqgVnNCfGggy7EAtCp0OW8kqmjw2idew995HD4b WJUlRfZEYumh1dXA+Sp3mt2A5DJBMWioDtfZS3nisVWnePW0e855Wsd3LrfpFqEDp1tY LCy1XExlhJMrESsOR+lhzRR91pNA4baRr2Jc0/AM+n84NfqZ4SBK8S8z2C95uwIlTcJc K8oQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=eeP0JHlN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v25si11900285pfj.139.2018.12.29.04.48.41; Sat, 29 Dec 2018 04:48:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=eeP0JHlN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726862AbeL2By7 (ORCPT + 99 others); Fri, 28 Dec 2018 20:54:59 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:37346 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726011AbeL2By7 (ORCPT ); Fri, 28 Dec 2018 20:54:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=nTTS0Oxnwwq7zyBs96gq67nFjAvmBAPzbWc9nnfvnC4=; b=eeP0JHlNVWPxJCgyT0Z7ODkiU gyJyv6qzAjCPY0oAzkQJd9ySgdGDSVNsNVY0eA+Qjg6Bt6S0s/6pynnOz7j95/4qZbYKNwptrRDHp YMTqdbtDpogacU/Craod/g4wf2Ue6e+JqIXmI+OwaLHwaDBHrDzajoyE7H7K6qsTF9S/Il9CZI+Gc JWPeaoHtITwpDZZWqs8CMs3tSlkXFM4GQmTcABLHct3WS9Tvd5PRjL+TrGjkB+w/XrqdLmufkoK8K 8RzucHQuFNK32RR0aebK4fgtzED5VXLeVOGoUEa7u28psKlYFq+dM7fL0sC/4dyZtAbcudaoxLWpT kMeNpJxDA==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1gd3q2-0004CV-9V; Sat, 29 Dec 2018 01:54:54 +0000 Date: Fri, 28 Dec 2018 17:54:54 -0800 From: Matthew Wilcox 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 Subject: Re: [Qemu-devel] d_off field in struct dirent and 32-on-64 emulation 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: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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?