All of lore.kernel.org
 help / color / mirror / Atom feed
From: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: xen-devel@lists.xen.org
Subject: Re: [PATCH 3/3] x86/AMD-Vi: Fix IVRS HPET special->handle override
Date: Tue, 17 Sep 2013 10:07:10 -0500	[thread overview]
Message-ID: <5238701E.4000907@amd.com> (raw)
In-Reply-To: <5236D75E02000078000F3847@nat28.tlf.novell.com>


[-- Attachment #1.1: Type: text/plain, Size: 2366 bytes --]

On 09/16/2013 03:03 AM, Jan Beulich wrote:
>>>> On 14.09.13 at 01:30, <suravee.suthikulpanit@amd.com> wrote:
>> From: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
>>
>> The current logic does not handle the case when HPET special->handle
>> is invalid in IVRS. On such system, the following message is shown:
>>
>> (XEN) AMD-Vi: Failed to setup HPET MSI remapping: Wrong HPET
>>
>> This patch will allow the ivrs_hpet[<handle>]=<sbdf> to override the
>> IVRS.
>>
>> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
>> ---
>>   xen/drivers/passthrough/amd/iommu_acpi.c | 22 +++++++++++++++-------
>>   1 file changed, 15 insertions(+), 7 deletions(-)
>>
>> diff --git a/xen/drivers/passthrough/amd/iommu_acpi.c
>> b/xen/drivers/passthrough/amd/iommu_acpi.c
>> index 0778af0..bfcc2eb 100644
>> --- a/xen/drivers/passthrough/amd/iommu_acpi.c
>> +++ b/xen/drivers/passthrough/amd/iommu_acpi.c
>> @@ -671,6 +671,7 @@ static void __init parse_ivrs_hpet(char *str)
>>       if ( !s || *s )
>>           return;
>>   
>> +    hpet_sbdf.id = id;
>>       hpet_sbdf.bdf = PCI_BDF(bus, dev, func);
>>       hpet_sbdf.seg = seg;
>>       hpet_sbdf.cmdline = 1;
>> @@ -787,19 +788,26 @@ static u16 __init parse_ivhd_device_special(
>>           }
>>           break;
>>       case ACPI_IVHD_HPET:
>> +        if ( hpet_sbdf.cmdline )
>> +        {
>> +            AMD_IOMMU_DEBUG("IVHD: Command line override present for HPET %#x "
>> +                            "(IVRS: %#x devID %04x:%02x:%02x.%u)\n",
>> +                            hpet_sbdf.id, special->handle, seg, PCI_BUS(bdf),
>> +                            PCI_SLOT(bdf), PCI_FUNC(bdf));
>> +            hpet_sbdf.iommu = iommu;
> This (unconditional) assignment is what the earlier logic attempted
> to avoid: We must not blindly set this (and in particular not blindly
> overwrite a previously set valid value), and in order to do so we
> need to know whether to trust devid or handle. I'm therefore going
> to apply only the first hunk - being a clear and obvious bug fix - for
> the time being.
>
> Jan
But since we only allow one HPET in the system, and if users want to 
override the one that is in the IVRS (the buggy one)
we should allow this, right?  Otherwise, if the special->handle doesn't 
match, it would end up causing this logic to complain
about multiple HPETs.

Suravee

[-- Attachment #1.2: Type: text/html, Size: 3196 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2013-09-17 15:07 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-13 23:30 [PATCH 0/3 V4] x86/AMD-Vi: Miscs patch to fix and clean up ivrs override suravee.suthikulpanit
2013-09-13 23:30 ` [PATCH 1/3] x86/AMD-Vi: Overrides special->handle in IVRS IOAPIC suravee.suthikulpanit
2013-09-13 23:30 ` [PATCH 2/3] x86/AMD-Vi: Clean up code for handling IVRS IOAPIC override suravee.suthikulpanit
2013-09-16  7:29   ` Jan Beulich
2013-09-17 15:06     ` Suravee Suthikulpanit
2013-09-13 23:30 ` [PATCH 3/3] x86/AMD-Vi: Fix IVRS HPET special->handle override suravee.suthikulpanit
2013-09-16  8:03   ` Jan Beulich
2013-09-17 15:07     ` Suravee Suthikulpanit [this message]
     [not found]     ` <523862B8.8000207@amd.com>
2013-09-17 15:30       ` Jan Beulich
2013-09-20 21:38         ` Suravee Suthikulanit
2013-09-23  6:52           ` Jan Beulich
2013-09-23 16:48             ` Suravee Suthikulpanit
2013-09-23 17:03               ` Andrew Cooper
2013-09-23 23:55                 ` Suravee Suthikulanit
2013-09-24  9:35                 ` Jan Beulich
2013-09-24  6:47               ` Jan Beulich
2013-09-24 23:26                 ` Suravee Suthikulanit
2013-09-25  6:12                   ` Jan Beulich
2013-09-25 15:01                     ` Suravee Suthikulpanit

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=5238701E.4000907@amd.com \
    --to=suravee.suthikulpanit@amd.com \
    --cc=JBeulich@suse.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.