ANDROID: KVM: arm64: iommu: Snapshot host stage-2
Snapshot the host stage-2 in the idmapped domain, this is done differently from the Android14: - Instead of assuming that the page table maps all the memory and the snapshot function would only unmap the donated pages, now the polarity is the opposite, where the page table is assumed to be empty and the snapshot function would map all host memory, so this slower, but done only once at boot, and that won't require the module to know the memory map. - Instead of calling snapshot at init, now it is exported to modules, as some IOMMUs as SMMUv3 doens't know the format of the page table until the device is attached. Bug: 357781595 Bug: 384432312 Change-Id: I82dbf273eebc4e5c588c230a3a9bb18ef7b468ea Signed-off-by: Mostafa Saleh <smostafa@google.com>
This commit is contained in:
@@ -9,6 +9,17 @@
|
||||
#include <nvhe/spinlock.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Domain ID for identity mapped domain that the host can attach
|
||||
* to get the same mapping available to the CPU page table.
|
||||
*/
|
||||
#define KVM_IOMMU_DOMAIN_IDMAP_ID 0
|
||||
|
||||
/* Used in alloc_domain type argument. */
|
||||
#define KVM_IOMMU_DOMAIN_IDMAP_TYPE 0
|
||||
|
||||
#define KVM_IOMMU_DOMAIN_NR_START (KVM_IOMMU_DOMAIN_IDMAP_ID + 1)
|
||||
|
||||
struct kvm_hyp_iommu_domain {
|
||||
atomic_t refs;
|
||||
pkvm_handle_t domain_id;
|
||||
|
||||
Reference in New Issue
Block a user