From patchwork Tue Mar 8 19:03:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Daney X-Patchwork-Id: 8536851 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8E1759F372 for ; Tue, 8 Mar 2016 19:05:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 85B7F2024C for ; Tue, 8 Mar 2016 19:05:51 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 74D72201FE for ; Tue, 8 Mar 2016 19:05:50 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1adMv5-00026A-OJ; Tue, 08 Mar 2016 19:03:47 +0000 Received: from mail-pa0-x22f.google.com ([2607:f8b0:400e:c03::22f]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1adMv1-00022V-Hm for linux-arm-kernel@lists.infradead.org; Tue, 08 Mar 2016 19:03:45 +0000 Received: by mail-pa0-x22f.google.com with SMTP id tt10so18644742pab.3 for ; Tue, 08 Mar 2016 11:03:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=LFt3FZ1yoqBIrOIQRMW/OYsh3nqsQXY6ggHmJ/XbsDs=; b=FGVO+LUpHjlPkckshRB/k2LMMYb/7N0sbskjSDgo750oLuF+sKJ61TM0hYJaWfYWut hBTEHsYAH273ql3wU3A9XJU19q5C6/cjGfT1rH92I1RTl07xxOO1a+uIbrUrO6zcE9gE /H1DCt54Jj/VbCkw6DoSq1ortl6cxXV7IhOzIdBlhQ/ViMn9GWJMI4OjiIwnqUDEFzb6 5jeIZJgk/v4bhDgnl+J67Octw6ZR0kzCCS1txNpgp4oxgEqZhAoUxWdZ0OIOY+zUNTEk 3f23V1TlO5O10SPdzw4ujEGw8sazqweLnDnHELqdabCZcwkWBlWm3smUWAU8jRtOU4VH UrOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=LFt3FZ1yoqBIrOIQRMW/OYsh3nqsQXY6ggHmJ/XbsDs=; b=YF/tgg3Aq5MfPnpRT2R2kJx3yXvIMsyho7WUmaxXuj2LlbpkPzH2v+lCl5U27rvjc+ 3Pl8XaL78kAAw0V6BLrRVxYB9ANB8+ijbUXKgfl9UVsoYtSX2uQ4XzJwcpnnERo77H50 BASI9W/1VUQztbf3TDCYLzgr2uAngOjaiHXc4msrrKVL2ZQTu9gmDyAqFGU4wx5I9yDq DgiW+uG0G4auD4RkZQY/zM8G+bgy5KaOsGUm1q2cW58U4Wj99xwJtIlHQq0Vg/tfJ73r OWhcoQJc8ban4ujfFsI6UDyjde3F9UOmUeGlhxsCT0Ky7/pKPGwYADwNpOSJwEriHtzv N0nQ== X-Gm-Message-State: AD7BkJKcVYLGMrtw0Zf+X0yuNmGFDa2PNsYZhuSXOPEkPX0CoWUgBCAY1W8QpuM2PY7IVA== X-Received: by 10.66.151.177 with SMTP id ur17mr43873817pab.68.1457463801921; Tue, 08 Mar 2016 11:03:21 -0800 (PST) Received: from dl.caveonetworks.com ([64.2.3.194]) by smtp.gmail.com with ESMTPSA id wx3sm6719089pab.25.2016.03.08.11.03.19 (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 08 Mar 2016 11:03:20 -0800 (PST) Received: from dl.caveonetworks.com (localhost.localdomain [127.0.0.1]) by dl.caveonetworks.com (8.14.5/8.14.5) with ESMTP id u28J3Ic9006886; Tue, 8 Mar 2016 11:03:18 -0800 Received: (from ddaney@localhost) by dl.caveonetworks.com (8.14.5/8.14.5/Submit) id u28J3EE4006885; Tue, 8 Mar 2016 11:03:14 -0800 From: David Daney To: Will Deacon , linux-arm-kernel@lists.infradead.org, Catalin Marinas , Ard Biesheuvel , Linus Torvalds Subject: [PATCH] Revert "arm64: vmemmap: use virtual projection of linear region" Date: Tue, 8 Mar 2016 11:03:12 -0800 Message-Id: <1457463792-6852-1-git-send-email-ddaney.cavm@gmail.com> X-Mailer: git-send-email 1.7.11.7 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160308_110343_698497_1A704EA4 X-CRM114-Status: GOOD ( 14.70 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, David Daney MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: David Daney This reverts commit dfd55ad85e4a7fbaa82df12467515ac3c81e8a3e. Commit dfd55ad85e4a ("arm64: vmemmap: use virtual projection of linear region") causes this failure on Cavium Thunder systems: EFI stub: Booting Linux Kernel... EFI stub: Using DTB from configuration table EFI stub: Exiting boot services and installing virtual address map... [ 0.000000] Booting Linux on physical CPU 0x0 [ 0.000000] Linux version 4.5.0-rc7-numa+ (ddaney@localhost.localdomain) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-4) (GCC) ) #125 SMP PREEMPT Tue Mar 8 09:59:40 PST 2016 [ 0.000000] Boot CPU: AArch64 Processor [431f0a10] [ 0.000000] earlycon: Early serial console at MMIO 0x87e024000000 (options '') [ 0.000000] bootconsole [uart0] enabled [ 0.000000] efi: Getting EFI parameters from FDT: [ 0.000000] EFI v2.40 by Cavium Thunder cn88xx EFI jenkins_weekly_build_6-1-g188619c-dirty Feb 19 2016 13:32:48 [ 0.000000] efi: ACPI=0xfffff000 ACPI 2.0=0xfffff014 SMBIOS 3.0=0x3faa62000 [ 0.000000] Unable to handle kernel paging request at virtual address fffffdff60ff0000 [ 0.000000] pgd = fffffe0000df0000 [ 0.000000] [fffffdff60ff0000] *pgd=00000003ffda0003, *pud=00000003ffda0003, *pmd=00000003ffda0003, *pte=0000000000000000 [ 0.000000] Internal error: Oops: 96000007 [#1] PREEMPT SMP [ 0.000000] Modules linked in: [ 0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 4.5.0-rc7-numa+ #125 [ 0.000000] Hardware name: Cavium ThunderX CN88XX board (DT) [ 0.000000] task: fffffe0000b29800 ti: fffffe0000af0000 task.ti: fffffe0000af0000 [ 0.000000] PC is at memmap_init_zone+0xd4/0x11c [ 0.000000] LR is at memmap_init_zone+0xb4/0x11c [ 0.000000] pc : [] lr : [] pstate: 800002c5 [ 0.000000] sp : fffffe0000af3d50 [ 0.000000] x29: fffffe0000af3d50 x28: 0000000000000001 [ 0.000000] x27: fffffe000092c2c0 x26: fffffe0000a90fc0 [ 0.000000] x25: fffffe0000b20000 x24: 0000000000040000 [ 0.000000] x23: 0000000000000000 x22: 4000000000000000 [ 0.000000] x21: 0000000000000001 x20: 00000000ffffffff [ 0.000000] x19: 000000000003fd40 x18: 0000000000000008 [ 0.000000] x17: 0000000400000000 x16: 0000000000000008 [ 0.000000] x15: 0000000000000018 x14: 00000003ffaa0000 [ 0.000000] x13: fffffe0000d6ccc0 x12: 0000000000000080 [ 0.000000] x11: 0000000600000008 x10: 00000003fffd8800 [ 0.000000] x9 : 0000000000000000 x8 : fffffe03febde800 [ 0.000000] x7 : 0000000004fb0000 x6 : fffffe0000d6c0c0 [ 0.000000] x5 : 0000000000001d40 x4 : 0000000000000007 [ 0.000000] x3 : fffffdff60000000 x2 : 0000000000ff0000 [ 0.000000] x1 : 0000000000000001 x0 : 0000000000000001 [ 0.000000] [ 0.000000] Process swapper (pid: 0, stack limit = 0xfffffe0000af0020) [ 0.000000] Stack: (0xfffffe0000af3d50 to 0xfffffe0000af4000) [ 0.000000] 3d40: fffffe0000af3da0 fffffe0000a73f50 [ 0.000000] 3d60: fffffe0000bf8080 000000000002ff40 fffffe0000bf8688 fffffe0000bf7000 . . . [ 0.000000] [] memmap_init_zone+0xd4/0x11c [ 0.000000] [] free_area_init_node+0x274/0x2bc [ 0.000000] [] bootmem_init+0x158/0x198 [ 0.000000] [] paging_init+0xec/0x1a4 [ 0.000000] [] setup_arch+0x110/0x5a0 [ 0.000000] [] start_kernel+0xa8/0x3dc [ 0.000000] [] 0xfffffe00000811b4 [ 0.000000] Code: cb424262 f2dfbfe3 d37ae442 f2ffffe3 (f8636840) [ 0.000000] ---[ end trace cb88537fdc8fa200 ]--- [ 0.000000] Kernel panic - not syncing: Fatal exception [ 0.000000] ---[ end Kernel panic - not syncing: Fatal exception Signed-off-by: David Daney --- arch/arm64/include/asm/pgtable.h | 7 +++---- arch/arm64/mm/init.c | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index f506086..bf464de 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h @@ -34,13 +34,13 @@ /* * VMALLOC and SPARSEMEM_VMEMMAP ranges. * - * VMEMAP_SIZE: allows the whole linear region to be covered by a struct page array + * VMEMAP_SIZE: allows the whole VA space to be covered by a struct page array * (rounded up to PUD_SIZE). * VMALLOC_START: beginning of the kernel VA space * VMALLOC_END: extends to the available space below vmmemmap, PCI I/O space, * fixed mappings and modules */ -#define VMEMMAP_SIZE ALIGN((1UL << (VA_BITS - PAGE_SHIFT - 1)) * sizeof(struct page), PUD_SIZE) +#define VMEMMAP_SIZE ALIGN((1UL << (VA_BITS - PAGE_SHIFT)) * sizeof(struct page), PUD_SIZE) #ifndef CONFIG_KASAN #define VMALLOC_START (VA_START) @@ -51,8 +51,7 @@ #define VMALLOC_END (PAGE_OFFSET - PUD_SIZE - VMEMMAP_SIZE - SZ_64K) -#define VMEMMAP_START (VMALLOC_END + SZ_64K) -#define vmemmap ((struct page *)VMEMMAP_START - (memstart_addr >> PAGE_SHIFT)) +#define vmemmap ((struct page *)(VMALLOC_END + SZ_64K)) #define FIRST_USER_ADDRESS 0UL diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index 7802f21..f3b061e 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -319,8 +319,8 @@ void __init mem_init(void) #endif MLG(VMALLOC_START, VMALLOC_END), #ifdef CONFIG_SPARSEMEM_VMEMMAP - MLG(VMEMMAP_START, - VMEMMAP_START + VMEMMAP_SIZE), + MLG((unsigned long)vmemmap, + (unsigned long)vmemmap + VMEMMAP_SIZE), MLM((unsigned long)virt_to_page(PAGE_OFFSET), (unsigned long)virt_to_page(high_memory)), #endif