diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2011-11-06 12:26:18 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2022-03-21 14:28:40 +0100 |
commit | 5e17b2ee45b941fb7bc46107810d727088be392e (patch) | |
tree | 7c1685099193fd7db854fbf5fb4eb4c31f64cf20 | |
parent | KVM: x86: synthesize CPUID leaf 0x80000021h if useful (diff) | |
download | linux-5e17b2ee45b941fb7bc46107810d727088be392e.tar.xz linux-5e17b2ee45b941fb7bc46107810d727088be392e.zip |
kvm: x86: Require const tsc for RT
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>
-rw-r--r-- | arch/x86/kvm/x86.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 4fa4d8269e5b..c58265d9f1b2 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -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(); |