All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: xen-devel <xen-devel@lists.xen.org>,
	Sherry Hurwitz <sherry.hurwitz@amd.com>
Subject: Re: [PATCH 1/2] AMD IOMMU: also spot missing IO-APIC entries in IVRS table
Date: Wed, 06 Feb 2013 15:12:23 +0000	[thread overview]
Message-ID: <511280E702000078000BC84A@nat28.tlf.novell.com> (raw)
In-Reply-To: <511270CA.6090903@oracle.com>

>>> On 06.02.13 at 16:03, Boris Ostrovsky <boris.ostrovsky@oracle.com> wrote:
> On 2/6/2013 9:52 AM, Jan Beulich wrote:
>>>>> On 06.02.13 at 15:41, Boris Ostrovsky<boris.ostrovsky@oracle.com>  wrote:
>>> On 2/6/2013 8:12 AM, Jan Beulich wrote:
>>>
>>>>
>>>> +    /* Each IO-APIC must have been mentioned in the table. */
>>>> +    for ( apic = 0; !error&&   apic<   nr_ioapics; ++apic )
>>>> +    {
>>>> +        if ( !nr_ioapic_entries[apic] ||
>>>> +             ioapic_sbdf[IO_APIC_ID(apic)].pin_setup )
>>>> +            continue;
>>>> +
>>>> +        printk(XENLOG_ERR "IVHD Error: no information for IO-APIC %#x\n",
>>>> +               IO_APIC_ID(apic));
>>>> +        if ( amd_iommu_perdev_intremap )
>>>> +            error = -ENXIO;
>>>> +        else
>>>> +        {
>>>> +            ioapic_sbdf[IO_APIC_ID(apic)].pin_setup = xzalloc_array(
>>>> +                unsigned long, BITS_TO_LONGS(nr_ioapic_entries[apic]));
>>>> +            if ( !ioapic_sbdf[IO_APIC_ID(apic)].pin_setup )
>>>> +            {
>>>> +                printk(XENLOG_ERR "IVHD Error: Out of memory\n");
>>>> +                error = -ENOMEM;
>>>> +            }
>>>> +        }
>>>> +    }
>>>> +
>>>>        return error;
>>>>    }
>>>>
>>>
>>> Don't we end up with ioapic_sbdf[IO_APIC_ID(apic)].bdf/seg being
>>> uninitialized? They are usually set in parse_ivhd_device_special(), at
>>> the same time pin_setup is allocated, but with IVRS broken in this way
>>> we'll never get there, will we?
>>
>> Correct. .bdf/.seg being uninitialized is no much of a problem
>> when using global intremap tables though.
> 
> Since this patch has been tested it clearly must have worked somehow but 
> I don't understand where you'd get bdf and seg in 
> amd_iommu_ioapic_update_ire() and then manage to find the right IOMMU.

The "right" IOMMU simply is the only one, and that is equally well
found with sbdf being zero.

Jan

  reply	other threads:[~2013-02-06 15:12 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-06 13:04 [PATCH 0/2] AMD IOMMU: XSA-36 follow ups Jan Beulich
2013-02-06 13:12 ` [PATCH 1/2] AMD IOMMU: also spot missing IO-APIC entries in IVRS table Jan Beulich
2013-02-06 14:41   ` Boris Ostrovsky
2013-02-06 14:52     ` Jan Beulich
2013-02-06 15:03       ` Boris Ostrovsky
2013-02-06 15:12         ` Jan Beulich [this message]
2013-02-11 10:49   ` Ian Campbell
2013-02-12 11:59     ` Jan Beulich
2013-02-06 13:12 ` [PATCH 2/2] AMD IOMMU: handle MSI for phantom functions Jan Beulich
2013-02-11 10:53   ` Ian Campbell
2013-02-08  9:58 ` [PATCH 0/2] AMD IOMMU: XSA-36 follow ups Jan Beulich
2013-02-08 13:53   ` Sander Eikelenboom
2013-03-01 18:45   ` Malcolm Crossley
2013-03-04  9:48     ` Jan Beulich
2013-02-11 13:12 ` Ian Campbell
2013-02-12  8:45   ` 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=511280E702000078000BC84A@nat28.tlf.novell.com \
    --to=jbeulich@suse.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=sherry.hurwitz@amd.com \
    --cc=xen-devel@lists.xen.org \
    /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.