History

liveupdate: luo_core: Live Update Orchestrator

Patch series "Live Update Orchestrator", v8. This series introduces the Live Update Orchestrator, a kernel subsystem designed to facilitate live kernel updates using a kexec-based reboot. This capability is critical for cloud environments, allowing hypervisors to be updated with minimal downtime for running virtual machines. LUO achieves this by preserving the state of selected resources, such as memory, devices and their dependencies, across the kernel transition. As a key feature, this series includes support for preserving memfd file descriptors, which allows critical in-memory data, such as guest RAM or any other large memory region, to be maintained in RAM across the kexec reboot. The other series that use LUO, are VFIO [1], IOMMU [2], and PCI [3] preservations. Github repo of this series [4]. The core of LUO is a framework for managing the lifecycle of preserved resources through a userspace-driven interface. Key features include: - Session Management Userspace agent (i.e. luod [5]) creates named sessions, each represented by a file descriptor (via centralized agent that controls /dev/liveupdate). The lifecycle of all preserved resources within a session is tied to this FD, ensuring automatic kernel cleanup if the controlling userspace agent crashes or exits unexpectedly. - File Preservation A handler-based framework allows specific file types (demonstrated here with memfd) to be preserved. Handlers manage the serialization, restoration, and lifecycle of their specific file types. - File-Lifecycle-Bound State A new mechanism for managing shared global state whose lifecycle is tied to the preservation of one or more files. This is crucial for subsystems like IOMMU or HugeTLB, where multiple file descriptors may depend on a single, shared underlying resource that must be preserved only once. - KHO Integration LUO drives the Kexec Handover framework programmatically to pass its serialized metadata to the next kernel. The LUO state is finalized and added to the kexec image just before the reboot is triggered. In the future this step will also be removed once stateless KHO is merged [6]. - Userspace Interface Control is provided via ioctl commands on /dev/liveupdate for creating and retrieving sessions, as well as on session file descriptors for managing individual files. - Testing The series includes a set of selftests, including userspace API validation, kexec-based lifecycle tests for various session and file scenarios, and a new in-kernel test module to validate the FLB logic. Introduce LUO, a mechanism intended to facilitate kernel updates while keeping designated devices operational across the transition (e.g., via kexec). The primary use case is updating hypervisors with minimal disruption to running virtual machines. For userspace side of hypervisor update we have copyless migration. LUO is for updating the kernel. This initial patch lays the groundwork for the LUO subsystem. Further functionality, including the implementation of state transition logic, integration with KHO, and hooks for subsystems and file descriptors, will be added in subsequent patches. Create a character device at /dev/liveupdate. A new uAPI header, <uapi/linux/liveupdate.h>, will define the necessary structures. The magic number for IOCTL is registered in Documentation/userspace-api/ioctl/ioctl-number.rst.

Pasha Tatashin committed 11 months ago

Commit 9e2fd061 parent 7bd36436 files · +220 −0Browse files

Showing the changes to include/uapi (1 of 6 files). Show all

Unified · Split

include/uapi/linux/liveupdate.h+46−0
@@ -0,0 +1,46 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2
3/*
4 * Userspace interface for /dev/liveupdate
5 * Live Update Orchestrator
6 *
7 * Copyright (c) 2025, Google LLC.
8 * Pasha Tatashin <pasha.tatashin@soleen.com>
9 */
10
11#ifndef _UAPI_LIVEUPDATE_H
12#define _UAPI_LIVEUPDATE_H
13
14#include <linux/ioctl.h>
15#include <linux/types.h>
16
17/**
18 * DOC: General ioctl format
19 *
20 * The ioctl interface follows a general format to allow for extensibility. Each
21 * ioctl is passed in a structure pointer as the argument providing the size of
22 * the structure in the first u32. The kernel checks that any structure space
23 * beyond what it understands is 0. This allows userspace to use the backward
24 * compatible portion while consistently using the newer, larger, structures.
25 *
26 * ioctls use a standard meaning for common errnos:
27 *
28 * - ENOTTY: The IOCTL number itself is not supported at all
29 * - E2BIG: The IOCTL number is supported, but the provided structure has
30 * non-zero in a part the kernel does not understand.
31 * - EOPNOTSUPP: The IOCTL number is supported, and the structure is
32 * understood, however a known field has a value the kernel does not
33 * understand or support.
34 * - EINVAL: Everything about the IOCTL was understood, but a field is not
35 * correct.
36 * - ENOENT: A provided token does not exist.
37 * - ENOMEM: Out of memory.
38 * - EOVERFLOW: Mathematics overflowed.
39 *
40 * As well as additional errnos, within specific ioctls.
41 */
42
43/* The ioctl type, documented in ioctl-number.rst */
44#define LIVEUPDATE_IOCTL_TYPE 0xBA
45
46#endif /* _UAPI_LIVEUPDATE_H */