Commit Graph

14 Commits

Author SHA1 Message Date
Alan Stokes 8d39a9b107 virtmgr: fail fast on misconfigured device
If the device does not advertise support for protected or
non-protected VMs, but still has the virt APEX installed, then that's
bad.

Fail fast to make this as noticeable as possible, and avoid wasting
resources, rather than waiting for things to go wrong later on.

While I'm here: make sure we consistently say "non-protected" rather
than "unprotected".

Bug: 254599807
Test: manual - fake property read, observe obvious failure
Test: atest MicrodroidTests MicrodroidHostTests
Change-Id: Ia0629f2d5b2094f6c1c41ff0fc3f2a76e285f0d7
2023-01-10 17:16:27 +00:00
David Brazdil 4b4c510ffb Start using virtmgr for running VMs
Make the final changes to start running VMs using virtmgr:

  * Have virtualizationservice host the VirtualizationServiceInternal
    AIDL service.

  * Remove memlock rlimit of virtmgr (instead of virtualizationservice)
    via a method on VirtualizationServiceInternal.

  * Have VirtualizationServiceInternal create the VM's temporary folder
    and change its owner to the client's UID. The files keep the same
    virtualizationservice_data_file SELinux label, but are now owned by
    the client's virtmgr instance. To this end, virtualizationservice
    requires CAP_CHOWN.

  * Switch all users to the new vmclient/javalib API for spawning
    virtmgr.

Bug: 245727626
Test: atest -p packages/modules/Virtualization:avf-presubmit
Change-Id: I93b2cadb67a8c125e1a86f9c1ba9cb98336f0cd4
2023-01-05 10:31:00 +00:00
Victor Hsieh f219cd8fd2 Delete cpu affinity config
Bug: 245746308
Test: TH
Change-Id: I0d74f55b7b41e5d6c38be0705582bf12fc9169d9
2022-09-09 13:46:08 -07:00
Treehugger Robot d1bd3c141b Merge changes I5e4db74f,I167148cd,I512a2cd0
* changes:
  Send UID and VM identifier to existing atoms
  Implement write_vm_exited_stats for VmExited atom
  Implement write_vm_booted_stats for VmBooted atom
2022-08-22 11:11:38 +00:00
Seungjae Yoo 62085c0e65 Send UID and VM identifier to existing atoms
Bug: 236252851
Test: N/A

Change-Id: I5e4db74f9a5cefd071676b9d248e9c5d91c5bfdd
2022-08-22 02:08:34 +00:00
David Brazdil 5f7c3c72c4 Move AVF tests to avf-pre/postsubmit test group
AVF presubmit test config currently runs all tests in the 'presubmit'
group. However, in presubmit the test configs are invoked with all
TEST_MAPPING paths from all affected CLs. Our test config can therefore
run tests from TEST_MAPPINGs outside of the Virtualization repo.

To work around this problem, move all Virtualization tests to
'avf-presubmit' group. Test config running in presubmit will still be
invoked with TEST_MAPPINGs from various repos but only our tests will
match the group.

Rename the postsubmit group to 'avf-postsubmit' for consistency.

Bug: 236755822
Test: atest --test-mapping packages/modules/Virtualization:avf-presubmit
Test: atest --test-mapping packages/modules/Virtualization:avf-postsubmit
Change-Id: I7be5781bef4b6e060a69724c7b4256423adc649c
2022-08-19 15:40:57 +00:00
Andrew Walbran 77497955f4 Update for new version of aarch64-paging.
Test: atest rialto_test
Change-Id: I5f4d900dab32534477aa7d6a3b8c71b73a3915e2
2022-08-15 16:41:00 +00:00
Alan Stokes 0e82b50e23 Move VM callback to vmclient
Instead of having clients directly register a callback with VS,
implement a Rust level callback interface in vmclient. This saves an
extra binder call on each notification, a bunch of boilerplate code,
and allows us to provide a slightly better interface (e.g. we can use
the Rust DeathReason enum, as elsewhere in vmclient, for instantly
better logging).

I also replaced all our usages of <some_interface>::binder::{...} with
direct access to binder::{...}. That makes it clearer what depends on
the interface itself and what is just generic binder code. I realise
this should be a separate change, but I only realised that after doing
bits of both.

Test: composd_cmd test-compile, observe logs (on both success & failure)
Test: atest -b (to make sure all our tests build)
Test: Presubmits
Change-Id: Iceda8d7b8f8008f9d7a2c51106c2794f09bb378e
2022-08-09 17:43:29 +01:00
Alan Stokes dfca76c8d1 rialto: Apply timeout to VM exit in test
Now that we have wait_for_death_with_timeout, use it.

Test: Hack VM to not exit, see timeout error
Change-Id: I4f9d03f6de6d441277c949d148c8fd3b30c8f88e
2022-08-03 13:34:24 +01:00
David Brazdil b6463c911a rialto: Remove activate_kernel_pgt function
Minor cleanup. Just call the activate() function from init_kernel_pgt.

Test: atest rialto_test
Change-Id: Ibc5762d91c06632da5d64e4c4ecddb3b61f8008b
2022-07-12 12:51:34 +01:00
David Brazdil 6629b6e5f8 rialto: Move PT Attributes to global constants
Define global constants for page table attributes.

Test: m rialto
Change-Id: I30d6ed5865112637f43397af3cba4190594aa06b
2022-07-12 12:50:12 +01:00
David Brazdil 05a72fda02 rialto: Remove 'extern crate log'
Add liblog_rust_nostd into the list of rustlibs instead.

Test: m rialto
Change-Id: I12fa74771c50927bbd1a0c70ece43aa09b46cd05
2022-07-12 12:50:12 +01:00
David Brazdil 2022bfbffd rialto: Add rialto_test to presubmit
Test: TH
Change-Id: Idbea7e2bcaf8b796996dc6adfcdc50a2e37cda0d
2022-07-08 15:12:50 +01:00
David Brazdil 66fc120377 rialto: Initial commit
Clone of ./vmbase/example with basic setup code.

Test: atest rialto_test
Change-Id: Id3d4e96674c261316e79c020ff0b1bd88f4363ba
2022-07-08 15:12:50 +01:00