Re: [RFC PATCH v5 008/104] KVM: TDX: Add a function to initialize TDX module

From: Paolo Bonzini
Date: Sun Mar 13 2022 - 10:03:46 EST


On 3/4/22 20:48, isaku.yamahata@xxxxxxxxx wrote:
+
+ if (!tdx_module_initialized) {
+ if (enable_tdx) {
+ ret = __tdx_module_setup();
+ if (ret)
+ enable_tdx = false;

"enable_tdx = false" isn't great to do only when a VM is created. Does it make sense to anticipate this to the point when the kvm_intel.ko module is loaded?

Paolo

+ else
+ tdx_module_initialized = true;
+ } else
+ ret = -EOPNOTSUPP;
+ }
+