From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73DB1C43461 for ; Wed, 16 Sep 2020 15:12:51 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id ED0862244C for ; Wed, 16 Sep 2020 15:12:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="nRG37AdB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ED0862244C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 250336B005C; Wed, 16 Sep 2020 11:12:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 228056B0068; Wed, 16 Sep 2020 11:12:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 13D5B6B0075; Wed, 16 Sep 2020 11:12:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0150.hostedemail.com [216.40.44.150]) by kanga.kvack.org (Postfix) with ESMTP id F21336B005C for ; Wed, 16 Sep 2020 11:12:49 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 9A22D1DEA for ; Wed, 16 Sep 2020 15:12:49 +0000 (UTC) X-FDA: 77269266858.04.power64_2b084a22711a Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin04.hostedemail.com (Postfix) with ESMTP id 705B0800B501 for ; Wed, 16 Sep 2020 15:12:49 +0000 (UTC) X-HE-Tag: power64_2b084a22711a X-Filterd-Recvd-Size: 5808 Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) by imf30.hostedemail.com (Postfix) with ESMTP for ; Wed, 16 Sep 2020 15:12:49 +0000 (UTC) Received: by mail-lf1-f46.google.com with SMTP id w11so7426392lfn.2 for ; Wed, 16 Sep 2020 08:12:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ThA+nYSGruz0FklKoGasWMI8RtBIZMKrAdw+w26lQQQ=; b=nRG37AdBCIwSxMQ0Q/MO17RMpp0wKLuk430YKp1EwfMNap8AvezmKLyKV3i6Y3ReHU c/5l7W8T2ek+O8HTqIy3xsuFBISY04tmfHOMZBHgRQjbn200Gm3LYG+A9O7bBkur966z Iklmfhr7BueLXE9Gr1oqU1KMVv/ei7rK7h3Kk6GFfHxpuAMNNzFC4VgEG3LaE7Q2AbN7 bjJXlgh6dJeYaNSLiU3lugfB9OOkz85afhwVt0mIbc6BSjVRAevSiqbtMovegOziAVAG ob4lyXSdTqlHC7VphAHGs+l9lYAZI8/e1X+aFxfFolLfaqOQhS/YbcEKNcRebQUfoc0Y YYqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ThA+nYSGruz0FklKoGasWMI8RtBIZMKrAdw+w26lQQQ=; b=aynFUDkZiSl1SKNU9WvQ3zHn2NJUc/Fx9oLoBgD/QPA5ZJQSQAUltHcpwJKvOA+duE JQ2xFajZReKlAnjPRub8jiY73T2YP13yp2sdXI/H+7mCGZbr7RPZA0n2vxySqENL/dGQ 8n4wCP1S0soZTzT61N40V4q1kSgk2Pk/5ldXl8HWaWCLoFIQmYHXMWQUTpfp3Q1R2wnJ EmH8jg+hHQNemb45KJDwiJdBkrf9HoTN/uqVo2kTliQfdwcKtfZgTAZYe09XhlE+Tyro pR60LmnFHaWRs3LHgeKTD2M1F+FSDt+6I6aiOy9cam61TkIBxDT7a2UnMydT1wgfZMvM ewlg== X-Gm-Message-State: AOAM531NFrhSIp5/Yl6ltdIOMiPyTr/QAUBxHQT6cU/I31I2FVJCGjZT 8Urj+4yq5Jn6LIyry/gdvFE3NQ== X-Google-Smtp-Source: ABdhPJzRoAOEmPF6B8uLCQGLSY2b9XTBLn9mz2XXu3cTkb66kJHIWxA/CsTAVqC38iICgZTrkucSvQ== X-Received: by 2002:a05:6512:370b:: with SMTP id z11mr7275110lfr.571.1600269167388; Wed, 16 Sep 2020 08:12:47 -0700 (PDT) Received: from localhost (c-9b28e555.07-21-73746f28.bbcust.telenor.se. [85.229.40.155]) by smtp.gmail.com with ESMTPSA id h22sm5430712ljl.101.2020.09.16.08.12.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2020 08:12:46 -0700 (PDT) From: Anders Roxell To: song.bao.hua@hisilicon.com Cc: akpm@linux-foundation.org, guro@fb.com, linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linuxarm@huawei.com, mike.kravetz@oracle.com, sfr@canb.auug.org.au, will@kernel.org, Anders Roxell Subject: [PATCH] arm64: mm: move dma_contiguous_reserve() to be after paging_init() Date: Wed, 16 Sep 2020 17:12:37 +0200 Message-Id: <20200916151237.3745922-1-anders.roxell@linaro.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200916085933.25220-1-song.bao.hua@hisilicon.com> References: <20200916085933.25220-1-song.bao.hua@hisilicon.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 705B0800B501 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: > Recent CMA change "cma: make number of CMA areas dynamic, remove > CONFIG_CMA_AREAS" breaks the boot of arm64 kernel in linux-next. > Knic is like: >=20 > Unable to handle kernel paging request at virtual address ffff0000438ff= f70 > Mem abort info: > ESR =3D 0x96000044 > EC =3D 0x25: DABT (current EL), IL =3D 32 bits > SET =3D 0, FnV =3D 0 > EA =3D 0, S1PTW =3D 0 > Data abort info: > ISV =3D 0, ISS =3D 0x00000044 > CM =3D 0, WnR =3D 1 > swapper pgtable: 4k pages, 48-bit VAs, pgdp=3D0000000041f61000 > [ffff0000438fff70] pgd=3D0000000000000000, p4d=3D0000000000000000 > Internal error: Oops: 96000044 [#1] PREEMPT SMP > Modules linked in: > CPU: 0 PID: 0 Comm: swapper Not tainted 5.9.0-rc3-00020-ge1bce3d64c48 #= 2 > Hardware name: linux,dummy-virt (DT) > pstate: 20000085 (nzCv daIf -PAN -UAO BTYPE=3D--) > pc : __memset+0x148/0x188 > lr : memblock_alloc_try_nid+0xbc/0xd4 > sp : ffff800011ab3d10 > x29: ffff800011ab3d10 x28: 0000000041710018 > x27: 0000000040000000 x26: ffff8000115d1000 > x25: 0000000000000000 x24: ffff800011300428 > x23: ffff800011d1bd60 x22: 0000000000000000 > x21: 00000000ffffffff x20: ffff0000438fff70 > x19: 0000000000000090 x18: 0000000000000010 > x17: 0000000000001400 x16: 0000000000001c00 > x15: ffff800011ac3530 x14: ffff800011ac3530 > x13: fffffdfffe600000 x12: ffff800011ab3e44 > x11: 0000000000000004 x10: 0000000000000018 > x9 : 0000000000000000 x8 : ffff0000438fff70 > x7 : 0000000000000000 x6 : 000000000000003f > x5 : 0000000000000040 x4 : 0000000000000010 > x3 : 0000000000000080 x2 : 0000000000000080 > x1 : 0000000000000000 x0 : ffff0000438fff70 > Call trace: > __memset+0x148/0x188 > cma_init_reserved_mem+0x94/0x154 > cma_declare_contiguous_nid+0x240/0x2bc > dma_contiguous_reserve_area+0x48/0x78 > dma_contiguous_reserve+0x78/0x88 > arm64_memblock_init+0x424/0x45c > setup_arch+0x270/0x5f0 > start_kernel+0x84/0x4dc > Code: f101007f fa45a068 54fffc0b aa0303e2 (a9001d07) > random: get_random_bytes called from print_oops_end_marker+0x2c/0x68 wi= th crng_init=3D0 > ---[ end trace 0000000000000000 ]--- > Kernel panic - not syncing: Attempted to kill the idle task! > ---[ end Kernel panic - not syncing: Attempted to kill the idle task! ]= --- >=20 > The virtual address returned from memblock_alloc() is not ready till > paging_init() is done. >=20 > Signed-off-by: Barry Song > Cc: Roman Gushchin > Cc: Mike Kravetz > Cc: Andrew Morton > Cc: Will Deacon > Cc: Stephen Rothwell Tested-by: Anders Roxell Cheers, Anders