Re: [PATCH 5/7] KVM: TDX: Handle TDG.VP.VMCALL

Chao Gao
2024-12-10T09:05:19Z

>diff --git a/Documentation/virt/kvm/api.rst b/Documentation/virt/kvm/api.rst
>index edc070c6e19b..bb39da72c647 100644
>--- a/Documentation/virt/kvm/api.rst
>+++ b/Documentation/virt/kvm/api.rst
>@@ -6815,6 +6815,7 @@ should put the acknowledged interrupt vector into the 'epr' field.
> #define KVM_SYSTEM_EVENT_WAKEUP 4
> #define KVM_SYSTEM_EVENT_SUSPEND 5
> #define KVM_SYSTEM_EVENT_SEV_TERM 6
>+ #define KVM_SYSTEM_EVENT_TDX_FATAL 7
> __u32 type;
> __u32 ndata;
> __u64 data[16];
>@@ -6841,6 +6842,13 @@ Valid values for 'type' are:
> reset/shutdown of the VM.
> - KVM_SYSTEM_EVENT_SEV_TERM -- an AMD SEV guest requested termination.
> The guest physical address of the guest's GHCB is stored in `data[0]`.
>+ - KVM_SYSTEM_EVENT_TDX_FATAL -- an TDX guest requested termination.

Not sure termination is an accurate interpretation of fatal errors. Maybe
just say: a fatal error reported by a TDX guest.

>+ The error codes of the guest's GHCI is stored in `data[0]`.

what do you mean by "guest's GHCI"?

>+ If the bit 63 of `data[0]` is set, it indicates there is TD specified
>+ additional information provided in a page, which is shared memory. The
>+ guest physical address of the information page is stored in `data[1]`.
>+ An optional error message is provided by `data[2]` ~ `data[9]`, which is
>+ byte sequence, LSB filled first. Typically, ASCII code(0x20-0x7e) is filled.
> - KVM_SYSTEM_EVENT_WAKEUP -- the exiting vCPU is in a suspended state and
> KVM has recognized a wakeup event. Userspace may honor this event by
> marking the exiting vCPU as runnable, or deny it and call KVM_RUN again.