From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: Commit 1aeb1156fa43fe2cd2b5003995b20466cd19a622: "x86 don't change affinity with interrupt unmasked", APCI errors and assorted pci trouble Date: Fri, 17 Apr 2015 16:46:56 +0100 Message-ID: <55312AF0.1030405@citrix.com> References: <1995398026.20150328163438@eikelenboom.it> <5516E53F.1080203@citrix.com> <1687342964.20150328211022@eikelenboom.it> <55192DBA.2070702@citrix.com> <351939600.20150330152618@eikelenboom.it> <551C03F8.9070204@citrix.com> <1827904804.20150414144652@eikelenboom.it> <55310E040200007800073330@mail.emea.novell.com> <336555093.20150417171147@eikelenboom.it> <553140EF0200007800073577@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Yj8Tu-0008Rl-SN for xen-devel@lists.xenproject.org; Fri, 17 Apr 2015 15:47:02 +0000 In-Reply-To: <553140EF0200007800073577@mail.emea.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 , Sander Eikelenboom Cc: xen-devel , Tim Deegan List-Id: xen-devel@lists.xenproject.org On 17/04/15 16:20, Jan Beulich wrote: >>>> On 17.04.15 at 17:11, wrote: >> Friday, April 17, 2015, 1:43:32 PM, you wrote: >>> --- unstable.orig/xen/drivers/passthrough/amd/iommu_intr.c >>> +++ unstable/xen/drivers/passthrough/amd/iommu_intr.c >>> @@ -365,15 +365,17 @@ unsigned int amd_iommu_read_ioapic_from_ >>> unsigned int apic, unsigned int reg) >>> { >>> unsigned int val = __io_apic_read(apic, reg); >>> + unsigned int pin = (reg - 0x10) / 2; >>> + unsigned int offset = ioapic_sbdf[IO_APIC_ID(apic)].pin_2_idx[pin]; >>> >>> - if ( !(reg & 1) ) >>> + if ( !(reg & 1) && offset < INTREMAP_ENTRIES ) >>> { >>> - unsigned int offset = val & (INTREMAP_ENTRIES - 1); >>> u16 bdf = ioapic_sbdf[IO_APIC_ID(apic)].bdf; >>> u16 seg = ioapic_sbdf[IO_APIC_ID(apic)].seg; >>> u16 req_id = get_intremap_requestor_id(seg, bdf); >>> const u32 *entry = get_intremap_entry(seg, req_id, offset); >>> >>> + ASSERT(offset == (val & (INTREMAP_ENTRIES - 1))); >>> val &= ~(INTREMAP_ENTRIES - 1); >>> val |= get_field_from_reg_u32(*entry, >>> INT_REMAP_ENTRY_INTTYPE_MASK, >> >> Hmmm can this patch or tim's patch make andrew's patch ineffective ? > I can't see how either would. Tim indicated that he thought my patch might be racy, so I might not be surprised if a problem still exists. ~Andrew