From patchwork Wed Jun 11 21:33:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Salter X-Patchwork-Id: 31799 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f198.google.com (mail-ve0-f198.google.com [209.85.128.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9CA852054B for ; Wed, 11 Jun 2014 21:34:41 +0000 (UTC) Received: by mail-ve0-f198.google.com with SMTP id db11sf1609533veb.1 for ; Wed, 11 Jun 2014 14:34:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=u8SHyTrnzW52BkR+e2eYGq5Yj1jV9/B/Fo1DdLYyfd8=; b=k6/U7cy6QgGdXG26hCE5E43gkO1Bsb5G7U5jpJjVdLQ1WB1KkC3rhj7fSJWL+EThbA LtBylOfm3p0NMUct8Zdf0T83yIVDVNYNZARjKFr+Y54Ksa1utIn1dGfxb3XgWNB6Katt 9Ev5JgLvUv+EzhGWUD5tnIep2qBY6N0twkHKeFY61MrIhPtHtXH8x+0gaUaWrG0jF4hn BvGyuh9meQlMc2PoibaucN9d9C8MF3sMzDRFZ8pF7ndcSnO4+r0s1nqWD+JwL3DYbSHm uSA3FvgxGl6ZW0QPLy6vSknm09Yd96XqB7141zsPHV2MuEsmmHJzq6+lf5jIeaj8vlHo WiLg== X-Gm-Message-State: ALoCoQlGysqwbsK9BXXhzz/0PRn1dXqHzfCl9bnLIav4vjryLpAZ7/w8c7DAEDclRS5XnQRi8pXX X-Received: by 10.236.126.79 with SMTP id a55mr3868363yhi.4.1402522481419; Wed, 11 Jun 2014 14:34:41 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.87.38 with SMTP id q35ls247658qgd.98.gmail; Wed, 11 Jun 2014 14:34:41 -0700 (PDT) X-Received: by 10.220.94.146 with SMTP id z18mr5005123vcm.40.1402522481231; Wed, 11 Jun 2014 14:34:41 -0700 (PDT) Received: from mail-ve0-f178.google.com (mail-ve0-f178.google.com [209.85.128.178]) by mx.google.com with ESMTPS id rn6si13366483vcb.80.2014.06.11.14.34.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 11 Jun 2014 14:34:41 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.178 as permitted sender) client-ip=209.85.128.178; Received: by mail-ve0-f178.google.com with SMTP id jx11so805589veb.9 for ; Wed, 11 Jun 2014 14:34:41 -0700 (PDT) X-Received: by 10.220.15.8 with SMTP id i8mr4073800vca.45.1402522481124; Wed, 11 Jun 2014 14:34:41 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.54.6 with SMTP id vs6csp340224vcb; Wed, 11 Jun 2014 14:34:40 -0700 (PDT) X-Received: by 10.66.226.172 with SMTP id rt12mr16439261pac.101.1402522480302; Wed, 11 Jun 2014 14:34:40 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g1si39348060pbw.91.2014.06.11.14.34.39; Wed, 11 Jun 2014 14:34:39 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754306AbaFKVeb (ORCPT + 27 others); Wed, 11 Jun 2014 17:34:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:26298 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752377AbaFKVea (ORCPT ); Wed, 11 Jun 2014 17:34:30 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s5BLY41x028089 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 11 Jun 2014 17:34:04 -0400 Received: from deneb.redhat.com (ovpn-113-156.phx2.redhat.com [10.3.113.156]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s5BLY3n8024454; Wed, 11 Jun 2014 17:34:04 -0400 From: Mark Salter To: Catalin Marinas Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Mark Salter Subject: [PATCH] arm64: fix MAX_ORDER for 64K pagesize Date: Wed, 11 Jun 2014 17:33:55 -0400 Message-Id: <1402522435-13884-1-git-send-email-msalter@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: msalter@redhat.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.178 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , With a kernel configured with ARM64_64K_PAGES && !TRANSPARENT_HUGEPAGE I get this at early boot: SMP: Total of 8 processors activated. devtmpfs: initialized Unable to handle kernel NULL pointer dereference at virtual address 00000008 pgd = fffffe0000050000 [00000008] *pgd=00000043fba00003, *pmd=00000043fba00003, *pte=00e0000078010407 Internal error: Oops: 96000006 [#1] SMP Modules linked in: CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.15.0-rc864k+ #44 task: fffffe03bc040000 ti: fffffe03bc080000 task.ti: fffffe03bc080000 PC is at __list_add+0x10/0xd4 LR is at free_one_page+0x270/0x638 ... Call trace: [] __list_add+0x10/0xd4 [] free_one_page+0x26c/0x638 [] __free_pages_ok.part.52+0x84/0xbc [] __free_pages+0x74/0xbc [] init_cma_reserved_pageblock+0xe8/0x104 [] cma_init_reserved_areas+0x190/0x1e4 [] do_one_initcall+0xc4/0x154 [] kernel_init_freeable+0x204/0x2a8 [] kernel_init+0xc/0xd4 This happens in this configuration because __free_one_page() is called with an order greater than MAX_ORDER, accesses past zone->free_list[] and passes a bogus list_head to list_add(). arch/arm64/Kconfig has: config FORCE_MAX_ZONEORDER int default "14" if (ARM64_64K_PAGES && TRANSPARENT_HUGEPAGE) default "11" So with THP turned off MAX_ORDER == 11 but init_cma_reserved_pageblock() passes __free_pages() an order of pageblock_order which is based on (HPAGE_SHIFT - PAGE_SHIFT) which is 13 for 64K pages. I worked around this by removing the THP test so FORCE_MAX_ZONEORDER is always 14 for ARM64_64K_PAGES. Signed-off-by: Mark Salter --- arch/arm64/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 7295419..42a334e 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -269,7 +269,7 @@ config XEN config FORCE_MAX_ZONEORDER int - default "14" if (ARM64_64K_PAGES && TRANSPARENT_HUGEPAGE) + default "14" if ARM64_64K_PAGES default "11" endmenu