diff options
author | Krister Johansen <kjlx@templeofstupid.com> | 2023-02-22 09:54:56 -0800 |
---|---|---|
committer | Juergen Gross <jgross@suse.com> | 2023-02-23 08:19:03 +0100 |
commit | 99a7bcafbd0d04555074554573019096a8c10450 (patch) | |
tree | a0c9249b67d133a8386f0e8844014a168b17a95d | |
parent | 5f6e839ebc951c50f1ca06791d016c256f0285a9 (diff) |
x86/xen/time: cleanup xen_tsc_safe_clocksource
Modifies xen_tsc_safe_clocksource() to use newly defined constants from
arch/x86/include/asm/xen/cpuid.h. This replaces a numeric value with
XEN_CPUID_TSC_MODE_NEVER_EMULATE, and deletes a comment that is now self
explanatory.
There should be no change in the function's behavior.
Signed-off-by: Krister Johansen <kjlx@templeofstupid.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Link: https://lore.kernel.org/r/a69ca370fecf85d312d2db633d9438ace2af6e5b.1677038165.git.kjlx@templeofstupid.com
Signed-off-by: Juergen Gross <jgross@suse.com>
-rw-r--r-- | arch/x86/xen/time.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c index 95140609c8a8..94056013a2a4 100644 --- a/arch/x86/xen/time.c +++ b/arch/x86/xen/time.c @@ -20,6 +20,7 @@ #include <asm/pvclock.h> #include <asm/xen/hypervisor.h> #include <asm/xen/hypercall.h> +#include <asm/xen/cpuid.h> #include <xen/events.h> #include <xen/features.h> @@ -495,11 +496,7 @@ static int __init xen_tsc_safe_clocksource(void) /* Leaf 4, sub-leaf 0 (0x40000x03) */ cpuid_count(xen_cpuid_base() + 3, 0, &eax, &ebx, &ecx, &edx); - /* tsc_mode = no_emulate (2) */ - if (ebx != 2) - return 0; - - return 1; + return ebx == XEN_CPUID_TSC_MODE_NEVER_EMULATE; } static void __init xen_time_init(void) |