virtualbox6: wait at least 1 ms during halt

When the wait value is too small the HALT attempt turnes into
busy-polling in the VMM. To prevent that always wait a minimal
amount of time.

Issue #4990.
This commit is contained in:
Josef Söntgen 2023-08-31 17:08:51 +02:00 committed by Christian Helmuth
parent 2bb901e1e3
commit ab4c36c834

View File

@ -721,7 +721,10 @@ template <typename VIRT> VBOXSTRICTRC Sup::Vcpu_impl<VIRT>::_switch_to_hw()
template <typename T> void Sup::Vcpu_impl<T>::halt(Genode::uint64_t const wait_ns)
{
RTSemEventMultiWait(_halt_semevent, wait_ns/RT_NS_1MS);
/* always wait for at least 1 ms */
Genode::uint64_t const v = wait_ns / RT_NS_1MS ? : 1;
RTSemEventMultiWait(_halt_semevent, v);
RTSemEventMultiReset(_halt_semevent);
}