From 9d3451a56ab961b73e9b623ee8921965ab3b1158 Mon Sep 17 00:00:00 2001 From: Isaku Yamahata Date: Sat, 18 Jul 2026 19:20:20 -0700 Subject: [PATCH] vmm: Fix aarch64 vmm::vm::unit_tests::test_create_fdt_with_devices() test_create_fdt_with_devices() fails with a divide by zero. The caller passes Some((0, 0, 0, 0)) for CPU topology as (threads_per_core, cores_per_die, dies_per_package, packages). The valid default is (1, 1, 1, 1), not all zero. Pass None because the eventual callee, create_cpu_nodes(), checks None to get the right default value. This affects the unit test only. A real VM never hits it because VmConfig::validate() rejects zero with an error. Fixes: 7fb980f17 ("arch, vmm: Pass cpu topology configuation to FDT") Assisted-by: Claude:Opus-4.8 (1M context) Signed-off-by: Isaku Yamahata --- vmm/src/vm.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vmm/src/vm.rs b/vmm/src/vm.rs index e055d75ac..3890a51f1 100644 --- a/vmm/src/vm.rs +++ b/vmm/src/vm.rs @@ -4030,7 +4030,7 @@ mod unit_tests { &mem, "console=tty0", &[0], - Some((0, 0, 0, 0)), + None, &dev_info, &gic, &None,