ANDROID: KVM: arm64: Prevent pKVM module loading after IOMMU init

As a fail-safe mechanism, disable pKVM module loading after the IOMMU
init is complete. This intends to make sure nothing can be loaded after
the IOMMU driver is ready, in case a vendor would forget to call
__pkvm_close_module_registration

Bug: 254835242
Change-Id: I32a9752e145a8ef9787dae6319e37ba38544739b
Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
This commit is contained in:
Vincent Donnefort
2023-04-06 10:50:50 +01:00
committed by Treehugger Robot
parent 3e3a126ea3
commit 0ec2539fbc

View File

@@ -14,6 +14,7 @@
#include <hyp/adjust_pc.h>
#include <nvhe/iommu.h>
#include <nvhe/mm.h>
#include <nvhe/modules.h>
#include <nvhe/pkvm.h>
#define DRV_ID(drv_addr) ((unsigned long)drv_addr)
@@ -469,6 +470,8 @@ int __pkvm_iommu_finalize(int err)
if (!ret && err)
pkvm_handle_system_misconfiguration(NO_DMA_ISOLATION);
__pkvm_close_late_module_registration();
return ret;
}