Re: [PATCH 2/5 V5] Add functions to check if the host has stoppedthe vm

From: Avi Kivity
Date: Wed Dec 14 2011 - 12:31:19 EST


On 12/14/2011 07:11 PM, Eric B Munson wrote:
> > > >
> > > > If I understand (please correct me if this is wrong) because this is only
> > > > called from the watchdog, which disables preemption, we should be protected
> > > > from something else writing to these flags.
> > >
> > > The host can write, but in that case race is harmless.
> >
> > Why is it harmless? You don't know what's in those other flags.
> >
> > --
> > error compiling committee.c: too many arguments to function
> >
>
> Currently there is only one other flag in this byte (PVCLOCK_TSC_STABLE_BIT)
> and it isset once in kvmclock_init(). It is highly unlikely that the vm will
> be stopped during this init and have the flag clobbered. After the tsc stable
> bit is written in the init, the field is read only outside of the guest paused
> code.

Let's not lay minefields for us later to step into. Making this a
cpu-local atomic (irq safe but not smp safe) is simple and easy,
somehting like __this_cpu_and().

--
error compiling committee.c: too many arguments to function

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/