Re: [patch] kvmclock fix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux