aboutsummaryrefslogtreecommitdiff
path: root/aarch64
diff options
context:
space:
mode:
authorDevin Moore <devinmoore@google.com>2024-03-08 01:55:24 +0000
committerDevin Moore <devinmoore@google.com>2024-03-08 17:39:04 +0000
commit62e8315f86691315b526e0c1e08873a9ee867c8d (patch)
treec32e99f9dc61ab59453e6a8687713be8d825f349 /aarch64
parent57de659ae789fc99f0c1eee09ae920c9aaa5a09c (diff)
parent73a8ca8efaaa38af81745f94dbac54c608e5d27b (diff)
downloadcrosvm-62e8315f86691315b526e0c1e08873a9ee867c8d.tar.gz
Merge remote-tracking branch 'aosp/upstream-main' into merge
+ cargo embargo Android.bp file changes + a couple of small conflicts in rutabaga_gfx * aosp/upstream-main: (181 commits) hypervisor: tests: require windows for haxm gpu_display: improve event device error logging. gpu: disable fixed_blob_mapping by default for gfxstream tools/install-mingw64-deps: remove unused winetricks vars Roll recipe dependencies (trivial). Make period have the precision of nanoseconds Roll recipe dependencies (trivial). Roll recipe dependencies (trivial). Roll recipe dependencies (trivial). e2e_tests: print prebuilt revision on initialize_once crypto: add generic crate for snapshot encryption. Roll recipe dependencies (trivial). Roll recipe dependencies (trivial). Roll recipe dependencies (trivial). Roll recipe dependencies (trivial). cros_tracing_types: statically initialize Mutex Roll recipe dependencies (trivial). Roll recipe dependencies (trivial). crosvm: Delay hotplug until PCIe slot is not busy devices: add notifier for hotplug command complete ... Test: launch_cvd Bug: 324080172 Change-Id: If3e3db7f87c61f1fa3d3ce38af90ac38ccb9727c
Diffstat (limited to 'aarch64')
-rw-r--r--aarch64/src/lib.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/aarch64/src/lib.rs b/aarch64/src/lib.rs
index 5821fd862..c88ad14d2 100644
--- a/aarch64/src/lib.rs
+++ b/aarch64/src/lib.rs
@@ -364,6 +364,16 @@ fn load_kernel(
pub struct AArch64;
+fn get_block_size() -> u64 {
+ let page_size = base::pagesize();
+ // Each PTE entry being 8 bytes long, we can fit in one page (page_size / 8)
+ // entries.
+ let ptes_per_page = page_size / 8;
+ let block_size = page_size * ptes_per_page;
+
+ block_size as u64
+}
+
impl arch::LinuxArch for AArch64 {
type Error = Error;
@@ -376,7 +386,7 @@ impl arch::LinuxArch for AArch64 {
let mut memory_regions = vec![(
GuestAddress(AARCH64_PHYS_MEM_START),
components.memory_size,
- Default::default(),
+ MemoryRegionOptions::new().align(get_block_size()),
)];
// Allocate memory for the pVM firmware.