From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965688AbbCPPQ5 (ORCPT ); Mon, 16 Mar 2015 11:16:57 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:56538 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932950AbbCPOT4 (ORCPT ); Mon, 16 Mar 2015 10:19:56 -0400 From: Arnd Bergmann To: Christopher Covington Cc: linux-arm-kernel@lists.infradead.org, Catalin Marinas , Michael Matz , Will Deacon , Alexander Graf , "linux-kernel@vger.kernel.org" , Dirk =?ISO-8859-1?Q?M=FCller?= , Suravee Suthikulanit , Andreas Schwab Subject: Re: [PATCH] arm64: Enable CONFIG_COMPAT also for 64k page size Date: Mon, 16 Mar 2015 15:19:41 +0100 Message-ID: <3082389.jo5M8JGykQ@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <5506E5C5.3000209@codeaurora.org> References: <1417707993-82290-1-git-send-email-agraf@suse.de> <5396604.TRferrWZgF@wuerfel> <5506E5C5.3000209@codeaurora.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:oPHu9emFXb26dOvBt7PkoW4YHjt+rMo6QS52SXvJwZOYXddQGaK AYWPCjUZFNr9xQZguwbZst4H5cYSOG5BpJOtniY+0A7FndmR4VDRsby/6GaswA3jaJavxi0 e2NWxwhs8FJuqKqscaQDLkegKe5Ho1rJ4fG+L1C83rBaX8Oe01vj2tVl5qxtf9nSmY4Aycb jScb80c6TsL41KAGVqlzQ== X-UI-Out-Filterresults: notjunk:1; Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Monday 16 March 2015 10:16:37 Christopher Covington wrote: > > On 03/11/2015 08:47 AM, Arnd Bergmann wrote: > > On Wednesday 11 March 2015 06:24:16 Alexander Graf wrote: > >> So after recompiling all of the distribution with newer binutils we now > >> have an openSUSE Factory tree that has 64k aligned 32bit binaries. > >> > >> Unfortunately however, the 32bit glibc has a bogus mmap() implementation > >> that hard codes 4k page size. > >> > >> With the patch below applied to glibc, I can successfully run 32bit user > >> space on Seattle with 64k PAGE_SIZE though. So I guess we'll need to fix > >> up glibc next. > >> > >> Do you know of anyone who's fluent enough in 32bit ARM assembly to > >> convert the hard coded assumptions in there to instead use a variable > >> that takes the actual host page size into account? > > > > I believe this is a kernel bug, and the kernel API for 32-bit emulation > > should always take the pgoff argument in 4KB units instead of PAGE_SIZE > > units, see the implementation of sys_mmap2 in > > arch/powerpc/kernel/sys_ppc32.c. > > > > All user space programs that call mmap2 still need to make sure that > > their arguments are PAGE_SIZE aligned, but the libc need not care > > about this here. > > What is the correct behavior for /proc/pid/pagemap, /proc/kpagecount, and > /proc/kpageflags for a AArch32 process running on an AArch64 kernel with > non-4K translation granule? Actual page frame number or units-of-4K frame number? > Not sure, see what PowerPC does in that case. Arnd