LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: "linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	Olof Johansson <olof@lixom.net>, "agraf@suse.de" <agraf@suse.de>,
	Will Deacon <Will.Deacon@arm.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] arm64: Enable CONFIG_COMPAT also for 64k page size
Date: Fri, 5 Dec 2014 11:05:07 +0000	[thread overview]
Message-ID: <20141205110507.GB28339@e104818-lin.cambridge.arm.com> (raw)
In-Reply-To: <3551792.oHatG1W6W1@wuerfel>

On Fri, Dec 05, 2014 at 10:39:40AM +0000, Arnd Bergmann wrote:
> On Thursday 04 December 2014 15:48:50 Olof Johansson wrote:
> > On Thu, Dec 4, 2014 at 3:41 PM, Alexander Graf <agraf@suse.de> wrote:
> > > On 04.12.14 22:15, Olof Johansson wrote:
> > >> On Thu, Dec 4, 2014 at 7:46 AM, Alexander Graf <agraf@suse.de> wrote:
> > >>> With binutils 2.25 the default alignment for 32bit arm sections changed to
> > >>> have everything 64k aligned. Armv7 binaries built with this binutils version
> > >>> run successfully on an arm64 system.
> > >>>
> > >>> Since effectively there is now the chance to run armv7 code on arm64 even
> > >>> with 64k page size, it doesn't make sense to block people from enabling
> > >>> CONFIG_COMPAT on those configurations.
> > >>>
> > >>> Signed-off-by: Alexander Graf <agraf@suse.de>
> > >>> ---
> > >>>  arch/arm64/Kconfig | 1 -
> > >>>  1 file changed, 1 deletion(-)
> > >>>
> > >>> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> > >>> index 9532f8d..3cf4f238 100644
> > >>> --- a/arch/arm64/Kconfig
> > >>> +++ b/arch/arm64/Kconfig
> > >>> @@ -409,7 +409,6 @@ source "fs/Kconfig.binfmt"
> > >>>
> > >>>  config COMPAT
> > >>>         bool "Kernel support for 32-bit EL0"
> > >>> -       depends on !ARM64_64K_PAGES
> > >>>         select COMPAT_BINFMT_ELF
> > >>>         select HAVE_UID16
> > >>>         select OLD_SIGSUSPEND3
> > >>
> > >> This is hardly "compat". Sure, it's great to have a new binutils that
> > >> has larger alignment, but practically not a single existing binary
> > >> will work today if someone tries to do this.
> > >
> > > Yes, but IMHO that's an implementation detail. The same applies for
> > > 32bit PPC binaries if you use 4k aligned segments. If your applications
> > > are not aligned for your page size, you can't run them. The only
> > > platform that managed nevertheless FWIW was IA64 ;).
> > 
> > Yes, but there the binutils change happened early enough that by the
> > time the kernel change went in, all major distros had binaries that
> > were compatible.
> 
> What is the exact symptom you see when running an unaligned user
> space binary on 64k-pages? Do we at least print a helpful error
> message somewhere or does it just crash?

The application doesn't even start because it cannot map page 0. It
looks like most 32-bit arm binaries are linked to be loaded at 32K.

> Should we add support for 64k-pages in the arm32 kernel as well now?

32-bit LPAE doesn't support 64K pages but IIRC the classic MMU does
(though I have to check whether it was optional). But it's not feasible
to enable this in a 32-bit environment because of the memory wasted with
large pages (on average 32KB per mapped file, possibly even more if you
have lots of small files).

-- 
Catalin

  reply	other threads:[~2014-12-05 11:05 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-04 15:46 [PATCH] arm64: Enable CONFIG_COMPAT also for 64k page size Alexander Graf
2014-12-04 18:18 ` Laura Abbott
2014-12-04 18:20 ` Will Deacon
2014-12-04 23:37   ` Alexander Graf
2014-12-08 13:47     ` Michael Matz
2014-12-06 17:23   ` Alexander Graf
2014-12-08 10:10     ` Will Deacon
2014-12-08 10:47       ` Alexander Graf
2015-03-11 11:24       ` Alexander Graf
2015-03-11 12:43         ` Andreas Schwab
2015-03-11 12:47         ` Arnd Bergmann
2015-03-11 13:08           ` Alexander Graf
2015-03-11 13:35             ` Andreas Schwab
2015-03-11 13:51               ` Arnd Bergmann
2015-03-11 13:57                 ` Andreas Schwab
2015-03-11 15:44                   ` Alexander Graf
2015-03-11 16:09                     ` Andreas Schwab
2015-03-11 18:11                       ` Alexander Graf
2015-03-12  9:07                         ` [PATCH] arm64: fix implementation of mmap2 compat syscall Andreas Schwab
2015-03-16 14:16           ` [PATCH] arm64: Enable CONFIG_COMPAT also for 64k page size Christopher Covington
2015-03-16 14:19             ` Arnd Bergmann
2014-12-04 21:15 ` Olof Johansson
2014-12-04 23:41   ` Alexander Graf
2014-12-04 23:48     ` Olof Johansson
2014-12-05 10:39       ` Arnd Bergmann
2014-12-05 11:05         ` Catalin Marinas [this message]
2014-12-05 12:24           ` Arnd Bergmann
2014-12-05 12:31             ` Catalin Marinas
2015-02-18 13:40           ` Christopher Covington
2014-12-05 12:06         ` Alexander Graf
2014-12-05 11:14   ` Catalin Marinas
2014-12-05 11:35     ` Will Deacon
2015-03-13  4:44     ` Jon Masters
2014-12-05 16:35 ` Liviu Dudau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141205110507.GB28339@e104818-lin.cambridge.arm.com \
    --to=catalin.marinas@arm.com \
    --cc=Will.Deacon@arm.com \
    --cc=agraf@suse.de \
    --cc=arnd@arndb.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=olof@lixom.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).