Received: by 2002:a25:d783:0:0:0:0:0 with SMTP id o125csp768375ybg; Thu, 19 Mar 2020 08:25:32 -0700 (PDT) X-Google-Smtp-Source: ADFU+vs30ePbH3Rp4WYQCvXTyZM+7Ji2gbLvFcDBSsbcvqka5gOM8aE+evBqUO+bnTu7XErI6x3o X-Received: by 2002:aca:4444:: with SMTP id r65mr2817848oia.76.1584631532359; Thu, 19 Mar 2020 08:25:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584631532; cv=none; d=google.com; s=arc-20160816; b=o4hxBdVfJEFdwDLP9mIoqYF3Oa/SXsxNSES8hkQms43EIRUX0eJg7yECRsTYHqN+ys L6dcE8vbW7FY6ndV+bKb+CvzRrfdGHv853W7RY0OU63SFq1ljo+M0B+HIW9tRaJd9T1z hMZi/qgCaIDIlKLDdOh07wlvSkXbAXv2Xn9ejDRNCltnFGpECT460VwNJ0zeePWRjJYo 3xIgz04uUqbFWT5kyGXnrM3maNZG7gU+rnHJNhQ905b8XdmnIiyaRWMDr76+FsBBAsS5 8rTUky3Kk4CVA/IwJhbrAjuDX+EqpHIw8a8/EAJo93n6P9VficVYYuOEVgghivXBU5UR 8XGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=jyRv3rP13OdLMBv8QRB7zdcpaPYtYEwSo56+MzJ+ZFs=; b=MfuTPmj5ydLK1poB6092Dr3+/Z6N2dGyBdoAHt8hZRXYW65P0WCBXnAWzhI9FqwQrf HAk1HVT67Ja0HOOC3QyCbn1kJV6m1DT19vxUqvFDpgXa1BRlwc8uog9pUsAuRV4+Llxa MOYPRr/qig8sIOKSVFVA0UnIKlPaYiqfYGMKflNk55E+Px5hNO3EKm4NvceeJXGa4s2U gASHq1k3zt89tv8TebhselVwGGGsY9oWSoXnVYPAI0eRQ3/GjjjGYbNTMb9WShrk3/5u yNx1tnc+PwcWzceRef7OGx/TgYSKxoEx2RnjGFxc23hVm5bF0a9JMq22hL+Na1BXe5l3 RQcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="nzCTjk/W"; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-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 w16si1492430otl.217.2020.03.19.08.25.19; Thu, 19 Mar 2020 08:25:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-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="nzCTjk/W"; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-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 S1726871AbgCSPZO (ORCPT + 99 others); Thu, 19 Mar 2020 11:25:14 -0400 Received: from mail-oi1-f196.google.com ([209.85.167.196]:35861 "EHLO mail-oi1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727001AbgCSPZO (ORCPT ); Thu, 19 Mar 2020 11:25:14 -0400 Received: by mail-oi1-f196.google.com with SMTP id k18so3088215oib.3 for ; Thu, 19 Mar 2020 08:25:14 -0700 (PDT) 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; bh=jyRv3rP13OdLMBv8QRB7zdcpaPYtYEwSo56+MzJ+ZFs=; b=nzCTjk/WTGmmxNxA/H2Cm1aSINgVwKRL8P40cMXfECaWzeOSAETe1qT50eksA8E/7M d6GjSn2pnegk1NyifuP79dQ9dC84a8nmHM4syOqSu8g2d0cBsI9pyKnyp9aAHhpNWDgl SI5Sw4lRrTbSnV6BRVaNrD9l0O94eJvI9K0GDjWRZmWyg2PtbD4PFVnNrS+SC3zVHxiW ZZ9EZXoe4IZ+toL1KWsOxuyDqnbxAMygRUUttkQTKU0AyzcXRMRCFCeRdACmmtUKb8GO 0kw84WtHRP2nsNgF9//Ikrxe0/kAALjzDPNwSPDsWSh+XO5iP74e7dP5Gs+/reJiePmq WfEA== 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; bh=jyRv3rP13OdLMBv8QRB7zdcpaPYtYEwSo56+MzJ+ZFs=; b=JU6x16gWdnIYVfZtA+kUg6dKqxPXKSpi+SrrMHX+8AclQXoUUjavaUitsUCk7Gl91S 5Vvjju/Aj3VIZjwe7lzrNqpdzS3TylOxWahE2lsACZfAbJzV0VJJSPcTgjRytHcZjxXH 5oGcvWJCzJk/T5O6M8VmY2I8/0GVZjp2sIu4ke+hBz7mKBlQPL4zgXZ8QpE41RRN+5cg tfyJw/YYrBJ6cXkfLr93OhCKzkNE0yBkriXZTpU7jiiByBidrDkIjBWq3FERuUtw9d8L r9yPvygUVh9qvrrBvA+Xtcu+2mh1qIeK1HeLQqqoC4brsgWL0/7EzCFSq1fKJuffBBJ1 srCg== X-Gm-Message-State: ANhLgQ1/12gYW080ex/52Y7YpE5tetnQUxmNGNC0VU2kv06RFxK5Iz2u GGop9+hUG2KLiEHVbyOU8WtwbodhUIZOzE0lPPb2Ng== X-Received: by 2002:aca:c695:: with SMTP id w143mr2824247oif.98.1584631513703; Thu, 19 Mar 2020 08:25:13 -0700 (PDT) MIME-Version: 1.0 References: <20200317113153.7945-1-linus.walleij@linaro.org> In-Reply-To: From: Peter Maydell Date: Thu, 19 Mar 2020 15:25:02 +0000 Message-ID: Subject: Re: [PATCH] ext4: Give 32bit personalities 32bit hashes To: Linus Walleij Cc: "Suzuki K. Poulose" , "Theodore Ts'o" , Andreas Dilger , Ext4 Developers List , linux-fsdevel , Linux API , QEMU Developers , Florian Weimer , Andy Lutomirski , stable Content-Type: text/plain; charset="UTF-8" Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Thu, 19 Mar 2020 at 15:13, Linus Walleij wrote: > On Tue, Mar 17, 2020 at 12:58 PM Peter Maydell wrote: > > What in particular does this personality setting affect? > > My copy of the personality(2) manpage just says: > > > > PER_LINUX32 (since Linux 2.2) > > [To be documented.] > > > > which isn't very informative. > > It's not a POSIX thing (not part of the Single Unix Specification) > so as with most Linux things it has some fuzzy semantics > defined by the community... > > I usually just go to the source. If we're going to decide that this is the way to say "give me 32-bit semantics" we need to actually document that and define in at least broad terms what we mean by it, so that when new things are added that might or might not check against the setting there is a reference defining whether they should or not, and so that userspace knows what it's opting into by setting the flag. The kernel loves undocumented APIs but userspace consumers of them are not so enamoured :-) As a concrete example, should "give me 32-bit semantics via PER_LINUX32" mean "mmap should always return addresses within 4GB" ? That would seem like it would make sense -- but on the other hand it would make it absolutely unusable for QEMU's purposes, because we want to be able to do full 64-bit mmap() for our own internal allocations. (This is a specific example of the general case that I'm dubious about having this be a process-wide switch, because QEMU is a single process which sometimes makes syscalls on its own behalf and sometimes makes syscalls on behalf of the guest program it is emulating. We want 32-bit semantics for the latter but if we also get them for the former then there might be unintended side effects.) > I would not be surprised if running say i586 on x86_64 > has the same problem, just that noone has reported > it yet. But what do I know. If they have the same problem > they can use the same solution. Hm QEMU supports > emulating i586 or even i386 ... maybe you could test? Native i586 code on x86-64 should be fine, because it will be using the compat syscalls, which ext4 already ensures get the 32-bit sized hash (see hash2pos() and friends). thanks -- PMM