Received: by 10.213.65.68 with SMTP id h4csp467931imn; Fri, 30 Mar 2018 08:57:30 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+b4hGaUmtaKW3h1HoVoAbKg7p4A8HXAfV9v8OwyVeHS19PxJt0BiRJdwYAmaKxfpZvcIeo X-Received: by 2002:a17:902:aa96:: with SMTP id d22-v6mr7365647plr.106.1522425450637; Fri, 30 Mar 2018 08:57:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522425450; cv=none; d=google.com; s=arc-20160816; b=xWZSGyff9MjLoZFtCfE9a75Dgnaw1tyj2Ybwu75IYZiON/ZH2o93CQJl80jD2wtQKI R5NbjXFJ6NJrtFkqBWZ8YO/027OuKc4yQ7cj2av7n0KmoTssMldbdEPWXdb3vOw4yIR6 V9hUacIPnZt6BcELFRPXUxh5ewtj64LebbngtBfcfkkLHjQJ8m2TNkMktubY1a3Exda7 FiFPmDDg1Fqw66NlBlzoAezH9ZKQYIh1QCPGtU7uyyDoJKJNiSp79tXsXkzVBsKzzvGB sCssTOzWHNG9QTaFSaR8W4LgeM1AzonEa15flCN6VyO++Xw6TUgbQRf4beauE4wvDwzp TnWQ== 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:arc-authentication-results; bh=5YNXBaYjYO2Zb6JorGdlgKlHh0a9rRw/+riCGs8IKgk=; b=hQ1ZT31bcBlQ888GvuHR6wOybVeAwh/UN3EwSC9eQh215p+LRpD0x3/FtLNFC7berq a5Nlf7Gpl4m9/wtWshx2x3oWz8wqWAr18sW4Vy3+aHnltDVUmjNN4g0NlLqed4voX8rZ OBNWT1aOKTqEbS08SQpumKocEprrfT9DOoPnUnHH1m4ampGRXZSGRiF3s46Im1ojsxao cBiQhPzi0LMBI3qvwSXl8P7JEcxJpQYrJTcNRyC98H6vDdu+Ks9Qag/6MViaworDSI2K jlwpsG9qjRqDZyFnsxHrieUxVBfY4rNOHAzveBMWBtrSLHOp3dzSjBPSAUiP5trWuw49 acaw== ARC-Authentication-Results: i=1; mx.google.com; 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 m23-v6si3877552pls.311.2018.03.30.08.57.16; Fri, 30 Mar 2018 08:57:30 -0700 (PDT) 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; 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 S1752086AbeC3P4K (ORCPT + 99 others); Fri, 30 Mar 2018 11:56:10 -0400 Received: from tartarus.angband.pl ([89.206.35.136]:60796 "EHLO tartarus.angband.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751147AbeC3P4H (ORCPT ); Fri, 30 Mar 2018 11:56:07 -0400 Received: from kilobyte by tartarus.angband.pl with local (Exim 4.89) (envelope-from ) id 1f1wMd-0001wK-BC; Fri, 30 Mar 2018 17:54:51 +0200 Date: Fri, 30 Mar 2018 17:54:51 +0200 From: Adam Borowski To: Ingo Molnar Cc: John Paul Adrian Glaubitz , Linus Torvalds , Al Viro , Dominik Brodowski , Linux Kernel Mailing List , Arnd Bergmann , linux-arch , Ralf Baechle , James Hogan , linux-mips , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , ppc-dev , Martin Schwidefsky , Heiko Carstens , linux-s390 , "David S . Miller" , sparclinux@vger.kernel.org, Ingo Molnar , Jiri Slaby , the arch/x86 maintainers Subject: Re: [RFC] new SYSCALL_DEFINE/COMPAT_SYSCALL_DEFINE wrappers Message-ID: <20180330155451.4rppf7iy2e3wzimh@angband.pl> References: <20180322001532.GA18399@ZenIV.linux.org.uk> <20180326004017.GA2211@ZenIV.linux.org.uk> <20180326034750.GN30522@ZenIV.linux.org.uk> <428751c8-6920-096b-8694-a3f1b8990bdf@physik.fu-berlin.de> <8a8ee344-fb19-3ed9-f7dc-db63f703e6d3@physik.fu-berlin.de> <7753539f-c72d-9e5a-eb2d-939e5514404b@physik.fu-berlin.de> <20180330105802.7df5pacjfqsqwa6l@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="rubjl4urpbxgxvwa" Content-Disposition: inline In-Reply-To: <20180330105802.7df5pacjfqsqwa6l@gmail.com> X-Junkbait: aaron@angband.pl, zzyx@angband.pl User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: kilobyte@angband.pl X-SA-Exim-Scanned: No (on tartarus.angband.pl); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --rubjl4urpbxgxvwa Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Mar 30, 2018 at 12:58:02PM +0200, Ingo Molnar wrote: > * John Paul Adrian Glaubitz wrote: >=20 > > On 03/27/2018 12:40 PM, Linus Torvalds wrote: > > > On Mon, Mar 26, 2018 at 4:37 PM, John Paul Adrian Glaubitz > > > wrote: > > >> > > >> What about a tarball with a minimal Debian x32 chroot? Then you can > > >> install interesting packages you would like to test yourself. > Here's the direct download link: > $ wget https://people.debian.org/~glaubitz/chroots/debian-x32-unstable.= tar.gz > Seems to work fine here (on a distro kernel) even if I extract all the fi= les as a=20 > non-root user and do: >=20 > ~/s/debian-x32-unstable> fakechroot /usr/sbin/chroot . /usr/bin/dpkg -l= | tail -2 >=20 > ERROR: ld.so: object 'libfakechroot.so' from LD_PRELOAD cannot be prelo= aded (cannot open shared object file): ignored. > ii util-linux:x32 2.31.1-0.5 x32 miscellane= ous system utilities > ii zlib1g:x32 1:1.2.8.dfsg-5 x32 compressio= n library - runtime > So that 'dpkg' instance appears to be running inside the chroot environme= nt and is=20 > listing x32 installed packages. > Although I did get this warning: > ERROR: ld.so: object 'libfakechroot.so' from LD_PRELOAD cannot be prelo= aded (cannot open shared object file): ignored. > Even with that warning, is still still a sufficiently complex test of x32= syscall=20 > code paths? Instead of mucking with fakechroot which would require installing its :x32 part inside the guest, or running the test as root, what about using any random static binary? For example, a shell like sash or bash-static would have a decentish syscall coverage even by itself. I've extracted sash from http://ftp.ports.debian.org/debian-ports//pool-x32/main/s/sash/sash_3.8-4_x= 32.deb and placed at https://angband.pl/tmp/sash.x32 $ sha256sum sash.x32=20 de24097c859b313fa422af742b648c9d731de6b33b98cb995658d1da16398456 sash.x32 Obviously, you can compile a static binary that uses whatever syscalls you want. Without a native chroot, you can "gcc -mx32" although you'd need some kind of libc unless your program is stand-alone. It might be worth mentioning my "arch-test: https://github.com/kilobyte/arch-test Because of many toolchain pieces it needs, you want a prebuilt copy: https://github.com/kilobyte/arch-test/releases/download/v0.10/arch-test_pre= built_0.10.tar.xz https://github.com/kilobyte/arch-test/releases/download/v0.10/arch-test_pre= built_0.10.tar.xz.asc -- while it has _extremely_ small coverage of syscalls (just write() and _exit(), enough to check endianness and pointer width), concentrating on instruction set inadequacies (broken SWP on arm, POWER7 vs POWER8, powerpc vs powerpcspe, etc), it provides minimal test binaries for a wide range of architectures. Meow! --=20 =E2=A2=80=E2=A3=B4=E2=A0=BE=E2=A0=BB=E2=A2=B6=E2=A3=A6=E2=A0=80 =E2=A3=BE=E2=A0=81=E2=A2=B0=E2=A0=92=E2=A0=80=E2=A3=BF=E2=A1=81 I was born = a dumb, ugly and work-loving kid, then I got swapped on =E2=A2=BF=E2=A1=84=E2=A0=98=E2=A0=B7=E2=A0=9A=E2=A0=8B=E2=A0=80 the materni= ty ward. =E2=A0=88=E2=A0=B3=E2=A3=84=E2=A0=80=E2=A0=80=E2=A0=80=E2=A0=80 --rubjl4urpbxgxvwa Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE1EvJgtm22kuq1XITcZ3MgL7QB/kFAlq+XcsACgkQcZ3MgL7Q B/mYBRAAi4LT3AZExNjOZ6td+RWmTVjWPKGJeWViLzuBcVteXwZQnkidx395scxR jv8kVqCqAxmEMyTdUwBxPQYb1i9e0A9+oPLQCG/U18HN9/4Z5pfAWnv5qgI5xhpM wLebeo75Irgpg9V40C+7pJ3e6zYit22ehx8YCDqFbj0JXy1aGgcd5URJYFBmGC7S O2Cvjaehfg/V6gTJ+U/7mbtlxeWVxW94dXHVnV+K1Q9Wh+vQcfHVrp7XmQZPZTSh H5UqErkBPSX5K8zTYRyfQry87dZblsk4OXdcX8Jld7UBceymu6Cbt7I9CGMRUART 030Y5YUPVKWHaoXkR9GqQOjzp7nauiUcPsekkh+Sym62BIUiXoY6dqKqJpgOuvCe vhOgTyaspRaT1HRQUQTRLEOGEjK/x9ULY9RaHAwBZunzkz5CS41jq9SHJCza8JL6 ATx6BYhAo0Ulw0YHFxaKugEsiyo6HdEoqsH3IwwGMqvinYguQ76Q19zggjxRei3Z aa9bS6/6hGJhXiLHi9C35syrsddB/RcijZ6W8jVzrO8zTHUQPcrGAsB0yl+Jfn5s QD5zvQg1uO7756S6vfYapD6LWZ8pEczStkc1WmJN0cd6BJsgyd5sD5nELGqSCEW5 DYSEmMre+Esljha61BC9FrWAjSxfbUYXa9IipzgB0L3N26s+Qbw= =nksn -----END PGP SIGNATURE----- --rubjl4urpbxgxvwa--