All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: KVM list <kvm@vger.kernel.org>
Subject: Re: [patch] kvmclock fix
Date: Wed, 4 Feb 2009 14:17:32 -0200	[thread overview]
Message-ID: <20090204161732.GA7821@amt.cnet> (raw)
In-Reply-To: <498878A7.4030709@redhat.com>

On Tue, Feb 03, 2009 at 06:02:31PM +0100, Gerd Hoffmann wrote:
>   Hi,
> 
> Here is a patch which fixes the kvmclock on multicore systems without
> constant_tsc.
> 
> I'm not that happy with the current form as the notifier duplicates code
> from tsc.c.  I don't see an easy way around that though.
> 
> Suggestions?  Other review comments?
> 
> thanks,
>   Gerd

> +	guest_mode = 0;
> +	spin_lock(&kvm_lock);
> +	list_for_each_entry(kvm, &vm_list, vm_list) {
> +		for (i = 0; i < KVM_MAX_VCPUS; ++i) {
> +			vcpu = kvm->vcpus[i];
> +			if (!vcpu)
> +				continue;
> +			if (vcpu->cpu != freq->cpu)
> +				continue;
> +			if (!kvm_request_guest_time_update(vcpu))
> +				continue;
> +			if (vcpu->guest_mode)
> +				guest_mode++;

This can race if the target vcpu has tested for vcpu->requests but not
set guest_mode yet, which is acceptable for the IRQs but for this case
it is not?

Better always send the IPI if the bit was unset and cpu_self !=
target_cpu.


  parent reply	other threads:[~2009-02-04 16:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-03 17:02 [patch] kvmclock fix Gerd Hoffmann
2009-02-03 17:14 ` Glauber Costa
2009-02-03 17:19   ` Gerd Hoffmann
2009-02-04 16:17 ` Marcelo Tosatti [this message]
2009-02-04 16:43   ` Gerd Hoffmann

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=20090204161732.GA7821@amt.cnet \
    --to=mtosatti@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=kvm@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.