From patchwork Fri Oct 11 15:00:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ritesh Harjani (IBM)" X-Patchwork-Id: 13832632 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6DDDAD0D7B8 for ; Fri, 11 Oct 2024 15:07:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 003DE6B00B0; Fri, 11 Oct 2024 11:07:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EF63D6B00B1; Fri, 11 Oct 2024 11:07:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D96D46B00B2; Fri, 11 Oct 2024 11:07:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id BAC936B00B0 for ; Fri, 11 Oct 2024 11:07:32 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 635BDC13D1 for ; Fri, 11 Oct 2024 15:07:27 +0000 (UTC) X-FDA: 82661650260.12.96BF26A Received: from mail-oi1-f179.google.com (mail-oi1-f179.google.com [209.85.167.179]) by imf22.hostedemail.com (Postfix) with ESMTP id BF0B4C0011 for ; Fri, 11 Oct 2024 15:07:27 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=j+5Upp+4; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf22.hostedemail.com: domain of ritesh.list@gmail.com designates 209.85.167.179 as permitted sender) smtp.mailfrom=ritesh.list@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1728659137; a=rsa-sha256; cv=none; b=ix7I7ZEauee1KEthUM06goP4V/UAAHx9TFqfKtPozsyzjSqWgH+pVw8w6PyTGgst7kPQco vnqWQPKBTLJUiKe5HG86bROSbZRHiig7cnwGS2TOPL8j8xfKkgEEEBdgAhGmnWKTU5D48y sE/NuBSAOxFkYfvzw8MWFkA0Gq1ps+4= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=j+5Upp+4; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf22.hostedemail.com: domain of ritesh.list@gmail.com designates 209.85.167.179 as permitted sender) smtp.mailfrom=ritesh.list@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1728659137; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=GxJ3a4GJ9kmYrP2J+wqTevzfvJ84If+iUVZIlsVHzAQ=; b=lZlJCDJRpWjrM1sOFSOMU9274EHXMcG8aTWy74YhK/0YGEecm22ayTG9T/dp9jkXHb7244 jqcd9rXkQbPwQJs0k8Hi8uASpXxtNeZ7mOLZHmDRjTFlCXd4Xcc2IKZVxqrinIFq5n8Wqt Jbz1zZrLJU46HCm7HxbL9w7WG3zXVMg= Received: by mail-oi1-f179.google.com with SMTP id 5614622812f47-3e3e0a8aaabso778913b6e.3 for ; Fri, 11 Oct 2024 08:07:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728659249; x=1729264049; darn=kvack.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=GxJ3a4GJ9kmYrP2J+wqTevzfvJ84If+iUVZIlsVHzAQ=; b=j+5Upp+4NIlr8VKPpJrQLZgkU62atGyQBrejKpyCIY8QDcsBXwPp6tsPTv3pTMdhlj e/qgm3VXU0sn4ai1dlCMc0jfvUYVN8y6Fvjkr7oioFbFmvpzUuoJLUN7uguoXLri9L6D hQMJmTK7qq0Czc0tGR7OmllloqiZ5kHBUmWmEYJbzmLjDwD+XBPxZuDryA/T610n29U6 MMy5V139uq11yLKAnAQ+AT5hQgOQwAeEr6/mouvfkqgElQTvUxa8vsZBWU2YfNtHmoAF vmkKwKiYJOIUDnVclpNj9u6bCcAIueNbS8IjdiZjWUPJn+hDEFDO64h2zadKh9pjov7O 5sdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728659249; x=1729264049; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=GxJ3a4GJ9kmYrP2J+wqTevzfvJ84If+iUVZIlsVHzAQ=; b=IqEocSRfjyWR6K7a//pUHGdspc6OxHGK6EEYUyGwX+3eQz+wx1/fvOW3ld90/pIggR 4Vl4DGerJJuCgQykNvH+y8kBaaKl4xOzQhBPMso70BKp0O8aHeaHU+rJjm8NqQFBdT9U jxCWSRPw2ll26+rbf+wAFtdFg+wd6auV48uYaysxs7Y4WXQJPkcK6oEYIWQeOPE4CCcT 5jKtjciVfUWvSUup98C+8yNtE6hjAjQDQIRgOGe0YduyGkfn1DvP5G6FpoY06xdpldZi eUTocZbLzC2tkiI/T3GQ7g35MKlLCiVK+pPSp4sF3RQrlDgVwMIaw3uSfV4lgAJflnyR qqYw== X-Gm-Message-State: AOJu0YwEIR/eYBLWN0LHVvahIERUzfMU2sU4OSExzUrue2pRCl5KRy8S YBt7QUovO8tiZwxdUpUkqCuQLXXdWhX50mblmnQpE41T9YtskBabrq8VIg== X-Google-Smtp-Source: AGHT+IFbjpvOtZ/4fnGnu1qPpet8fqGoBC1EXvpTqBB5vCO3GdLz4J1XYWVfGZyMKj/vHw3RhywtBA== X-Received: by 2002:a05:6a00:84c:b0:71d:eb7d:20e4 with SMTP id d2e1a72fcca58-71e37e4e13emr4618936b3a.8.1728658815997; Fri, 11 Oct 2024 08:00:15 -0700 (PDT) Received: from dw-tp.. ([171.76.85.106]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71e4a2c9767sm146561b3a.85.2024.10.11.08.00.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Oct 2024 08:00:15 -0700 (PDT) From: "Ritesh Harjani (IBM)" To: linuxppc-dev@lists.ozlabs.org Cc: linux-mm@kvack.org, Sourabh Jain , Hari Bathini , Zi Yan , David Hildenbrand , "Kirill A . Shutemov" , Mahesh J Salgaonkar , Michael Ellerman , Madhavan Srinivasan , "Aneesh Kumar K . V" , Donet Tom , LKML , Sachin P Bappalige , "Ritesh Harjani (IBM)" Subject: [RFC v3 1/3] fadump: Refactor and prepare fadump_cma_init for late init Date: Fri, 11 Oct 2024 20:30:04 +0530 Message-ID: <030b6d46fddac126a6cf7e119bea48055338f0ed.1728658614.git.ritesh.list@gmail.com> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: BF0B4C0011 X-Stat-Signature: xtae1hf5bekgm6r1dtis53ab5p8qermy X-Rspam-User: X-HE-Tag: 1728659247-897357 X-HE-Meta: U2FsdGVkX1/eL4NdSfCpNTgAG371EjZ4YInGo+lfpS+NmDWtAHOnx9objm+giibwse8zjEH/OE6LCF1zNsyoGtYLx/iWd90czeLi0/w4Rx4l50ubD9O9dWzDbs4unVVlncJJPeKhdYmjiRv0+ozFxO9a8G+l4Q3mb/AdiJLsg7NjNv50JQyuWh5wiQY/NLok1NUOOvpzrvHZ4vhw4Wr3MJ5y4pu0opMo88GcLYS8HggHoSVxCov4KaWw2fPoJ1BUfLTmlT4s1i4duxRYAauKnc5IbwNiM2Ck4Xv3pLepS4u2KH1t8lnThPt6FvCwTWwR281jwDRF+eAx9naXJjUrd2kZkS1yZ4qc8K5vLGNw6P38hDOTljeUUmn4ooIdSM1p2Jx9hb9qSpA5KJCsbyYdwcEgIVCRmUofQLuyOpm0BN5gqarcr5FyJ56yFrYEDZl5Y0wsy/Vz0EShPqWgMPlCzokbAxQQt4Vsrqlw1zCu1LwIRDDMNunIjGEzAcL6T1gTbhcyGwyx4uY7VCp4UWOMXrpmleeanVKjcpGkmTjsbO2WO44GTaB74kUsdEN2lLKEhh3kOuCS6Mt38hllw6Do/CI7PZ5g5KC6IY20tKlpn+NvdM0aMgRJgPVD5WlVXBshAou/tnWvzUBB+tZ1HDZLgoj1OxLk516aAyrlE4IQ82Kk2twtmyaVQ4Wc0VqmZ/MmEGRwkkf5GQccd+x8kdgAuoP8AJ+lxx3fxMc8JElm58trkke2CD2k3mnkUbHcM5QyQg6ckIYsW42DRMoPst4bkn4BKubYX9+peIDfXYJW5XZPvHopEnc7OXVO2XydG7c9XGtMkq4O3xnQaZwfF7njef8AddLsh//0snD3AqpWz+qUCVL9VDB7kYybQlmDhjWyYXBumXnrF3wQnLui3EXm0EGVBPNyo20h/hjgz2h0SKGhuruiCxYPYv6mTyze8QEF2fV6+tNhq8l+w+T8ezv A67Efd+z 5exKBZ5wbOS6jPlCeqJwEzutWqJ0OlflujSkZzjXyXlFHQ78yFC/SVCfs13dfQkpAozgCyoMX+Tyo544FmDUH9foH6nZJ3OZ05vc+nN8HiEgAlJKAJgRa4lrHkCxutfebDYxMlIBQoGC1RfK1RzkLSAPGcPuZwNYvffde96jDcY1DjiR6uhBJKeQyFK0AUKHb1cxJ7NS8eYAnX7VgcdD+qNxQ/bVsAgstvKWKvhdYbhTPoUoLwBiKMktEhuF4soC63cT2Q2vL42NCzo0zQ95EY/mttcYe8YVSx764GmjH6pDE8SOF4GTI4Xm1DlP4+vh1noUid0xlcwVPucqvQc6fShCH8lYYdx00ES9V1t1ZC0dtRR4SSLOnCAUn8dOU41Yk5OHk+4ePTBnylTWGQuXudatAAyWEMfrbjC4JrYgfXr/CFaZtXjB4yuX/nk1lPgjg/o1Pzq04CvhsOIGx9k7AEt2yDkENwK02KW3T/R4BARADpyfREvXumprJiFHIahOHvZSupXte8WCEX7LCpMMJVITAplaaFhUye8yo0PA/AV5ag6VU/SWutV47/Ikr2vwTErGM 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: List-Subscribe: List-Unsubscribe: We anyway don't use any return values from fadump_cma_init(). Since fadump_reserve_mem() from where fadump_cma_init() gets called today, already has the required checks. This patch makes this function return type as void. Let's also handle extra cases like return if fadump_supported is false or dump_active, so that in later patches we can call fadump_cma_init() separately from setup_arch(). Acked-by: Hari Bathini Signed-off-by: Ritesh Harjani (IBM) Reviewed-by: Madhavan Srinivasan for the series. --- v2 -> v3: Separated the series into 2 as discussed in v2. [v2]: https://lore.kernel.org/linuxppc-dev/cover.1728585512.git.ritesh.list@gmail.com/ arch/powerpc/kernel/fadump.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) -- 2.46.0 diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c index a612e7513a4f..162327d66982 100644 --- a/arch/powerpc/kernel/fadump.c +++ b/arch/powerpc/kernel/fadump.c @@ -78,27 +78,23 @@ static struct cma *fadump_cma; * But for some reason even if it fails we still have the memory reservation * with us and we can still continue doing fadump. */ -static int __init fadump_cma_init(void) +static void __init fadump_cma_init(void) { unsigned long long base, size; int rc; - if (!fw_dump.fadump_enabled) - return 0; - + if (!fw_dump.fadump_supported || !fw_dump.fadump_enabled || + fw_dump.dump_active) + return; /* * Do not use CMA if user has provided fadump=nocma kernel parameter. - * Return 1 to continue with fadump old behaviour. */ - if (fw_dump.nocma) - return 1; + if (fw_dump.nocma || !fw_dump.boot_memory_size) + return; base = fw_dump.reserve_dump_area_start; size = fw_dump.boot_memory_size; - if (!size) - return 0; - rc = cma_init_reserved_mem(base, size, 0, "fadump_cma", &fadump_cma); if (rc) { pr_err("Failed to init cma area for firmware-assisted dump,%d\n", rc); @@ -108,7 +104,7 @@ static int __init fadump_cma_init(void) * blocked from production system usage. Hence return 1, * so that we can continue with fadump. */ - return 1; + return; } /* @@ -125,10 +121,9 @@ static int __init fadump_cma_init(void) cma_get_size(fadump_cma), (unsigned long)cma_get_base(fadump_cma) >> 20, fw_dump.reserve_dump_area_size); - return 1; } #else -static int __init fadump_cma_init(void) { return 1; } +static void __init fadump_cma_init(void) { } #endif /* CONFIG_CMA */ /* @@ -638,7 +633,7 @@ int __init fadump_reserve_mem(void) pr_info("Reserved %lldMB of memory at %#016llx (System RAM: %lldMB)\n", (size >> 20), base, (memblock_phys_mem_size() >> 20)); - ret = fadump_cma_init(); + fadump_cma_init(); } return ret; From patchwork Fri Oct 11 15:00:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ritesh Harjani (IBM)" X-Patchwork-Id: 13832629 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3BE9D0D7AB for ; Fri, 11 Oct 2024 15:00:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1D2A86B00A3; Fri, 11 Oct 2024 11:00:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 182666B00A5; Fri, 11 Oct 2024 11:00:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 049AC6B00A7; Fri, 11 Oct 2024 11:00:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id DC82C6B00A3 for ; Fri, 11 Oct 2024 11:00:24 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 6F1DC8124F for ; Fri, 11 Oct 2024 15:00:20 +0000 (UTC) X-FDA: 82661632326.03.C0D5043 Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) by imf16.hostedemail.com (Postfix) with ESMTP id 010BB180016 for ; Fri, 11 Oct 2024 15:00:19 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=bnsVdkPv; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf16.hostedemail.com: domain of ritesh.list@gmail.com designates 209.85.210.182 as permitted sender) smtp.mailfrom=ritesh.list@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1728658709; a=rsa-sha256; cv=none; b=Y86RgdmsqkhTE0tqP8P4teUJapXVAuqYdp578STG4+aFKgt9A7kgdNF735Hl6KPmlGs0q/ 0Qy90ULYGNExzdWOiqPt3fvniT5Qkoe8XTcypyQAviodzM1fa8CY93N0cqt1y24E3BAVU/ UbiGnGHgtQHstOXxv6xutDLJD16TyvA= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=bnsVdkPv; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf16.hostedemail.com: domain of ritesh.list@gmail.com designates 209.85.210.182 as permitted sender) smtp.mailfrom=ritesh.list@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1728658709; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=FOuvgWQlE/foa4I7724xWSn7l3vcksejBT7rSNJjxxM=; b=D0MZrq/gk7zTfesgIkQXSP3UDuP6CYGYVd4SlbMrtai/j9xJM+9ydMwL2o1t6Irki+SUP9 Bbwifi3pgJaWzxOohR62zRVAg/6i7oAHrhcWl4DFU5qKzl5P1kxP/Ct8LvCfgz34QwLtAt 2X56Hw7piLrKweeJfFRTsYg6jDyrUYk= Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-71dec1cf48fso1839009b3a.0 for ; Fri, 11 Oct 2024 08:00:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728658821; x=1729263621; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FOuvgWQlE/foa4I7724xWSn7l3vcksejBT7rSNJjxxM=; b=bnsVdkPvckRXc1AxjGPKaAradQ5W9InN726OoAiXAQIbeG27BbWbjs8Dd7kzS8O9fM AQukcUKbLjqAo4pbOczS4vCFwc984aj0pjGQPPvnwC4hrODrzWNS0JyPttlCKTcj5B1x uKNeWa1YgSpWpGFykhZZBzMt5IDD87T6eXY1NoF/9ZTaD/Unqqb0Rjav4UK7APHMmEKV xtIow7yMLi+eII1lFwesx/nIl0K0mYjWEVXivhHdRrXvNRcLchwugHDOu1BAwVASiB2d 4/IL0+jzEYkrE7/LJgNUbOmK1hj/zbOsbcawoQDPz97yPy8S7LkUri4qFx1+xEBgxBZU wyiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728658821; x=1729263621; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FOuvgWQlE/foa4I7724xWSn7l3vcksejBT7rSNJjxxM=; b=s8BW+VH6X4NowV0b+KdXpqfDcTVKHYWzG8Ug2BEJtfcPz34FzdLBVvRR+0XOfgyYtS HVksg7ZwnyHZ2aSVSOi4FAWiAmxfihyk8Bz+D4mI/9RS4YPbaBldqYhWnpzlS7AVCYxM XgTyiPyE8vueJt42goeFlm0S1ziJwrbDXPSnMkap+4sk6QWQUWhBSejxsvUCUFGphnb8 GTUF54V0BR0giqkW9Yn1hYaZoEARfBGQ9HFkYM6ISM6phNEDwZgUcMcozgnVSDblfd9h XmQbEE1a2B4+dbbiYu7KARIjMVuidP2hNFpGfH+wUf4/h1oRBUvr999Ubx9HAEI2u+nF hvVw== X-Gm-Message-State: AOJu0Yyz+eNhWrGgosAuH3rfHCA5vdoLlZAFODRQPPZEb4t2qGqWbuqD 7gvD8lXxOh/zxlo3vfGxMh1bP8ILRJQRuErRqBwAj4wXy16pD5RE X-Google-Smtp-Source: AGHT+IG28SN7o4rqiQUvFnUoGcWs4GuDv3GMOcb/mAbo3sv1g27mwrxdu/TPHQf2tYzBTJhSQ+rF+g== X-Received: by 2002:a05:6a00:4fd6:b0:71d:fb10:7d1c with SMTP id d2e1a72fcca58-71e380beb6bmr3997069b3a.26.1728658820768; Fri, 11 Oct 2024 08:00:20 -0700 (PDT) Received: from dw-tp.. ([171.76.85.106]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71e4a2c9767sm146561b3a.85.2024.10.11.08.00.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Oct 2024 08:00:20 -0700 (PDT) From: "Ritesh Harjani (IBM)" To: linuxppc-dev@lists.ozlabs.org Cc: linux-mm@kvack.org, Sourabh Jain , Hari Bathini , Zi Yan , David Hildenbrand , "Kirill A . Shutemov" , Mahesh J Salgaonkar , Michael Ellerman , Madhavan Srinivasan , "Aneesh Kumar K . V" , Donet Tom , LKML , Sachin P Bappalige , "Ritesh Harjani (IBM)" Subject: [RFC v3 2/3] fadump: Reserve page-aligned boot_memory_size during fadump_reserve_mem Date: Fri, 11 Oct 2024 20:30:05 +0530 Message-ID: <32496f6daeb4ed04c772ae484895241ab2ae1da1.1728658614.git.ritesh.list@gmail.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <030b6d46fddac126a6cf7e119bea48055338f0ed.1728658614.git.ritesh.list@gmail.com> References: <030b6d46fddac126a6cf7e119bea48055338f0ed.1728658614.git.ritesh.list@gmail.com> MIME-Version: 1.0 X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 010BB180016 X-Stat-Signature: zbsdj4px1e6ubwjrzhgyiyho4kib43u8 X-Rspam-User: X-HE-Tag: 1728658819-531910 X-HE-Meta: U2FsdGVkX18MZDwe8Z/25DvPZ+DW5TnzjzAkki1MR39yjxHzAe85T5+XA8TGqwOQT2fEJK+hwcnknDXnEKE8tQ7Feh2T6xiWNxQL473B6bPOZzNorGgRrzj6yxxvV8iqyfhPSrvf8Xa1JK1iF/1BN6H5CSbIh8TJYInXktztycNW9FJ1mk81p7MNXtRaTKxBAYuoyLpvLNMEGWLayqlTw1oBGi+p4fwRoAGGKF6yakNj3jmjwc0M67U+jrtnzzZX5ze68+hxH/9gAaMRDaj2ocGV7LG7sxX+yH53Qz6MctvCvjOqPWH/CbbVP+PiHDCWFkiQUFSlup5Ufv7ccXYUpoZ2lxwPco6yJB9qWZzeREmEK28pgk5pvacaDoEVuuSo07D+mdR2d3VCc36ko3dLeTaEEIkIb2F1ZOV4+hEIvgtnJ8rRfbx/v9X2KUVhltmd56YI58Ld5RrM3rilXkVOrFNfxY9WJ9Fv35m7PZD3i4CV5yKR8lbguOCw/tB9J6Ch8YBizJtNtqEN3dank1eLrsyKlRWDeo9Dnvlte19OKNMrAhNBp+8R2CrmZbqFAgJWVjFLEduXHg46UPxRnopMTiV1961A9D7F7fcii6uv9xvLx836V5N+GgZ9bS2yC7aPgGYuoV6Gt/hC0wZ3lDHQKBSAawA3MZfFX5qPCgLe36F/ZNGuDUv8w+69LpcmpWueucsNojtSq4lCsJgTkaEw8S0TR5QMT+UviSSwuYpA0E92v8ucd3fzY86oSWHrW9MDRRPTtojTN6Uehm5k4veoma2hX7MkzlB0xiVsh41H15FGHIVWsSPmad45/l1O9L7ub1RrK8GkWSLHhIU7q2izUo3JTMUABKxh6n3vp8srXFAzPtMxE9IlBGs5zjy5v6dqokNXguJJFaQq8wJ3jUT4UghFaSYqn9Br34wCCsk/nfTu7dWqSEshGqHJddoPv1XQeAjQKByLSX06f58xZE7 6s4Lh+xH L6nMTkSh/VcdSE4JlGhWx9b3+MqHAl6rbhS1CEZjbqfp9EzyRYx6gBoBfzb9FzpvSjs2ItETwJj8nBo5dZfUA4q6tAiLxxE63WnS7RHacwSruUoo4s0NP2KRFX2RMR2m7EYRx8Nq/qtH+jauy43R0liJ8uLJJBD8BV8peRT8LhHBqplbyKE20w4ggR17aLdAvmMiYHknFlS7ZBJLnj9ULiL2GLb1QIp5TTgs9dFvKlH4a+k441LnQgVjYNeZMvNfR1pbdQF9Xlod/nk0VIPatzOqkNBI/3Tpsys0R9TTLRjckkyKMowgYNJtESQSqadEF6di40GbIbssub+g7aSJbp9Bn6EgLvMpM/HMKNM969USW5Z3+NUg67m+qoLUgqiNRDjBv9A0nz1tRyvQffVomd0FDWOGh/44Mwj8RUGDgU3bb8a4ThPKzhj8fQRdi5WVqgRk3DO4VAUPwz1zdcjZ+OTjYxWzuUeD2+XZSxp9p4eTW+owztVr9O1hQOB8l70d2ZsxECidl3etxLvh5Oh1IkpS4cIE75cfvjxD8sBYZAUvBY2Y= 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: List-Subscribe: List-Unsubscribe: This patch refactors all CMA related initialization and alignment code to within fadump_cma_init() which gets called in the end. This also means that we keep [reserve_dump_area_start, boot_memory_size] page aligned during fadump_reserve_mem(). Then later in fadump_cma_init() we extract the aligned chunk and provide it to CMA. This inherently also fixes an issue in the current code where the reserve_dump_area_start is not aligned when the physical memory can have holes and the suitable chunk starts at an unaligned boundary. After this we should be able to call fadump_cma_init() independently later in setup_arch() where pageblock_order is non-zero. Suggested-by: Sourabh Jain Acked-by: Hari Bathini Signed-off-by: Ritesh Harjani (IBM) --- arch/powerpc/kernel/fadump.c | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c index 162327d66982..ffaec625b7a8 100644 --- a/arch/powerpc/kernel/fadump.c +++ b/arch/powerpc/kernel/fadump.c @@ -80,7 +80,7 @@ static struct cma *fadump_cma; */ static void __init fadump_cma_init(void) { - unsigned long long base, size; + unsigned long long base, size, end; int rc; if (!fw_dump.fadump_supported || !fw_dump.fadump_enabled || @@ -92,8 +92,24 @@ static void __init fadump_cma_init(void) if (fw_dump.nocma || !fw_dump.boot_memory_size) return; + /* + * [base, end) should be reserved during early init in + * fadump_reserve_mem(). No need to check this here as + * cma_init_reserved_mem() already checks for overlap. + * Here we give the aligned chunk of this reserved memory to CMA. + */ base = fw_dump.reserve_dump_area_start; size = fw_dump.boot_memory_size; + end = base + size; + + base = ALIGN(base, CMA_MIN_ALIGNMENT_BYTES); + end = ALIGN_DOWN(end, CMA_MIN_ALIGNMENT_BYTES); + size = end - base; + + if (end <= base) { + pr_warn("%s: Too less memory to give to CMA\n", __func__); + return; + } rc = cma_init_reserved_mem(base, size, 0, "fadump_cma", &fadump_cma); if (rc) { @@ -116,11 +132,12 @@ static void __init fadump_cma_init(void) /* * So we now have successfully initialized cma area for fadump. */ - pr_info("Initialized 0x%lx bytes cma area at %ldMB from 0x%lx " + pr_info("Initialized [0x%llx, %luMB] cma area from [0x%lx, %luMB] " "bytes of memory reserved for firmware-assisted dump\n", - cma_get_size(fadump_cma), - (unsigned long)cma_get_base(fadump_cma) >> 20, - fw_dump.reserve_dump_area_size); + cma_get_base(fadump_cma), cma_get_size(fadump_cma) >> 20, + fw_dump.reserve_dump_area_start, + fw_dump.boot_memory_size >> 20); + return; } #else static void __init fadump_cma_init(void) { } @@ -553,13 +570,6 @@ int __init fadump_reserve_mem(void) if (!fw_dump.dump_active) { fw_dump.boot_memory_size = PAGE_ALIGN(fadump_calculate_reserve_size()); -#ifdef CONFIG_CMA - if (!fw_dump.nocma) { - fw_dump.boot_memory_size = - ALIGN(fw_dump.boot_memory_size, - CMA_MIN_ALIGNMENT_BYTES); - } -#endif bootmem_min = fw_dump.ops->fadump_get_bootmem_min(); if (fw_dump.boot_memory_size < bootmem_min) { From patchwork Fri Oct 11 15:00:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ritesh Harjani (IBM)" X-Patchwork-Id: 13832630 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF4D0D0D7B3 for ; Fri, 11 Oct 2024 15:00:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 506946B00A7; Fri, 11 Oct 2024 11:00:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4B6396B00A9; Fri, 11 Oct 2024 11:00:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3A5AA6B00AA; Fri, 11 Oct 2024 11:00:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 1AF796B00A7 for ; Fri, 11 Oct 2024 11:00:29 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id DC0691A0E12 for ; Fri, 11 Oct 2024 15:00:20 +0000 (UTC) X-FDA: 82661632494.11.3D6E0D7 Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) by imf21.hostedemail.com (Postfix) with ESMTP id D5B431C0029 for ; Fri, 11 Oct 2024 15:00:21 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=UUm5Xu37; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf21.hostedemail.com: domain of ritesh.list@gmail.com designates 209.85.210.179 as permitted sender) smtp.mailfrom=ritesh.list@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1728658782; a=rsa-sha256; cv=none; b=G3v5aF/wJahYbhAsiuvMRnnjn/3zCD5MuOg9G98jRAGleJoYv3BaISHzuw/2QMyJC9ztbX XEBR008QtzqeI9LjhvYwkQea4c6ThTfoJarSthA9BG+xO1w35zOT+Ers6L3k05sh0J3ZXN OPGOOIwJNfV/QsS8s3EZ4JCuqhyYm+0= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=UUm5Xu37; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf21.hostedemail.com: domain of ritesh.list@gmail.com designates 209.85.210.179 as permitted sender) smtp.mailfrom=ritesh.list@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1728658782; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=SU6Z8cvJobq05V76diaI6hL+YRyehnIANBYxgVSeFp8=; b=046MBlXDgLx6qAM6oyvkDLehtkOe60xOfy5xLXF6mmZli0j28aZOjk1HfwkpCSVR/aXcwG ehN3IfFLPEp+WpTYa4rTEf0jH6wmcat8UXUY8o4w3ym0YPLHU9hxmVYFsb/lzFn0AwI7qP WK59L6Znj88it91ZHNuEwAlGAoHy85c= Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-71e03be0d92so1789449b3a.3 for ; Fri, 11 Oct 2024 08:00:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728658825; x=1729263625; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SU6Z8cvJobq05V76diaI6hL+YRyehnIANBYxgVSeFp8=; b=UUm5Xu37QtVJkz05F8UKvwM8U14Orf7dhfrZp9lCgsEqUzXv0miijWF3SCEAWRsxKw 6FXWhB1eXxFTVnkNQBdAdriiGu2M019aMUnXVnaLYl96Zyy1DCNztnKx+LGkdwW6eape QztLwGAnZpDPteWExBa+Qrkt4kSpLx4/4ftVZ0yTr+G8Na+e5OtYDbuBJA3QCPIV893K hPQTQ8HkIK9rbpa0q004emsIJSZwYiDTdu3lBi8KgrGTgIRXyuse5vfZVTYSKkCFjObZ s5HERBcdmnb9I6C7BlwfPfYOUIcPRDVah4dQ4LAkgSQZc8cY+mgglSzbsp6qzKFI7IXV MVmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728658825; x=1729263625; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SU6Z8cvJobq05V76diaI6hL+YRyehnIANBYxgVSeFp8=; b=HAwpmitDDqt7gWePDw94tBQEp2I3LARL2lsTtEksnZsVTjF8O+BPr2wZVthGIXzBPi LDm/KmKuY1cSHVNzPd2SvhtnD+6AiiafNIUcT7NyvUVYqassoe5Fq3tb8vXBfZjTxm/K 9qhTNZKdr8EEUbPZwFFBE/IWDtGQX8tR9ph5rH/OGTsAW15nvWyVi3U/VxbeU23KLlyq ycqSjXxQ7Lyjflry4pbbOPWPWSRacSi3/97jlWFixNoETmq/rZ6+wATc9c/TMXSrPTtc kvWqMRDNzDuhIjuLKWKHEt0fjF92AQ7R0gesJjUhhF7wEvT1eaDnXxTTEKGS/O8Q4mJr 7xGw== X-Gm-Message-State: AOJu0YyAT4Q7LzkS9tLIVMq9+oGJlk6XeAv5MghExpqTclUu9tS9Iwa2 5tRFNj3oZgbiMcwsfvD7ONdHSF7F7UYHNe6pm35k4o1b0CXvn1TJ X-Google-Smtp-Source: AGHT+IHIUtDDWU1ylOOcQb4+U5VINFQKXV7ELQ0WwbOcryePVBd3VxH1zwAA7jKr8WsXcEzg2aapfg== X-Received: by 2002:a05:6a00:1941:b0:710:5848:8ae1 with SMTP id d2e1a72fcca58-71e37e28ad2mr5574776b3a.4.1728658825459; Fri, 11 Oct 2024 08:00:25 -0700 (PDT) Received: from dw-tp.. ([171.76.85.106]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71e4a2c9767sm146561b3a.85.2024.10.11.08.00.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Oct 2024 08:00:24 -0700 (PDT) From: "Ritesh Harjani (IBM)" To: linuxppc-dev@lists.ozlabs.org Cc: linux-mm@kvack.org, Sourabh Jain , Hari Bathini , Zi Yan , David Hildenbrand , "Kirill A . Shutemov" , Mahesh J Salgaonkar , Michael Ellerman , Madhavan Srinivasan , "Aneesh Kumar K . V" , Donet Tom , LKML , Sachin P Bappalige , "Ritesh Harjani (IBM)" Subject: [RFC v3 3/3] fadump: Move fadump_cma_init to setup_arch() after initmem_init() Date: Fri, 11 Oct 2024 20:30:06 +0530 Message-ID: <759d0fc37d9fedca6cfe78ea7061447ecbf1bc77.1728658614.git.ritesh.list@gmail.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <030b6d46fddac126a6cf7e119bea48055338f0ed.1728658614.git.ritesh.list@gmail.com> References: <030b6d46fddac126a6cf7e119bea48055338f0ed.1728658614.git.ritesh.list@gmail.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Queue-Id: D5B431C0029 X-Rspamd-Server: rspam01 X-Stat-Signature: t1m3e87rjhc5osty3aijphxpqn8riz33 X-HE-Tag: 1728658821-412195 X-HE-Meta: U2FsdGVkX1+bTfF6PWJynNPDdiyMFkTxX8mPl2J+GhhfxD370vtnAPEkMWyCtb3J0V1+9xd/RwzFNuT8zmL//P+tkdntIjnaRIMhRX0TK30Gbg8sIJa0O58k71wU2twVY+FtEUNSQocG7LErGeXXeHobYtoQm+aEXpiJ4N8Dq905+rAOJhCXDNRkHAir4CDW/B1A37Px+XtyfzgI6o2RhKCM4L9Uo5efJ9r5lkgx1DKqgErmdSFxNWj9BkJIbm9KqrQcmsV1TlDuQKfzkHpxmBjZS3xDjl3QG8wbvYTKg+TOBMYyXRbzEel5IfhEOMHup0Icv9Jpl6Xwi8t2riLq5pguwFvk8CtM0MqmRUdJVB7zLop5FLPEvUkMpQsGQKtXllhFC8dgYlobovHtSuPAESL45Nen1nb51gQD5eXjS/cy+r2oQIcyh/3+PZgVYoN5fSOQQwu68siohFGtWSLl0XGA6jb1dET5ZOq9uq+GFyqNW8IyZUNnwxv9csbzr1YUYuI0Pk80gdQ2QihBEylFRJs0bRruiByl4GrYcAldVRky9SxsZ59ijb+VAMBqYRkZyEFk/ZDBvHoFS1ITEBHeMBf+rqN30F1MjZkyF5Jij+6LuQVd6u82T2xVG1fca8L8YGoCCkZjw4pDWS5d5MjHpeLa6nqBTdLLRadsCR80O9qjmQcZK9IC9QgjC+F3qsxE0KSIEasmRr8wQyFCfJIXeSsQfn29ZuK3S48mMXUZxlvQjcDDvcMZ2+hcx2hgZtGo1nh2cBzY2otK6MMa34aMkAr2pzmWIOs18MufMYx/XHNFVQmbYvG6rgtBPYMyQUvZ4OWVU/ZnPUqHhSgW9V2FxdmNuRLtpLslxf7zScgAwEdFyGaEevrwe6W8pH81YLxObJrlnX6KQ3kRNXpL4mGyWjJXIKGvmZNWIM30UD7rXDJYbwD07HI++tnXanSirck4j1ECn3+VtzKd/aUE9H7 v5wE3ysi HC00tNvgAssASkX4xJJHmSqdvu+imcqRxOqovW8yyE6HQ4TAEZ6LC9Fht6Rz/xhnajweQ8IH4MZJguiKMcXicoKWukmAjd+lWHzxc1C2cRTHlwKcUkelndCdjB67qLUlbq5SntKoCXYNilxlTPKWoo8B7eXe+35NEjMBn9rQhNNS6UlqL/B98qioI2KFTe1FohTfjJeUFp9r9sunZLTPawrDA/kB3qFTgzcEHIUgrdpP+kMyoELmMEQct8InQPDTdA1Xcf9A5lg2xhOE2RVFZ0Um7TjmSXQdnYFTCQfPnBwQ077IfAc0+abH0odbdELx9crbysF6+m3t4Mf6bCcmETF5NDD+oa5tPBFbDnLm5bGzN5NnQ4Vpr47Pqw5gm5Og/2WT+IZ0rOL5l9iR4qM20tLN8unhT1M6EqxZndNjMGDCGJqkcs+dVq9WZH/FjbC8sExrIBoavB3zdlV3HvIJp3aAnPciTF04WRQYKZPFo196WFiBZGcZ6HuhZpeu51UszujfNdEjSca8pfD5d0FPERgrzz8QumOD14NY8n5EHdPJ6NkY2x4vT+pgMYDxUnuNHjp9j 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: List-Subscribe: List-Unsubscribe: During early init CMA_MIN_ALIGNMENT_BYTES can be PAGE_SIZE, since pageblock_order is still zero and it gets initialized later during initmem_init() e.g. setup_arch() -> initmem_init() -> sparse_init() -> set_pageblock_order() One such use case where this causes issues is - early_setup() -> early_init_devtree() -> fadump_reserve_mem() -> fadump_cma_init() This causes CMA memory alignment check to be bypassed in cma_init_reserved_mem(). Then later cma_activate_area() can hit a VM_BUG_ON_PAGE(pfn & ((1 << order) - 1)) if the reserved memory area was not pageblock_order aligned. Fix it by moving the fadump_cma_init() after initmem_init(), where other such cma reservations also gets called. ============== page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10010 flags: 0x13ffff800000000(node=1|zone=0|lastcpupid=0x7ffff) CMA raw: 013ffff800000000 5deadbeef0000100 5deadbeef0000122 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: VM_BUG_ON_PAGE(pfn & ((1 << order) - 1)) ------------[ cut here ]------------ kernel BUG at mm/page_alloc.c:778! Call Trace: __free_one_page+0x57c/0x7b0 (unreliable) free_pcppages_bulk+0x1a8/0x2c8 free_unref_page_commit+0x3d4/0x4e4 free_unref_page+0x458/0x6d0 init_cma_reserved_pageblock+0x114/0x198 cma_init_reserved_areas+0x270/0x3e0 do_one_initcall+0x80/0x2f8 kernel_init_freeable+0x33c/0x530 kernel_init+0x34/0x26c ret_from_kernel_user_thread+0x14/0x1c Fixes: 11ac3e87ce09 ("mm: cma: use pageblock_order as the single alignment") Suggested-by: David Hildenbrand Reported-by: Sachin P Bappalige Acked-by: Hari Bathini Signed-off-by: Ritesh Harjani (IBM) --- arch/powerpc/include/asm/fadump.h | 7 +++++++ arch/powerpc/kernel/fadump.c | 6 +----- arch/powerpc/kernel/setup-common.c | 6 ++++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/arch/powerpc/include/asm/fadump.h b/arch/powerpc/include/asm/fadump.h index ef40c9b6972a..3638f04447f5 100644 --- a/arch/powerpc/include/asm/fadump.h +++ b/arch/powerpc/include/asm/fadump.h @@ -34,4 +34,11 @@ extern int early_init_dt_scan_fw_dump(unsigned long node, const char *uname, int depth, void *data); extern int fadump_reserve_mem(void); #endif + +#if defined(CONFIG_FA_DUMP) && defined(CONFIG_CMA) +void fadump_cma_init(void); +#else +static inline void fadump_cma_init(void) { } +#endif + #endif /* _ASM_POWERPC_FADUMP_H */ diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c index ffaec625b7a8..c42f89862893 100644 --- a/arch/powerpc/kernel/fadump.c +++ b/arch/powerpc/kernel/fadump.c @@ -78,7 +78,7 @@ static struct cma *fadump_cma; * But for some reason even if it fails we still have the memory reservation * with us and we can still continue doing fadump. */ -static void __init fadump_cma_init(void) +void __init fadump_cma_init(void) { unsigned long long base, size, end; int rc; @@ -139,8 +139,6 @@ static void __init fadump_cma_init(void) fw_dump.boot_memory_size >> 20); return; } -#else -static void __init fadump_cma_init(void) { } #endif /* CONFIG_CMA */ /* @@ -642,8 +640,6 @@ int __init fadump_reserve_mem(void) pr_info("Reserved %lldMB of memory at %#016llx (System RAM: %lldMB)\n", (size >> 20), base, (memblock_phys_mem_size() >> 20)); - - fadump_cma_init(); } return ret; diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index 4bd2f87616ba..9f1e6f2e299e 100644 --- a/arch/powerpc/kernel/setup-common.c +++ b/arch/powerpc/kernel/setup-common.c @@ -996,9 +996,11 @@ void __init setup_arch(char **cmdline_p) initmem_init(); /* - * Reserve large chunks of memory for use by CMA for KVM and hugetlb. These must - * be called after initmem_init(), so that pageblock_order is initialised. + * Reserve large chunks of memory for use by CMA for fadump, KVM and + * hugetlb. These must be called after initmem_init(), so that + * pageblock_order is initialised. */ + fadump_cma_init(); kvm_cma_reserve(); gigantic_hugetlb_cma_reserve();