Re: [RFC PATCH 12/15] virt: tdx-guest: Support Trust Device Interface (TDI) activation

From: Xiaoyao Li

Date: Mon Oct 26 2026 - 03:20:01 EST


On 9/24/2026 12:10 PM, Zhenzhong Duan wrote:
> Store the bind session ID obtained after binding the TDI which is used
> by TDG.TDI.START to verify same bind session established by host before
> activation.
>
> Add tdx_tdi_start_dev() to signal guest readiness to the TDX module and
> issue the TDCM_OP_START_TDI hypercall for the host to complete activation.

It mainly is stating what the code is doing. What matters more is the design
choice. E.g., why the session ID needs to stored? will it be used anywhere else?
can it be obtained just when calling the tdx_mcall_tdi_start()?

Is there a hard requirement that before the MMIO is accepted, the DEVCIE cannot
be started? Is it able to accept MMIO at runtime like the private memory?

> The run callback accepts private MMIO ranges, starts the TDI, and verifies
> that it reaches TDI_STATE_RUN, finally notifies DMA sub-system device's
> ready to DMA to private memory. Note that private DMA is enabled separately
> during driver attach by accepting the default DMAR entry.

But this patch already calls dma_set_cc_private(). Will it cause problem without
the following patch? If so, it has bisect issue.