From patchwork Fri Jul 22 19:45:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 9244181 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 50F9D60757 for ; Fri, 22 Jul 2016 19:45:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 40BDE27FAD for ; Fri, 22 Jul 2016 19:45:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 30DDA27FAB; Fri, 22 Jul 2016 19:45:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8431E27FAB for ; Fri, 22 Jul 2016 19:45:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753699AbcGVTpQ (ORCPT ); Fri, 22 Jul 2016 15:45:16 -0400 Received: from mail-qt0-f181.google.com ([209.85.216.181]:35516 "EHLO mail-qt0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751861AbcGVTpO (ORCPT ); Fri, 22 Jul 2016 15:45:14 -0400 Received: by mail-qt0-f181.google.com with SMTP id x25so67615031qtx.2 for ; Fri, 22 Jul 2016 12:45:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=RUxfuAP7KCFUfl6tlKFOt7BXMnw9NbIhETSwCjeb0/c=; b=dkS/PN0p1Ek5yKRwBAtMALGvqLQtcBOedh9JpjXX/MjwgDYguNkPzdXKUNShQkWqZm Ijq2U0rVguOJhRKIueNYA0fd0YmolCLHyVDys2InsbuT0eYcq5EEJYJjgtRRGHxeOjmO NOJ7c61cm5cC5OBz188cvoQQiMfX4ZOJv+hS4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=RUxfuAP7KCFUfl6tlKFOt7BXMnw9NbIhETSwCjeb0/c=; b=DfR1JDE2ApOkc0fBEaB1sHy92pSB9Ow/7QkJ309rLROAQ6+9YrVZKUC6R+d9p5KlSA 60PQRcXbXT7KhdQOUIrjTlqwP9MkMoF4ezYsHBvQKQYrk1yat+fzICeOSY8MpAUz4F0E vm/xQKSCpI+99zKhXoWi1RtYpHZ8QU1TdA2b7wbvu6qTw77HR/Yh8Og1V7V8MO2cJD/r FI8LdnlLW9E5RoZCcUmdIdvAy3Dt0nON6jVFy1ZCVGfooay7p9Zdx9DxrJRfCFvTG0rB zw6YGU/GjSvo3pmgkbetnFuS3LMyKdSbAmoYOi/FShB1kVuyZ1AfCfEteZtwRxxjwDao r1yg== X-Gm-Message-State: AEkoouslhXwCYIZbIL3NjL3oRM2Qkr9pHkTtgJJcpOmUVEWjClZSsfB3VzS7Idf0kpvSG2Dg X-Received: by 10.200.50.199 with SMTP id a7mr9049651qtb.43.1469216713478; Fri, 22 Jul 2016 12:45:13 -0700 (PDT) Received: from xanadu.home ([2607:fa48:6e39:d410:feaa:14ff:fea7:ed77]) by smtp.gmail.com with ESMTPSA id 2sm8185936qta.2.2016.07.22.12.45.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Jul 2016 12:45:12 -0700 (PDT) Date: Fri, 22 Jul 2016 15:45:11 -0400 (EDT) From: Nicolas Pitre To: Russell King - ARM Linux cc: Greg Ungerer , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Alexander Viro , David Howells , One Thousand Gnomes Subject: Re: [PATCH v4 00/12] allow BFLT executables on systems with a MMU In-Reply-To: <20160722192250.GP1041@n2100.armlinux.org.uk> Message-ID: References: <1469042561-7360-1-git-send-email-nicolas.pitre@linaro.org> <6d7b45eb-8085-47fa-fc31-5fb26b7dd009@linux-m68k.org> <20160722192250.GP1041@n2100.armlinux.org.uk> User-Agent: Alpine 2.20 (LFD 67 2015-01-07) MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Fri, 22 Jul 2016, Russell King - ARM Linux wrote: > On Fri, Jul 22, 2016 at 05:28:13PM +1000, Greg Ungerer wrote: > > On 22/07/16 00:48, Nicolas Pitre wrote: > > > On Thu, 21 Jul 2016, Greg Ungerer wrote: > > >> Hi Nicolas, > > >> > > >> On 21/07/16 05:22, Nicolas Pitre wrote: > > >>> This series provides the necessary changes to allow "flat" executable > > >>> binaries meant for no-MMU systems to actually run on systems with a MMU. > > >>> Also thrown in are various cleanups to binfmt_flat.c. > > >> > > >> I got to the bottom of why I couldn't run m68k flat binaries on > > >> an MMU enabled m68k system. I had to fix the regs setup, with the > > >> patch below. With this I can now run flat binaries on my ColdFire > > >> MMU enabled system. > > > > > > Excellent! > > > > > >> This change is completely independent of your patch series so I'll > > >> push this separately via the linux-m68k list and my m68knommu git > > >> tree. > > > > > > OK. > > > > > > Who should merge my patch series at this point? > > > > If no-one else wants to carry it I can take it in the m68knommu > > git tree. But I would want to be sure everyone is good with it > > first. > > > > Alan: are you happy with where this is at? > > rmk: ok with the arm flat.h change going via another tree? > > I've no idea, sorry. This is the first I've heard about this as I > haven't been copied with any of the patches, neither has the > linux-arm-kernel mailing list. This is almost all generic code changes, hence I didn't want to spam too many lists with those patches. > So, given that no one has seen this on the ARM side, I think there's > a need to post the patches so that it can be reviewed there, especially > so that the wider ARM audience can see what's going on, and ARM64 folk > can see as well. Here's the ARM specific part: rp is a user space reloc pointer therefore it should use user space accessors. That's all there is to the arch specific part. Pending your agreement with the above, everyone is fine with the series. Nicolas --- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/include/asm/flat.h b/arch/arm/include/asm/flat.h index e847d23351..acf1d14b89 100644 --- a/arch/arm/include/asm/flat.h +++ b/arch/arm/include/asm/flat.h @@ -8,8 +8,9 @@ #define flat_argvp_envp_on_stack() 1 #define flat_old_ram_flag(flags) (flags) #define flat_reloc_valid(reloc, size) ((reloc) <= (size)) -#define flat_get_addr_from_rp(rp, relval, flags, persistent) ((void)persistent,get_unaligned(rp)) -#define flat_put_addr_at_rp(rp, val, relval) put_unaligned(val,rp) +#define flat_get_addr_from_rp(rp, relval, flags, persistent) \ + ({ unsigned long __val; __get_user_unaligned(__val, rp); __val; }) +#define flat_put_addr_at_rp(rp, val, relval) __put_user_unaligned(val, rp) #define flat_get_relocate_addr(rel) (rel) #define flat_set_persistent(relval, p) 0