Re: [PATCH v2 10/31] x86/virt/tdx: Add extra memory to TDX Module for Extensions

Huang, Kai
2026-04-23T21:55:45Z

>
> >
> > Btw, I think technically we can reuse the seamcall_ir_resched() you introduced
> > later, albeit in which a local '_args' is used as a copy of the original 'args',
> > but that has no harm for the case where we can just use the 'args' to loop.
>
> No we can't. TDH_EXT_MEM_ADD is designed to use output parameter RCX
> to override/update input parameter RCX, so the caller doesn't have to
> do manual parameter update on retry call. Using seamcall_ir_resched()
> makes each retry use the original RCX, not the updated one.

OK I wish there's a comment saying there's additional output besides error code
via RAX and we just need to feed the output as input again when retrying the
SEAMCALL.

>
> >
> > I am wondering whether we can just use that here, or we just get rid of that
> > helper (then open retry by the callers of these SEAMCALL wrappers), since there
> > will be more cases where we need to manually set 'resume=1' in the SEAMCALL
> > input 'args' when retrying TDX_INTERRUPTED_RESUMABLE.
>
> I'd like to know why some SEAMCALLs needs resume flag but others don't.
> If there is chance we don't introduce too much variants for the same thing,
> that's most friendly to OS. And "no resume flag" is my best preference.

I don't know either.

>
> For now, I can see only one SEAMCALL with resume flag in mainline,
> tdh_phymem_cache_wb(). I'd rather we treat it as an exception and no
> resume flag any more if possible.

Right, but there will be more, and setting 'resumed=1' is even different from
how tdh_phymem_cache_wb() does.