vmbase: Only lazy-map MMIO if hyp has MMIO_GUARD

Instead of MMIO_GUARD_MAP-ing all MMIO pages described in the DT (e.g.
for PCI), we lazy-map them in the MMU and only MMIO_GUARD_MAP in the
handler. This results in a greatly reduced number of pages being
mapped/unmapped with the hypervisor.

However, there is no point in doing so on hypervisors that don't support
MMIO_GUARD and the current architecture forces their backends to provide
stub mmio_guard_{,un}map() functions. Instead, create valid mappings for
those MMIO pages from the start, which will remove the need for the
stubs (addressed in a later commit) and won't involve the fault handler
on those platforms, in turn reducing the number of page table updates,
potentially improving performance.

No functional change intended on hypervisors that support MMIO_GUARD.

Test: atest DebugPolicyHostTests#testNoAdbInDebugPolicy_withDebugLevelNone_boots
Test: atest rialto_test vmbase_example.integration_test
Change-Id: Idde59d24c8bf848eac0ae5c38b3f7dede47863e3
1 file changed
tree: bc13543d3dae82a9dfb8cf2c1a0e3253db51cea0
  1. apex/
  2. apkdmverity/
  3. authfs/
  4. compos/
  5. demo/
  6. demo_native/
  7. docs/
  8. encryptedstore/
  9. javalib/
  10. launcher/
  11. libs/
  12. microdroid/
  13. microdroid_manager/
  14. pvmfw/
  15. rialto/
  16. service_vm/
  17. tests/
  18. virtualizationmanager/
  19. virtualizationservice/
  20. vm/
  21. vm_payload/
  22. vmbase/
  23. vmclient/
  24. zipfuse/
  25. .clang-format
  26. .gitignore
  27. Android.bp
  28. OWNERS
  29. PREUPLOAD.cfg
  30. README.md
  31. TEST_MAPPING
README.md

Virtualization

This repository contains userspace services related to running virtual machines on Android, especially protected virtual machines. See the getting started documentation and Microdroid README for more information.