Skip to content

Commit 99a7bca

Browse files
kmjohansenjgross1
authored andcommitted
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 <[email protected]> Reviewed-by: Juergen Gross <[email protected]> Link: https://lore.kernel.org/r/a69ca370fecf85d312d2db633d9438ace2af6e5b.1677038165.git.kjlx@templeofstupid.com Signed-off-by: Juergen Gross <[email protected]>
1 parent 5f6e839 commit 99a7bca

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

arch/x86/xen/time.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <asm/pvclock.h>
2121
#include <asm/xen/hypervisor.h>
2222
#include <asm/xen/hypercall.h>
23+
#include <asm/xen/cpuid.h>
2324

2425
#include <xen/events.h>
2526
#include <xen/features.h>
@@ -495,11 +496,7 @@ static int __init xen_tsc_safe_clocksource(void)
495496
/* Leaf 4, sub-leaf 0 (0x40000x03) */
496497
cpuid_count(xen_cpuid_base() + 3, 0, &eax, &ebx, &ecx, &edx);
497498

498-
/* tsc_mode = no_emulate (2) */
499-
if (ebx != 2)
500-
return 0;
501-
502-
return 1;
499+
return ebx == XEN_CPUID_TSC_MODE_NEVER_EMULATE;
503500
}
504501

505502
static void __init xen_time_init(void)

0 commit comments

Comments
 (0)