From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754384AbaHFWRV (ORCPT ); Wed, 6 Aug 2014 18:17:21 -0400 Received: from gw-1.arm.linux.org.uk ([78.32.30.217]:39496 "EHLO pandora.arm.linux.org.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752723AbaHFWRT (ORCPT ); Wed, 6 Aug 2014 18:17:19 -0400 Date: Wed, 6 Aug 2014 23:16:48 +0100 From: Russell King - ARM Linux To: Kees Cook Cc: Nicolas Pitre , Liu hua , Rob Herring , wangnan0 , Laura Abbott , peifeiyue , Will Deacon , "linux-kernel@vger.kernel.org" , Vitaly Andrianov , Rabin Vincent , Santosh Shilimkar , "liusdu@126.com" , "linux-arm-kernel@lists.infradead.org" , Mark Salter Subject: Re: [PATCH v3 2/2] ARM : change fixmap mapping region to support 32 CPUs Message-ID: <20140806221648.GT30282@n2100.arm.linux.org.uk> References: <1397559967-26050-1-git-send-email-sdu.liu@huawei.com> <1397559967-26050-3-git-send-email-sdu.liu@huawei.com> <53E1A3A3.8080706@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.19 (2009-01-05) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 06, 2014 at 10:28:37AM -0700, Kees Cook wrote: > That's what I was thinking. I tried this, and things are still weird, > though I think I'm narrowing it down. I made the early_pte_alloc > happen, but after boot it doesn't show up in > /sys/kernel/debug/kernel_page_tables. When I attempt a fixmap text > poke, I get this out of dmesg (lkdtm is reporting the address returned > from the patch mapping): > > lkdtm: 80421ac0 mapped RW via ffdefac0 > Unable to handle kernel paging request at virtual address ffdefac0 > pgd = 9e888000 > [ffdefac0] *pgd=9fffc811, *pte=00000000, *ppte=00000000 > Internal error: Oops: 807 [#1] SMP ARM > > The target address (0xffdefac0) is correct; it's in the range set aside: > > #define FIXADDR_START 0xffc00000UL > #define FIXADDR_END 0xffe00000UL > #define FIXADDR_TOP (FIXADDR_END - PAGE_SIZE) > > enum fixed_addresses { > /* Support 16 CPUs for kmap as the first region of fixmap entries. */ > FIX_KMAP_BEGIN, > FIX_KMAP_END = 15, > > /* Support writing RO kernel text via kprobes, jump labels, etc. */ > FIX_TEXT_POKE0, > FIX_TEXT_POKE1, > > __end_of_fixed_addresses > }; > > But the resulting PTE is in totally the wrong location as reported by > /sys/kernel/debug/kernel_page_tables: > > ---[ Fixmap Area ]--- > 0xfffef000-0xffff0000 4K RW NX SHD MEM/CACHED/WBWA > > I continue to dig... This sounds like you have an erroneous merge conflict resolution. You seem to be poking into TOP_PTE rather than fixmap_page_table. -- FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up according to speedtest.net.