Disable vdso_clock_gettime on KVM.

Unfortunately, I think TSC misalignment means that we can't really expect any
consistent correspondence between a TSC-based VDSO and the sentry's view of
time on the KVM platform.

PiperOrigin-RevId: 332576147
This commit is contained in:
Jamie Liu
2020-09-18 20:53:55 -07:00
committed by gVisor bot
parent 4ba86e6258
commit 916751039c
@@ -48,6 +48,11 @@ std::string PrintClockId(::testing::TestParamInfo<clockid_t> info) {
class MonotonicVDSOClockTest : public ::testing::TestWithParam<clockid_t> {};
TEST_P(MonotonicVDSOClockTest, IsCorrect) {
// The VDSO implementation of clock_gettime() uses the TSC. On KVM, sentry and
// application TSCs can be very desynchronized; see
// sentry/platform/kvm/kvm.vCPU.setSystemTime().
SKIP_IF(GvisorPlatform() == Platform::kKVM);
// Check that when we alternate readings from the clock_gettime syscall and
// the VDSO's implementation, we observe the combined sequence as being
// monotonic.