commit | d643cfefac129595d3502d709bd3d4128f2ada1e | [log] [tgz] |
---|---|---|
author | Pierre-Clément Tosi <ptosi@google.com> | Thu Jun 29 09:30:51 2023 +0000 |
committer | Pierre-Clément Tosi <ptosi@google.com> | Fri Jul 07 10:45:17 2023 +0000 |
tree | 5e2808800d699297d3428a2c415d5074cbf2cccd | |
parent | 32279ef5c46ab5081638e87d8d4c89d940a1b4c1 [diff] |
hyp: Refactor HypervisorCap to harden backends The Hypervisor trait previously required backends to implement all of its functions, even when they related to features that their underlying hypervisor did not implement. To deal with this, capabilities were introduced so that client code would conditionally call those functions based on the availability of the feature (discovered through the capabilities). This resulted in useless boiler-plate code in the backends (either using unimplemented()! or returning placeholders to please the caller) and a high risk of making use of unavailable features in hypervisor-agnostic client code. Instead, rework Hypervisor as an Inlineable Dyn Extension Trait [1], making it programmatically impossible to call a function for a feature that the running hypervisor doesn't provide. This also removes the need for any boilerplate code in the backends. Introduce the accessors get_mmio_guard() and get_mem_sharer(). No functional change intended. [1]: https://github.com/daniel5151/inlinable-dyn-extension-traits/blob/master/writeup.md Test: atest DebugPolicyHostTests#testNoAdbInDebugPolicy_withDebugLevelNone_boots Test: atest rialto_test vmbase_example.integration_test Change-Id: I6404fa141f53d074c9529403c4606ab90867cf6c
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.