From 507e5ac77604fc722bf64e9f754e11b3bd3e29cc Mon Sep 17 00:00:00 2001 From: Alexander Boettcher Date: Mon, 20 Dec 2021 16:55:36 +0100 Subject: [PATCH] vmm_x86: fix sporadic test failures on x86_32 nova Explicitly configure wanted exits instead of using the "random" primary ctrl value. --- repos/os/src/test/vmm_x86/component.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/repos/os/src/test/vmm_x86/component.cc b/repos/os/src/test/vmm_x86/component.cc index ff3872387c..408c1088e2 100644 --- a/repos/os/src/test/vmm_x86/component.cc +++ b/repos/os/src/test/vmm_x86/component.cc @@ -102,7 +102,10 @@ class Vmm::Vcpu INTEL_CTRL_SECOND_UG = 1 << 7, INTEL_CTRL_SECOND_RDTSCP_ENABLE = 1 << 3, }; - enum { AMD_CTRL_SECOND_VMRUN = 1 << 0 }; + enum { + AMD_CTRL_PRIMARY_HLT = 1 << 24, + AMD_CTRL_SECOND_VMRUN = 1 << 0 + }; /* http://www.sandpile.org/x86/initial.htm */ @@ -137,7 +140,7 @@ class Vmm::Vcpu INTEL_CTRL_SECOND_RDTSCP_ENABLE); } if (_svm) { - /* required for native AMD hardware (!= Qemu) for NOVA */ + state.ctrl_primary.charge(AMD_CTRL_PRIMARY_HLT); state.ctrl_secondary.charge(AMD_CTRL_SECOND_VMRUN); }