Add test to verify page size of Microdroid VM
Also fix the x86_64 microdroid_16k. Unfortunately passing the
`page_shift = 14` option in the bootconfig doesn't enable 16k emulation,
so we need to pass the option in the kernel cmdline until support for
bootconfig is implemented in the kernel.
Bug: 333730505
Test: atest MicrodroidTests
Change-Id: I35375ad272b4ff91c37a9a69658a17045a4a7ac8
diff --git a/android/virtmgr/src/aidl.rs b/android/virtmgr/src/aidl.rs
index f55471e..87d7a88 100644
--- a/android/virtmgr/src/aidl.rs
+++ b/android/virtmgr/src/aidl.rs
@@ -1154,6 +1154,13 @@
}
}
+ // Unfortunately specifying page_shift = 14 in bootconfig doesn't enable 16k pages emulation,
+ // so we need to provide it in the kernel cmdline.
+ // TODO(b/376901009): remove this after passing page_shift in bootconfig is supported.
+ if os_name.ends_with("_16k") && cfg!(target_arch = "x86_64") {
+ append_kernel_param("page_shift=14", &mut vm_config);
+ }
+
if config.memoryMib > 0 {
vm_config.memoryMib = config.memoryMib;
}