Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1448738

Re: [PATCH v4 00/12] allow BFLT executables on systems with a MMU

From Nicolas Pitre <nicolas.pitre@linaro.org>
Newsgroups linux.kernel
Subject Re: [PATCH v4 00/12] allow BFLT executables on systems with a MMU
Date 2016-07-22 21:50 +0200
Message-ID <rXOCl-1EM-3@gated-at.bofh.it> (permalink)
References <rX5lT-5vv-3@gated-at.bofh.it> <rXg7E-3W1-15@gated-at.bofh.it> <rXnsu-gG-25@gated-at.bofh.it> <rXD4e-2FR-13@gated-at.bofh.it> <rXOiZ-1yn-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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:

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
 

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

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v4 00/12] allow BFLT executables on systems with a MMU Nicolas Pitre <nicolas.pitre@linaro.org> - 2016-07-20 21:30 +0200
  [PATCH v4 10/12] binfmt_flat: update libraries' data segment pointer with userspace accessors Nicolas Pitre <nicolas.pitre@linaro.org> - 2016-07-20 21:30 +0200
  [PATCH v4 06/12] binfmt_flat: clean up create_flat_tables() and stack accesses Nicolas Pitre <nicolas.pitre@linaro.org> - 2016-07-20 21:30 +0200
  [PATCH v4 02/12] binfmt_flat: convert printk invocations to their modern form Nicolas Pitre <nicolas.pitre@linaro.org> - 2016-07-20 21:30 +0200
  [PATCH v4 03/12] binfmt_flat: prevent kernel dammage from corrupted executable headers Nicolas Pitre <nicolas.pitre@linaro.org> - 2016-07-20 21:30 +0200
  [PATCH v4 09/12] binfmt_flat: use clear_user() rather than memset() to clear .bss Nicolas Pitre <nicolas.pitre@linaro.org> - 2016-07-20 21:30 +0200
  [PATCH v4 07/12] binfmt_flat: use proper user space accessors with relocs processing code Nicolas Pitre <nicolas.pitre@linaro.org> - 2016-07-20 21:30 +0200
  [PATCH v4 05/12] binfmt_flat: use generic transfer_args_to_stack() Nicolas Pitre <nicolas.pitre@linaro.org> - 2016-07-20 21:30 +0200
  Re: [PATCH v4 00/12] allow BFLT executables on systems with a MMU Greg Ungerer <gerg@linux-m68k.org> - 2016-07-21 09:00 +0200
    Re: [PATCH v4 00/12] allow BFLT executables on systems with a MMU Nicolas Pitre <nicolas.pitre@linaro.org> - 2016-07-21 16:50 +0200
      Re: [PATCH v4 00/12] allow BFLT executables on systems with a MMU Greg Ungerer <gerg@linux-m68k.org> - 2016-07-22 09:30 +0200
        Re: [PATCH v4 00/12] allow BFLT executables on systems with a MMU One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk> - 2016-07-22 17:10 +0200
        Re: [PATCH v4 00/12] allow BFLT executables on systems with a MMU Russell King - ARM Linux <linux@armlinux.org.uk> - 2016-07-22 21:30 +0200
          Re: [PATCH v4 00/12] allow BFLT executables on systems with a MMU Nicolas Pitre <nicolas.pitre@linaro.org> - 2016-07-22 21:50 +0200

csiph-web