Function tdx_guest::tdcall::write_servetd
source · pub fn write_servetd(
binding_handle: u64,
field_identifier: u64,
data: u64,
mask: u64,
uuid: [u64; 4],
) -> Result<(u64, [u64; 4]), TdCallError>
Expand description
As a service TD, write a metadata field (control structure field) of a target TD.
Inputs:
- binding_handle: the binding handle of the target TD.
- field_identifier: the identifier of the field to read.
The
LAST_ELEMENT_IN_FIELD
andLAST_FIELD_IN_SEQUENCE
components of the field identifier must be 0.WRITE_MASK_VALID
,INC_SIZE
,CONTEXT_CODE
andELEMENT_SIZE_CODE
components of the field identifier are ignored. A value of -1 is a special case: it is not a valid field identifier; in this case the first readable field identifier is returned inRDX
. - data: Data to write to the field.
- write_mask: A 64b write mask to indicate which bits of the value in
R8
are to be written to the field. - uuid: the TD_UUID of the target TD, using little-Endian.
Outputs:
- Previous contents of the field. In case of an error,
R8
returns 0. - Updated target TD’s TD_UUID, using little-Endian.