Change the condition for preparing for ramdump on the crosvm side

Preparing for ramdump on the crosvm side means two activities:
* creating an empty file for storing the ramdump (and making it as the
  backing file for the /dev/hvc1 virtio console)
* adding `crashkernel=xxM` parameter

For protected VMs: ramdump is prepared if debug policy (accessed by
reading the device tree) says ramdump is enabled. Note that we can do
this unconditionally for protected VMs because pvmfw will anyway kick in
and remove the parameter if ramdump is enabled. We do this conditionally
on the host just because we don't want to create the ramdump file
unnecessarily.

For non-protected VMs: ramdump is prepared if debug policy says so OR
the debugLevel is full. This allows developers to do the ramdump even on
a device where debug policy is not provisioed.

Bug: 270657304
Test: test ramdump on the following combinations:
* dp provisioned + pVM + debugLevel=none: ramdump enabled
* dp provisioned + pVM + debugLevel=full: ramdump enabled
* dp provisioned + non-pVM + debugLevel=none: ramdump enabled
* dp provisioned + non-pVM + debugLevel=full: ramdump enabled
* dp empty + pVM + debugLevel=none: ramdump disabled
* dp empty + pVM + debugLevel=full: ramdump disabled [note]
* dp empty + non-pVM + debugLevel=none: ramdump disabled
* dp empty + non-pVM + debugLevel=full: ramdump enabled

[note] `crashkernel=xx` is sent from the host. However, pvmfw
unconditionally removes the parameter from the cmdline because dp is not
provisioned. It could have checked the debug level by looking into the
bootconfig in the initrd, but it's too dirty.

Change-Id: I52ce34e0f9ef6404e482abec728c8108341a9fd6
3 files changed
tree: 1476dc91cc8e4622d7c60fab4d1b98e601e9d9d0
  1. apex/
  2. apkdmverity/
  3. authfs/
  4. avmd/
  5. compos/
  6. demo/
  7. docs/
  8. encryptedstore/
  9. javalib/
  10. launcher/
  11. libs/
  12. microdroid/
  13. microdroid_manager/
  14. pvmfw/
  15. rialto/
  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.