Re: [PATCH v19 093/130] KVM: TDX: Implements vcpu request_immediate_exit

From: Isaku Yamahata
Date: Tue Apr 02 2024 - 02:53:10 EST


On Fri, Mar 29, 2024 at 09:54:04AM +0800,
Chao Gao <chao.gao@xxxxxxxxx> wrote:

> On Mon, Feb 26, 2024 at 12:26:35AM -0800, isaku.yamahata@xxxxxxxxx wrote:
> >From: Isaku Yamahata <isaku.yamahata@xxxxxxxxx>
> >
> >Now we are able to inject interrupts into TDX vcpu, it's ready to block TDX
> >vcpu. Wire up kvm x86 methods for blocking/unblocking vcpu for TDX. To
> >unblock on pending events, request immediate exit methods is also needed.
>
> TDX doesn't support this immediate exit. It is considered as a potential
> attack to TDs. TDX module deploys 0/1-step mitigations to prevent this.
> Even KVM issues a self-IPI before TD-entry, TD-exit will happen after
> the guest runs a random number of instructions.
>
> KVM shouldn't request immediate exits in the first place. Just emit a
> warning if KVM tries to do this.

0ec3d6d1f169
("KVM: x86: Fully defer to vendor code to decide how to force immediate exit")
removed the hook. This patch will be dropped and tdx_vcpu_run() will ignore
force_immediate_exit.
--
Isaku Yamahata <isaku.yamahata@xxxxxxxxx>