diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2011-11-06 15:26:18 +0400 |
---|---|---|
committer | Minda Chen <minda.chen@starfivetech.com> | 2023-11-06 14:24:50 +0300 |
commit | a62bece538b731c8710ab9e05b92c660d7b11e7f (patch) | |
tree | 802891a649ec1d45ff22de4a7348280e1c2edfae | |
parent | 3bdf070a42b297f08bc9f14bc0f5de2d08dcf8b7 (diff) | |
download | linux-a62bece538b731c8710ab9e05b92c660d7b11e7f.tar.xz |
x86: kvm 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>
-rw-r--r-- | arch/x86/kvm/x86.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index bfe0de3008a6..f63f6de4d466 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -8433,6 +8433,14 @@ int kvm_arch_init(void *opaque) goto out; } +#ifdef CONFIG_PREEMPT_RT + if (!boot_cpu_has(X86_FEATURE_CONSTANT_TSC)) { + pr_err("RT requires X86_FEATURE_CONSTANT_TSC\n"); + r = -EOPNOTSUPP; + goto out; + } +#endif + r = -ENOMEM; x86_fpu_cache = kmem_cache_create("x86_fpu", sizeof(struct fpu), __alignof__(struct fpu), SLAB_ACCOUNT, |