From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: Re: [PATCH] KVM: Fix kvm_irqfd_init initialization Date: Tue, 7 May 2013 18:24:48 +0300 Message-ID: <20130507152448.GB23721@redhat.com> References: <1367938456-21005-1-git-send-email-asias@redhat.com> <20130507145937.GA23273@redhat.com> <20130507150512.GA21464@hj.localdomain> <20130507151133.GB23608@redhat.com> <20130507151609.GD7899@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20130507151609.GD7899@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org To: Gleb Natapov Cc: kvm@vger.kernel.org, virtualization@lists.linux-foundation.org List-Id: virtualization@lists.linuxfoundation.org On Tue, May 07, 2013 at 06:16:09PM +0300, Gleb Natapov wrote: > On Tue, May 07, 2013 at 06:11:33PM +0300, Michael S. Tsirkin wrote: > > On Tue, May 07, 2013 at 11:05:12PM +0800, Asias He wrote: > > > On Tue, May 07, 2013 at 05:59:38PM +0300, Michael S. Tsirkin wrote: > > > > On Tue, May 07, 2013 at 10:54:16PM +0800, Asias He wrote: > > > > > In commit a0f155e96 'KVM: Initialize irqfd from kvm_init()', when > > > > > kvm_init() is called the second time (e.g kvm-amd.ko and kvm-intel.ko), > > > > > kvm_arch_init() will fail with -EEXIST, > > > > > > > > Wow. Is this intentional? > > > > > > I think it is. You can not be amd and intel at the same time ;-) > > > > > > kvm_arch_init > > > > > > if (kvm_x86_ops) { > > > printk(KERN_ERR "kvm: already loaded the other module\n"); > > > r = -EEXIST; > > > goto out; > > > } > > > > > > > Interesting. So we check it with > > if (kvm_x86_ops) > > and later we do > > kvm_x86_ops = ops; > > > > > > This looks racy - or is something serializing > > module loading? > > > I think module loading is serialized. > Hmm then I don't understand ... both kvm-intel and kvm-amd *can't* be loaded at the same time: module loading fails for one of them. > -- > Gleb.