Re: [PATCH v3 13/18] x86/tsc: Rename native_read_tsc() to rdtsc()

Borislav Petkov
2015-06-24T21:38:47Z

On Tue, Jun 16, 2015 at 05:36:01PM -0700, Andy Lutomirski wrote:
> Now that there is no paravirt TSC, the "native" is inappropriate.
> The function does RDTSC, so give it the obvious name: rdtsc()
>
> Suggested-by: Borislav Petkov <bp@suse.de>
> Signed-off-by: Andy Lutomirski <luto@kernel.org>
> ---
> arch/x86/boot/compressed/aslr.c | 2 +-
> arch/x86/entry/vdso/vclock_gettime.c | 2 +-
> arch/x86/include/asm/msr.h | 11 ++++++++++-
> arch/x86/include/asm/pvclock.h | 2 +-
> arch/x86/include/asm/stackprotector.h | 2 +-
> arch/x86/include/asm/tsc.h | 2 +-
> arch/x86/kernel/apb_timer.c | 8 ++++----
> arch/x86/kernel/apic/apic.c | 8 ++++----
> arch/x86/kernel/cpu/amd.c | 4 ++--
> arch/x86/kernel/cpu/mcheck/mce.c | 4 ++--
> arch/x86/kernel/espfix_64.c | 2 +-
> arch/x86/kernel/hpet.c | 4 ++--
> arch/x86/kernel/trace_clock.c | 2 +-
> arch/x86/kernel/tsc.c | 4 ++--
> arch/x86/kvm/lapic.c | 4 ++--
> arch/x86/kvm/svm.c | 4 ++--
> arch/x86/kvm/vmx.c | 4 ++--
> arch/x86/kvm/x86.c | 12 ++++++------
> arch/x86/lib/delay.c | 8 ++++----
> drivers/input/gameport/gameport.c | 4 ++--
> drivers/input/joystick/analog.c | 4 ++--
> drivers/net/hamradio/baycom_epp.c | 2 +-
> drivers/thermal/intel_powerclamp.c | 4 ++--
> tools/power/cpupower/debug/kernel/cpufreq-test_tsc.c | 4 ++--
> 24 files changed, 58 insertions(+), 49 deletions(-)

Btw, just added the hunk below to that one because

4055fad34086 ("intel_pstate: Add tsc collection and keep previous target pstate")

which came in through the pm+acpi pull request added another
native_read_tsc() call:

---
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 15ada47bb720..7c56d7eaa671 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -765,7 +765,7 @@ static inline void intel_pstate_sample(struct cpudata *cpu)
local_irq_save(flags);
rdmsrl(MSR_IA32_APERF, aperf);
rdmsrl(MSR_IA32_MPERF, mperf);
- tsc = native_read_tsc();
+ tsc = rdtsc();
local_irq_restore(flags);

cpu->last_sample_time = cpu->sample.time;
---

--
Regards/Gruss,
Boris.

ECO tip #101: Trim your mails when you reply.
--