From patchwork Mon Jun 13 08:21:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: mawupeng X-Patchwork-Id: 12879120 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 1C46BC43334 for ; Mon, 13 Jun 2022 08:00:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 883088D0163; Mon, 13 Jun 2022 04:00:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 833AE8D0162; Mon, 13 Jun 2022 04:00:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 61F068D0163; Mon, 13 Jun 2022 04:00:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 4BCA88D0142 for ; Mon, 13 Jun 2022 04:00:41 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 290B360EAA for ; Mon, 13 Jun 2022 08:00:41 +0000 (UTC) X-FDA: 79572465882.22.24DB973 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf12.hostedemail.com (Postfix) with ESMTP id 33DA340097 for ; Mon, 13 Jun 2022 08:00:39 +0000 (UTC) Received: from dggpemm500021.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4LM3nN2LhNzRhyk; Mon, 13 Jun 2022 15:57:12 +0800 (CST) Received: from dggpemm500014.china.huawei.com (7.185.36.153) by dggpemm500021.china.huawei.com (7.185.36.109) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Mon, 13 Jun 2022 16:00:28 +0800 Received: from localhost.localdomain (10.175.112.125) by dggpemm500014.china.huawei.com (7.185.36.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Mon, 13 Jun 2022 16:00:27 +0800 From: Wupeng Ma To: , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v4 2/6] arm64/mirror: arm64 enabling - find mirrored memory ranges Date: Mon, 13 Jun 2022 16:21:43 +0800 Message-ID: <20220613082147.183145-3-mawupeng1@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220613082147.183145-1-mawupeng1@huawei.com> References: <20220613082147.183145-1-mawupeng1@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm500014.china.huawei.com (7.185.36.153) X-CFilter-Loop: Reflected ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1655107240; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Sz0ppXu94FD4gnGC2OE16e3BJiKVkqXJJS3QRDoKYgU=; b=Ce4IqbvUrxcuzsaweJZ3e/MgwCJGDlRNPZS6ipXXspvnE/QmISnQ4ec83W+C7NmEfFu9W4 CdOWD/y15q2TXiqvTWIYZSQx8aWiodV98Zzz9D6ATXdEb93aVCH+3D1ZwBFJQEyZ2x0IOt n2cnZMnhxOJcFigSy4cLbVLNWNq+Nk4= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1655107240; a=rsa-sha256; cv=none; b=OATPdbjKWy0pr60SlqWuBeT3LyFVtjrcbff8LpYCEVLBf1ZSG7HbbkCuptnJ6DCklrCN7k LqIrhH8TXlfBeZ0rypnKQtO4wPRr1Z2cbfmVMISJ/RL9SqLiRSLXG2KGryGdzjY5ZaMwGr wC52bQS6fT2h+apsyPvDyy/j5brGiyQ= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf12.hostedemail.com: domain of mawupeng1@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=mawupeng1@huawei.com X-Rspam-User: Authentication-Results: imf12.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf12.hostedemail.com: domain of mawupeng1@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=mawupeng1@huawei.com X-Rspamd-Server: rspam03 X-Stat-Signature: 4s1qjnm4x7ji6qiisy3tcp8rfy1ih1zx X-Rspamd-Queue-Id: 33DA340097 X-HE-Tag: 1655107239-322808 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: From: Ma Wupeng Commit b05b9f5f9dcf ("x86, mirror: x86 enabling - find mirrored memory ranges") introduced mirrored memory support for x86 and this could be used on arm64. Since we only support this feature on arm64, efi_find_mirror() won't be placed into efi_init(), which is used by riscv/arm/arm64, it is added in setup_arch() to scan the memory map and mark mirrored memory in memblock. Signed-off-by: Ma Wupeng Reviewed-by: Kefeng Wang --- Documentation/admin-guide/kernel-parameters.txt | 2 +- arch/arm64/kernel/setup.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 8090130b544b..e3537646b6f7 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -2301,7 +2301,7 @@ keepinitrd [HW,ARM] - kernelcore= [KNL,X86,IA-64,PPC] + kernelcore= [KNL,X86,IA-64,PPC,ARM64] Format: nn[KMGTPE] | nn% | "mirror" This parameter specifies the amount of memory usable by the kernel for non-movable allocations. The requested diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index cf3a759f10d4..6e9acd7ecf0f 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c @@ -328,6 +328,7 @@ void __init __no_sanitize_address setup_arch(char **cmdline_p) xen_early_init(); efi_init(); + efi_find_mirror(); if (!efi_enabled(EFI_BOOT) && ((u64)_text % MIN_KIMG_ALIGN) != 0) pr_warn(FW_BUG "Kernel image misaligned at boot, please fix your bootloader!");