All of lore.kernel.org
 help / color / mirror / Atom feed
From: Will Deacon <will.deacon@arm.com>
To: Sasha Levin <sasha.levin@oracle.com>
Cc: andre.przywara@arm.com, josh@joshtriplett.org,
	penberg@kernel.org, asias.hejun@gmail.com, kvm@vger.kernel.org
Subject: Re: [PATCH 2/2] kvmtool: assume dead vcpus are paused too
Date: Thu, 5 Nov 2015 14:41:16 +0000	[thread overview]
Message-ID: <20151105144116.GE26684@arm.com> (raw)
In-Reply-To: <563A99F0.10100@oracle.com>

On Wed, Nov 04, 2015 at 06:51:12PM -0500, Sasha Levin wrote:
> On 11/04/2015 06:51 AM, Will Deacon wrote:
> > +	mutex_lock(&pause_lock);
> > +
> > +	/* The kvm->cpus array contains a null pointer in the last location */
> > +	for (i = 0; ; i++) {
> > +		if (kvm->cpus[i])
> > +			pthread_kill(kvm->cpus[i]->thread, SIGKVMEXIT);
> > +		else
> > +			break;
> > +	}
> > +
> > +	kvm__continue(kvm);
> 
> In this scenario: if we grabbed pause_lock, signaled vcpu0 to exit, and it did
> before we called kvm__continue(), we won't end up releasing pause_lock, which
> might cause a lockup later, no?

Hmm, yeah, maybe that should be an explicit mutex_unlock rather than a
call to kvm__continue.

Will

  reply	other threads:[~2015-11-05 14:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1445265650-25616-1-git-send-email-sasha.levin@oracle.com>
     [not found] ` <1445265650-25616-2-git-send-email-sasha.levin@oracle.com>
     [not found]   ` <20151027160802.GD20208@arm.com>
     [not found]     ` <56302E2C.2010207@oracle.com>
     [not found]       ` <20151028122745.GC29512@arm.com>
     [not found]         ` <5630C6D7.2020608@oracle.com>
     [not found]           ` <20151028133425.GB18966@arm.com>
2015-11-04 11:51             ` [PATCH 2/2] kvmtool: assume dead vcpus are paused too Will Deacon
2015-11-04 23:51               ` Sasha Levin
2015-11-05 14:41                 ` Will Deacon [this message]
2015-11-05 16:02                   ` Sasha Levin

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=20151105144116.GE26684@arm.com \
    --to=will.deacon@arm.com \
    --cc=andre.przywara@arm.com \
    --cc=asias.hejun@gmail.com \
    --cc=josh@joshtriplett.org \
    --cc=kvm@vger.kernel.org \
    --cc=penberg@kernel.org \
    --cc=sasha.levin@oracle.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 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.