From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: [PATCH 3/4] VMX: Add posted interrupt supporting Date: Tue, 09 Apr 2013 10:18:55 +0100 Message-ID: References: <5163F4C502000078000CBA9D@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5163F4C502000078000CBA9D@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich , Yang Z Zhang Cc: Xiantao Zhang , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On 09/04/2013 10:00, "Jan Beulich" wrote: >>>> Can't you use vlapic_set_vector() here (even if that means >>>> looping over vectors individually rather than groups), to add the >>>> necessary atomicity (I don't see how you avoid races with other >>>> updates) and to avoid the ugly cast? >> Which races? > > vlapic.c also updates the APIC_IRR bit array, and hence (unless > you can guarantee that now and forever such updates only > happen when the subject vCPU is current, which I don't think is > the case) It's not the case. Which is one reason the IRR updates (and I think all bitmap updates) in vlapic.c are atomic. -- Keir > your non-atomic read-modify-write operation here can > discard an update done in vlapic.c. And am I wrong in recalling > that the CPU may actually also on its own update that bit array?