From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [patch 2/3] KVM: x86: disallow KVM_{SET,GET}_LAPIC without in kernel irqchip Date: Wed, 28 Oct 2009 12:39:36 +0200 Message-ID: <20091028103936.GV29477@redhat.com> References: <20091027151042.118902183@redhat.com> <20091027151125.345664553@redhat.com> <20091027175026.GC14421@redhat.com> <4AE80F90.8010303@redhat.com> <20091028102041.GA24238@redhat.com> <20091028103039.GU29477@redhat.com> <20091028103223.GB24238@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Avi Kivity , Marcelo Tosatti , kvm , stable@kernel.org To: "Michael S. Tsirkin" Return-path: Received: from mx1.redhat.com ([209.132.183.28]:46518 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753586AbZJ1KkA (ORCPT ); Wed, 28 Oct 2009 06:40:00 -0400 Content-Disposition: inline In-Reply-To: <20091028103223.GB24238@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Oct 28, 2009 at 12:32:24PM +0200, Michael S. Tsirkin wrote: > On Wed, Oct 28, 2009 at 12:30:39PM +0200, Gleb Natapov wrote: > > On Wed, Oct 28, 2009 at 12:20:42PM +0200, Michael S. Tsirkin wrote: > > > On Wed, Oct 28, 2009 at 11:32:00AM +0200, Avi Kivity wrote: > > > > On 10/27/2009 07:50 PM, Michael S. Tsirkin wrote: > > > >> Can the value of irqchip_in_kernel be changed by userspace > > > >> after we have checked it? If yes, this check won't help ... > > > >> > > > > > > > > A change from false to true is possible, but not the reverse. > > > > > > Hmm. If we want to rely on this, we have to play with > > > memory barriers to write/read it. Doable, but hard to get right. > > Why? If userspace is so racy that it tries to use vpic while other > > thread creates it let it fail and burn in hell. > > Yes but reading uninitialized memory in kernel can > lead to host kernel crashes. > A you concerned that arch.vpic pointer assignment will be seen before vpic initialization? Yes this theoretically possible. > > > Can we always have the irqchip object exist? > > > It doesn't use a lot of memory, does it? > > > Maybe have it inline, save an extra indirection on > > > fastpath ... > > > > > > > -- > > > > error compiling committee.c: too many arguments to function > > > -- > > > To unsubscribe from this list: send the line "unsubscribe kvm" in > > > the body of a message to majordomo@vger.kernel.org > > > More majordomo info at http://vger.kernel.org/majordomo-info.html > > > > -- > > Gleb. -- Gleb.