Merge "Add mock settings pages to terminal app" into main
diff --git a/android/virtmgr/src/aidl.rs b/android/virtmgr/src/aidl.rs
index 87fb611..4b203d6 100644
--- a/android/virtmgr/src/aidl.rs
+++ b/android/virtmgr/src/aidl.rs
@@ -221,6 +221,7 @@
console_out_fd: Option<&ParcelFileDescriptor>,
console_in_fd: Option<&ParcelFileDescriptor>,
log_fd: Option<&ParcelFileDescriptor>,
+ dump_dt_fd: Option<&ParcelFileDescriptor>,
) -> binder::Result<Strong<dyn IVirtualMachine>> {
let mut is_protected = false;
let ret = self.create_vm_internal(
@@ -229,6 +230,7 @@
console_in_fd,
log_fd,
&mut is_protected,
+ dump_dt_fd,
);
write_vm_creation_stats(config, is_protected, &ret);
ret
@@ -485,6 +487,7 @@
console_in_fd: Option<&ParcelFileDescriptor>,
log_fd: Option<&ParcelFileDescriptor>,
is_protected: &mut bool,
+ dump_dt_fd: Option<&ParcelFileDescriptor>,
) -> binder::Result<Strong<dyn IVirtualMachine>> {
let requester_uid = get_calling_uid();
let requester_debug_pid = get_calling_pid();
@@ -527,6 +530,7 @@
clone_or_prepare_logger_fd(console_out_fd, format!("Console({})", cid))?;
let console_in_fd = console_in_fd.map(clone_file).transpose()?;
let log_fd = clone_or_prepare_logger_fd(log_fd, format!("Log({})", cid))?;
+ let dump_dt_fd = dump_dt_fd.map(clone_file).transpose()?;
// Counter to generate unique IDs for temporary image files.
let mut next_temporary_image_id = 0;
@@ -744,6 +748,7 @@
audio_config,
no_balloon: config.noBalloon,
usb_config,
+ dump_dt_fd,
};
let instance = Arc::new(
VmInstance::new(
diff --git a/android/virtmgr/src/crosvm.rs b/android/virtmgr/src/crosvm.rs
index b2be736..25271f8 100644
--- a/android/virtmgr/src/crosvm.rs
+++ b/android/virtmgr/src/crosvm.rs
@@ -135,6 +135,7 @@
pub audio_config: Option<AudioConfig>,
pub no_balloon: bool,
pub usb_config: UsbConfig,
+ pub dump_dt_fd: Option<File>,
}
#[derive(Debug)]
@@ -985,6 +986,11 @@
// Keep track of what file descriptors should be mapped to the crosvm process.
let mut preserved_fds = config.indirect_files.into_iter().map(|f| f.into()).collect();
+ if let Some(dump_dt_fd) = config.dump_dt_fd {
+ let dump_dt_fd = add_preserved_fd(&mut preserved_fds, dump_dt_fd);
+ command.arg("--dump-device-tree-blob").arg(dump_dt_fd);
+ }
+
// Setup the serial devices.
// 1. uart device: used as the output device by bootloaders and as early console by linux
// 2. uart device: used to report the reason for the VM failing.
diff --git a/android/virtualizationservice/aidl/android/system/virtualizationservice/IVirtualizationService.aidl b/android/virtualizationservice/aidl/android/system/virtualizationservice/IVirtualizationService.aidl
index 234d8d0..0c3f6b7 100644
--- a/android/virtualizationservice/aidl/android/system/virtualizationservice/IVirtualizationService.aidl
+++ b/android/virtualizationservice/aidl/android/system/virtualizationservice/IVirtualizationService.aidl
@@ -35,11 +35,14 @@
* `consoleInFd` is provided then console input to the VM will be read from it. If `osLogFd` is
* provided then the OS-level logs will be sent to it. `osLogFd` is supported only when the OS
* running in the VM has the logging system. In case of Microdroid, the logging system is logd.
+ * `dumpDtFd` is the file where to dump the VM's device tree. It is only used in
+ * debugging/testing.
*/
IVirtualMachine createVm(in VirtualMachineConfig config,
in @nullable ParcelFileDescriptor consoleOutFd,
in @nullable ParcelFileDescriptor consoleInFd,
- in @nullable ParcelFileDescriptor osLogFd);
+ in @nullable ParcelFileDescriptor osLogFd,
+ in @nullable ParcelFileDescriptor dumpDtFd);
/**
* Allocate an instance_id to the (newly created) VM.
diff --git a/android/vm/src/main.rs b/android/vm/src/main.rs
index 609bbdf..81ca8fa 100644
--- a/android/vm/src/main.rs
+++ b/android/vm/src/main.rs
@@ -114,6 +114,10 @@
#[cfg(debuggable_vms_improvements)]
#[arg(long)]
enable_earlycon: bool,
+
+ /// Path to file to dump VM device tree.
+ #[arg(long)]
+ dump_device_tree: Option<PathBuf>,
}
impl DebugConfig {
diff --git a/android/vm/src/run.rs b/android/vm/src/run.rs
index 823546f..0e1f4cc 100644
--- a/android/vm/src/run.rs
+++ b/android/vm/src/run.rs
@@ -203,6 +203,7 @@
config.debug.console.as_ref().map(|p| p.as_ref()),
config.debug.console_in.as_ref().map(|p| p.as_ref()),
config.debug.log.as_ref().map(|p| p.as_ref()),
+ config.debug.dump_device_tree.as_ref().map(|p| p.as_ref()),
)
}
@@ -284,6 +285,7 @@
config.debug.console.as_ref().map(|p| p.as_ref()),
config.debug.console_in.as_ref().map(|p| p.as_ref()),
config.debug.log.as_ref().map(|p| p.as_ref()),
+ config.debug.dump_device_tree.as_ref().map(|p| p.as_ref()),
)
}
@@ -306,6 +308,7 @@
console_out_path: Option<&Path>,
console_in_path: Option<&Path>,
log_path: Option<&Path>,
+ dump_device_tree: Option<&Path>,
) -> Result<(), Error> {
let console_out = if let Some(console_out_path) = console_out_path {
Some(File::create(console_out_path).with_context(|| {
@@ -330,9 +333,17 @@
} else {
Some(duplicate_fd(io::stdout())?)
};
+ let dump_dt = if let Some(dump_device_tree) = dump_device_tree {
+ Some(File::create(dump_device_tree).with_context(|| {
+ format!("Failed to open file to dump device tree: {:?}", dump_device_tree)
+ })?)
+ } else {
+ None
+ };
let callback = Box::new(Callback {});
- let vm = VmInstance::create(service, config, console_out, console_in, log, Some(callback))
- .context("Failed to create VM")?;
+ let vm =
+ VmInstance::create(service, config, console_out, console_in, log, dump_dt, Some(callback))
+ .context("Failed to create VM")?;
vm.start().context("Failed to start VM")?;
let debug_level = get_debug_level(config).unwrap_or(DebugLevel::NONE);
diff --git a/android/vm_demo_native/main.cpp b/android/vm_demo_native/main.cpp
index bc42036..d7ff02e 100644
--- a/android/vm_demo_native/main.cpp
+++ b/android/vm_demo_native/main.cpp
@@ -226,8 +226,10 @@
ScopedFileDescriptor console_out_fd(fcntl(fileno(stdout), F_DUPFD_CLOEXEC));
ScopedFileDescriptor console_in_fd(fcntl(fileno(stdin), F_DUPFD_CLOEXEC));
ScopedFileDescriptor log_fd(fcntl(fileno(stdout), F_DUPFD_CLOEXEC));
+ ScopedFileDescriptor dump_dt_fd(-1);
- ScopedAStatus ret = service.createVm(config, console_out_fd, console_in_fd, log_fd, &vm);
+ ScopedAStatus ret =
+ service.createVm(config, console_out_fd, console_in_fd, log_fd, dump_dt_fd, &vm);
if (!ret.isOk()) {
return Error() << "Failed to create VM";
}
diff --git a/guest/rialto/tests/test.rs b/guest/rialto/tests/test.rs
index 582b69e..7ec5647 100644
--- a/guest/rialto/tests/test.rs
+++ b/guest/rialto/tests/test.rs
@@ -335,6 +335,14 @@
let virtmgr = vmclient::VirtualizationService::new().context("Failed to spawn VirtMgr")?;
let service = virtmgr.connect().context("Failed to connect to VirtMgr")?;
info!("Connected to VirtMgr for service VM");
- VmInstance::create(service.as_ref(), &config, console, /* consoleIn */ None, log, None)
- .context("Failed to create VM")
+ VmInstance::create(
+ service.as_ref(),
+ &config,
+ console,
+ /* consoleIn */ None,
+ log,
+ /* dump_dt */ None,
+ None,
+ )
+ .context("Failed to create VM")
}
diff --git a/libs/framework-virtualization/src/android/system/virtualmachine/VirtualMachine.java b/libs/framework-virtualization/src/android/system/virtualmachine/VirtualMachine.java
index 3b16a8a..b278610 100644
--- a/libs/framework-virtualization/src/android/system/virtualmachine/VirtualMachine.java
+++ b/libs/framework-virtualization/src/android/system/virtualmachine/VirtualMachine.java
@@ -1578,7 +1578,8 @@
: createVirtualMachineConfigForAppFrom(vmConfig, service);
mVirtualMachine =
- service.createVm(vmConfigParcel, consoleOutFd, consoleInFd, mLogWriter);
+ service.createVm(
+ vmConfigParcel, consoleOutFd, consoleInFd, mLogWriter, null);
mVirtualMachine.registerCallback(new CallbackTranslator(service));
if (mMemoryManagementCallbacks != null) {
mContext.registerComponentCallbacks(mMemoryManagementCallbacks);
diff --git a/libs/libcompos_common/compos_client.rs b/libs/libcompos_common/compos_client.rs
index 107f8d0..316eaa9 100644
--- a/libs/libcompos_common/compos_client.rs
+++ b/libs/libcompos_common/compos_client.rs
@@ -152,6 +152,7 @@
console_fd,
/* console_in_fd */ None,
log_fd,
+ /* dump_dt */ None,
Some(callback),
)
.context("Failed to create VM")?;
diff --git a/libs/libservice_vm_manager/src/lib.rs b/libs/libservice_vm_manager/src/lib.rs
index d7b4dd6..0f322bb 100644
--- a/libs/libservice_vm_manager/src/lib.rs
+++ b/libs/libservice_vm_manager/src/lib.rs
@@ -244,8 +244,9 @@
let console_out = Some(android_log_fd()?);
let console_in = None;
let log = Some(android_log_fd()?);
+ let dump_dt = None;
let callback = None;
- VmInstance::create(service.as_ref(), &config, console_out, console_in, log, callback)
+ VmInstance::create(service.as_ref(), &config, console_out, console_in, log, dump_dt, callback)
.context("Failed to create service VM")
}
diff --git a/libs/libvmclient/src/lib.rs b/libs/libvmclient/src/lib.rs
index ce7d5a5..13630c0 100644
--- a/libs/libvmclient/src/lib.rs
+++ b/libs/libvmclient/src/lib.rs
@@ -208,14 +208,21 @@
console_out: Option<File>,
console_in: Option<File>,
log: Option<File>,
+ dump_dt: Option<File>,
callback: Option<Box<dyn VmCallback + Send + Sync>>,
) -> BinderResult<Self> {
let console_out = console_out.map(ParcelFileDescriptor::new);
let console_in = console_in.map(ParcelFileDescriptor::new);
let log = log.map(ParcelFileDescriptor::new);
+ let dump_dt = dump_dt.map(ParcelFileDescriptor::new);
- let vm =
- service.createVm(config, console_out.as_ref(), console_in.as_ref(), log.as_ref())?;
+ let vm = service.createVm(
+ config,
+ console_out.as_ref(),
+ console_in.as_ref(),
+ log.as_ref(),
+ dump_dt.as_ref(),
+ )?;
let cid = vm.getCid()?;
diff --git a/microfuchsia/microfuchsiad/src/instance_starter.rs b/microfuchsia/microfuchsiad/src/instance_starter.rs
index 15fcc06..61a024f 100644
--- a/microfuchsia/microfuchsiad/src/instance_starter.rs
+++ b/microfuchsia/microfuchsiad/src/instance_starter.rs
@@ -90,6 +90,7 @@
console_out,
console_in,
/* log= */ None,
+ /* dump_dt= */ None,
None,
)
.context("Failed to create VM")?;
diff --git a/tests/hostside/Android.bp b/tests/hostside/Android.bp
index d0838a6..1f86d6b 100644
--- a/tests/hostside/Android.bp
+++ b/tests/hostside/Android.bp
@@ -26,6 +26,7 @@
":microdroid_general_sepolicy.conf",
":test.com.android.virt.pem",
":test2.com.android.virt.pem",
+ "java/**/goldens/dt_dump_*",
],
data_native_bins: [
"sepolicy-analyze",
@@ -38,6 +39,7 @@
"lz4",
"sign_virt_apex",
"simg2img",
+ "dtc",
],
// java_test_host doesn't have data_native_libs but jni_libs can be used to put
// native modules under ./lib directory.
@@ -48,6 +50,7 @@
"libcrypto_utils",
"libcrypto",
"libext4_utils",
+ "libfdt",
"liblog",
"liblp",
"libsparse",
diff --git a/tests/hostside/java/com/android/microdroid/test/MicrodroidHostTests.java b/tests/hostside/java/com/android/microdroid/test/MicrodroidHostTests.java
index 2d55d66..b8b4312 100644
--- a/tests/hostside/java/com/android/microdroid/test/MicrodroidHostTests.java
+++ b/tests/hostside/java/com/android/microdroid/test/MicrodroidHostTests.java
@@ -1352,6 +1352,134 @@
}
}
+ @Test
+ @Parameters(method = "gkiVersions")
+ @TestCaseName("{method}_gki_{0}")
+ public void microdroidDeviceTreeCompat(String gki) throws Exception {
+ assumeArm64Supported();
+ final String configPath = "assets/vm_config.json";
+ // Preconditions
+ assumeKernelSupported(gki);
+ int mem_size = 256;
+ assertTrue("Memory size too small", mem_size >= minMemorySize());
+
+ // Start the VM with the dump DT option.
+ mMicrodroidDevice =
+ MicrodroidBuilder.fromDevicePath(getPathForPackage(PACKAGE_NAME), configPath)
+ .debugLevel("full")
+ .memoryMib(mem_size)
+ .cpuTopology("one_cpu")
+ .protectedVm(false)
+ .gki(sGkiVersions.get(gki))
+ .name("test_device_tree")
+ .dumpDt("/data/local/tmp/dump_dt.dtb")
+ .build(getAndroidDevice());
+ assertThat(mMicrodroidDevice.waitForBootComplete(BOOT_COMPLETE_TIMEOUT)).isTrue();
+
+ File goldenDt = findTestFile("dt_dump_golden.dts");
+ testGoldenDeviceTree(goldenDt.getAbsolutePath());
+ }
+
+ @Test
+ @Parameters(method = "gkiVersions")
+ @TestCaseName("{method}_gki_{0}")
+ public void microdroidProtectedDeviceTreeCompat(String gki) throws Exception {
+ assumeArm64Supported();
+ final String configPath = "assets/vm_config.json";
+ // Preconditions
+ assumeKernelSupported(gki);
+ assumeVmTypeSupported(true);
+ int mem_size = 256;
+ assertTrue("Memory size too small", mem_size >= minMemorySize());
+
+ // Start the VM with the dump DT option.
+ mMicrodroidDevice =
+ MicrodroidBuilder.fromDevicePath(getPathForPackage(PACKAGE_NAME), configPath)
+ .debugLevel("full")
+ .memoryMib(mem_size)
+ .cpuTopology("one_cpu")
+ .protectedVm(true)
+ .gki(sGkiVersions.get(gki))
+ .name("test_device_tree")
+ .dumpDt("/data/local/tmp/dump_dt.dtb")
+ .build(getAndroidDevice());
+ assertThat(mMicrodroidDevice.waitForBootComplete(BOOT_COMPLETE_TIMEOUT)).isTrue();
+
+ File goldenDt = findTestFile("dt_dump_protected_golden.dts");
+ testGoldenDeviceTree(goldenDt.getAbsolutePath());
+ }
+
+ private void testGoldenDeviceTree(String goldenDt) throws Exception {
+ // Pull the device tree to host.
+ TestDevice device = getAndroidDevice();
+ boolean disableRoot = !device.isAdbRoot();
+ device.enableAdbRoot();
+ assumeTrue("adb root is not enabled", device.isAdbRoot());
+
+ // Pull DT from device
+ File dtb_from_device = device.pullFile("/data/local/tmp/dump_dt.dtb");
+ if (disableRoot) {
+ device.disableAdbRoot();
+ }
+
+ File dtc = findTestFile("dtc");
+
+ // Create temp file for Device tree conversion
+ File dt_dump_dts = File.createTempFile("dt_dump", "dts");
+ dt_dump_dts.delete();
+ String dt_dump_dts_path = dt_dump_dts.getAbsolutePath();
+ // Convert DT to text format.
+ CommandResult dtb_to_dts =
+ RunUtil.getDefault()
+ .runTimedCmd(
+ 3000,
+ dtc.getAbsolutePath(),
+ "-I",
+ "dtb",
+ "-O",
+ "dts",
+ "-qqq",
+ "-f",
+ "-s",
+ "-o",
+ dt_dump_dts_path,
+ dtb_from_device.getAbsolutePath());
+ assertTrue(
+ "result convert stderr: " + dtb_to_dts.getStderr(),
+ dtb_to_dts.getStderr().trim().isEmpty());
+ assertTrue(
+ "result convert stdout: " + dtb_to_dts.getStdout(),
+ dtb_to_dts.getStdout().trim().isEmpty());
+
+ // Diff device's DT with the golden DT.
+ CommandResult result_compare =
+ RunUtil.getDefault()
+ .runTimedCmd(
+ 3000,
+ "diff",
+ "-u",
+ "-w",
+ "-I",
+ "kaslr-seed",
+ "-I",
+ "instance-id",
+ "-I",
+ "rng-seed",
+ "-I",
+ "linux,initrd-end",
+ "-I",
+ "secretkeeper_public_key",
+ dt_dump_dts_path,
+ goldenDt);
+
+ assertTrue(
+ "result compare stderr: " + result_compare.getStderr(),
+ result_compare.getStderr().trim().isEmpty());
+ assertTrue(
+ "result compare stdout: " + result_compare.getStdout(),
+ result_compare.getStdout().trim().isEmpty());
+ }
+
@Before
public void setUp() throws Exception {
assumeDeviceIsCapable(getDevice());
@@ -1428,4 +1556,11 @@
"Microdroid is not supported for specific VM protection type",
getAndroidDevice().supportsMicrodroid(protectedVm));
}
+
+ private void assumeArm64Supported() throws Exception {
+ CommandRunner android = new CommandRunner(getDevice());
+ String abi = android.run("getprop", "ro.product.cpu.abi");
+ assertThat(abi).isNotEmpty();
+ assumeTrue("Skipping test as the architecture is not supported", abi.startsWith("arm64"));
+ }
}
diff --git a/tests/hostside/java/com/android/microdroid/test/goldens/dt_dump_golden.dts b/tests/hostside/java/com/android/microdroid/test/goldens/dt_dump_golden.dts
new file mode 100644
index 0000000..795c50f
--- /dev/null
+++ b/tests/hostside/java/com/android/microdroid/test/goldens/dt_dump_golden.dts
@@ -0,0 +1,145 @@
+/dts-v1/;
+
+/ {
+ #address-cells = <0x02>;
+ #size-cells = <0x02>;
+ compatible = "linux,dummy-virt";
+ interrupt-parent = <0x01>;
+ name = "reference";
+
+ U6_16550A@2e8 {
+ clock-frequency = <0x1c2000>;
+ compatible = "ns16550a";
+ interrupts = <0x00 0x02 0x01>;
+ reg = <0x00 0x2e8 0x00 0x08>;
+ };
+
+ U6_16550A@2f8 {
+ clock-frequency = <0x1c2000>;
+ compatible = "ns16550a";
+ interrupts = <0x00 0x02 0x01>;
+ reg = <0x00 0x2f8 0x00 0x08>;
+ };
+
+ U6_16550A@3e8 {
+ clock-frequency = <0x1c2000>;
+ compatible = "ns16550a";
+ interrupts = <0x00 0x00 0x01>;
+ reg = <0x00 0x3e8 0x00 0x08>;
+ };
+
+ U6_16550A@3f8 {
+ clock-frequency = <0x1c2000>;
+ compatible = "ns16550a";
+ interrupts = <0x00 0x00 0x01>;
+ reg = <0x00 0x3f8 0x00 0x08>;
+ };
+
+ __symbols__ {
+ intc = "/intc";
+ };
+
+ avf {
+ secretkeeper_public_key = [];
+
+ untrusted {
+ defer-rollback-protection;
+ instance-id = <0xf145d4f8 0x15f03952 0x5af249aa 0xfead94d8 0xb9f05746 0xd9163f48 0x7251b67b 0xe117409e 0x2b14dfa5 0xcaa8caf7 0x14176d2d 0xf88cc94b 0xeed4a59d 0x9a2d8fe5 0x5ac590f1 0xbb6c96f5>;
+ };
+ };
+
+ chosen {
+ bootargs = "panic=-1 crashkernel=17M";
+ kaslr-seed = <>;
+ linux,initrd-end = <0x81200360>;
+ linux,initrd-start = <0x81000000>;
+ linux,pci-probe-only = <0x01>;
+ rng-seed = <>;
+ stdout-path = "/U6_16550A@3f8";
+ };
+
+ config {
+ kernel-address = <0x80000000>;
+ kernel-size = <0xc91000>;
+ };
+
+ cpufreq {
+ compatible = "virtual,kvm-cpufreq";
+ };
+
+ cpus {
+ #address-cells = <0x01>;
+ #size-cells = <0x00>;
+
+ cpu@0 {
+ compatible = "arm,armv8";
+ device_type = "cpu";
+ phandle = <0x100>;
+ reg = <0x00>;
+ };
+ };
+
+ intc {
+ #address-cells = <0x02>;
+ #interrupt-cells = <0x03>;
+ #size-cells = <0x02>;
+ compatible = "arm,gic-v3";
+ interrupt-controller;
+ phandle = <0x01>;
+ reg = <0x00 0x3fff0000 0x00 0x10000 0x00 0x3ffd0000 0x00 0x20000>;
+ };
+
+ memory {
+ device_type = "memory";
+ reg = <0x00 0x80000000 0x00 0x10000000>;
+ };
+
+ pci {
+ #address-cells = <0x03>;
+ #interrupt-cells = <0x01>;
+ #size-cells = <0x02>;
+ bus-range = <0x00 0x00>;
+ compatible = "pci-host-cam-generic";
+ device_type = "pci";
+ dma-coherent;
+ interrupt-map = <0x800 0x00 0x00 0x01 0x01 0x00 0x00 0x00 0x04 0x04 0x1000 0x00 0x00 0x01 0x01 0x00 0x00 0x00 0x05 0x04 0x1800 0x00 0x00 0x01 0x01 0x00 0x00 0x00 0x06 0x04 0x2000 0x00 0x00 0x01 0x01 0x00 0x00 0x00 0x07 0x04 0x2800 0x00 0x00 0x01 0x01 0x00 0x00 0x00 0x08 0x04 0x3000 0x00 0x00 0x01 0x01 0x00 0x00 0x00 0x09 0x04 0x3800 0x00 0x00 0x01 0x01 0x00 0x00 0x00 0x0a 0x04 0x4000 0x00 0x00 0x01 0x01 0x00 0x00 0x00 0x0b 0x04 0x4800 0x00 0x00 0x01 0x01 0x00 0x00 0x00 0x0c 0x04>;
+ interrupt-map-mask = <0xf800 0x00 0x00 0x07 0xf800 0x00 0x00 0x07 0xf800 0x00 0x00 0x07 0xf800 0x00 0x00 0x07 0xf800 0x00 0x00 0x07 0xf800 0x00 0x00 0x07 0xf800 0x00 0x00 0x07 0xf800 0x00 0x00 0x07 0xf800 0x00 0x00 0x07>;
+ ranges = <0x3000000 0x00 0x2000000 0x00 0x2000000 0x00 0x2000000 0x43000000 0x00 0x90800000 0x00 0x90800000 0xff 0x6f800000>;
+ reg = <0x00 0x10000 0x00 0x1000000>;
+ };
+
+ pclk@3M {
+ #clock-cells = <0x00>;
+ clock-frequency = <0x2fefd8>;
+ compatible = "fixed-clock";
+ phandle = <0x18>;
+ };
+
+ psci {
+ compatible = "arm,psci-1.0\0arm,psci-0.2";
+ method = "hvc";
+ };
+
+ rtc@2000 {
+ arm,primecell-periphid = <0x41030>;
+ clock-names = "apb_pclk";
+ clocks = <0x18>;
+ compatible = "arm,primecell";
+ interrupts = <0x00 0x01 0x04>;
+ reg = <0x00 0x2000 0x00 0x1000>;
+ };
+
+ timer {
+ always-on;
+ compatible = "arm,armv8-timer";
+ interrupts = <0x01 0x0d 0x108 0x01 0x0e 0x108 0x01 0x0b 0x108 0x01 0x0a 0x108>;
+ };
+
+ vmwdt@3000 {
+ clock-frequency = <0x02>;
+ compatible = "qemu,vcpu-stall-detector";
+ interrupts = <0x01 0x0f 0x101>;
+ reg = <0x00 0x3000 0x00 0x1000>;
+ timeout-sec = <0x0a>;
+ };
+};
diff --git a/tests/hostside/java/com/android/microdroid/test/goldens/dt_dump_protected_golden.dts b/tests/hostside/java/com/android/microdroid/test/goldens/dt_dump_protected_golden.dts
new file mode 100644
index 0000000..5761c15
--- /dev/null
+++ b/tests/hostside/java/com/android/microdroid/test/goldens/dt_dump_protected_golden.dts
@@ -0,0 +1,159 @@
+/dts-v1/;
+
+/ {
+ #address-cells = <0x02>;
+ #size-cells = <0x02>;
+ compatible = "linux,dummy-virt";
+ interrupt-parent = <0x01>;
+ name = "reference";
+
+ U6_16550A@2e8 {
+ clock-frequency = <0x1c2000>;
+ compatible = "ns16550a";
+ interrupts = <0x00 0x02 0x01>;
+ reg = <0x00 0x2e8 0x00 0x08>;
+ };
+
+ U6_16550A@2f8 {
+ clock-frequency = <0x1c2000>;
+ compatible = "ns16550a";
+ interrupts = <0x00 0x02 0x01>;
+ reg = <0x00 0x2f8 0x00 0x08>;
+ };
+
+ U6_16550A@3e8 {
+ clock-frequency = <0x1c2000>;
+ compatible = "ns16550a";
+ interrupts = <0x00 0x00 0x01>;
+ reg = <0x00 0x3e8 0x00 0x08>;
+ };
+
+ U6_16550A@3f8 {
+ clock-frequency = <0x1c2000>;
+ compatible = "ns16550a";
+ interrupts = <0x00 0x00 0x01>;
+ reg = <0x00 0x3f8 0x00 0x08>;
+ };
+
+ __symbols__ {
+ intc = "/intc";
+ };
+
+ avf {
+ secretkeeper_public_key = [];
+
+ untrusted {
+ defer-rollback-protection;
+ instance-id = <0x4d482941 0x27228238 0x11d7b28 0xaeed3076 0x88eb3fcb 0x2b9de301 0x57ff8977 0xaf8c24b6 0x55466af4 0x23beed37 0x2f976083 0xe630eb28 0x1edbc491 0xa8300897 0xeb3e9f76 0x21ea9284>;
+ };
+ };
+
+ chosen {
+ bootargs = "panic=-1 crashkernel=31M";
+ kaslr-seed = <>;
+ linux,initrd-end = <0x81202104>;
+ linux,initrd-start = <0x81000000>;
+ linux,pci-probe-only = <0x01>;
+ rng-seed = <>;
+ stdout-path = "/U6_16550A@3f8";
+ };
+
+ config {
+ kernel-address = <0x80000000>;
+ kernel-size = <0xc91000>;
+ };
+
+ cpufreq {
+ compatible = "virtual,kvm-cpufreq";
+ };
+
+ cpus {
+ #address-cells = <0x01>;
+ #size-cells = <0x00>;
+
+ cpu@0 {
+ compatible = "arm,armv8";
+ device_type = "cpu";
+ phandle = <0x100>;
+ reg = <0x00>;
+ };
+ };
+
+ intc {
+ #address-cells = <0x02>;
+ #interrupt-cells = <0x03>;
+ #size-cells = <0x02>;
+ compatible = "arm,gic-v3";
+ interrupt-controller;
+ phandle = <0x01>;
+ reg = <0x00 0x3fff0000 0x00 0x10000 0x00 0x3ffd0000 0x00 0x20000>;
+ };
+
+ memory {
+ device_type = "memory";
+ reg = <0x00 0x80000000 0x00 0x10e00000>;
+ };
+
+ pci {
+ #address-cells = <0x03>;
+ #interrupt-cells = <0x01>;
+ #size-cells = <0x02>;
+ bus-range = <0x00 0x00>;
+ compatible = "pci-host-cam-generic";
+ device_type = "pci";
+ dma-coherent;
+ interrupt-map = <0x800 0x00 0x00 0x01 0x01 0x00 0x00 0x00 0x04 0x04 0x1000 0x00 0x00 0x01 0x01 0x00 0x00 0x00 0x05 0x04 0x1800 0x00 0x00 0x01 0x01 0x00 0x00 0x00 0x06 0x04 0x2000 0x00 0x00 0x01 0x01 0x00 0x00 0x00 0x07 0x04 0x2800 0x00 0x00 0x01 0x01 0x00 0x00 0x00 0x08 0x04 0x3000 0x00 0x00 0x01 0x01 0x00 0x00 0x00 0x09 0x04 0x3800 0x00 0x00 0x01 0x01 0x00 0x00 0x00 0x0a 0x04 0x4000 0x00 0x00 0x01 0x01 0x00 0x00 0x00 0x0b 0x04>;
+ interrupt-map-mask = <0xf800 0x00 0x00 0x07 0xf800 0x00 0x00 0x07 0xf800 0x00 0x00 0x07 0xf800 0x00 0x00 0x07 0xf800 0x00 0x00 0x07 0xf800 0x00 0x00 0x07 0xf800 0x00 0x00 0x07 0xf800 0x00 0x00 0x07>;
+ memory-region = <0x02>;
+ ranges = <0x3000000 0x00 0x2000000 0x00 0x2000000 0x00 0x2000000 0x43000000 0x00 0x91600000 0x00 0x91600000 0xff 0x6ea00000>;
+ reg = <0x00 0x10000 0x00 0x1000000>;
+ };
+
+ pclk@3M {
+ #clock-cells = <0x00>;
+ clock-frequency = <0x2fefd8>;
+ compatible = "fixed-clock";
+ phandle = <0x18>;
+ };
+
+ psci {
+ compatible = "arm,psci-1.0\0arm,psci-0.2";
+ method = "hvc";
+ };
+
+ reserved-memory {
+ #address-cells = <0x02>;
+ #size-cells = <0x02>;
+ ranges;
+
+ restricted_dma_reserved {
+ alignment = <0x00 0x1000>;
+ compatible = "restricted-dma-pool";
+ phandle = <0x02>;
+ size = <0x00 0xe00000>;
+ };
+ };
+
+ rtc@2000 {
+ arm,primecell-periphid = <0x41030>;
+ clock-names = "apb_pclk";
+ clocks = <0x18>;
+ compatible = "arm,primecell";
+ interrupts = <0x00 0x01 0x04>;
+ reg = <0x00 0x2000 0x00 0x1000>;
+ };
+
+ timer {
+ always-on;
+ compatible = "arm,armv8-timer";
+ interrupts = <0x01 0x0d 0x108 0x01 0x0e 0x108 0x01 0x0b 0x108 0x01 0x0a 0x108>;
+ };
+
+ vmwdt@3000 {
+ clock-frequency = <0x02>;
+ compatible = "qemu,vcpu-stall-detector";
+ interrupts = <0x01 0x0f 0x101>;
+ reg = <0x00 0x3000 0x00 0x1000>;
+ timeout-sec = <0x0a>;
+ };
+};
diff --git a/tests/vm_accessor/accessor/src/run.rs b/tests/vm_accessor/accessor/src/run.rs
index 932baab..6dcc507 100644
--- a/tests/vm_accessor/accessor/src/run.rs
+++ b/tests/vm_accessor/accessor/src/run.rs
@@ -128,6 +128,7 @@
Some(android_log_fd()?), /* console_out */
None, /* console_in */
Some(android_log_fd()?), /* log */
+ None, /* dump_dt */
Some(Box::new(Callback {})),
)
.context("Failed to create VM")?;
diff --git a/tests/vmbase_example/src/main.rs b/tests/vmbase_example/src/main.rs
index e0563b7..34a2b0b 100644
--- a/tests/vmbase_example/src/main.rs
+++ b/tests/vmbase_example/src/main.rs
@@ -119,6 +119,7 @@
Some(console),
/* consoleIn */ None,
Some(log_writer),
+ /* dump_dt */ None,
None,
)
.context("Failed to create VM")?;