From: Suresh Siddha <suresh.b.siddha@intel.com>
To: "Han, Weidong" <weidong.han@intel.com>
Cc: "dwmw2@infradead.org" <dwmw2@infradead.org>,
"mingo@elte.hu" <mingo@elte.hu>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"iommu@lists.linux-foundation.org"
<iommu@lists.linux-foundation.org>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: [PATCH 2/2] Intel-IOMMU, intr-remap: source-id checking
Date: Thu, 07 May 2009 11:19:41 -0700 [thread overview]
Message-ID: <1241720381.27006.8582.camel@localhost.localdomain> (raw)
In-Reply-To: <1241676996-27406-2-git-send-email-weidong.han@intel.com>
On Wed, 2009-05-06 at 23:16 -0700, Han, Weidong wrote:
> @@ -634,6 +694,44 @@ static int ir_parse_ioapic_scope(struct acpi_dmar_header *header,
> " 0x%Lx\n", scope->enumeration_id,
> drhd->address);
>
> + bus = pci_find_bus(drhd->segment, scope->bus);
> + path = (struct acpi_dmar_pci_path *)(scope + 1);
> + count = (scope->length -
> + sizeof(struct acpi_dmar_device_scope))
> + / sizeof(struct acpi_dmar_pci_path);
> +
> + while (count) {
> + if (pdev)
> + pci_dev_put(pdev);
> +
> + if (!bus)
> + break;
> +
> + pdev = pci_get_slot(bus,
> + PCI_DEVFN(path->dev, path->fn));
> + if (!pdev)
> + break;
ir_parse_ioapic_scope() happens very early in the boot. So, I don't
think we can do the pci related discovery here.
thanks,
suresh
> +
> + path++;
> + count--;
> + bus = pdev->subordinate;
> + }
> +
> + if (pdev) { /* PCI discoverable IOAPIC*/
> + ir_ioapic[ir_ioapic_num].bus =
> + pdev->bus->number;
> + ir_ioapic[ir_ioapic_num].devfn = pdev->devfn;
> + } else { /* Not PCI discoverable IOAPIC */
> + if (!bus)
> + ir_ioapic[ir_ioapic_num].bus =
> + scope->bus;
> + else
> + ir_ioapic[ir_ioapic_num].bus =
> + bus->number;
> + ir_ioapic[ir_ioapic_num].devfn =
> + PCI_DEVFN(path->dev, path->fn);
> + }
> +
> ir_ioapic[ir_ioapic_num].iommu = iommu;
> ir_ioapic[ir_ioapic_num].id = scope->enumeration_id;
> ir_ioapic_num++;
next prev parent reply other threads:[~2009-05-07 18:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-07 6:16 [PATCH 1/2] Intel-IOMMU, intr-remap: set the whole 128bits of irte when modify/free it Weidong Han
2009-05-07 6:16 ` [PATCH 2/2] Intel-IOMMU, intr-remap: source-id checking Weidong Han
2009-05-07 18:19 ` Suresh Siddha [this message]
2009-05-11 6:22 ` Han, Weidong
2009-05-11 13:20 ` Ingo Molnar
2009-05-18 9:46 ` Han, Weidong
2009-05-19 9:32 ` Ingo Molnar
2009-05-19 10:34 ` Han, Weidong
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=1241720381.27006.8582.camel@localhost.localdomain \
--to=suresh.b.siddha@intel.com \
--cc=dwmw2@infradead.org \
--cc=iommu@lists.linux-foundation.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=weidong.han@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox