From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 C49C827B336 for ; Mon, 29 Dec 2025 21:09:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767042567; cv=none; b=H13hQDaqJG9u3s3a5VrRHERzyjKYGeMl//+0eNKCptTXJOS2zWEq/IxBh2fzwX9lk+FcVadlz+PGAOfDxKK/jS8GlEwNEseK890Av/1L7CP+zl/xW8LgaVR/OlGnR+lpZ91qif5wME8q5NGR8+tq1WAPTbf3eG/Zoi7GpIzDaUo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767042567; c=relaxed/simple; bh=VUVk1CmbFBfYMnd+onKI6dHabioivTyCBsvilOrGEbo=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=ChXbiMDx6dDcTfVQxlxSmaUd6p8vuZS4uVYBpOM2RbRpyVNmvRXBEck9RFe0ZmUuigogCQ+00Pr6KBA9NWyvLXFUXrI3dYHM33X3VN+JLlAozs85zZTvT1e2ZLuQ6mYa4Uf64z5g8jGhpvkCT8R3XKJxYvLvc1t0mHsV8EtRv0U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=N9e8bCrV; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="N9e8bCrV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4386CC116D0; Mon, 29 Dec 2025 21:09:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1767042567; bh=VUVk1CmbFBfYMnd+onKI6dHabioivTyCBsvilOrGEbo=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=N9e8bCrVuBEncQY6DY/pq7L587pcxnuZNkUiX7jAH7g7gNTO0y0pXZPeInuYaf0m9 812ZhsV0+TyJogWbd9NPmIeqMpvofs98qURaj9WiG48AwIN7WvvmvCmSzSWgXie0KA CCAy5b26YL9gzrOmAo6bPMUaYRtYNsuJiVy5YWpxZpJRA+eh0vBVaHHKkn+5dTKB9q XCga1hD5U5zBXosGvPjHHU92N6xxbsFtWsf+67cUv/sWP/Ntbxl5dUA7cPwVE3XsMH a77CArbgngll92iBlUHc4ILjqjWsepe7/hqHpU9yHYBS6tEI+xdWwAPg1YhKoLEg35 nTP6Pz7wt0lBQ== From: Pratyush Yadav To: Fadouse Cc: Evangelos Petrongonas , Mike Rapoport , Pasha Tatashin , Pratyush Yadav , Alexander Graf , Andrew Morton , Jason Miu , linux-kernel@vger.kernel.org, kexec@lists.infradead.org, linux-mm@kvack.org, nh-open-source@amazon.com Subject: Re: [PATCH] kho: add support for deferred struct page init In-Reply-To: <7024cefd-bf27-430b-b8fa-04e1457e0eb8@proton.me> (fadouse@proton.me's message of "Wed, 24 Dec 2025 07:34:04 +0000") References: <7024cefd-bf27-430b-b8fa-04e1457e0eb8@proton.me> Date: Mon, 29 Dec 2025 22:09:21 +0100 Message-ID: <86zf718072.fsf@kernel.org> User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Wed, Dec 24 2025, Fadouse wrote: > Hi Evangelos, Mike, Pasha, Pratyush, > > I independently hit a crash in the LUO/memfd restore path with > CONFIG_DEFERRED_STRUCT_PAGE_INIT=3Dy, on a local build based on dd9b004b7= ff3 > (x86_64 QEMU, 6.19.0-rc1 timeframe). How? config KEXEC_HANDOVER depends on !DEFERRED_STRUCT_PAGE_INIT. So you shouldn't even be able to enable KHO or LUO with CONFIG_DEFERRED_STRUCT_PAGE_INIT=3Dy. Are you sure it is enabled? > > In my reproducer, stage1 preserves a memfd via LUO and kexecs into stage2; > stage2 calls LIVEUPDATE_SESSION_FINISH without retrieving files. I observ= ed > a reliable crash in adjust_managed_page_count() from kho_restore_page(). > > Minimal excerpt: > > stage2: start > stage2: retrieved session fd=3D4 > BUG: unable to handle page fault for address: 0000000000001410 > RIP: adjust_managed_page_count+0x29/0x40 > Call Trace: > =C2=A0 kho_restore_page+0x18a/0x1c0 > =C2=A0 kho_restore_folio+0xe/0x60 > =C2=A0 memfd_luo_finish+0xe6/0x160 > =C2=A0 luo_file_finish+0x188/0x240 > =C2=A0 luo_session_finish+0x2c/0x80 > =C2=A0 luo_session_ioctl+0xf5/0x170 > =C2=A0 __x64_sys_ioctl+0x91/0xe0 > > Applying the patch in <20251216084913.86342-1-epetron@amazon.de> makes the > issue no longer reproduce for me. > > I can share full logs and the small two-stage initramfs reproducer if nee= ded. > > Thanks, > YanXin Li > > Tested-by: YanXin Li > [...] --=20 Regards, Pratyush Yadav