ANDROID: KVM: arm64: Fix link with CONFIG_MODULES=n

The recently introduced support for pKVM modules has clearly lacked a
bit of testing with CONFIG_MODULES=n.

Make sure to not access __pkvm_modules_enabled when CONFIG_MODULES=n to
fix the link.

Bug: 244543039
Bug: 244373730
Reported-by: kernel test robot <lkp@intel.com>
Change-Id: I65c6ad7c07c2812b85dcd435b24b3444c0ce7f1e
Signed-off-by: Quentin Perret <qperret@google.com>
This commit is contained in:
Quentin Perret
2022-12-07 17:50:33 +00:00
parent 9fe1568804
commit 94958d875e

View File

@@ -416,6 +416,7 @@ int pkvm_vm_ioctl_enable_cap(struct kvm *kvm, struct kvm_enable_cap *cap)
return 0;
}
#ifdef CONFIG_MODULES
static int __init early_pkvm_enable_modules(char *arg)
{
kvm_nvhe_sym(__pkvm_modules_enabled) = true;
@@ -423,6 +424,7 @@ static int __init early_pkvm_enable_modules(char *arg)
return 0;
}
early_param("kvm-arm.protected_modules", early_pkvm_enable_modules);
#endif
struct pkvm_mod_sec_mapping {
struct pkvm_module_section *sec;