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

Re: [Xen-devel] Possible bug with pass-through hot-plug?

To: Simon Horman <horms@xxxxxxxxxxxx>
Subject: Re: [Xen-devel] Possible bug with pass-through hot-plug?
From: Tom Rotenberg <tom.rotenberg@xxxxxxxxx>
Date: Thu, 8 Oct 2009 15:55:21 +0200
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 08 Oct 2009 06:55:48 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=2XOYh20vHWxYq5FwtPShf8DGwiLWH3NbSZ7H31KU/RM=; b=Bohr4ocDwdNDpEEEiDrqsa/Fd6BtRBb7e7ktPVMZjNawcpFa4DqFTGUJ9jQkEhWueC ugfk4Rqm5+wrrN68VPyKh8FRx2FD2NcIX6tRDrR2C9+9zDGFUTDS8AcJB0n/93A5tIu9 JtBa7GcIFKGWWvMY0yyCTdjlJMonX2+8tqrgE=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=fZYFmg676/jMEHrxN0eCLqnUcA04ImfC/jXlCkl/4hpXsT1I+l9QPr1kSI4zidjLJf QUxCltO0GB03fULRF2xjrSyUI7TFqmC3Zmpz49yrZ1af4VJENz2amaE2mur3n13ELGVa SsUSUUwOjHeum4c9CbFwN9ywYy8TSsedWwIu0=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20091007234132.GE2055@xxxxxxxxxxxx>
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: <8686c3cd0910070200r7f3c59d9o8964ea432372a6b2@xxxxxxxxxxxxxx> <20091007093840.GB18775@xxxxxxxxxxxx> <8686c3cd0910070256p77f58aeat23aea646aaf82b86@xxxxxxxxxxxxxx> <20091007120246.GA5088@xxxxxxxxxxxx> <8686c3cd0910070828v30b1838by29c592bfb18f27c1@xxxxxxxxxxxxxx> <8686c3cd0910070841t2dd45aebx2f8a047477807e41@xxxxxxxxxxxxxx> <20091007225211.GD2055@xxxxxxxxxxxx> <20091007234132.GE2055@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
The qemu xen i tested today, (which aslo doesn't work), is:
--------------------------------------------------------------
commit a05958b6e32f1748ea70b1efca13394956c0698b
Author: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Date:   Wed Oct 7 15:57:18 2009 +0100

    block: Clean up after deleting BHs
--------------------------------------------------------------

Here are the log results you wanted (without my change):

dm-command: hot insert pass-through pci dev
insert_to_pci_devfn: bdf_slt="0000:00:1b.0@100"
insert_to_pci_devfn: devfn=0x100 -> slot=0x00, func=0x0
register_real_device: Assigning real physical device 00:1b.0 ...


Try to reproduce it, with the change i offered, and i'm almost sure,
you will see it happens.

Tom

On Thu, Oct 8, 2009 at 1:41 AM, Simon Horman <horms@xxxxxxxxxxxx> wrote:
> On Thu, Oct 08, 2009 at 09:52:11AM +1100, Simon Horman wrote:
>> On Wed, Oct 07, 2009 at 05:41:38PM +0200, Tom Rotenberg wrote:
>> > Just tried it, with xen-unstable changeset: 20249, and it also doesn't 
>> > work.
>> >
>> > When i assigned the device regularly, it was assigned to the virtual
>> > BDF: 00:04.0, and the detachment worked fine, but when i caused it to
>> > be registered on the virtual BDF 00:1b.0 - the detachment didn't
>> > work...
>> >
>> > The change i made to the qemu code to make the device to be assigned
>> > on 00:1b.0, is:
>> >
>> > diff --git a/hw/pass-through.c b/hw/pass-through.c
>> > index 8d80755..2b79812 100644
>> > --- a/hw/pass-through.c
>> > +++ b/hw/pass-through.c
>> > @@ -974,6 +974,7 @@ int insert_to_pci_devfn(char *bdf_slt)
>> >          return -1;
>> >      }
>> >
>> > +    devfn = PCI_DEVFN(0x1b,0);
>> >      return __insert_to_pci_devfn(bus, dev, func, devfn, opt);
>> >
>> >  }
>> >
>> >
>> > Can u please check if it works on your system?
>>
>> Sure, will do.
>
> Hi Tom,
>
> I'm not having any luck reproducing this problem.
> Could you check which version of qemu-xen you have,
> mine is commit "allow logdirty commands while paused (unbreaks
> 60dbe1+8f09f4)" (743edef44f1d0da792aeb38a33bf468a4596f730) of
> http://xenbits.xensource.com/git-http/qemu-xen-unstable.git
>
> I am curious to know what the value of bdf_slt and devfn
> without your modification. Could you try the following?
>
> diff --git a/hw/pass-through.c b/hw/pass-through.c
> index a97368a..4a5c016 100644
> --- a/hw/pass-through.c
> +++ b/hw/pass-through.c
> @@ -971,11 +971,15 @@ int insert_to_pci_devfn(char *bdf_slt)
>     int seg, bus, dev, func, devfn;
>     char *opt;
>
> +    PT_LOG("bdf_slt=\"%s\"\n", bdf_slt);
> +
>     if ( !parse_bdf(&bdf_slt, &seg, &bus, &dev, &func, &opt, &devfn) )
>     {
>         return -1;
>     }
>
> +    PT_LOG("devfn=0x%02x -> slot=0x%02x, func=0x%x\n",
> +           devfn, PCI_SLOT(devfn), PCI_FUNC(devfn));
>     return __insert_to_pci_devfn(bus, dev, func, devfn, opt);
>
>  }
>
>

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