linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Randy Dunlap <rdunlap@xenotime.net>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Avi Kivity <avi@redhat.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	linux-next@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"Liu >> \"Liu, Jinsong\"" <jinsong.liu@intel.com>,
	"Tian, Kevin" <kevin.tian@intel.com>
Subject: Re: [PATCH] KVM: x86: Use do_div for tsc deadline calculation
Date: Fri, 30 Sep 2011 10:35:53 -0700	[thread overview]
Message-ID: <4E85FDF9.7060502@xenotime.net> (raw)
In-Reply-To: <4E85ACFC.1090509@siemens.com>

On 09/30/11 04:50, Jan Kiszka wrote:
> Required on i386 hosts.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>

Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Acked-by: Randy Dunlap <rdunlap@xenotime.net>

Thanks.

> ---
>  arch/x86/kvm/lapic.c |    7 ++++---
>  1 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
> index f9385ec..92390dc 100644
> --- a/arch/x86/kvm/lapic.c
> +++ b/arch/x86/kvm/lapic.c
> @@ -740,9 +740,10 @@ static void start_apic_timer(struct kvm_lapic *apic)
>  
>  		now = apic->lapic_timer.timer.base->get_time();
>  		guest_tsc = kvm_x86_ops->read_l1_tsc(vcpu);
> -		if (likely(tscdeadline > guest_tsc))
> -			ns = (tscdeadline - guest_tsc)
> -				* 1000000L / this_tsc_khz;
> +		if (likely(tscdeadline > guest_tsc)) {
> +			ns = (tscdeadline - guest_tsc) * 1000000ULL;
> +			do_div(ns, this_tsc_khz);
> +		}
>  		hrtimer_start(&apic->lapic_timer.timer,
>  			ktime_add_ns(now, ns), HRTIMER_MODE_ABS);
>  


-- 
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

  reply	other threads:[~2011-09-30 17:35 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-29  6:57 linux-next: Tree for Sept 29 Stephen Rothwell
2011-09-29 19:50 ` linux-next: Tree for Sept 29 (kvm) Randy Dunlap
2011-09-29 22:58   ` Stephen Rothwell
2011-09-30 11:50     ` [PATCH] KVM: x86: Use do_div for tsc deadline calculation Jan Kiszka
2011-09-30 17:35       ` Randy Dunlap [this message]
2011-10-02  9:05       ` Avi Kivity
2011-09-29 20:17 ` [PATCH] olpc: olpc-xo1-sci.c is an input driver, depends on INPUT Randy Dunlap
2011-09-29 20:34   ` Andres Salomon
2011-09-29 20:36     ` Randy Dunlap
2011-10-06 17:12     ` Randy Dunlap
2011-09-29 20:35 ` [PATCH -next] x86 mrst: fix build error when X86_MRST is not enabled Randy Dunlap
2011-09-29 22:57   ` Alan Cox
2011-09-29 23:10     ` Andrew Morton
2011-09-30  9:07       ` Alan Cox
2011-09-29 23:16     ` Randy Dunlap
2011-09-30  9:04       ` Alan Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E85FDF9.7060502@xenotime.net \
    --to=rdunlap@xenotime.net \
    --cc=avi@redhat.com \
    --cc=jan.kiszka@siemens.com \
    --cc=jinsong.liu@intel.com \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=sfr@canb.auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).