All of lore.kernel.org
 help / color / mirror / Atom feed
From: Suravee Suthikulanit <suravee.suthikulpanit@amd.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: xiantao.zhang@intel.com, stefan.bader@canonical.com,
	xen-devel@lists.xen.org
Subject: Re: [PATCH 1/1 V2] x86/AMD: Fix setup ssss:bb:dd:f for d0 failed
Date: Wed, 4 Sep 2013 10:54:52 -0500	[thread overview]
Message-ID: <522757CC.8070005@amd.com> (raw)
In-Reply-To: <522710CF02000078000F0406@nat28.tlf.novell.com>

On 9/4/2013 3:51 AM, Jan Beulich wrote:
>>>> On 31.08.13 at 02:41, <suravee.suthikulpanit@amd.com> wrote:
>>>>
>> --- a/xen/drivers/passthrough/vtd/intremap.c
>> +++ b/xen/drivers/passthrough/vtd/intremap.c
>> @@ -453,6 +453,7 @@ static void set_msi_source_id(struct pci_dev *pdev,
>> struct iremap_entry *ire)
>>           break;
>>   
>>       case DEV_TYPE_PCI:
>> +    case DEV_TYPE_PCI_HOST_BRIDGE:
>>       case DEV_TYPE_LEGACY_PCI_BRIDGE:
>>       case DEV_TYPE_PCI2PCIe_BRIDGE:
>>           ret = find_upstream_bridge(seg, &bus, &devfn, &secbus);
> There shouldn't be an upstream bridge to a host bridge, and
> hence adding the case here (rather than above) is at least
> pointlessly running more complex code (all under the unlikely but
> not impossible assumption that a host bridge would have MSI set
> up for it in the first place).
I put it here because the original code (before introducing the 
DEV_TYPE_PCI_HOST_BRIDGE) would have classified the host bridge device 
as "DEV_TYPE_PCI".  Therefore, I was trying to keep the logic the same 
for Intel.   However, I agree that there should not be upstream bridge 
from host bridge.  But I am not sure that the case below would be 
appropriate.

     case DEV_TYPE_PCIe_ENDPOINT:
     case DEV_TYPE_PCIe_BRIDGE:
     case DEV_TYPE_PCIe2PCI_BRIDGE:
         switch ( pdev->phantom_stride )
         {
         case 1: sq = SQ_13_IGNORE_3; break;
         case 2: sq = SQ_13_IGNORE_2; break;
         case 4: sq = SQ_13_IGNORE_1; break;
         default: sq = SQ_ALL_16; break;
         }
         set_ire_sid(ire, SVT_VERIFY_SID_SQ, sq, PCI_BDF2(bus, devfn));
         break;

Do we need to call set_ire_sid() for host bridge device?  Or should we 
just have it's own case which does nothing.
>> --- a/xen/drivers/passthrough/vtd/iommu.c
>> +++ b/xen/drivers/passthrough/vtd/iommu.c
>> @@ -1451,6 +1451,7 @@ static int domain_context_mapping(
>>           break;
>>   
>>       case DEV_TYPE_PCI:
>> +    case DEV_TYPE_PCI_HOST_BRIDGE:
>>           if ( iommu_verbose )
>>               dprintk(VTDPREFIX, "d%d:PCI: map %04x:%02x:%02x.%u\n",
>>                       domain->domain_id, seg, bus,
>> @@ -1580,6 +1581,7 @@ static int domain_context_unmap(
>>           break;
>>   
>>       case DEV_TYPE_PCI:
>> +    case DEV_TYPE_PCI_HOST_BRIDGE:
>>           if ( iommu_verbose )
>>               dprintk(VTDPREFIX, "d%d:PCI: unmap %04x:%02x:%02x.%u\n",
>>                       domain->domain_id, seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
> Host bridges would so far have gone through the respective default
> cases, not setting up any mapping, but logging a message. I think
> the change ought to be that host bridges result in both functions to
> fail, but without the log message saying "unknown" (and perhaps
> with -EPERM or -EACCES rather than -EINVAL).
I could do that.
> But in any event - you forgot to Cc the VT-d maintainer, who will
> need to ack the change anyway.
Sorry and thanks :)
>
> Jan
>
>

  reply	other threads:[~2013-09-04 15:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-31  0:41 [PATCH 1/1 V2] x86/AMD: Fix setup ssss:bb:dd:f for d0 failed suravee.suthikulpanit
2013-09-01 20:40 ` Andrew Cooper
2013-09-03  2:36   ` Suravee Suthikulpanit
2013-09-04  8:53     ` Jan Beulich
2013-09-04 14:10       ` Suravee Suthikulanit
2013-09-04  8:51 ` Jan Beulich
2013-09-04 15:54   ` Suravee Suthikulanit [this message]
2013-09-05  7:03     ` 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=522757CC.8070005@amd.com \
    --to=suravee.suthikulpanit@amd.com \
    --cc=JBeulich@suse.com \
    --cc=stefan.bader@canonical.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.