Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751953Ab3FZClv (ORCPT ); Tue, 25 Jun 2013 22:41:51 -0400 Received: from cnbjrel02.sonyericsson.com ([219.141.167.166]:1166 "EHLO cnbjrel02.sonyericsson.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751251Ab3FZCls (ORCPT ); Tue, 25 Jun 2013 22:41:48 -0400 From: "Wang, Yalin" To: "'Will Deacon'" CC: "'linux-kernel@vger.kernel.org'" , "'linux-arch@vger.kernel.org'" Date: Wed, 26 Jun 2013 10:41:40 +0800 Subject: ARM pagetable setting in Linux Thread-Topic: ARM pagetable setting in Linux Thread-Index: Ac5yFq/ukbzQ3tr2QI2PQwwF5C8inQ== Message-ID: <35FD53F367049845BC99AC72306C23D19441BF5863@CNBJMBX05.corpusers.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id r5Q2fwlx002811 Content-Length: 1786 Lines: 56 Hi Will, I have a question about arm pagetable setting in Linux . >From armV6, there is TTBR0 and TTBR1 translation base address registers in mmu . But I found linux only use TTBR0 for translation base address , Could we use TTBR0 and TTBR1 to split user task and kernel pagetables (swapper_pg_dir)? But I found this need set TTBCR.N , If PAGE_OFFSET==0xc0000000 , set TTBCR.N=0x2 , Will not work , because only ensure 0--0x00FFFFFF MVA use TTBCR0 And other MVA will use TTBCR1 , But if we set PAGE_OFFSET==0x80000000 (2GB split ) , And set TTBCR.N=0x1 , This will make sure user task MVA use TTBCR0 and kernel MVA Use TTBCR1 , this will make some improvement for the system . 1. Because we don’t need copy kernel first –level pagetables into every User task’s pagetables and flush tlb (for example fork() a new process). 2. And don’t need handle kernel page fault because that user task’s kernel Pagetable when it is not set up , need copy again( for example vmalloc() ioremap() kmap() will change Kernel pagetables and need update to every task pagetables ) . 3. We even can only allocate 8KB first level pagetables for user task to save Memorys . I am not sure if its possible to implement this on cortex-A cpus ? And if there is some side effects if we use this in linux ? If possible , I can make a change to do some test . Thanks for your help . Yalin.Wang Software Engineer OS Kernel&Graphics   Sony Mobile Communications Tel: +86 10 5966 9819 Phone: 18610323092 Address: No.16 Guangshun South Street, Chaoyang, Beijing, P.R.C. sonymobile.com    ????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?