mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-11 13:35:27 +00:00
While implementing TSC calibration in #5215, the issue of properly serializing TSC reads came up. Some learnings of the discussion were noted in #5430. Using `cpuid` for serialization as in Trace::timestamp() is portable, but will cause VM exits on VMX and SVM and is therefore unsuitable to retain a roughly working calibration loop while running virtualized. On the other hand on most AMD systems, dispatch serializing `lfence` needs to be explicitly enabled via a non-architectural MSR. Enable setting up dispatch serializing lfence on AMD systems and always serialize rdtsc accesses in Hw::Tsc::rdtsc() for maximum reliability. Issues #5215, #5430