Skip to content

Commit

Permalink
kvm: x86: Require const tsc for RT
Browse files Browse the repository at this point in the history
Non constant TSC is a nightmare on bare metal already, but with
virtualization it becomes a complete disaster because the workarounds
are horrible latency wise. That's also a preliminary for running RT in
a guest on top of a RT host.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Message-Id: <Yh5eJSG19S2sjZfy@linutronix.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
KAGA-KOKO authored and bonzini committed Mar 21, 2022
1 parent f144c49 commit 5e17b2e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions arch/x86/kvm/x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -8865,6 +8865,12 @@ int kvm_arch_init(void *opaque)
goto out;
}

if (IS_ENABLED(CONFIG_PREEMPT_RT) && !boot_cpu_has(X86_FEATURE_CONSTANT_TSC)) {
pr_err("RT requires X86_FEATURE_CONSTANT_TSC\n");
r = -EOPNOTSUPP;
goto out;
}

r = -ENOMEM;

x86_emulator_cache = kvm_alloc_emulator_cache();
Expand Down

0 comments on commit 5e17b2e

Please sign in to comment.