openvmm icon indicating copy to clipboard operation
openvmm copied to clipboard

Add igvm V2 RPC interfaces to propagate igvm error info

Open qiucwang opened this issue 1 year ago • 1 comments

Add igvm V2 RPC request and response headers to propagate igvm attest error info.

HCL and Underhill in Confidential VMs, send requests to IGVM Agent in the host through the VM worker process (VMWP). The HCL/UH sends requests to the VMWP via the GET emulation protocol, while the VMWP communicates with the IGVM Agent via Windows RPC. The current interface between HCL/UH and VMWP will not change. Currently interface, sends a i32 (-1), 0xFFFFFFFF back if there are any errors with the request to IGVM Agent. VMWP just acts as a proxy.

The proposed changes are to the format of the messages that are sent between UH/HCL and IGVM Agent. The version field of request header is incremented from 1 to 2 and a new struct CapabilityBitmap is added to the header:

pub struct IgvmAttestRequestData {
    pub data_size: u32,
    /// Version number, 1 or 2
    pub version: u32,
    pub report_type: IgvmAttestReportType,
    pub report_data_hash_type: IgvmAttestHashType,
    pub variable_data_size: u32,
    /// Bitmap of additional Igvm request attributes.
    /// [0] error_code: Requesting IGVM Agent Error code
    /// [1] retry: Retry preference
    pub capability_bitmap: IgvmCapabilityBitMap,
}

In case of a version 2 request being sent, IGVM Agent would respond with a version 2 response, whose header include a new field as IgvmErrorInfo that include error code and retry signal. The IGVM Agent attestation error is then propagated to UH and UH can take proper retry strategy as per retry recommendation.

pub struct IgvmErrorInfo {
    /// ErrorCode propogated from IgvmAgent
    pub error_code: u32,
    /// HttpStatusCode propogated from IgvmAgent that enhances the ErrorCode
    pub http_status_code: u32,
    /// Igvm signal bitmap from response, the first bit is retry recommendation
    pub igvm_signal: IgvmSignal,
    /// Reserved
    pub reserved: [u32; 3],
}

pub struct IgvmAttestKeyReleaseResponseHeader {
    pub data_size: u32,
    /// Version number that should match the request version
    pub version: u32,
    /// IgvmErrorInfo that contains RPC result and retry recommendation
    pub error_info: IgvmErrorInfo,
}

qiucwang avatar Jan 14 '25 17:01 qiucwang

Do not share links to docs hosted on the Microsoft sharepoint if they aren't able to be viewed publicly.

Please update the PR description to include the context and rationale behind this change directly.

daprilik avatar Jan 14 '25 18:01 daprilik

@smalis-msft can you help reviewing?

mingweishih avatar Aug 05 '25 20:08 mingweishih