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: 72639 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp1170407qga; Fri, 22 Jul 2016 12:45:25 -0700 (PDT) X-Received: by 10.98.14.72 with SMTP id w69mr9323392pfi.119.1469216725410; Fri, 22 Jul 2016 12:45:25 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id pl3si17387495pac.22.2016.07.22.12.45.21; Fri, 22 Jul 2016 12:45:25 -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; dkim=pass header.i=@linaro.org; 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 dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753815AbcGVTpR (ORCPT + 29 others); Fri, 22 Jul 2016 15:45:17 -0400 Received: from mail-qt0-f172.google.com ([209.85.216.172]:34679 "EHLO mail-qt0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751849AbcGVTpO (ORCPT ); Fri, 22 Jul 2016 15:45:14 -0400 Received: by mail-qt0-f172.google.com with SMTP id u25so67488813qtb.1 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=e2iB/tj4S5CJEurUaX7tIT1C61AbZHbpfqWu1WVXULdp/ymM/0AnoC22EwzfYku23e G4S7LxPNUaw5msfvItDl77y8Tmn3Ves4pVGzP8CmFvQ4Bj2tCAMCNlmCSm2YdylvvfmQ i0291BH+BIdnnqC4eCL8a5etXU017s3ICLs/d2wNUOibDAVp+/SxfEw1PhBWzvZexR8Y YRs3aOgVFBvrE0e3FVjuDnb2+YJvICGZJvyViPPANxiQAQtlH1aSz9XWSyH2cVSTAg5B khVdzJNBUlR7MpfWwKGw8SKiaNGUEOMj0mrdEVT3XLPt8FZqZDTGSJpppIjCZIQ+L6n8 6mAw== X-Gm-Message-State: AEkooutKO5u/62N3/zCCEURhPQt7qfRMsWR4pS6u6bpKkuBC/ooYbOTb6EkTdviCISWPbkRP 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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