Re: SVSM Observability and Configuration Protocol draft

Nicolai Stange <[email protected]> Tue, 14 Apr 2026 10:46:33 +0200
Newsgroups dev.linux.lists.coconut-svsm
Message-ID <87mrz6lyja.fsf@>
Hi,

Jörg Rödel <[email protected]> writes:

> ### Source entry layout
>
> One entry in the array is 128 bytes in size and uses the following layout:
>
> | Offset | Size (Bytes) | Description                         |
> |-------:|-------------:|-------------------------------------|
> | `0x00` | 4            | Flags                               |
> | `0x04` | 124          | Name of the source encoded as UTF-8 |

Just a generic comment: as in my understanding there's no central
authority managing the names, would it perhaps make sense to split the
Name from above into something like a 16 byte UUID + a human readable
name, the latter being only informative (or, alternatively, whose
semantics are defined only within the scope of the UUID)?


> The Flags stored in each entry are a bit field stored in little-endian byte
> order. The defined flags are:
>
> | Bit(s) | Name           | Description                                    |
> |-------:|----------------|------------------------------------------------|
> | 0      | `WRITEABLE`    | The source supports the `SVSM_OCP_WRITE` call. |
> | 31:1   | Reserved – MBZ | All other bits are reserved and must be zero.  |
>

<snip>

>
> ## SVSM_OCP_WRITE Call
>
> This call will attempt to write data into a specified observability or
> configuration source.
>
> ### Registers
>
> | Register | Size (Bytes) | Alignment | In/Out | Description                                        |
> |----------|-------------:|----------:|:------:|----------------------------------------------------|
> | `RAX`    | 4            |           | OUT    | Result value                                       |
> | `RCX`    | 4            |           | IN     | Array index of the source to write to              |
> | `RDX`    | 8            | 8         | IN     | GPA of buffer with data to write                   |
> | `R8 `    | 4            |           | IN     | Number of bytes to write                           |
> | `R8`     | 4            |           | OUT    | Number of bytes written                            |
> | `R9`     | 4            |           | IN     | Byte offset into data to start the write operation |
>
> The `SVSM_OCP_WRITE` call attempts to write data from the GPA specified in
> `RDX` to the observability or configuration source specified in `RCX`. The size
> of the data to write is specified in `R8` and the offset to write the data to
> in `R9`.
>
> Sources can only be written to if the Flags field in the `SVSM_OCP_LIST` call
> has the `WRITEABLE` bit set. If the source is not writable the call will return
> `SVSM_ERR_INVALID_PARAMETER`.
>
> The format of the data allowed to write is source dependent. If a given data
> format is not understood by the source the call will also return
> `SVSM_ERR_INVALID_PARAMETER`.

I assume other errors would be allowed as well? I'm thinking of a
situation where a "source/configuration" is backed by storage, and
writes to that could fail.

Thanks,

Nicolai

-- 
SUSE Software Solutions Germany GmbH, Frankenstraße 146, 90461 Nürnberg, Germany
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich
(HRB 36809, AG Nürnberg)