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 04C2A1F55F8 for ; Sun, 7 Sep 2025 07:00:40 +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=1757228440; cv=none; b=gMvdeeqOmoP/+nGJPONL4CYtRlSYhDTR0VVJNJKLmusX9stLo1m/myCEUuUey+pvmH/4xMXSMBCioTdA6OXY0/0Lx6UAhPJw93OnD0ipKBFTgWQKWf3oBFsQIZ609xUxh1LmL5qBYrtJ//3Jjq93poktOZBiBbaH0L7OF6UjN7o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757228440; c=relaxed/simple; bh=Y+6NT7qGhfiYpIQPVV4I0mtOFqnghk5yu59oPQEuT2I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sOegEzB9yQP2bBtGsugYxNQ2gaKSnSjeJycFmcMtisszmtkmy6S0jYvCWKKR8ekRpMKznisEjN0nWIGBhIZMK9Kwz87QTbloRdLyfQdwdqwnPmcdyaiZroLMSoaiPvmIVHncSpsxkj9WV7Hcok9FQpMrAC6Z+VuHOp1pP5c5vSY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HgDPUEr+; 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="HgDPUEr+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BFA2AC4CEFA; Sun, 7 Sep 2025 07:00:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1757228439; bh=Y+6NT7qGhfiYpIQPVV4I0mtOFqnghk5yu59oPQEuT2I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HgDPUEr+nACQDYmwMPpNxXvHoZoDdvANiaJUMpLW4tS3GcSp1/k3Pr84+5Ir1abd2 ckZUS8wUb1PmH7Dx0xqG/nfAHPjouj3pTAUA+haMisAuuWYnFQ1wT2/AYWvB2v26KE S35V+vdyN78ZZe3plraMPrn6JsR9rgbvow7wUihUmt+3HHQGhsbsChl2udCBjwI5dd /l5RZd25dlfVBMJavzboaaOCj3jon6FeaLKNVqUMP9RaK/GsX/uEfjs6Fwx1VR5Owq kI9qX3VN3ikWNkolazVK/3V3iS/3skSqXIEyYpb2IozltdgiFhmHQERtPw+wqhB18Q r/2XppbwT6uGQ== From: Mike Rapoport To: Andrew Morton Cc: Alexander Graf , Baoquan He , Changyuan Lyu , Chris Li , Jason Gunthorpe , Mike Rapoport , Pasha Tatashin , Pratyush Yadav , kexec@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 0/2] kho: add support for preserving vmalloc allocations Date: Sun, 7 Sep 2025 10:00:20 +0300 Message-ID: <20250907070022.2177974-4-rppt@kernel.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250907070022.2177974-1-rppt@kernel.org> References: <20250907070022.2177974-1-rppt@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Mike Rapoport (Microsoft)" Hi, Following the discussion about preservation of memfd with LUO [1] these patches add support for preserving vmalloc allocations. Any KHO uses case presumes that there's a data structure that lists physical addresses of preserved folios (and potentially some additional metadata). Allowing vmalloc preservations with KHO allows scalable preservation of such data structures. For instance, instead of allocating array describing preserved folios in the fdt, memfd preservation can use vmalloc: preserved_folios = vmalloc_array(nr_folios, sizeof(*preserved_folios)); memfd_luo_preserve_folios(preserved_folios, folios, nr_folios); kho_preserve_vmalloc(preserved_folios, &folios_info); [1] https://lore.kernel.org/all/20250807014442.3829950-30-pasha.tatashin@soleen.com v3 changes: * rebase on mm-unstable v2: https://lore.kernel.org/all/20250905131302.3595582-1-rppt@kernel.org * support preservation of vmalloc backed by large pages * add check for supported vmalloc flags and preserve the flags to be able to identify incompatible preservations * don't use kho_preserve_phys() * add kernel-doc v1: https://lore.kernel.org/all/20250903063018.3346652-1-rppt@kernel.org Mike Rapoport (Microsoft) (2): kho: add support for preserving vmalloc allocations lib/test_kho: use kho_preserve_vmalloc instead of storing addresses in fdt include/linux/kexec_handover.h | 12 ++ kernel/kexec_handover.c | 200 +++++++++++++++++++++++++++++++++ lib/test_kho.c | 41 +++++-- 3 files changed, 241 insertions(+), 12 deletions(-) base-commit: b024763926d2726978dff6588b81877d000159c1 -- 2.50.1