Re: [RFC PATCH 10/15] virt: tdx-guest: Set up and accept private MMIO ranges

From: Xiaoyao Li

Date: Fri Nov 20 2026 - 02:42:48 EST


On 11/20/2026 7:22 AM, Edgecombe, Rick P wrote:
> On Thu, 2026-11-19 at 09:59 -0400, Jason Gunthorpe wrote:
>> On Thu, Nov 19, 2026 at 07:24:13PM +0800, Xiaoyao Li wrote:
>>> On 11/3/2026 6:38 AM, Edgecombe, Rick P wrote:
>>>> On Thu, 2026-10-29 at 09:56 +0000, Duan, Zhenzhong wrote:
>>>>> After thinking about this further, a second .run() attempt cannot recover
>>>>> from partial MMIO acceptance with the current implementation. It starts
>>>>> accepting ranges from the beginning, so it will encounter a re-acceptance
>>>>> error on the first range successfully accepted by the previous attempt,
>>>>> before reaching the range that originally failed.
>>>> How does MMIO acceptance fail? Whose fault is it?
>>> According to the Completion Status Codes defined for TDG.TDI.MMIO.ACCEPT in TDX
>>> Connect ABI spec, it can fail due to various reason. I think most of them are
>>> the fault of the host, and a few are guest fault.
> What are the ones with the guest? We have some existing issues with normal
> accept. I'd prefer not to pile on.

TDX_MMIO_ACCEPT_SIZE_MISMATCH

This is the similar for private page that happens when accepting at a large
level than what is mapped by the host VMM. It can be handled by accepting at
smaller level. And since currently only 4K level is supported, guest won't get
it actually.

TDX_OPERAND_INVALID
TDX_TDI_INVALID_METADATA
TDX_TDI_INVALID_STATE

These are due to bad input from guest. Not the thing we need to worry about for
a well-behaved guest.

>>> The most interesting one is the TDX_OPERAND_BUSY due to contention on some
>>> locks. E.g., when host is operating on the TDI, it fails to acquire the TDIMT lock.
> Oh, hmm. Binbin was going to look at the host priority bit TDX arch as a general
> thing. Can you show this example to him?

sure. I will talk to him offline.