From: Tim Deegan Subject: Re: [PATCH 1/2 v4] iommu/amd: Fix logic for clearing the IOMMU interrupt bits Date: Mon, 10 Jun 2013 13:46:22 +0100 Message-ID: <20130610124622.GG8802@ocelot.phlegethon.org> References: <1370840751-11277-1-git-send-email-suravee.suthikulpanit@amd.com> <51B5CCF002000078000DC9A5@nat28.tlf.novell.com> <20130610121855.GE8802@ocelot.phlegethon.org> <51B5E58802000078000DCA7E@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <51B5E58802000078000DCA7E@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 Cc: suravee.suthikulpanit@amd.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org At 13:41 +0100 on 10 Jun (1370871672), Jan Beulich wrote: > The IOMMU interrupt bits in the IOMMU status registers are > "read-only, and write-1-to-clear (RW1C). Therefore, the existing > logic which reads the register, set the bit, and then writing back > the values could accidentally clear certain bits if it has been set. > > The correct logic would just be writing only the value which only > set the interrupt bits, and leave the rest to zeros. > > This patch also, clean up #define masks as Jan has suggested. > > Signed-off-by: Suravee Suthikulpanit > > With iommu_interrupt_handler() properly having got switched its readl() > from status to control register, the subsequent writel() needed to be > switched too (and the RW1C comment there was bogus). > > Some of the cleanup went too far - undone. > > Further, with iommu_interrupt_handler() now actually disabling the > interrupt sources, they also need to get re-enabled by the tasklet once > it finished processing the respective log. > > Finally, guest write emulation to the status register needs to be done > with the RW1C (and RO for all other bits) semantics in mind too. > > Signed-off-by: Jan Beulich Reviewed-by: Tim Deegan