commit | e5b78343c02e07d380eaf75a5fbf09e59f30d5d5 | [log] [tgz] |
---|---|---|
author | Charisee <chiw@google.com> | Mon Apr 08 17:59:31 2024 +0000 |
committer | Charisee Chiw <chiw@google.com> | Wed Apr 10 17:36:54 2024 +0000 |
tree | ef89ddfaab764747bf9e3d17a55ec6481293a33d | |
parent | cd31a066db22cd69a92d50228579f390eaf23c7c [diff] |
Update needed for Rust v1.77.1 error: creating a mutable reference to mutable static is discouraged --> packages/modules/Virtualization/vmbase/example/src/main.rs:141:32 | 141 | let zeroed_data = unsafe { &mut ZEROED_DATA }; | ^^^^^^^^^^^^^^^^ mutable reference to mutable static | = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447> = note: this will be a hard error in the 2024 edition = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior = note: `-D static-mut-refs` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(static_mut_refs)]` help: use `addr_of_mut!` instead to create a raw pointer | 141 | let zeroed_data = unsafe { addr_of_mut!(ZEROED_DATA) }; | ~~~~~~~~~~~~~~~~~~~~~~~~~ error: creating a mutable reference to mutable static is discouraged --> packages/modules/Virtualization/vmbase/example/src/main.rs:144:33 | 144 | let mutable_data = unsafe { &mut MUTABLE_DATA }; | ^^^^^^^^^^^^^^^^^ mutable reference to mutable static | = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447> = note: this will be a hard error in the 2024 edition = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior help: use `addr_of_mut!` instead to create a raw pointer | 144 | let mutable_data = unsafe { addr_of_mut!(MUTABLE_DATA) }; | ~~~~~~~~~~~~~~~~~~~~~~~~~~ ---------------------- using suggested change creates the following errors ----------------------- error[E0599]: no method named `iter` found for raw pointer `*mut [u32; 10]` in the current scope --> packages/modules/Virtualization/vmbase/example/src/main.rs:147:32 | 147 | for element in zeroed_data.iter() { | ^^^^ method not found in `*mut [u32; 10]` | = note: try using `<*const T>::as_ref()` to get a reference to the type behind the pointer: https://doc.rust-lang.org/std/primitive.pointer.html#method.as_ref = note: using `<*const T>::as_ref()` on a pointer which is unaligned or points to invalid or uninitialized memory is undefined behavior error[E0608]: cannot index into a value of type `*mut [u32; 10]` --> packages/modules/Virtualization/vmbase/example/src/main.rs:150:16 | 150 | zeroed_data[0] = 13; | ^^^ | help: consider using `wrapping_add` or `add` for indexing into raw pointer | 150 | zeroed_data.wrapping_add(0) = 13; Bug: http://b/330185853 Test: ./test_compiler.py --prebuilt-path dist/rust-dev.tar.xz --target aosp_cf_x86_64_phone --image Change-Id: I641ef7fc9e6226692a2c55fe6f8917c92dcfd16f
Android Virtualization Framework (AVF) provides secure and private execution environments for executing code. AVF is ideal for security-oriented use cases that require stronger isolation assurances over those offered by Android’s app sandbox.
Visit our public doc site to learn more about what AVF is, what it is for, and how it is structured. This repository contains source code for userspace components of AVF.
If you want a quick start, see the getting started guideline and follow the steps there.
For in-depth explanations about individual topics and components, visit the following links.
AVF components:
AVF APIs:
How-Tos: