Re: [RFC PATCH 05/15] virt: tdx-guest: Add TDCM helpers and TEE-IO support check

From: Xiaoyao Li

Date: Wed Oct 28 2026 - 22:27:33 EST


On 10/27/2026 4:32 PM, Duan, Zhenzhong wrote:
>> -----Original Message-----
>> From: Li, Xiaoyao <xiaoyao.li@xxxxxxxxx>
>> Subject: Re: [RFC PATCH 05/15] virt: tdx-guest: Add TDCM helpers and TEE-IO
>> support check
>>
>> On 9/24/2026 12:10 PM, Zhenzhong Duan wrote:
>>> Implement internal helper wrappers tdx_tdcm_alloc(), tdx_tdcm_run(),
>>> and tdx_tdcm_free() to manage execution context lifecycle for TDX Connect
>>> TEE-IO Device Control and Management (TDCM) commands.
>>>
>>> Use these infrastructures to deploy all TDCM commands to orchestrate
>>> trusted device management, beginning with the first command,
>>> TDCM_OP_CHECK_TEEIO_SUPP, executed during the secure device locking
>>> sequence.
>> I think it needs to be split into 2 patches:
>> - implement tdx_tdcm_* and justify why poll mode in chosen instread of
>> notification.
>>
>> - Add TDCM_OP_CHECK_TEEIO_SUPP check to tdx_devsec_lock(). We need explain
>> what
>> it does, why we need it, and why it needs to be in tdx_devsec_lock() as the
>> first step.
> Hmm, that may break build because we define some static functions without user.

__maybe_unused can help.