KVM: SVM: Connect 'npt' module param to KVM's internal 'npt_enabled'
authorSean Christopherson <seanjc@google.com>
Fri, 5 Mar 2021 02:16:37 +0000 (18:16 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 5 Mar 2021 13:33:15 +0000 (08:33 -0500)
commit99840a75454b66d69d2a450ab04e6438d75eba48
tree572c8e408b2e4791aaca75e5bea734566e52c194
parentbeda430177f56656e7980dcce93456ffaa35676b
KVM: SVM: Connect 'npt' module param to KVM's internal 'npt_enabled'

Directly connect the 'npt' param to the 'npt_enabled' variable so that
runtime adjustments to npt_enabled are reflected in sysfs.  Move the
!PAE restriction to a runtime check to ensure NPT is forced off if the
host is using 2-level paging, and add a comment explicitly stating why
NPT requires a 64-bit kernel or a kernel with PAE enabled.

Opportunistically switch the param to octal permissions.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20210305021637.3768573-1-seanjc@google.com>
Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm/svm.c