Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755298AbbGFPmh (ORCPT ); Mon, 6 Jul 2015 11:42:37 -0400 Received: from terminus.zytor.com ([198.137.202.10]:49338 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752472AbbGFPmd (ORCPT ); Mon, 6 Jul 2015 11:42:33 -0400 Date: Mon, 6 Jul 2015 08:41:27 -0700 From: tip-bot for Andy Lutomirski Message-ID: Cc: mingo@kernel.org, luto@kernel.org, bp@suse.de, hpa@zytor.com, torvalds@linux-foundation.org, lenb@kernel.org, ralf@linux-mips.org, luto@amacapital.net, dvlasenk@redhat.com, kvm@vger.kernel.org, bp@alien8.de, ray.huang@amd.com, brgerst@gmail.com, john.stultz@linaro.org, linux-kernel@vger.kernel.org, peterz@infradead.org, tglx@linutronix.de Reply-To: john.stultz@linaro.org, brgerst@gmail.com, ray.huang@amd.com, bp@alien8.de, kvm@vger.kernel.org, luto@amacapital.net, dvlasenk@redhat.com, tglx@linutronix.de, peterz@infradead.org, linux-kernel@vger.kernel.org, luto@kernel.org, mingo@kernel.org, lenb@kernel.org, ralf@linux-mips.org, hpa@zytor.com, torvalds@linux-foundation.org, bp@suse.de In-Reply-To: References: To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/asm] x86/asm/tsc: Use the full 64-bit TSC in delay_tsc() Git-Commit-ID: 9cfa1a0279e22063a727fd204a75cf3672860d83 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2403 Lines: 72 Commit-ID: 9cfa1a0279e22063a727fd204a75cf3672860d83 Gitweb: http://git.kernel.org/tip/9cfa1a0279e22063a727fd204a75cf3672860d83 Author: Andy Lutomirski AuthorDate: Thu, 25 Jun 2015 18:44:00 +0200 Committer: Ingo Molnar CommitDate: Mon, 6 Jul 2015 15:23:27 +0200 x86/asm/tsc: Use the full 64-bit TSC in delay_tsc() As a very minor optimization, delay_tsc() was only using the low 32 bits of the TSC. It's a delay function, so just use the whole thing. Signed-off-by: Andy Lutomirski Signed-off-by: Borislav Petkov Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Brian Gerst Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Huang Rui Cc: John Stultz Cc: Len Brown Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Ralf Baechle Cc: Thomas Gleixner Cc: kvm ML Link: http://lkml.kernel.org/r/bd1a277c71321b67c4794970cb5ace05efe21ab6.1434501121.git.luto@kernel.org Signed-off-by: Ingo Molnar --- arch/x86/lib/delay.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/lib/delay.c b/arch/x86/lib/delay.c index 9a52ad0..35115f3 100644 --- a/arch/x86/lib/delay.c +++ b/arch/x86/lib/delay.c @@ -49,16 +49,16 @@ static void delay_loop(unsigned long loops) /* TSC based delay: */ static void delay_tsc(unsigned long __loops) { - u32 bclock, now, loops = __loops; + u64 bclock, now, loops = __loops; int cpu; preempt_disable(); cpu = smp_processor_id(); rdtsc_barrier(); - rdtscl(bclock); + bclock = native_read_tsc(); for (;;) { rdtsc_barrier(); - rdtscl(now); + now = native_read_tsc(); if ((now - bclock) >= loops) break; @@ -80,7 +80,7 @@ static void delay_tsc(unsigned long __loops) loops -= (now - bclock); cpu = smp_processor_id(); rdtsc_barrier(); - rdtscl(bclock); + bclock = native_read_tsc(); } } preempt_enable(); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/