public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@qumranet.com>
To: "Yang, Sheng" <sheng.yang@intel.com>
Cc: kvm-devel@lists.sourceforge.net
Subject: Re: [PATCH 1/6] KVM: In kernel pit model
Date: Wed, 05 Mar 2008 08:54:06 +0200	[thread overview]
Message-ID: <47CE438E.2090408@qumranet.com> (raw)
In-Reply-To: <200803041822.44757.sheng.yang@intel.com>

Yang, Sheng wrote:
> +
> +static int pit_get_out(struct kvm *kvm, int channel)
> +{
> +	struct kvm_kpit_channel_state *c =
> +		&kvm->arch.vpit->pit_state.channels[channel];
> +	s64 d, t;
> +	int out;
> +
> +	ASSERT(mutex_is_locked(&kvm->arch.vpit->pit_state.lock));
> +
> +	t = ktime_to_ns(ktime_sub(ktime_get(), c->count_load_time));
> +	d = muldiv64(t, PIT_FREQ, 1e9);
>   

NSECS_PER_SEC to avoid people jumping on you saying you can't use 
floating point in the kernel (yes, the compiler converts it at 
compile-time, but they'll still say it).

-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

  reply	other threads:[~2008-03-05  6:54 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-04 10:22 [PATCH 1/6] KVM: In kernel pit model Yang, Sheng
2008-03-05  6:54 ` Avi Kivity [this message]
2008-03-05  7:04   ` Yang, Sheng
2008-03-05  9:15     ` Ingo Molnar
2008-03-05 11:35       ` Yang, Sheng
2008-03-05 11:43         ` Avi Kivity
2008-03-05 12:24         ` Ingo Molnar
2008-03-06  7:56         ` Yang, Sheng
2008-03-06  8:06           ` Avi Kivity
2008-03-06  8:43             ` Yang, Sheng
2008-03-06  9:41               ` Yang, Sheng
2008-03-07  8:12                 ` Yang, Sheng
2008-03-07  8:53                   ` Avi Kivity
2008-03-07  9:14                     ` Yang, Sheng
2008-03-07  9:57                       ` Avi Kivity
2008-03-06  9:14           ` Ingo Molnar
2008-03-06  9:25             ` Yang, Sheng
2008-03-06 12:33               ` Ingo Molnar
  -- strict thread matches above, loose matches on Subject: below --
2008-03-07 12:52 [PATCH 1/6] KVM: In kernel PIT model Yang, Sheng

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=47CE438E.2090408@qumranet.com \
    --to=avi@qumranet.com \
    --cc=kvm-devel@lists.sourceforge.net \
    --cc=sheng.yang@intel.com \
    /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