Re: [PATCH v4 01/11] KVM: x86/mmu: Change tdp_mmu to a read-only parameter

Huang, Kai
2022-10-12T21:38:02Z

On Wed, 2022-10-12 at 18:16 +0000, Sean Christopherson wrote:
> From: David Matlack <dmatlack@google.com>
>
> Change tdp_mmu to a read-only parameter and drop the per-vm
> tdp_mmu_enabled.  Keep the is_tdp_mmu_enabled() helper instead of
> referencing tdp_mmu_enabled directly to allow for future optimizations
> without needing to churn a lot of code, e.g. KVM can use a static key
> for now that the knob is read-only after the vendor module is loaded.
>
> The TDP MMU was introduced in 5.10 and has been enabled by default since
> 5.15. At this point there are no known functionality gaps between the
> TDP MMU and the shadow MMU, and the TDP MMU uses less memory and scales
> better with the number of vCPUs. In other words, there is no good reason
> to disable the TDP MMU on a live system.
>
> Purposely do not drop tdp_mmu=N support (i.e. do not force 64-bit KVM to
> always use the TDP MMU) since tdp_mmu=N is still used to get test
> coverage of KVM's shadow MMU TDP support, which is used in 32-bit KVM.
>
> Signed-off-by: David Matlack <dmatlack@google.com>
> [sean: keep is_tdp_mmu_enabled()]
> Signed-off-by: Sean Christopherson <seanjc@google.com>

Reviewed-by: Kai Huang <kai.huang@intel.com>