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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1A7F6C3DA61 for ; Mon, 29 Jul 2024 03:30:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=uO9CpgXouDh8hOZN70chmiOKh3p65Id9D7Y8jU0waHQ=; b=PYtq5G/pOv1sY/p8uhK1JKTDmh FJMQk9UX9AQQuouZ69T97HwNbzPaTyf0kvgPRhfLpjqT4G7KEEh7Id8QOfm6wgxEzTvp2oe21UQGN 8iBJhZ36Le7jwfh5s95nA6i1scYcxcmbj/vnqx4GHtULP0E8q6CerHvIMapGA/HMPV1wIl7cxOxSU aKe6NGj+YPH2BTkJtKe4qCy9McRjUTha9uCm+hQLfXTWwECrk5qhS0HfmYy1SGjXOWeZ2kYJImt4L LY5qQOpMo14/YZAMTgdzitlcia1r0p3dESOqAKGvDPuxrLXAliNCgvtR17qXqiKYQ98MY0dOZnH0h 6kG5bSWw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sYH5e-00000009qxt-3iRd; Mon, 29 Jul 2024 03:30:26 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sYH5F-00000009qsV-1sNe for linux-arm-kernel@lists.infradead.org; Mon, 29 Jul 2024 03:30:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1722223799; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=uO9CpgXouDh8hOZN70chmiOKh3p65Id9D7Y8jU0waHQ=; b=StOwZourodaoq9QzHty1L1ZLLouWxdNElh5fdiA2zGVvIJD9sS0y13wPiayOC4S+njn5gs iEohWPK8vm6JTcHK0FYdo1NeLQZRC2kMhlMM8Kf2B53WpOUNayrLoMFaZyV/s9vo0jIC+g kKulfCZ1VArVT5a6VtzUybSbNbkr9Kg= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-424-iQL7kj1FMMaHm6fmYiu_QA-1; Sun, 28 Jul 2024 23:29:56 -0400 X-MC-Unique: iQL7kj1FMMaHm6fmYiu_QA-1 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id CA7CD1955D47; Mon, 29 Jul 2024 03:29:53 +0000 (UTC) Received: from localhost (unknown [10.72.112.54]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D94083000193; Mon, 29 Jul 2024 03:29:51 +0000 (UTC) Date: Mon, 29 Jul 2024 11:29:46 +0800 From: Baoquan He To: Jinjie Ruan Cc: akpm@linux-foundation.org, vgoyal@redhat.com, dyoung@redhat.com, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, rppt@kernel.org, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v5] crash: Fix crash memory reserve exceed system memory bug Message-ID: References: <20240723020746.3945016-1-ruanjinjie@huawei.com> <564e362d-5e8c-5d23-9c54-bfb811794169@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <564e362d-5e8c-5d23-9c54-bfb811794169@huawei.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240728_203001_727956_B058EDC1 X-CRM114-Status: GOOD ( 17.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 07/29/24 at 11:24am, Jinjie Ruan wrote: > > > On 2024/7/23 13:17, Baoquan He wrote: > > On 07/23/24 at 10:07am, Jinjie Ruan wrote: > >> On x86_32 Qemu machine with 1GB memory, the cmdline "crashkernel=4G" is ok > >> as below: > >> crashkernel reserved: 0x0000000020000000 - 0x0000000120000000 (4096 MB) > >> > >> It's similar on other architectures, such as ARM32 and RISCV32. > >> > >> The cause is that the crash_size is parsed and printed with "unsigned long > >> long" data type which is 8 bytes but allocated used with "phys_addr_t" > >> which is 4 bytes in memblock_phys_alloc_range(). > >> > >> Fix it by checking if crash_size is greater than system RAM size and > >> return error if so. > >> > >> After this patch, there is no above confusing reserve success info. > >> > >> Signed-off-by: Jinjie Ruan > >> Suggested-by: Baoquan He > >> Suggested-by: Mike Rapoport > > > > > > My Suggested-by can be taken off because I suggested to check the parsed > > value after parse_crashkernel(), Mike's suggestion is better. > > Hi, Can the suggested-by be removed when this version is merged, or a > new version needs to be sent? You can send a new one and CC Andrew.