Re: [RFC PATCH v5 032/104] KVM: x86/mmu: introduce config for PRIVATE KVM MMU

From: Paolo Bonzini
Date: Tue Apr 05 2022 - 17:04:39 EST


On 4/1/22 04:13, Kai Huang wrote:
I don't want to use CONFIG_INTEL_TDX_HOST in KVM MMU code. I think the change
to KVM MMU should be a sort of independent from TDX. But it seems failed based
on your feedback.

Why do you need to use any config? As I said majority of your changes to MMU
are not under any config. But I'll leave this to maintainer/reviewers.

There are few uses, but the effect should be pretty large, because the config symbol replaces variable accesses with constants:

+static inline gfn_t kvm_gfn_stolen_mask(struct kvm *kvm)
+{
+#ifdef CONFIG_KVM_MMU_PRIVATE
+ return kvm->arch.gfn_shared_mask;
+#else
+ return 0;
+#endif
+}

Please keep it.

Paolo