x86/tsc: Do feature check as the very first thing
authorBorislav Petkov (AMD) <bp@alien8.de>
Sun, 18 Dec 2022 20:53:36 +0000 (21:53 +0100)
committerBorislav Petkov (AMD) <bp@alien8.de>
Sat, 11 Feb 2023 09:44:07 +0000 (10:44 +0100)
commit6b8d5dde5b6903baf82fc7400e0b3376b10805b4
tree2f538623d9a2601479dc86b81b9a11ce8ea62d1f
parent8fe6d84947582e2c076abc6253b80709fb047935
x86/tsc: Do feature check as the very first thing

Do the feature check as the very first thing in the function. Everything
else comes after that and is meaningless work if the TSC CPUID bit is
not even set. Switch to cpu_feature_enabled() too, while at it.

No functional changes.

Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/Y5990CUCuWd5jfBH@zn.tnic
arch/x86/kernel/tsc.c