Code walkthrough
Each patch of the series laid out side by side: its code on the left, split into units (functions, structures, sections), and on the right what each unit means and how the pieces fit together.
| # | Patch | Structure | Files | Units |
|---|---|---|---|---|
| 01 | ctlv: Add the schema language and generator | Introduces the whole build-time half of CTLV: three JSON-Schema meta-schemas under Documentation/ctlv/ that define the YAML spec language, the append-only family registry and the generated-file manifest, plus the Python package tools/ctlv/ctlvgen that consumes them. | 23 | 212 |
| 02 | ctlv: Add the UAPI wire format and family API | Headers-only patch that fixes the contract of the series: the userspace TLV wire format, ioctl and event record (uapi/linux/ctlv.h), the cursor type shared by core and families (linux/ctlv.h), and the static schema/op/family descriptors that generated family code fills in (linux/ctlv_family.h). | 5 | 23 |
| 03 | ctlv: Add the root family specification and generated files | Defines the root CTLV family (ID 0) that every device answers: its YAML spec is the source of truth, with the registry, generated-file manifest and ABI snapshot around it. | 9 | 43 |
| 04 | Documentation: ctlv: Add userspace ABI | Documentation-only patch that publishes the CTLV userspace ABI as one RST document, links it into the userspace-api index and adds it to the CTLV MAINTAINERS entry. | 3 | 20 |
| 05 | ctlv: Prepare message input handling | Introduces the drivers/ctlv core module skeleton (Kconfig, Makefile, MAINTAINERS) and the input side of message handling: bounds-checked walking of TLV nests, a per-request index of attrs, and validated accessors. | 7 | 34 |
| 06 | ctlv: Prepare blob descriptor validation | Adds the helper that parses a blob descriptor (the nested type/address/fd/offset/length attribute group) out of a request and checks it against the blob limits of the schema node. | 3 | 8 |
| 07 | ctlv: Prepare schema validation | Adds schema.c, the layer that interprets the generated schema tables: walking the family chain, computing effective message size limits, and validating inbound messages against the schema while building a per-request index. | 3 | 25 |
| 08 | ctlv: Prepare message output handling | Adds the schema-aware reply builder: the put and nest helpers that family code uses to write output attributes, plus operation error reporting and query fragment completion. | 5 | 19 |
| 09 | ctlv: Prepare VA blob handling | Adds the blob layer: a family callback can resolve a validated blob descriptor in the request into a pinned, CPU-accessible user buffer, read or write it by offset, and release it. | 6 | 26 |
| 10 | ctlv: Prepare event queue support | Adds the event half of the core: per-open subscriptions, bounded per-file event queues with loss reporting, and event creation/emission for families. | 7 | 33 |
| 11 | ctlv: Prepare runtime introspection | Adds drivers/ctlv/introspection.c, the handlers behind the CTLV root family's discovery queries: list the family chain, list a device's published operations with effective sizes and state, and describe the request/reply message schema of an operation. | 2 | 18 |
| 12 | ctlv: Add device and operation dispatch | This patch adds drivers/ctlv/core.c, the layer that turns a family descriptor chain into a registered character device and dispatches validated ioctl operations to family callbacks. | 7 | 62 |
| 13 | Documentation: ctlv: Describe how to write a family | Adds the driver-API guide for writing a CTLV family: the YAML specification, generated descriptors and callbacks, device lifecycle, operations, hooks, blobs, events and extension through inheritance. | 3 | 19 |
| 14 | attestation: Add the base family specification and generated files | Defines the base attestation CTLV family specification-first: the YAML spec, its ABI snapshot, registry entries, and the generated UAPI and kernel files. | 10 | 52 |
| 15 | attestation: Prepare provider and instance core | Introduces the attestation core module: the public provider descriptor (include/linux/attestation.h), the private instance object (core/internal.h) and the registry, validation and lifecycle code (core/core.c) that implement the generated base-family callbacks. | 8 | 27 |
| 16 | attestation: Prepare measurement register journal | Adds the measurement-register layer to the attestation core: per-instance MR objects built from the provider's fixed MR list, an append-only journal of INFO and EXTEND entries keyed by MR generation, and a prepare/commit scheme for extensions that allocates everything (entry and event) before calling the provider so publication is infallible. | 6 | 30 |
| 17 | attestation: Add CTLV operation handling | This patch adds the translation layer between the generated CTLV attestation family (patch 14) and the provider/MR-journal core (patches 15-16): core/ctlv.c implements the per-operation handlers named by the family's op table. | 6 | 24 |
| 18 | tdx-guest: Expose the native attestation service API | This patch refactors the TDX guest driver so that TDREPORT, Quote and RTMR operations are available as an in-kernel service (struct tdx_guest_ops) in addition to the existing misc ioctl, TSM report and TSM MR frontends, all sharing the same locks and buffers. | 4 | 26 |
| 19 | attestation: Add the TDX family specification and generated files | Declares the ctlv-attestation-tdx family (ID 2), a child of ctlv-attestation that fills the device-info extension point with TDX-specific measurement IDs. | 9 | 19 |
| 20 | attestation: Add the TDX family implementation | Implements the TDX attestation provider as a module that registers as a client of the native tdx-guest service (patch 18) and creates a ctlv-attestation-tdx instance per TDX device. | 4 | 15 |