pvmfw: apply_debug_policy: Backup DT before unpacking

As the DT needs to be backed-up before applying the overlay due to
fdt_apply_overlay corrupting its inputs on failure, do so before
unpacking it, reducing the amount of memory needed by the backup Vec
from the maximum size that the DT could occupy (here, 2MiB) to the
actual size that the DT has (here, a few KiB).

Note: This wasn't detected previously due to a bug in Fdt::header()
      causing fdt.as_slice() == &[] but will be required once the bug is
      fixed as pvmfw's HEAP can't hold a 2MiB slice.

Test: atest MicrodroidHostTests
Change-Id: Ic6e651a73c4fb97e4bf97c32edc0b327b6cd1def
1 file changed
tree: 91690e0a5a7eab3fa26edf242910c15c205f4862
  1. apex/
  2. apkdmverity/
  3. authfs/
  4. compos/
  5. demo/
  6. docs/
  7. encryptedstore/
  8. javalib/
  9. launcher/
  10. libs/
  11. microdroid/
  12. microdroid_manager/
  13. pvmfw/
  14. rialto/
  15. service_vm/
  16. tests/
  17. virtualizationmanager/
  18. virtualizationservice/
  19. vm/
  20. vm_payload/
  21. vmbase/
  22. vmclient/
  23. zipfuse/
  24. .clang-format
  25. .gitignore
  26. Android.bp
  27. OWNERS
  28. PREUPLOAD.cfg
  29. README.md
  30. 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.