Re: [PATCH kvmtool v3 08/17] Add helpers to pause the VM from vCPU thread

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

 



Hey Will,

On Mon, Sep 18, 2023 at 11:40:28AM +0100, Will Deacon wrote:
> On Wed, Aug 02, 2023 at 11:42:46PM +0000, Oliver Upton wrote:
> > +void kvm_cpu__pause_vm(struct kvm_cpu *vcpu)
> > +{
> > +	/*
> > +	 * Mark the calling vCPU as paused to avoid waiting indefinitely for a
> > +	 * signal exit.
> > +	 */
> > +	vcpu->paused = true;
> > +	kvm__pause(vcpu->kvm);
> > +}
> > +
> > +void kvm_cpu__continue_vm(struct kvm_cpu *vcpu)
> > +{
> > +	vcpu->paused = false;
> > +	kvm__continue(vcpu->kvm);
> > +}
> 
> Why is it safe to manipulate 'vcpu->paused' here without the pause_lock
> held?

Heh, I hacked this up to get _something_ working and never re-evaluated
the locking that I completely sidestepped.

> Relatedly, how does this interact with the 'pause' and 'resume'
> lkvm commands?

Poorly, if I had to guess. I hadn't actually tested with them. I'll take
another crack at this to safely quiesce when handling calls.

Thanks for having a look.

-- 
Best,
Oliver



[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