WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] RE: [PATCH] passthrough: update bus2bridge mapping as PCI d

To: Jan Beulich <JBeulich@xxxxxxxx>
Subject: [Xen-devel] RE: [PATCH] passthrough: update bus2bridge mapping as PCI devices get added/removed
From: "Kay, Allen M" <allen.m.kay@xxxxxxxxx>
Date: Fri, 7 Oct 2011 18:39:40 -0700
Accept-language: en-US
Acceptlanguage: en-US
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Fri, 07 Oct 2011 18:40:23 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4E8EC18C0200007800059E17@xxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <4E8B08A10200007800059278@xxxxxxxxxxxxxxxxxxxx> <987664A83D2D224EAE907B061CE93D5301EE709B54@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <4E8EC18C0200007800059E17@xxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcyEv80sHSj/QYc+Q3WIsFj6xv6s6wAmvupA
Thread-topic: [PATCH] passthrough: update bus2bridge mapping as PCI devices get added/removed
> +            for ( ; sec_bus <= sub_bus; sec_bus++ )
> +                pseg->bus2bridge[sec_bus] = pseg->bus2bridge[pdev->bus];

OK.  You are collapsing the bridge of the subordinate buses to be the same 
upstream bridge of the pdev we are removing.  Looks good.  Ack!

Allen

-----Original Message-----
From: Jan Beulich [mailto:JBeulich@xxxxxxxx] 
Sent: Friday, October 07, 2011 12:08 AM
To: Kay, Allen M
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: RE: [PATCH] passthrough: update bus2bridge mapping as PCI devices get 
added/removed

>>> On 07.10.11 at 04:00, "Kay, Allen M" <allen.m.kay@xxxxxxxxx> wrote:
> Hi Jan,
> 
> I'm not able to spot the difference between this patch and the earlier one 
> you had second thoughts about in attached email.  Was there a change I 
> missed?

It addresses the comment I made in the mail you had attached, i.e. ...

> Allen
> 
> -----Original Message-----
>...
> -static void free_pdev(struct pci_dev *pdev)
> +static void free_pdev(struct pci_seg *pseg, struct pci_dev *pdev)
>  {
> +    /* update bus2bridge */
> +    switch ( pdev_type(pseg->nr, pdev->bus, pdev->devfn) )
> +    {
> +        u8 dev, func, sec_bus, sub_bus;
> +
> +        case DEV_TYPE_PCIe2PCI_BRIDGE:
> +        case DEV_TYPE_LEGACY_PCI_BRIDGE:
> +            dev = PCI_SLOT(pdev->devfn);
> +            func = PCI_FUNC(pdev->devfn);
> +            sec_bus = pci_conf_read8(pseg->nr, pdev->bus, dev, func,
> +                                     PCI_SECONDARY_BUS);
> +            sub_bus = pci_conf_read8(pseg->nr, pdev->bus, dev, func,
> +                                     PCI_SUBORDINATE_BUS);
> +
> +            spin_lock(&pseg->bus2bridge_lock);
> +            for ( ; sec_bus <= sub_bus; sec_bus++ )
> +                pseg->bus2bridge[sec_bus] = pseg->bus2bridge[pdev->bus];

... the right side of this was 0 on the first posting.

Jan

> +            spin_unlock(&pseg->bus2bridge_lock);
> +            break;
> +    }
> +
>      list_del(&pdev->alldevs_list);
>      xfree(pdev);
>  }



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel