From: Tom Rotenberg Subject: Re: Possible bug with pass-through hot-plug? Date: Thu, 15 Oct 2009 11:38:39 +0200 Message-ID: <8686c3cd0910150238h3d79d81dse8ee1ecb8f5350f2@mail.gmail.com> References: <20091009114720.GA29353@verge.net.au> <20091009120927.GA31495@verge.net.au> <8686c3cd0910090729p7f7a1c2aq482bf9c70fab0910@mail.gmail.com> <20091010014127.GB22324@verge.net.au> <8686c3cd0910110257oa841842q2ed87f6b0f5b7a35@mail.gmail.com> <20091012223616.GC9072@verge.net.au> <8686c3cd0910130208k7b9b0feva576864c9d819737@mail.gmail.com> <20091013094345.GA16712@verge.net.au> <8686c3cd0910130252m6a57388cv8b4d5211a14a4998@mail.gmail.com> <20091015093107.GA11293@verge.net.au> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <20091015093107.GA11293@verge.net.au> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Simon Horman Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Simon, i'm glad you were able to re-produce it :) About the bug, i suspect that the code in the virtual DSDT, which "checks" which device was hot-plugged, is really not efficient, as it needs to go over all sltos prior to the new assigned slot before notifying the device. This means that if the slot number is 0x14, then the 'if' clause in the dsdt, needs about 20*8=3D160 if statements before it's notifying, and this what i think is causing the problem. Especially, because the GPE interrupt is defined as level interrupt. This bug can be fixed, using one of the followings: 1. Improve the code in the virtual DSDT (e.g.: doing some sort of 'binary-search' to see which device should be notified. This will reduce the number of 'if' clause to evaluate from 160 to ~5) 2. Change the interrupt to edge interrupt, and see if it helps What do u say? Tom On Thu, Oct 15, 2009 at 11:31 AM, Simon Horman wrote: > Hi Tom, > > I have been able to produce the following behaviour using a > 32bit XP SP2 guest: > > 1. Attach to a low slot: xm ok, appears in device manager > 2. Detach =A0 =A0 =A0 =A0 =A0 =A0 =A0: xm ok, disappears from device mana= ger > > 3. Attach to a high slot: xm seems ok, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0but the device doesn't= appear in device manager > 4. Detach: =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0xm fails (time-out waiting for = response from BIOS) > > Where a high slot seems to be 8 or greater. > > This seems to be in line with the problem that you were reporting. > i > Unfortunately at this stage I'm not sure exactly how to fix it > but I suspect either: > > a) A problem the way XP is dealing with ACPI events or; > b) More likely a deficiency in the virtual BIOS that xen is supplying. > =A0 In particular, the code in tools/firmware/hvmloader/acpi/dsdt.asl > >