From: Tim Deegan Subject: Re: [PATCH 2/2 V2] iommu/amd: Workaround for erratum 787 Date: Mon, 10 Jun 2013 14:56:55 +0100 Message-ID: <20130610135655.GH8802@ocelot.phlegethon.org> References: <1370840751-11277-1-git-send-email-suravee.suthikulpanit@amd.com> <1370840751-11277-2-git-send-email-suravee.suthikulpanit@amd.com> <20130610093532.GA8802@ocelot.phlegethon.org> <51B5BCDF02000078000DC94E@nat28.tlf.novell.com> <20130610104008.GC8802@ocelot.phlegethon.org> <51B5CC4902000078000DC9A1@nat28.tlf.novell.com> <20130610124329.GF8802@ocelot.phlegethon.org> <51B5F3C202000078000DCAD7@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: <51B5F3C202000078000DCAD7@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 14:41 +0100 on 10 Jun (1370875314), Jan Beulich wrote: > >>> On 10.06.13 at 14:43, Tim Deegan wrote: > > How about: > > write-to-clear status.pending > > process the log > > if (status.pending) > > reschedule the tasklet > > else > > unmask the interrupt. > > Actually I think this is leaving a window for improperly handled > log entries too: There's also no guarantee that re-enabling the > interrupt would cause an interrupt to be raised when the buffer > became non-empty between the status.pending check and the > re-enable. Oh. Yes, I suppose that depends on whether the interrupt is triggered on (edge(pending) && enabled) or edge(pending && enabled), or something else. > Therefore I think we need > > write-to-clear status.pending > process the log > unmask the interrupt. > if (status.pending) > reschedule the tasklet Yes, that looks better. Tim.