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 9518EC982DA for ; Sun, 20 Sep 2026 20:23:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Reply-To:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Content-Transfer-Encoding:Content-Type:References:In-Reply-To:Cc:To:Subject: From:MIME-Version:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=sHYNy5wwK9fmryuUm9WuegCfsJ5nAR1Rndu3nKXnWCM=; b=M8hRCo+dscmpfAjOXbxTmC871/ Pb7+KeawWvqP6sqqY4Q9Q+t1Via5IRvVgxrfdDvJaUWzllwxHFkBL9TXeLSV7QzRkIOJ3ISoPPudV O0lBLd0kMzsw5PSlLAK+uYRz9p+mnGUxl1fDyXg3M6WmCJCagIslRgvAnBVu++sQRy/sl4okjLrek qNFWrcGtZ9Uca4u0m8Wr95WzI8LJzX2Su314pJtHIv1sN+2MYRycNN9XD8Gho2RzmCa0BIORLdrWY fiRiat0YHE9oILWRngcbLM7tYNEr9oBZB0cwwBKIdgLuBDri1sqFHDLaiX9NWM3yXBHMq6LB0DdUG UQ3yBQsQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1x8O4g-00000000N9E-3uMG; Sun, 20 Sep 2026 20:23:46 +0000 Received: from tor.source.kernel.org ([2600:3c04:e001:324:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1x7Vje-0000000E5WM-2Wg9; Fri, 18 Sep 2026 10:22:26 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 91C5960A59; Fri, 18 Sep 2026 10:22:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0EA691F000FF; Fri, 18 Sep 2026 10:22:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1789726945; bh=sHYNy5wwK9fmryuUm9WuegCfsJ5nAR1Rndu3nKXnWCM=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=oc0rbtes9P5pCgieiV/VOaF4yxIo3bihzqlKgZzfBIMfnz2VHuU6zRiW4ajSUXtnm uVE5FocXY1Yhiy4t8pnIJoR3/BnczzB9iCs51LhoCpGiksebj3Qt2pLRsukqoUpYEm REf0NPHz8XkXAdp50l1exaR1wvGNu10DTsFYjcPy6aKz14s9a4O/je6de4IvC6GLg0 A1DaIKk9DyKxib5oxpK9DguKSuVOC9vs7GO3t+W6NbvNJEh57V+Ns6VoIsyvecixuE bSGzwYp/Fe+PLbPTDSWWY8CwW7XXF44rEsII/FQ6ZPKK3hgeuSTBltWF4ZWzp1WTW9 X3l1tPtzei24Q== From: sashiko-bot@kernel.org Subject: Re: [PATCH v5 01/17] kexec: Fix CMA segment address translation with non-zero text_offset To: loongarch@lists.linux.dev, pratyush@kernel.org, kas@kernel.org, "Jinjie Ruan" , kees@kernel.org, rppt@kernel.org, rafael@kernel.org, linux-mm@kvack.org, kernel@xen0n.name, dakr@kernel.org, maddy@linux.ibm.com, catalin.marinas@arm.com, robh@kernel.org, chleroy@kernel.org, ritesh.list@gmail.com, thuth@redhat.com, ruirui.yang@linux.dev, npiggin@gmail.com, mclapinski@google.com, graf@amazon.com, eric.devolder@oracle.com, vishal.l.verma@intel.com, leitao@debian.org, ardb@kernel.org, x86@kernel.org, bgwin@google.com, driver-core@lists.linux.dev, me@linux.beauty, mpe@ellerman.id.au, chenhuacai@kernel.org, takahiro.akashi@linaro.org, james.morse@arm.com, chao.gao@intel.com, liukexin@kylinos.cn, seanjc@google.com, palmer@rivosinc.com, pasha.tatashin@soleen.com, gshan@redhat.com, hbathini@linux.ibm.com, coxu@redhat.com, will@kernel.org, ruanjinjie@huawei.com, maqianga@uniontech.com, piliu@redhat.com, guodongtai@kylinos.cn, baoquan.he@linux.dev, sourabhjain@linux.ibm.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, mark.rutl and@arm.com, mingo@redhat.com, yeoreum.yun@arm.com, akpm@linux-foundation.org, bp@alien8.de, linuxppc-dev@lists.ozlabs.org, adityag@linux.ibm.com, hpa@zytor.com, zhangtianyang@loongson.cn, dave.hansen@linux.intel.com, lizhengyu3@huawei.com, tangyouling@kylinos.cn, blum@kernel.org, tglx@kernel.org, jbouron@amazon.com, linux-arm-kernel@lists.infradead.org, sshegde@linux.ibm.com, gregkh@linuxfoundation.org Cc: kexec@lists.infradead.org In-Reply-To: <20260918100442.3841135-2-ruanjinjie@huawei.com> References: <20260918100442.3841135-1-ruanjinjie@huawei.com> <20260918100442.3841135-2-ruanjinjie@huawei.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 18 Sep 2026 10:22:21 +0000 Message-Id: <20260918102222.0EA691F000FF@smtp.kernel.org> X-Mailman-Approved-At: Sun, 20 Sep 2026 13:23:20 -0700 X-BeenThere: kexec@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev Sender: "kexec" Errors-To: kexec-bounces+kexec=archiver.kernel.org@lists.infradead.org > kimage_load_cma_segment() and kimage_map_segment() translate a CMA > segment to a kernel virtual address with page_address(cma), ignoring > segment->mem. But arm64's image_load() adds text_offset to segment->mem, > so the kernel payload is copied to the wrong offset while image->start > points past it, and kexec jumps into the middle of the kernel. > kimage_map_segment() has the same problem for any CMA segment whose mem > was moved. >=20 > Add kimage_cma_vaddr() to translate a boot physical address inside a CMA > segment to its virtual address, and use it in both places. >=20 > Cc: Andrew Morton > Cc: Baoquan He > Cc: Mike Rapoport > Cc: Pasha Tatashin > Cc: Pratyush Yadav > Cc: Pingfan Liu > Cc: Justinien Bouron > Cc: Sourabh Jain > Cc: stable@vger.kernel.org > Fixes: 07d24902977e ("kexec: enable CMA based contiguous allocation") > Signed-off-by: Jinjie Ruan Sashiko has reviewed this patch and found no issues. It looks great! --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20260918100442.3841= 135-1-ruanjinjie@huawei.com?part=3D1