From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH v4] kvm: Use a bitmap for tracking used GSIs Date: Mon, 18 May 2009 18:08:29 +0300 Message-ID: <4A1179ED.7040206@redhat.com> References: <1242256055.9456.326.camel@lappy> <4A1077F9.8040604@redhat.com> <20090518111246.GB3037@redhat.com> <4A114849.604@redhat.com> <20090518121952.GA14327@redhat.com> <4A115590.6030500@redhat.com> <20090518134504.GB23296@redhat.com> <4A1168D2.7090709@redhat.com> <20090518144020.GB23940@redhat.com> <4A1174B1.9080201@redhat.com> <20090518150130.GC23940@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Alex Williamson , kvm@vger.kernel.org, sheng.yang@intel.com To: "Michael S. Tsirkin" Return-path: Received: from mx2.redhat.com ([66.187.237.31]:41408 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751140AbZERPId (ORCPT ); Mon, 18 May 2009 11:08:33 -0400 In-Reply-To: <20090518150130.GC23940@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Michael S. Tsirkin wrote: > Here's the race as I see it: we discussed the possibility > of making kernel and user share and actual memory page, > and using that for MSI-X tables. > > host kernel want to send msi x message > host kernel test mask bit: unmasked > guest sets mask bit > guest does read to flash msi writes > guest does sync irq and makes sure there are no > outstanging interrupts > ---> at this stage guest expects not to get interrupts > guest starts editing msix entry > > host kernel never saw mask so it sends message to the old address > or even a corrupted address which the guest is in > the middle of editing > bad things happen > > This race is not easy to solve, except by catching writes to msix table, > and syncronising them with interrupt delivery. > You're right of course. In any case this is premature, we'll have to see if this happens with any frequency. -- error compiling committee.c: too many arguments to function