From nobody Tue Feb 10 02:49:30 2026 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 675B3137757 for ; Mon, 8 Jul 2024 13:29:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.187 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720445394; cv=none; b=HFfyMV7LuA4H9DEiLRwyDCJqiWUlXPQ/agvx9zvF3QDlK/lTMYmr9N28i3QoBuE8VPwGbzok2zf0CujTLDZRRmjR272SJYKjcAtZfKzF0U2WfNZozcJ/QfqY2/89/M8BYNQ+9aTNP9fAG9wdF8ZIqslYiuqCUQQtvgdhrxRNRLA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720445394; c=relaxed/simple; bh=v0m01wOgJdCx25vKCu7GRWUXyEUDmtefnlx+KwmQUEU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=P8Ip8Bi51GrWgYygVNxboGLFX5SUTsubR22LVCYVvC98s2Rn9bzT76VghSTVUye26XutAV6tTMADNtrRilkJD+XOoX05EUbsGE25VGj62uCU9bX4s55PvwpcKRqarM485me4KbPeala4dnMw8qa5rvxK+4U2yvrm6b5GazbSLyE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.187 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.252]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4WHlGs2J4bzwWPg; Mon, 8 Jul 2024 21:25:09 +0800 (CST) Received: from kwepemi100008.china.huawei.com (unknown [7.221.188.57]) by mail.maildlp.com (Postfix) with ESMTPS id 8465C180087; Mon, 8 Jul 2024 21:29:49 +0800 (CST) Received: from huawei.com (10.90.53.73) by kwepemi100008.china.huawei.com (7.221.188.57) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Mon, 8 Jul 2024 21:29:48 +0800 From: Jinjie Ruan To: , , , , , , , , , , , , , , , , , , , , , CC: Subject: [PATCH 2/3] ARM: Fix crash kenrel data type bug Date: Mon, 8 Jul 2024 21:33:47 +0800 Message-ID: <20240708133348.3592667-3-ruanjinjie@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240708133348.3592667-1-ruanjinjie@huawei.com> References: <20240708133348.3592667-1-ruanjinjie@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemi100008.china.huawei.com (7.221.188.57) Content-Type: text/plain; charset="utf-8" On QEMU vexpress-a9 with 1GB memory, the crash kernel "crashkernel=3D4G" is ok as below: Reserving 4096MB of memory at 2432MB for crashkernel (System RAM: 1024MB) The above info is confusing, because the System memory is as below: # cat /proc/iomem | grep Sys 60000000-9fffffff : System RAM The cause is that the crash_size is parsed and printed with "unsigned long long" data type which is 8 bytes but used with "phys_addr_t" which is 4 bytes in memblock_phys_alloc_range(). Fixes: 9d17f3372306 ("ARM: 9190/1: kdump: add invalid input check for 'cras= hkernel=3D0'") Signed-off-by: Jinjie Ruan --- arch/arm/kernel/setup.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index e6a857bf0ce6..59e1a13b5cf6 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c @@ -1012,6 +1012,7 @@ static void __init reserve_crashkernel(void) &crash_size, &crash_base, NULL, NULL); /* invalid value specified or crashkernel=3D0 */ + crash_size =3D (phys_addr_t)crash_size; if (ret || !crash_size) return; =20 --=20 2.34.1