All of lore.kernel.org
 help / color / mirror / Atom feed
From: Suravee Suthikulanit <suravee.suthikulpanit@amd.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Jacob Shin <jacob.shin@amd.com>,
	xiantao.zhang@intel.com, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH 1/6] AMD IOMMU: allocate IRTE entries instead of using a static mapping
Date: Fri, 26 Apr 2013 12:13:58 -0500	[thread overview]
Message-ID: <517AB5D6.5030009@amd.com> (raw)
In-Reply-To: <51713F2D02000078000CEF05@nat28.tlf.novell.com>

On 4/19/2013 5:57 AM, Jan Beulich wrote:
> --- a/xen/drivers/passthrough/amd/iommu_acpi.c
> +++ b/xen/drivers/passthrough/amd/iommu_acpi.c
>
> @@ -691,14 +694,16 @@ static u16 __init parse_ivhd_device_spec
>                   ioapic_sbdf[special->handle].bdf = bdf;
>                   ioapic_sbdf[special->handle].seg = seg;
>   
> -                ioapic_sbdf[special->handle].pin_setup = xzalloc_array(
> -                    unsigned long, BITS_TO_LONGS(nr_ioapic_entries[apic]));
> +                ioapic_sbdf[special->handle].pin_2_idx = xmalloc_array(
> +                    u16, nr_ioapic_entries[apic]);
>                   if ( nr_ioapic_entries[apic] &&
> -                     !ioapic_sbdf[IO_APIC_ID(apic)].pin_setup )
> +                     !ioapic_sbdf[IO_APIC_ID(apic)].pin_2_idx )
>                   {
>                       printk(XENLOG_ERR "IVHD Error: Out of memory\n");
>                       return 0;
>                   }
> +                memset(ioapic_sbdf[IO_APIC_ID(apic)].pin_2_idx, -1,
> +                       nr_ioapic_entries[apic]);
>               }

Jan,

Ok.. here is why the (offset >= INTREMAP_ENTRIES) in update_intremap_entry_from_ioapic failed.

+                memset(ioapic_sbdf[IO_APIC_ID(apic)].pin_2_idx, -1,
+                       nr_ioapic_entries[apic]);

should have been

+                memset(ioapic_sbdf[IO_APIC_ID(apic)].pin_2_idx, -1,
+                       (nr_ioapic_entries[apic] * sizeof(u16)));

Since nr_ioapic_entries[apic] = 24, only pin_2_idx[0 to 11] is set to 0xffff.  This causes the pin_2_idx[12-23] to fail the check.

Suravee.

  parent reply	other threads:[~2013-04-26 17:13 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-19 10:50 [PATCH 0/6] x86/IOMMU: multi-vector MSI Jan Beulich
2013-04-19 10:57 ` [PATCH 1/6] AMD IOMMU: allocate IRTE entries instead of using a static mapping Jan Beulich
2013-04-23 13:21   ` Suravee Suthikulanit
2013-04-23 15:06     ` Suravee Suthikulanit
2013-04-24 13:34       ` Jan Beulich
2013-04-24 21:52         ` suravee suthikulpanit
2013-04-26 10:39           ` Jan Beulich
2013-04-26 17:13   ` Suravee Suthikulanit [this message]
2013-04-29  7:31     ` Jan Beulich
2013-04-29  7:33       ` Suthikulpanit, Suravee
2013-04-29  7:42         ` Jan Beulich
2013-04-19 10:57 ` [PATCH 2/6] AMD IOMMU: untie remap and vector maps Jan Beulich
2013-04-19 10:58 ` [PATCH 3/6] VT-d: enable for multi‑vector MSI Jan Beulich
2013-04-19 10:59 ` [PATCH 4/6] AMD IOMMU: enable for multi-vector MSI Jan Beulich
2013-04-19 10:59 ` [PATCH 5/6] x86: enable " Jan Beulich
2013-04-23  0:55   ` Suravee Suthikulanit
2013-04-23  6:26     ` Jan Beulich
2013-04-26 21:16       ` Suravee Suthikulanit
2013-04-19 11:00 ` [PATCH 6/6] pciif: add multi-vector-MSI command Jan Beulich
2013-04-19 14:48 ` [PATCH 0/6] x86/IOMMU: multi-vector MSI Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=517AB5D6.5030009@amd.com \
    --to=suravee.suthikulpanit@amd.com \
    --cc=JBeulich@suse.com \
    --cc=jacob.shin@amd.com \
    --cc=konrad.wilk@oracle.com \
    --cc=xen-devel@lists.xen.org \
    --cc=xiantao.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.