From nobody Thu Apr 2 15:37:43 2026 Received: from m16.mail.163.com (m16.mail.163.com [117.135.210.2]) (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 929C3319601 for ; Wed, 11 Feb 2026 03:30:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=117.135.210.2 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770780627; cv=none; b=GRbi1n0zY/s9VqzRT24QlGqpNSG0ppZV7uUNFLQuxA4t3o+nMo2KcD0q5tF3v5qchGUleKk2IWIwX2O+Uvhq9BTosADzB0iRnCtr923+6j37U5nEn7IvioXIk6MGkVoqtoTPK3Kc2LD9p/ohKvM4TLBzKE/hjDchmiPvcL9RFSM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770780627; c=relaxed/simple; bh=imY9aSrauAcI3Q+b0tMWg80L2Pr2epvsxLBcrMuP2Oo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ne8EtLGVdf1M4OqTYgHsMD4cPZJyiIoqwka1B8tYNlgo+Jb8ZLINPfOipBIVjsTfq3eJsM2u6F5zN0zmpAsku2UjYjVvsBfaYpEEQhLfs0NdiqfAGULTKRUnPuNIGW5LYtc4ZgnexzfX5rf9fs3vNybsnNn/c4xlksUUbjuqfyk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=HceFhu3n; arc=none smtp.client-ip=117.135.210.2 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="HceFhu3n" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=2P ofqhw8hhVYRB6tvSmJBYOSQQUpinLxB4MYSnGPSGU=; b=HceFhu3nMRYyko5zy2 oGVdYUY0A2rx3paMDWFBi9XZ9gwjiIg8O24PLF8VuWKOl55eHYKqAbOVAT3F4dbL pH55QEJ5DBwwZRUyml4unUKSe95YlbBuzIuqqldYwNKT9BijQfrNW9FRzHKNs9Fe cNcXtTlBJi9ctae7GjgsqBvmo= Received: from ubuntu24-z.. (unknown []) by gzsmtp2 (Coremail) with SMTP id PSgvCgC3f96j94tpMZp0RA--.2981S3; Wed, 11 Feb 2026 11:29:41 +0800 (CST) From: ranxiaokai627@163.com To: graf@amazon.com, rppt@kernel.org, pasha.tatashin@soleen.com, pratyush@kernel.org, akpm@linux-foundation.org Cc: kexec@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, ran.xiaokai@zte.com.cn, ranxiaokai627@163.com Subject: [PATCH v2 1/2] kho: fix missing early_memunmap() call in kho_populate() Date: Wed, 11 Feb 2026 03:29:36 +0000 Message-ID: <20260211032937.208353-2-ranxiaokai627@163.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260211032937.208353-1-ranxiaokai627@163.com> References: <20260211032937.208353-1-ranxiaokai627@163.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-CM-TRANSID: PSgvCgC3f96j94tpMZp0RA--.2981S3 X-Coremail-Antispam: 1Uf129KBjvJXoW7AF4fAF1rGFWrJF13Zr1fWFg_yoW8AFWUpr yfGa4fAw40qayjqa17J3Wfu34rK3ykt3W3ta4UC34SyrnrXwn7A3yIq3Z2yF12qr9ag3W7 tF4FyayrW3W8CFDanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0zErcTPUUUUU= X-CM-SenderInfo: xudq5x5drntxqwsxqiywtou0bp/xtbC7gZksGmL96afRQAA3V Content-Type: text/plain; charset="utf-8" From: Ran Xiaokai kho_populate() returns without calling early_memunmap() on success path, this will cause early ioremap virtual address space leak. Fixes: b50634c5e84a ("kho: cleanup error handling in kho_populate()") Reviewed-by: Pratyush Yadav Signed-off-by: Ran Xiaokai --- kernel/liveupdate/kexec_handover.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/kernel/liveupdate/kexec_handover.c b/kernel/liveupdate/kexec_h= andover.c index fb3a7b67676e..3c705b08a489 100644 --- a/kernel/liveupdate/kexec_handover.c +++ b/kernel/liveupdate/kexec_handover.c @@ -1463,13 +1463,14 @@ void __init kho_populate(phys_addr_t fdt_phys, u64 = fdt_len, struct kho_scratch *scratch =3D NULL; phys_addr_t mem_map_phys; void *fdt =3D NULL; + bool populated =3D false; int err; =20 /* Validate the input FDT */ fdt =3D early_memremap(fdt_phys, fdt_len); if (!fdt) { pr_warn("setup: failed to memremap FDT (0x%llx)\n", fdt_phys); - goto err_report; + goto report; } err =3D fdt_check_header(fdt); if (err) { @@ -1529,16 +1530,17 @@ void __init kho_populate(phys_addr_t fdt_phys, u64 = fdt_len, kho_in.scratch_phys =3D scratch_phys; kho_in.mem_map_phys =3D mem_map_phys; kho_scratch_cnt =3D scratch_cnt; - pr_info("found kexec handover data.\n"); =20 - return; + populated =3D true; + pr_info("found kexec handover data.\n"); =20 err_unmap_scratch: early_memunmap(scratch, scratch_len); err_unmap_fdt: early_memunmap(fdt, fdt_len); -err_report: - pr_warn("disabling KHO revival\n"); +report: + if (!populated) + pr_warn("disabling KHO revival\n"); } =20 /* Helper functions for kexec_file_load */ --=20 2.25.1 From nobody Thu Apr 2 15:37:43 2026 Received: from m16.mail.163.com (m16.mail.163.com [220.197.31.5]) (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 ECEB9347BA5 for ; Wed, 11 Feb 2026 03:30:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=220.197.31.5 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770780633; cv=none; b=FmNmKZWHeoDH03LSHTUMmAsRgYvLeUeWyIklAHsg0DP+Y703jujlGz1+UeyDyFUvJiJdLsxA4T37ik9n37yZRFn1esvS9CE6vP3ed3Svg3r6mgoDyZ+MF1z8or75JCk7Dd1diVr10Fnpn91diNvBCKE+jokOKPgFjFLM90fgjUM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770780633; c=relaxed/simple; bh=ozPtkJqAmbYDf1CYy485KVGkHNe8OdiGFcsuPR/vqtk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Bzvsm0xpc8e43zkqDe9YAAQGyoDS1H9uHHTwl35RciGrYoLO68zqw9+lOvjl5g74rUB28u5QtlTxMCLDAOnXKf29ITvhYrlb/+McxQCoewIFzWQCXbgVsGdP5soYTCLtMY8+bV8dlLUowC35/Zaq78xuLpC9GSGVI4n//jooD/U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=Vx/PWKIP; arc=none smtp.client-ip=220.197.31.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="Vx/PWKIP" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=OR VMZK9TTKMl+jFhx+5kZzvswRYg3GhA/r8yrkv73eE=; b=Vx/PWKIPqvGfFelh/g KfFjktTZZm9TEtVUQeXkFYUO2aQlZM+uQwAIUZMjUcLhCq2LVsIP6O+esfL3QYVZ my8xCJRgIrWl2aNHNts4LZ77merEU1LF/uR9WM8mSi1Fai9gH00SZLvkomwfSo4S KAw0+FtvoH3dBRBzspho2KudQ= Received: from ubuntu24-z.. (unknown []) by gzsmtp2 (Coremail) with SMTP id PSgvCgC3f96j94tpMZp0RA--.2981S4; Wed, 11 Feb 2026 11:29:43 +0800 (CST) From: ranxiaokai627@163.com To: graf@amazon.com, rppt@kernel.org, pasha.tatashin@soleen.com, pratyush@kernel.org, akpm@linux-foundation.org Cc: kexec@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, ran.xiaokai@zte.com.cn, ranxiaokai627@163.com Subject: [PATCH v2 2/2] kho: remove unnecessary WARN_ON(err) in kho_populate() Date: Wed, 11 Feb 2026 03:29:37 +0000 Message-ID: <20260211032937.208353-3-ranxiaokai627@163.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260211032937.208353-1-ranxiaokai627@163.com> References: <20260211032937.208353-1-ranxiaokai627@163.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-CM-TRANSID: PSgvCgC3f96j94tpMZp0RA--.2981S4 X-Coremail-Antispam: 1Uf129KBjvdXoWrtw1xXw17Cw4DGFW8XF4Dtwb_yoWDKFc_WF 4xtw1Ikr4qvrn0vr1Yk39avFWrKw40qFyvv3W3XFWxt3W5tayj9393Zw4DAFn8W34qkryD Ar1kWrZ8tr4fWjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xRCHq2DUUUUU== X-CM-SenderInfo: xudq5x5drntxqwsxqiywtou0bp/xtbCxgdksGmL96fAXQAA36 Content-Type: text/plain; charset="utf-8" From: Ran Xiaokai The following pr_warn() provides detailed error and location information, WARN_ON(err) adds no additional debugging value, so remove the redundant WARN_ON() call. Signed-off-by: Ran Xiaokai Reviewed-by: Pratyush Yadav Reviewed-by: Pasha Tatashin --- kernel/liveupdate/kexec_handover.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/liveupdate/kexec_handover.c b/kernel/liveupdate/kexec_h= andover.c index 3c705b08a489..eb87d23e8da6 100644 --- a/kernel/liveupdate/kexec_handover.c +++ b/kernel/liveupdate/kexec_handover.c @@ -1507,7 +1507,7 @@ void __init kho_populate(phys_addr_t fdt_phys, u64 fd= t_len, =20 memblock_add(area->addr, size); err =3D memblock_mark_kho_scratch(area->addr, size); - if (WARN_ON(err)) { + if (err) { pr_warn("failed to mark the scratch region 0x%pa+0x%pa: %pe", &area->addr, &size, ERR_PTR(err)); goto err_unmap_scratch; --=20 2.25.1