From nobody Thu Dec 18 00:10:57 2025 Received: from mail-vk1-f173.google.com (mail-vk1-f173.google.com [209.85.221.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 41C692FB988 for ; Sat, 1 Nov 2025 14:23:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762007028; cv=none; b=dG30COaOyO0gfgVh2es0E7aWkUoqJPMHmBfTxjDgH1MbiVPMfMyN+MSYbH28LDwAHdJMZi8kJ2JflLodKjzB7B9csa2EC3C7cQCImn5cqv/XIVuVSBXrCYaDz8Lmp9OUH37O6FEfmoG6DS6P66ZtY8YdMiS+iw3buy5jM1MMXHI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762007028; c=relaxed/simple; bh=Sz6qvH3kZZly7FxwahblwfCH26skEMNmJunfLKVFLiY=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ro84iR8N5eexfoxApvzknInMxLNtd5nx6Wrig9gKAVBB6nsi+NeJr215mCIGHiYnac3PpiQpTWZ2OzsD9kWnBEE5IpPlfvm+ybRUFovAMQIysaWLWva0RYTq4hqXr99tAuG/n0mKvQuIm13er+lfuZEuW24msuxUyp6ELLN9ouQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=soleen.com; spf=pass smtp.mailfrom=soleen.com; dkim=pass (2048-bit key) header.d=soleen.com header.i=@soleen.com header.b=Q8hF631B; arc=none smtp.client-ip=209.85.221.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=soleen.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=soleen.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=soleen.com header.i=@soleen.com header.b="Q8hF631B" Received: by mail-vk1-f173.google.com with SMTP id 71dfb90a1353d-5563c36f6d4so3234329e0c.1 for ; Sat, 01 Nov 2025 07:23:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; t=1762007025; x=1762611825; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=GqNjQc+nWE3xdzzLNsyLKvDeccdmT+igcGJuf8ZrBtc=; b=Q8hF631BsLLm76sDVONF8JXZiWa0IrI2d3Ie4tbwxb56JjjGTH2W+inbYiPElSXGae wLTKKTrB/ZSaqiAXr9XQN2VZzJvOOPJvcAQdfXcEDyHDNHGitReCRLMn0y2ejXKfLVDq LxOughvsVo2Y4awPiRZ8oFFYX/ej/rKsiRbmatK4NbBWpRVlC5AHxEw/lhartnPEIwr8 7dUrUwzdnsEgbw4NVT0Xzqv2xGpzgcp3cteGclv17nG+dvIFSJHBguIDE1nAWdNr9P9Y hHlyzxGIrqyNJSG/s6ejET1LM8MumQ0cHoK0ipsgO3UOpNWwr5cUyFiTSdkc4oJ/X5pV fTeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762007025; x=1762611825; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GqNjQc+nWE3xdzzLNsyLKvDeccdmT+igcGJuf8ZrBtc=; b=iTx1jHQvaKFm5SCWAu7Y/ODjDXFsu6nTaL36mpEtICdox3vIN1Vm7Wptlno8hwwwsi oJA7mWuUoxru6fRCTrQJsNSMULPV3CgjX5+p2i9KjcnDtpeL9NIgEJ94/HKP2ZkUkHF1 MnrRvNu0CGcOhXYQbCUZYhoXituLN0d9cNbKuzPVEvH9lRVLpusfWixXQq0h9eNY74+i DZ9x8Ee2djI0pmbpGaLcOhpPgXQgY6nx3lb6uVY/Qce1D6pH+qavR+TJOXZpiFxQuLnS NAuuVnraaTzzLDSlPOmaNDSIrFZ6/XCSPiw4NwYtCJ3ryEp6R7i8DcbPco7pxYNdCzcW /RKg== X-Forwarded-Encrypted: i=1; AJvYcCXPCE6JWW2dxccXBbwYWxsf/oPdh1/Dic5Uz3v4qlB3XhQMLDkv+Z5CyTeIeBXGhRV9mwjIx/JeJC6AAyg=@vger.kernel.org X-Gm-Message-State: AOJu0YzCpRcwSKktqlKahu89P+oQe/oCPyUGFtnw1fClCy+jLbI3pTYe U+3/t5M5GicISOZUf5+3p6C4xgTK+O9/CIeTgACf4ILRcezBHbFgLI9PIavM2Kfr7ec= X-Gm-Gg: ASbGnctb5N7xoODO4FTMubtcQCJ643jQvS0neWEC2Fyxkrm6ljj+9c7NRbhV3fFwPOl EC7Z0nB8ZpQRlhEArELplIQGyKn+Qosh7tuLgUVd/2dBrxTWw+H1wRdG8QbVe7AcMaSmUu4Ak2g kpFFTFRIRhIKvDsifTc+NFzXrAnk5hChwsMFZ6mD0UEsO3f28Gg/sJg+BL3Fdgz68DxWwPX7abI Wxi7GsuuvKAtJ3/jSy7kc/QyQt6uyyIB4wF/EKGworkELqJqtDFwgkRCsgrH1AcU615lSsk4Zjk G5voMUFKtTosngr2mXRmMrUSgqOscgDx6m2LCS4iH+kw6jBeDz1VshaWkQQnUTR5UK2IVuns0iK CeJhQqUgchwv42tIS8f2NC9ixWCFCp/sE3WGiSPn/6U+eiNZwqtoHqCMZWw5oWWSueEWjMmR160 fDHWlQQwbDJaXnFcKBWTtECuWX2lxaK2I+18PdLIafrQdbv0m9rQtj2d7XJhbk X-Google-Smtp-Source: AGHT+IHYfN0T4cVNH96uqE/VxqJsEPgIJwOQllfGh/DOiPLvpYAfaaq3PsJ2yY0Nnq8P1OfSoH8nvw== X-Received: by 2002:a05:6122:3289:b0:552:3366:e822 with SMTP id 71dfb90a1353d-5593e260540mr2675875e0c.1.1762007025167; Sat, 01 Nov 2025 07:23:45 -0700 (PDT) Received: from soleen.c.googlers.com.com (53.47.86.34.bc.googleusercontent.com. [34.86.47.53]) by smtp.gmail.com with ESMTPSA id 71dfb90a1353d-559449647e0sm1776242e0c.3.2025.11.01.07.23.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Nov 2025 07:23:44 -0700 (PDT) From: Pasha Tatashin To: akpm@linux-foundation.org, brauner@kernel.org, corbet@lwn.net, graf@amazon.com, jgg@ziepe.ca, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org, masahiroy@kernel.org, ojeda@kernel.org, pasha.tatashin@soleen.com, pratyush@kernel.org, rdunlap@infradead.org, rppt@kernel.org, tj@kernel.org, yanjun.zhu@linux.dev Subject: [PATCH v9 7/9] liveupdate: kho: move to kernel/liveupdate Date: Sat, 1 Nov 2025 10:23:23 -0400 Message-ID: <20251101142325.1326536-8-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.51.1.930.gacf6e81ea2-goog In-Reply-To: <20251101142325.1326536-1-pasha.tatashin@soleen.com> References: <20251101142325.1326536-1-pasha.tatashin@soleen.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 Content-Type: text/plain; charset="utf-8" Move KHO to kernel/liveupdate/ in preparation of placing all Live Update core kernel related files to the same place. Signed-off-by: Pasha Tatashin Reviewed-by: Jason Gunthorpe Reviewed-by: Mike Rapoport (Microsoft) --- Documentation/core-api/kho/concepts.rst | 2 +- MAINTAINERS | 2 +- init/Kconfig | 2 + kernel/Kconfig.kexec | 34 ---------------- kernel/Makefile | 4 +- kernel/liveupdate/Kconfig | 39 +++++++++++++++++++ kernel/liveupdate/Makefile | 5 +++ kernel/{ =3D> liveupdate}/kexec_handover.c | 4 +- .../{ =3D> liveupdate}/kexec_handover_debug.c | 0 .../{ =3D> liveupdate}/kexec_handover_debugfs.c | 0 .../kexec_handover_internal.h | 0 11 files changed, 51 insertions(+), 41 deletions(-) create mode 100644 kernel/liveupdate/Kconfig create mode 100644 kernel/liveupdate/Makefile rename kernel/{ =3D> liveupdate}/kexec_handover.c (99%) rename kernel/{ =3D> liveupdate}/kexec_handover_debug.c (100%) rename kernel/{ =3D> liveupdate}/kexec_handover_debugfs.c (100%) rename kernel/{ =3D> liveupdate}/kexec_handover_internal.h (100%) diff --git a/Documentation/core-api/kho/concepts.rst b/Documentation/core-a= pi/kho/concepts.rst index 36d5c05cfb30..d626d1dbd678 100644 --- a/Documentation/core-api/kho/concepts.rst +++ b/Documentation/core-api/kho/concepts.rst @@ -70,5 +70,5 @@ in the FDT. That state is called the KHO finalization pha= se. =20 Public API =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D -.. kernel-doc:: kernel/kexec_handover.c +.. kernel-doc:: kernel/liveupdate/kexec_handover.c :export: diff --git a/MAINTAINERS b/MAINTAINERS index bdd0a1260421..764df916fae7 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -13795,7 +13795,7 @@ S: Maintained F: Documentation/admin-guide/mm/kho.rst F: Documentation/core-api/kho/* F: include/linux/kexec_handover.h -F: kernel/kexec_handover* +F: kernel/liveupdate/kexec_handover* F: tools/testing/selftests/kho/ =20 KEYS-ENCRYPTED diff --git a/init/Kconfig b/init/Kconfig index cab3ad28ca49..0605de5d96c0 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -2138,6 +2138,8 @@ config TRACEPOINTS =20 source "kernel/Kconfig.kexec" =20 +source "kernel/liveupdate/Kconfig" + endmenu # General setup =20 source "arch/Kconfig" diff --git a/kernel/Kconfig.kexec b/kernel/Kconfig.kexec index cc6743137946..15632358bcf7 100644 --- a/kernel/Kconfig.kexec +++ b/kernel/Kconfig.kexec @@ -94,40 +94,6 @@ config KEXEC_JUMP Jump between original kernel and kexeced kernel and invoke code in physical address mode via KEXEC =20 -config KEXEC_HANDOVER - bool "kexec handover" - depends on ARCH_SUPPORTS_KEXEC_HANDOVER && ARCH_SUPPORTS_KEXEC_FILE - depends on !DEFERRED_STRUCT_PAGE_INIT - select MEMBLOCK_KHO_SCRATCH - select KEXEC_FILE - select LIBFDT - select CMA - help - Allow kexec to hand over state across kernels by generating and - passing additional metadata to the target kernel. This is useful - to keep data or state alive across the kexec. For this to work, - both source and target kernels need to have this option enabled. - -config KEXEC_HANDOVER_DEBUG - bool "Enable Kexec Handover debug checks" - depends on KEXEC_HANDOVER - help - This option enables extra sanity checks for the Kexec Handover - subsystem. Since, KHO performance is crucial in live update - scenarios and the extra code might be adding overhead it is - only optionally enabled. - -config KEXEC_HANDOVER_DEBUGFS - bool "kexec handover debugfs interface" - default KEXEC_HANDOVER - depends on KEXEC_HANDOVER - select DEBUG_FS - help - Allow to control kexec handover device tree via debugfs - interface, i.e. finalize the state or aborting the finalization. - Also, enables inspecting the KHO fdt trees with the debugfs binary - blobs. - config CRASH_DUMP bool "kernel crash dumps" default ARCH_DEFAULT_CRASH_DUMP diff --git a/kernel/Makefile b/kernel/Makefile index 2cf7909a74e5..e83669841b8c 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -52,6 +52,7 @@ obj-y +=3D printk/ obj-y +=3D irq/ obj-y +=3D rcu/ obj-y +=3D livepatch/ +obj-y +=3D liveupdate/ obj-y +=3D dma/ obj-y +=3D entry/ obj-y +=3D unwind/ @@ -82,9 +83,6 @@ obj-$(CONFIG_CRASH_DUMP_KUNIT_TEST) +=3D crash_core_test.o obj-$(CONFIG_KEXEC) +=3D kexec.o obj-$(CONFIG_KEXEC_FILE) +=3D kexec_file.o obj-$(CONFIG_KEXEC_ELF) +=3D kexec_elf.o -obj-$(CONFIG_KEXEC_HANDOVER) +=3D kexec_handover.o -obj-$(CONFIG_KEXEC_HANDOVER_DEBUG) +=3D kexec_handover_debug.o -obj-$(CONFIG_KEXEC_HANDOVER_DEBUGFS) +=3D kexec_handover_debugfs.o obj-$(CONFIG_BACKTRACE_SELF_TEST) +=3D backtracetest.o obj-$(CONFIG_COMPAT) +=3D compat.o obj-$(CONFIG_CGROUPS) +=3D cgroup/ diff --git a/kernel/liveupdate/Kconfig b/kernel/liveupdate/Kconfig new file mode 100644 index 000000000000..1379a4c40b09 --- /dev/null +++ b/kernel/liveupdate/Kconfig @@ -0,0 +1,39 @@ +# SPDX-License-Identifier: GPL-2.0-only + +menu "Live Update and Kexec HandOver" + +config KEXEC_HANDOVER + bool "kexec handover" + depends on ARCH_SUPPORTS_KEXEC_HANDOVER && ARCH_SUPPORTS_KEXEC_FILE + depends on !DEFERRED_STRUCT_PAGE_INIT + select MEMBLOCK_KHO_SCRATCH + select KEXEC_FILE + select LIBFDT + select CMA + help + Allow kexec to hand over state across kernels by generating and + passing additional metadata to the target kernel. This is useful + to keep data or state alive across the kexec. For this to work, + both source and target kernels need to have this option enabled. + +config KEXEC_HANDOVER_DEBUG + bool "Enable Kexec Handover debug checks" + depends on KEXEC_HANDOVER + help + This option enables extra sanity checks for the Kexec Handover + subsystem. Since, KHO performance is crucial in live update + scenarios and the extra code might be adding overhead it is + only optionally enabled. + +config KEXEC_HANDOVER_DEBUGFS + bool "kexec handover debugfs interface" + default KEXEC_HANDOVER + depends on KEXEC_HANDOVER + select DEBUG_FS + help + Allow to control kexec handover device tree via debugfs + interface, i.e. finalize the state or aborting the finalization. + Also, enables inspecting the KHO fdt trees with the debugfs binary + blobs. + +endmenu diff --git a/kernel/liveupdate/Makefile b/kernel/liveupdate/Makefile new file mode 100644 index 000000000000..f52ce1ebcf86 --- /dev/null +++ b/kernel/liveupdate/Makefile @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0 + +obj-$(CONFIG_KEXEC_HANDOVER) +=3D kexec_handover.o +obj-$(CONFIG_KEXEC_HANDOVER_DEBUG) +=3D kexec_handover_debug.o +obj-$(CONFIG_KEXEC_HANDOVER_DEBUGFS) +=3D kexec_handover_debugfs.o diff --git a/kernel/kexec_handover.c b/kernel/liveupdate/kexec_handover.c similarity index 99% rename from kernel/kexec_handover.c rename to kernel/liveupdate/kexec_handover.c index 3adf86c7c2db..be945c133a2f 100644 --- a/kernel/kexec_handover.c +++ b/kernel/liveupdate/kexec_handover.c @@ -26,8 +26,8 @@ * KHO is tightly coupled with mm init and needs access to some of mm * internal APIs. */ -#include "../mm/internal.h" -#include "kexec_internal.h" +#include "../../mm/internal.h" +#include "../kexec_internal.h" #include "kexec_handover_internal.h" =20 #define KHO_FDT_COMPATIBLE "kho-v1" diff --git a/kernel/kexec_handover_debug.c b/kernel/liveupdate/kexec_handov= er_debug.c similarity index 100% rename from kernel/kexec_handover_debug.c rename to kernel/liveupdate/kexec_handover_debug.c diff --git a/kernel/kexec_handover_debugfs.c b/kernel/liveupdate/kexec_hand= over_debugfs.c similarity index 100% rename from kernel/kexec_handover_debugfs.c rename to kernel/liveupdate/kexec_handover_debugfs.c diff --git a/kernel/kexec_handover_internal.h b/kernel/liveupdate/kexec_han= dover_internal.h similarity index 100% rename from kernel/kexec_handover_internal.h rename to kernel/liveupdate/kexec_handover_internal.h --=20 2.51.1.930.gacf6e81ea2-goog