ANDROID: KVM: arm64: iommu: Track MMIO correctly
Although at the moment pKVM doesn’t support device assignment, the
hypervisor donates the MMIO of the IOMMU to itself (and in some
other cases also).
So, we shouldn’t allow the host to map those pages in the IOMMU page
tables, for that we check the leaf pte and it’s mapped in host (or
default) mapping fails.
We should also prevent the other cases where a page was already mapped
and the hypervisor attempts to donate it, as MMIO pages are not
currently refcounted, we taint them by marking using a new state
PKVM_PAGE_MMIO_DMA, which prevents any transition.
This is too restrictive at the moment which would be improved with
more infrastructure to track MMIO pages that ideally comes with
device assignment support.
Bug: 277989609
Bug: 278749606
Change-Id: Ib1b7af57f0a858f6e5f0641664fe1f7fa670f908
Signed-off-by:
Mostafa Saleh <smostafa@google.com>
Loading
Please sign in to comment