public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: michael@ellerman.id.au
Cc: Marcelo Tosatti <mtosatti@redhat.com>, kvm@vger.kernel.org
Subject: Re: [PATCH] KVM: Ensure all vcpus are consistent with in-kernel irqchip settings
Date: Tue, 06 Mar 2012 12:37:49 +0200	[thread overview]
Message-ID: <4F55E8FD.1090408@redhat.com> (raw)
In-Reply-To: <1331011859.25651.6.camel@concordia>

On 03/06/2012 07:30 AM, Michael Ellerman wrote:
> On Mon, 2012-03-05 at 14:29 +0200, Avi Kivity wrote:
> > If some vcpus are created before KVM_CREATE_IRQCHIP, then
> > irqchip_in_kernel() and vcpu->arch.apic will be inconsistent, leading
> > to potential NULL pointer dereferences.
> > 
> > Fix by:
> > - ensuring that no vcpus are installed when KVM_CREATE_IRQCHIP is called
> > - ensuring that a vcpu has an apic if it is installed after KVM_CREATE_IRQCHIP
> > 
> > This is somewhat long winded because vcpu->arch.apic is created without
> > kvm->lock held.
>
> Hi Avi,
>
> Thanks for following up on this. This looks OK to me.
>
> I wonder if we will end up needing to add other sanity tests at the same
> point, ie. when we install the vcpu, in which case we might need a
> generic "sanity hook". But better to keep it specific until we need
> something generalised.

Right, ARM will also have the same problem (with/without GIC).

> When we do irqchip-in-kernel on powerpc we'll need to rework the #ifdef
> in kvm_host.h, because we don't want CONFIG_KVM_APIC_ARCHITECTURE, but
> we will need our own kvm_vcpu_compatible(). But again we'll do that at
> the time.
>

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


      reply	other threads:[~2012-03-06 10:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-05 12:29 [PATCH] KVM: Ensure all vcpus are consistent with in-kernel irqchip settings Avi Kivity
2012-03-06  5:30 ` Michael Ellerman
2012-03-06 10:37   ` Avi Kivity [this message]

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=4F55E8FD.1090408@redhat.com \
    --to=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=michael@ellerman.id.au \
    --cc=mtosatti@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox