Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp9813183imu; Sun, 30 Dec 2018 06:02:56 -0800 (PST) X-Google-Smtp-Source: ALg8bN4ZpeZGVh3m0w745Qz0GHMOhsNXbdBzj3uOA57dmIn/Xo7InJe0jkrGrH2z9LQ5pL5Io11Z X-Received: by 2002:a63:b649:: with SMTP id v9mr4610727pgt.436.1546178576882; Sun, 30 Dec 2018 06:02:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546178576; cv=none; d=google.com; s=arc-20160816; b=dIi9TuHjQYailY7HKvuexxR1WFYUD/FAGZZ3Q91d2jt/TpHzzWW2mBAg4exqFodz/i 9FYp88SHwXzOq3SQ0avcWvBAq5bVnasmwQje+gR/kid+yofKRHq5567LtQ6vfbwVPNEO /90VCkOC8upecJGPIiq0qM9ZpCIlNKIKBL4cUgmlpA7mkXYWD1ICdMoJeQ1VENe9Zusc bfGwMy7rXCO3PwEi8nB3Z4EMq+d17eKjW2ov9IyTiPw7fOZDb006mwBSuHcnYpkm+OY0 N3+jODvcrbqiLmHJFqydpfltbT6Y3/gtrVlvmi6Cej7g3ix0zDYN+AUlJsdfF5QWBDKW xDLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=3160XWMiyGzMoXzkO7EYYdMp0aFg5cJaC9940mnNcWo=; b=YZb7SzBcT66aMOwAhdcCcFpZJNqHnJfQ35CPsdAZJLJP6TTIHIZjSlr6+Vub7Puerf P+48qvmu8D3E82K1KB3j+Z5AkpmRse9A3O8vDfInfjRCuvSA7AM1hwej7i2dXErPZE1s /+VOkEJM3lJTbKRhdLAab8q4GmMhpvVk4vJP/0QXuaBS5DYDyxXW/702yqajFBbjhaE7 uYXvNqvtnsmS7Q+060hE4I8duArXZVmJE/NEuy78hO2LmGaqmhdHqJqmC+AJV9kcq56h pIDC+qE47H04CcEOKRyd0N9v1r0IeskPViJm1Od/zQQHF98IHl8Rkg+He3f9ucLC2n/l vMIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XKc2RPvZ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g31si26346583pld.358.2018.12.30.06.02.28; Sun, 30 Dec 2018 06:02: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=pass header.i=@linaro.org header.s=google header.b=XKc2RPvZ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726132AbeL3N7a (ORCPT + 99 others); Sun, 30 Dec 2018 08:59:30 -0500 Received: from mail-ot1-f67.google.com ([209.85.210.67]:40033 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725954AbeL3N73 (ORCPT ); Sun, 30 Dec 2018 08:59:29 -0500 Received: by mail-ot1-f67.google.com with SMTP id s5so21964689oth.7 for ; Sun, 30 Dec 2018 05:59:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=3160XWMiyGzMoXzkO7EYYdMp0aFg5cJaC9940mnNcWo=; b=XKc2RPvZQVeuWAaTWfgDbuJio2dLv/dbkoWL4LNQyLCxXhAUoUiq9uAXVuBeopBk68 iAeRKjI6jmj+SkFQIeh9ndywg6YUskgg9WYejOpoTnVTw+rlrj5C2HTKGXdX4SGEHt+A 1WPCk1olN0QdCFvFTbAlUv2HP8jwmnKKNXXto= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=3160XWMiyGzMoXzkO7EYYdMp0aFg5cJaC9940mnNcWo=; b=JoE2aBznfHpedeD0DbqM8Q9JPLiWQhOWjC4vux+wS20RVuRce7q2umLc7bft1XkeBi 6NmNKyo0f3DjSvHQ8uR0o4Vq1+5HeHVJDkmTq7qbSk9KOQ+jR3WOLaetnozT5YIFJpl9 mdBgHH7M+9lVDyUpNIfdlvOJGtZDKgDhaQVmICtoN92N80TKExynQCH/SJ0RkVen6X20 5NHsRiN2C5SBqTKH7W68M66dwZEMBxXOBuLPXlYiLH2kHoDTfmDuqN3AfIaDtq8nLYJa GK8xjZh5mLfLN/2VrPsPdwHoWc/5m7T82K8b5kzcMkVXxWQnNXPn2/dAJz910Ao0AILn uD7A== X-Gm-Message-State: AJcUukf9RqM91PPzqCURSHqYGKdHUQrxR/Sd7EhJdcTXd2xhyXCsMJL4 BLMfVU3ShOIQlS6zVGeuRws6CmdIeby6X/muzEGSSA== X-Received: by 2002:a9d:6f0b:: with SMTP id n11mr5442838otq.363.1546178368822; Sun, 30 Dec 2018 05:59:28 -0800 (PST) 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: From: Peter Maydell Date: Sun, 30 Dec 2018 13:59:17 +0000 Message-ID: Subject: Re: [Qemu-devel] d_off field in struct dirent and 32-on-64 emulation To: Andy Lutomirski Cc: Matthew Wilcox , 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 29 Dec 2018 at 16:49, Andy Lutomirski 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=E2=80=99d= 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