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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0AFAC54FB3 for ; Mon, 26 May 2025 06:33:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 51EBB6B0083; Mon, 26 May 2025 02:33:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4F67D6B0088; Mon, 26 May 2025 02:33:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3E4F96B0089; Mon, 26 May 2025 02:33:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 20FBD6B0083 for ; Mon, 26 May 2025 02:33:03 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id BC79F58A8F for ; Mon, 26 May 2025 06:33:02 +0000 (UTC) X-FDA: 83484091404.12.1BC6FE9 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf27.hostedemail.com (Postfix) with ESMTP id 1DA4940006 for ; Mon, 26 May 2025 06:33:00 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=mgymWtG+; spf=pass (imf27.hostedemail.com: domain of rppt@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1748241181; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=egS+WyFpMDWNGX+h8E2//NoOIlVYIKmoh9vs3EPgE3I=; b=ks07MQyRLSEHGZMceEUBd6quV39R9TwLxU0BESoexT+GCmSzEOaOd2vD+VcbrrN6bCvxgL pK2a7Wc5OXRIVBbszRdp1mKuYdvKv4y7UW4WacskIwN6DM5HuUTY/QVz9K+MU256CA1gy4 yacNzJWwdqcDsifEj/Kp0JnR2iMjRio= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=mgymWtG+; spf=pass (imf27.hostedemail.com: domain of rppt@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1748241181; a=rsa-sha256; cv=none; b=YXAhIlJNom2PKGj3wsPxbKu+TidFgs/O8+2VYyOmVrV9I1RmqoEUC4vfB6p+KNujjZDPvG pU6qbeUjMp5e6I+xAnpa4JMdd/2tgSLz97UU5+3tKmVNPnXIAWV79NwvXqGU5mlJvIum8d q5TiydWhr7tjzNF7YxLkYvJfZuh1Yuw= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id C96EC5C4CB7; Mon, 26 May 2025 06:30:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A531C4CEE7; Mon, 26 May 2025 06:32:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1748241179; bh=1SesHpH2CP4usADRmgfgQeKfD4QmxgxLDTCgDd3G+Gc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mgymWtG+WQtWWgZU/ituPtgvWA7eQ3ol4RmsQ/kt+lpkvS8hpC3Dbg5TPDE//B+xo k763m5GVaGO5GaxTbUe+WVHc9M6epuBWl3wERloYnnWtZ6ZCf46LP76/gjlp574c3x ExBbvLHscqD6iOpL5stQFwJ8/F5NpN67grFjlThzmUfUct28r4/xffG/h9lQAZf8bx i10V1IuOut58DJTeq6+VypAusmC2bwNVslb08hEwB/sodZRIEnPuzHv8T37lg690Ur RnouW58DxjFxQVL8YQQtwelBOThqwoo12r7vtHFFJM23cCD3z9C0UqrgDmsoTI0FgG y//+1+CNZ85Kw== Date: Mon, 26 May 2025 09:32:41 +0300 From: Mike Rapoport To: Pasha Tatashin Cc: pratyush@kernel.org, jasonmiu@google.com, graf@amazon.com, changyuanl@google.com, dmatlack@google.com, rientjes@google.com, corbet@lwn.net, rdunlap@infradead.org, ilpo.jarvinen@linux.intel.com, kanie@linux.alibaba.com, ojeda@kernel.org, aliceryhl@google.com, masahiroy@kernel.org, akpm@linux-foundation.org, tj@kernel.org, yoann.congal@smile.fr, mmaurer@google.com, roman.gushchin@linux.dev, chenridong@huawei.com, axboe@kernel.dk, mark.rutland@arm.com, jannh@google.com, vincent.guittot@linaro.org, hannes@cmpxchg.org, dan.j.williams@intel.com, david@redhat.com, joel.granados@kernel.org, rostedt@goodmis.org, anna.schumaker@oracle.com, song@kernel.org, zhangguopeng@kylinos.cn, linux@weissschuh.net, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, gregkh@linuxfoundation.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, rafael@kernel.org, dakr@kernel.org, bartosz.golaszewski@linaro.org, cw00.choi@samsung.com, myungjoo.ham@samsung.com, yesanishhere@gmail.com, Jonathan.Cameron@huawei.com, quic_zijuhu@quicinc.com, aleksander.lobakin@intel.com, ira.weiny@intel.com, andriy.shevchenko@linux.intel.com, leon@kernel.org, lukas@wunner.de, bhelgaas@google.com, wagi@kernel.org, djeffery@redhat.com, stuart.w.hayes@gmail.com, ptyadav@amazon.de, linux-api@vger.kernel.org Subject: Re: [RFC v2 00/16] Live Update Orchestrator Message-ID: References: <20250515182322.117840-1-pasha.tatashin@soleen.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250515182322.117840-1-pasha.tatashin@soleen.com> X-Rspamd-Queue-Id: 1DA4940006 X-Stat-Signature: krs664r9ds45ntt87mcys86mhfag4q66 X-Rspam-User: X-Rspamd-Server: rspam07 X-HE-Tag: 1748241180-442216 X-HE-Meta: U2FsdGVkX19kVcK2wT1gZO2AHryrewB10a9JFsc40Tp9cHtKyEuGnJYox5QsB5wi3ovhzTJmqVtM3flIonxkpV7zZ+wsSwlmZ6nsHVMR7/IQZCKzeBOpKPHD39gfhjKMGBXrVqup5zy8LacnnqvAezBVGjnw691AA2eYkBAf3Lk1ZH2PPhlJtFRSZSbxhw10G35YNp9s536yZcg1QMnGAuSCCQWjaCeUFIUjmdUaBX8gkc58vLgVi4sEDaIhNiuBsNcBZojp7hvJFqZaE5YhJd8fA8x5vr2hGW34b8CGgpLNOD1QDSRUFvI9RHRdOGxRGMJEC0E4hJNGOTNpbQcNQ+IxV7bjVtKXdsoXHJlsDHq0dZ4mWMBEFgWxw6TpjjpHrKnqutSdosz6Vg4BLVhLab2qGhZfSKAyzZTyCziFoaan6zJ6PNrQ7ixYLqFC9QK2sCB6emEpl9+BzaaLhHfiVzqXKk6CKv/WhhR2mkGkBpXA+QCSDEz7MnBG04H2wsfbyYEqcbqqZlddxAP2+7q/gM/qXIUT+yxqKiNIwOHS8cRyYB1Z9lostRq/TzDHde4jRAI7WUQzPVs7PthNikhonhi+t/KfMmzAj3cRjU0NUZmM0A/LvSGj72rbEmVcJQMfUkOo5kKhJ9+cSTULr7i/4WPBI/R1vx7b7cuQRpPmHYtZgAZWtBeB+Z6cDgGbLOHroB78HSto2yC9ETs2fRz8f12dbODYa09Lz0agdPI9laJCUABaAFgsnMl0tyeEVsOUKI1GmXY/OmzYPi7qxHc/sudytBjv+Eed3M389cYlEX+GO1D0oIeUK/iN6MeLCXkXQ+e8NKO+YtWAyxj8Sj4o6s5ixDiKrPpCm6dXSTbaexr+3GpXDtwOr9FJ3UvcNCFyu/pvOhfxqKnqVqybU/96jxEnJCH9r9zGt8GtywXKsfAg6jXH6ZHQwAWVTPCV7UaUdjt9n5Uinft/hIWIAAo 2KR07GuE 1mwkGDnct3DGbWOz+EvNDm4DCBJabII5lKoJ1YLiV2RTwXGUR1XCHFZLgpQn0hF0wPI2P3ci2XbuVrlF783JwnsWUyAVAcloooCRw4uQD4bPwaFWuuoZeFjQ6bi52y/YR4o72556pdf7K6PpgdTjVhLiXJUHY1d4fyy0obzau3q7qp4QUUeAlsQQjJ75jrehZcrD04vyPRfHS0UCUlqotRICFLfxQAHiMPq3Zh0+/f36RnNSyUYdqCAVdILVk5VC2ii1TjEn2vM7KDN8WFlZyUgFTmwGupbUF1BaCFmFkVBdlOl6rvCkhHJBHsTzPpj9BUi2SnIw99YYivSkpPlDiGX/hoVY4kgKAhaFNDPOIDik+xjylsF1GhVMjYNwj2hc9SFVlEHV5LyNg/yYia/4hwKruSYw6qMzM8MjHjOPrAS0C+8m/gHZRfWZ1neAhCsUWkbcsQDhxYddJ8+I= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: (cc'ing linux-api) On Thu, May 15, 2025 at 06:23:04PM +0000, Pasha Tatashin wrote: > This v2 series introduces the LUO, a kernel subsystem designed to > facilitate live kernel updates with minimal downtime, > particularly in cloud delplyoments aiming to update without fully > disrupting running virtual machines. > > This series builds upon KHO framework [1] by adding programmatic > control over KHO's lifecycle and leveraging KHO for persisting LUO's > own metadata across the kexec boundary. The git branch for this series > can be found at: > https://github.com/googleprodkernel/linux-liveupdate/tree/luo/rfc-v2 > > Changelog from v1: > - Control Interface: Shifted from sysfs-based control > (/sys/kernel/liveupdate/{prepare,finish}) to an ioctl interface > (/dev/liveupdate). Sysfs is now primarily for monitoring the state. > - Event/State Renaming: LIVEUPDATE_REBOOT event/phase is now > LIVEUPDATE_FREEZE. > - FD Preservation: A new component for preserving file descriptors. > Subsystem Registration: A formal mechanism for kernel subsystems > to participate. > - Device Layer: removed device list handling from this series, it is > going to be added separately. > - Selftests: Kernel-side selftest hooks and userspace selftests are > now included. > KHO Enhancements: > - KHO debugfs became optional, and kernel APIs for finalize/abort > were added (driven by LUO's needs). > - KHO unpreserve functions were also added. > > What is Live Update? > Live Update is a specialized reboot process where selected kernel > resources (memory, file descriptors, and eventually devices) are kept > operational or their state preserved across a kernel transition (e.g., > via kexec). For certain resources, DMA and interrupt activity might > continue with minimal interruption during the kernel reboot. > > LUO v2 Overview: > LUO v2 provides a framework for coordinating live updates. It features: > State Machine: Manages the live update process through states: > NORMAL, PREPARED, FROZEN, UPDATED. > > KHO Integration: > > LUO programmatically drives KHO's finalization and abort sequences. > KHO's debugfs interface is now optional configured via > CONFIG_KEXEC_HANDOVER_DEBUG. > > LUO preserves its own metadata via KHO's kho_add_subtree and > kho_preserve_phys() mechanisms. > > Subsystem Participation: A callback API liveupdate_register_subsystem() > allows kernel subsystems (e.g., KVM, IOMMU, VFIO, PCI) to register > handlers for LUO events (PREPARE, FREEZE, FINISH, CANCEL) and persist a > u64 payload via the LUO FDT. > > File Descriptor Preservation: Infrastructure > liveupdate_register_filesystem, luo_register_file, luo_retrieve_file to > allow specific types of file descriptors (e.g., memfd, vfio) to be > preserved and restored. > > Handlers for specific file types can be registered to manage their > preservation and restoration, storing a u64 payload in the LUO FDT. > > Example WIP for memfd preservation can be found here [2]. > > User-space Interface: > > ioctl (/dev/liveupdate): The primary control interface for > triggering LUO state transitions (prepare, freeze, finish, cancel) > and managing the preservation/restoration of file descriptors. > Access requires CAP_SYS_ADMIN. > > sysfs (/sys/kernel/liveupdate/state): A read-only interface for > monitoring the current LUO state. This allows userspace services to > track progress and coordinate actions. > > Selftests: Includes kernel-side hooks and userspace selftests to > verify core LUO functionality, particularly subsystem registration and > basic state transitions. > > LUO State Machine and Events: > > NORMAL: Default operational state. > PREPARED: Initial preparation complete after LIVEUPDATE_PREPARE > event. Subsystems have saved initial state. > FROZEN: Final "blackout window" state after LIVEUPDATE_FREEZE > event, just before kexec. Workloads must be suspended. > UPDATED: Next kernel has booted via live update. Awaiting restoration > and LIVEUPDATE_FINISH. > > Events: > LIVEUPDATE_PREPARE: Prepare for reboot, serialize state. > LIVEUPDATE_FREEZE: Final opportunity to save state before kexec. > LIVEUPDATE_FINISH: Post-reboot cleanup in the next kernel. > LIVEUPDATE_CANCEL: Abort prepare or freeze, revert changes. > > [1] https://lore.kernel.org/all/20250509074635.3187114-1-changyuanl@google.com > https://github.com/googleprodkernel/linux-liveupdate/tree/luo/kho-v8 > [2] https://github.com/googleprodkernel/linux-liveupdate/tree/luo/memfd-v0.1 > > RFC v1: https://lore.kernel.org/all/20250320024011.2995837-1-pasha.tatashin@soleen.com > > Changyuan Lyu (1): > kho: add kho_unpreserve_folio/phys > > Pasha Tatashin (15): > kho: make debugfs interface optional > kho: allow to drive kho from within kernel > luo: luo_core: Live Update Orchestrator > luo: luo_core: integrate with KHO > luo: luo_subsystems: add subsystem registration > luo: luo_subsystems: implement subsystem callbacks > luo: luo_files: add infrastructure for FDs > luo: luo_files: implement file systems callbacks > luo: luo_ioctl: add ioctl interface > luo: luo_sysfs: add sysfs state monitoring > reboot: call liveupdate_reboot() before kexec > luo: add selftests for subsystems un/registration > selftests/liveupdate: add subsystem/state tests > docs: add luo documentation > MAINTAINERS: add liveupdate entry > > .../ABI/testing/sysfs-kernel-liveupdate | 51 ++ > Documentation/admin-guide/index.rst | 1 + > Documentation/admin-guide/liveupdate.rst | 62 ++ > .../userspace-api/ioctl/ioctl-number.rst | 1 + > MAINTAINERS | 14 +- > drivers/misc/Kconfig | 1 + > drivers/misc/Makefile | 1 + > drivers/misc/liveupdate/Kconfig | 60 ++ > drivers/misc/liveupdate/Makefile | 7 + > drivers/misc/liveupdate/luo_core.c | 547 +++++++++++++++ > drivers/misc/liveupdate/luo_files.c | 664 ++++++++++++++++++ > drivers/misc/liveupdate/luo_internal.h | 59 ++ > drivers/misc/liveupdate/luo_ioctl.c | 203 ++++++ > drivers/misc/liveupdate/luo_selftests.c | 283 ++++++++ > drivers/misc/liveupdate/luo_selftests.h | 23 + > drivers/misc/liveupdate/luo_subsystems.c | 413 +++++++++++ > drivers/misc/liveupdate/luo_sysfs.c | 92 +++ > include/linux/kexec_handover.h | 27 + > include/linux/liveupdate.h | 214 ++++++ > include/uapi/linux/liveupdate.h | 324 +++++++++ > kernel/Kconfig.kexec | 10 + > kernel/Makefile | 1 + > kernel/kexec_handover.c | 343 +++------ > kernel/kexec_handover_debug.c | 237 +++++++ > kernel/kexec_handover_internal.h | 74 ++ > kernel/reboot.c | 4 + > tools/testing/selftests/Makefile | 1 + > tools/testing/selftests/liveupdate/.gitignore | 1 + > tools/testing/selftests/liveupdate/Makefile | 7 + > tools/testing/selftests/liveupdate/config | 6 + > .../testing/selftests/liveupdate/liveupdate.c | 440 ++++++++++++ > 31 files changed, 3933 insertions(+), 238 deletions(-) > create mode 100644 Documentation/ABI/testing/sysfs-kernel-liveupdate > create mode 100644 Documentation/admin-guide/liveupdate.rst > create mode 100644 drivers/misc/liveupdate/Kconfig > create mode 100644 drivers/misc/liveupdate/Makefile > create mode 100644 drivers/misc/liveupdate/luo_core.c > create mode 100644 drivers/misc/liveupdate/luo_files.c > create mode 100644 drivers/misc/liveupdate/luo_internal.h > create mode 100644 drivers/misc/liveupdate/luo_ioctl.c > create mode 100644 drivers/misc/liveupdate/luo_selftests.c > create mode 100644 drivers/misc/liveupdate/luo_selftests.h > create mode 100644 drivers/misc/liveupdate/luo_subsystems.c > create mode 100644 drivers/misc/liveupdate/luo_sysfs.c > create mode 100644 include/linux/liveupdate.h > create mode 100644 include/uapi/linux/liveupdate.h > create mode 100644 kernel/kexec_handover_debug.c > create mode 100644 kernel/kexec_handover_internal.h > create mode 100644 tools/testing/selftests/liveupdate/.gitignore > create mode 100644 tools/testing/selftests/liveupdate/Makefile > create mode 100644 tools/testing/selftests/liveupdate/config > create mode 100644 tools/testing/selftests/liveupdate/liveupdate.c > > -- > 2.49.0.1101.gccaa498523-goog > -- Sincerely yours, Mike.