Re: [PATCH v9 07/18] x86/virt/tdx: Do TDX module per-cpu initialization

From: Dave Hansen
Date: Mon Feb 13 2023 - 18:52:17 EST


On 2/13/23 15:43, Huang, Kai wrote:
> ( My main concern is "Run after the KVM handler" seems a little bit hacky to me.
> Logically, it's more reasonable to have the TDX callback _before_ KVM's but not
> _after_. If any user (KVM) has done tdx_enable() successfully, the TDX code
> should give the user a "TDX-runnable" cpu before user (KVM)'s own callback is
> involved. Anyway as mentioned above, I'll do above as you suggested.)

I was assuming that the KVM callback is what does VMXON for a given
logical CPU. If that were the case, you'd need to do the TDX stuff
*AFTER* VMXON.

Am I wrong?