RE: [RFC PATCH 12/15] virt: tdx-guest: Support Trust Device Interface (TDI) activation
From: Duan, Zhenzhong
Date: Wed Oct 28 2026 - 02:45:07 EST
>-----Original Message-----
>From: Li, Xiaoyao <xiaoyao.li@xxxxxxxxx>
>Subject: Re: [RFC PATCH 12/15] virt: tdx-guest: Support Trust Device
>Interface (TDI) activation
>
>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()?
Will add more introduction.
>
>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.
Agreed, it make more sense to move dma_set_cc_private() call into enable_dma() callback.