Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753950AbaDNKo6 (ORCPT ); Mon, 14 Apr 2014 06:44:58 -0400 Received: from cam-admin0.cambridge.arm.com ([217.140.96.50]:33381 "EHLO cam-admin0.cambridge.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751519AbaDNKo4 (ORCPT ); Mon, 14 Apr 2014 06:44:56 -0400 Date: Mon, 14 Apr 2014 11:43:00 +0100 From: Will Deacon To: Jianguo Wu Cc: "linux@arm.linux.org.uk" , Wang Nan , "gregkh@linuxfoundation.org" , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , Li Zefan , Catalin Marinas , Ben Dooks , "linux-arm-kernel@lists.infradead.org" , marc.zyngier@arm.com Subject: Re: [PATCH v2] ARM: mm: support big-endian page tables Message-ID: <20140414104300.GA3530@arm.com> References: <5301B4AF.1040305@huawei.com> <5327F75F.1010406@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5327F75F.1010406@huawei.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org (catching up on old email) On Tue, Mar 18, 2014 at 07:35:59AM +0000, Jianguo Wu wrote: > Cloud you please take a look at this? [...] > On 2014/2/17 15:05, Jianguo Wu wrote: > > When enable LPAE and big-endian in a hisilicon board, while specify > > mem=384M mem=512M@7680M, will get bad page state: > > > > Freeing unused kernel memory: 180K (c0466000 - c0493000) > > BUG: Bad page state in process init pfn:fa442 > > page:c7749840 count:0 mapcount:-1 mapping: (null) index:0x0 > > page flags: 0x40000400(reserved) > > Modules linked in: > > CPU: 0 PID: 1 Comm: init Not tainted 3.10.27+ #66 > > [] (unwind_backtrace+0x0/0x11c) from [] (show_stack+0x10/0x14) > > [] (show_stack+0x10/0x14) from [] (bad_page+0xd4/0x104) > > [] (bad_page+0xd4/0x104) from [] (free_pages_prepare+0xa8/0x14c) > > [] (free_pages_prepare+0xa8/0x14c) from [] (free_hot_cold_page+0x18/0xf0) > > [] (free_hot_cold_page+0x18/0xf0) from [] (handle_pte_fault+0xcf4/0xdc8) > > [] (handle_pte_fault+0xcf4/0xdc8) from [] (handle_mm_fault+0xf4/0x120) > > [] (handle_mm_fault+0xf4/0x120) from [] (do_page_fault+0xfc/0x354) > > [] (do_page_fault+0xfc/0x354) from [] (do_DataAbort+0x2c/0x90) > > [] (do_DataAbort+0x2c/0x90) from [] (__dabt_usr+0x34/0x40) [...] > > The bug is happened in cpu_v7_set_pte_ext(ptep, pte): > > when pte is 64-bit, for little-endian, will store low 32-bit in r2, > > high 32-bit in r3; for big-endian, will store low 32-bit in r3, > > high 32-bit in r2, this will cause wrong pfn stored in pte, > > so we should exchange r2 and r3 for big-endian. I believe that Marc (added to CC) has been running LPAE-enabled, big-endian KVM guests without any issues, so it seems unlikely that we're storing the PTEs backwards. Can you check the configuration of SCTLR.EE? Will -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/