From owner-freebsd-emulation@FreeBSD.ORG Tue Sep 11 12:32:27 2012 Return-Path: Delivered-To: emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 599BE106566C for ; Tue, 11 Sep 2012 12:32:27 +0000 (UTC) (envelope-from decke@bluelife.at) Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id D03FB8FC0A for ; Tue, 11 Sep 2012 12:32:26 +0000 (UTC) Received: by wgbds11 with SMTP id ds11so360288wgb.31 for ; Tue, 11 Sep 2012 05:32:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bluelife.at; s=google; h=mime-version:sender:x-originating-ip:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=6U8Onwhz0dUKuWWh/W3+uZWwDC3rQVd1K1Yx3bNlH2Y=; b=B8l6f0RiY+2H1wB2RiS0l1pdsLpbkoOSIGfb3vqiAmlniO9jn5BoREEm8PgKfD2jAL UBw7jhQ8LNObPDudwDYc4aEpaO6s4AObds810tCKAxbgY19Go6xwAe6aRtvx5jfyESed T25uUJT490kni9XGDM7vtrWsjKHP2TQyb8Rr0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:x-originating-ip:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding:x-gm-message-state; bh=6U8Onwhz0dUKuWWh/W3+uZWwDC3rQVd1K1Yx3bNlH2Y=; b=I9xJL3lX0LzMbR0I5tCRW9KIKcrCMQWjDsf2k78ZoxMXOEWIfq/MWD6YYeYJt62/ZD YaBZMWOGe5o0RyTaLXEsHqnQeuuLkgMTTTAlqARLsBXiKgbuRHs2D7X8c1zViVkAou6u hKtowUX6wblX+hROF0KTNxXC9v7B2uB19Hrl2g9dNVHNqtReOktaK7YbC7XJ5TD99zzr djSyz9xkzaljQYSQN/dbA/Qh04gcYDSqAprP1SqVJ6cj05zlgWLqZ8us2vt6z3O1NHZX bOsvM1hjdUTvOJfVwsFxF1NREoCJ77JjrgWFbKTt7Yu2IjI1lOz8yPUp76WMc0SeofWn gfwQ== MIME-Version: 1.0 Received: by 10.216.131.13 with SMTP id l13mr9991593wei.195.1347366231692; Tue, 11 Sep 2012 05:23:51 -0700 (PDT) Sender: decke@bluelife.at Received: by 10.180.90.15 with HTTP; Tue, 11 Sep 2012 05:23:51 -0700 (PDT) X-Originating-IP: [80.123.233.199] In-Reply-To: <504916C5.7070302@entel.upc.edu> References: <50449030.1010206@entel.upc.edu> <504916C5.7070302@entel.upc.edu> Date: Tue, 11 Sep 2012 14:23:51 +0200 X-Google-Sender-Auth: mR1xgIpyQYN8-PeHC25WgILy1xk Message-ID: From: =?ISO-8859-1?Q?Bernhard_Fr=F6hlich?= To: =?ISO-8859-1?Q?Gustau_P=E9rez_i_Querol?= Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQmpld9JECDjUa0ZSYmodwHIfdoV+eAkhv2gdXHF6d3NPp4KyxM2klCLlb2fv5bcivBEsKRW Cc: emulation@freebsd.org Subject: Re: Fix ich9 bios to correctly configure pci bridge1 and pci bridge2 X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Sep 2012 12:32:27 -0000 On Thu, Sep 6, 2012 at 11:33 PM, Gustau P=E9rez i Querol wrote: > On 03/09/2012 13:10, Gustau P=E9rez i Querol wrote: >> >> >> The upcoming 4.2.0 release of virtualbox allows to plug more than 8 >> network adapter to a guest. >> >> When testing that kind of setup I noticed FreeBSD (stable or head, it >> doesn't matter) is unable to map more than 8 cards. It appears that the >> ninth (and so on) get connected to the pci bus 1. >> >> The output of a guest FreeBSD machine shows this: >> >> ************* >> pcib1: at device 24.0 on pci0 >> pcib1: domain 0 >> pcib1: secondary bus 1 >> pcib1: subordinate bus 2 >> pcib1: no prefetched decode >> pcib1: Subtractively decoded bridge. >> pci1: on pcib1 >> pci1: domain=3D0, physical bus=3D1 >> pcib2: at device 25.0 on pci0 >> pcib0: allocated type 4 (0xe000-0xefff) for rid 1c of pcib2 >> pcib0: allocated type 3 (0xf0a00000-0xf0afffff) for rid 20 of pcib2 >> pcib2: domain 0 >> pcib2: secondary bus 2 >> pcib2: subordinate bus 3 >> pcib2: I/O decode 0xe000-0xefff >> pcib2: memory decode 0xf0a00000-0xf0afffff >> pcib2: no prefetched decode >> pcib2: Subtractively decoded bridge. >> pci2: on pcib2 >> pci2: domain=3D0, physical bus=3D2 >> ********************* >> >> The topology the developers of vbox try to build is this: >> >> >> ----------------------------------------------------------- pci bus 0 >> | | >> ___ |______ _____|____ >> | | | | >> | Bridge1 | | Bridge2 | >> |_________| |_________| >> | | >> ----------- pci bus 1 ------------ pci bus 2 >> >> >> >> The problem is that the pci bridge1 connects the bus0 to the bus1 and >> thus the primary bus would 0; the secondary would the 1 because the bus = 1 >> doesn't >> connect any other bus through any other bridge then its subordinate must >> be also 1. The pci bridge1 connects the pci bus 0 with the pci bus 2; th= e >> primary must be 0 and the secondary and subordinate must be 2: >> >> The vbox programmers set the subordinate bus of bridge1 to 2 and th= e >> subordinate of bridge2 to 3 (which is incorrect). At pci_pci.c we can ad= d >> quirks to circumvent this (we can't change real hardware) but in this ca= se >> we can change the hardware. >> >> I'm attaching the patch that changes the behavior of vbox. The outpu= t >> of FreeBSD virtual machine with the modified 'hardware' is this: >> >> ************* >> pcib1: at device 24.0 on pci0 >> pcib1: domain 0 >> pcib1: secondary bus 1 >> pcib1: subordinate bus 1 >> pcib1: no prefetched decode >> pcib1: Subtractively decoded bridge. >> pci1: on pcib1 >> pci1: domain=3D0, physical bus=3D1 >> pcib2: at device 25.0 on pci0 >> pcib0: allocated type 4 (0xe000-0xefff) for rid 1c of pcib2 >> pcib0: allocated type 3 (0xf0a00000-0xf0afffff) for rid 20 of pcib2 >> pcib2: domain 0 >> pcib2: secondary bus 2 >> pcib2: subordinate bus 2 >> pcib2: I/O decode 0xe000-0xefff >> pcib2: memory decode 0xf0a00000-0xf0afffff >> pcib2: no prefetched decode >> pcib2: Subtractively decoded bridge. >> pci2: on pcib2 >> pci2: domain=3D0, physical bus=3D2 >> ********************* >> >> Which is what should be according to the simple topology of the buses >> and bridges. It works as it should. I hope I did not say anything wrong. > > > Looks like the mailing list ate the attachment. I can be downloaded he= re: > > http://www-entel.upc.edu/gus/patch-src-VBox-Devices-Bus-DevPciIch9.cpp > > Best, > > Gustau > > -- > -------------------------------------------------------------------------= -- > Prou top-posting : http://ca.wikipedia.org/wiki/Top-posting > Stop top-posting : http://en.wikipedia.org/wiki/Posting_style > > O O O Gustau P=E9rez i Querol > O O O Departament d'Enginyeria Telem=E0tica > O O O Universitat Polit=E8cnica de Catalunya > Edifici C3 - Despatx S101-B > UPC Campus Nord UPC > C/ Jordi Girona, 1-3 > 08034 - Barcelona > > _______________________________________________ > freebsd-emulation@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-emulation > To unsubscribe, send any mail to "freebsd-emulation-unsubscribe@freebsd.o= rg" Thanks to avg@ who got my attention on that report. I just committed the patch to our devel repository and will see what upstream thinks about that. http://redports.org/changeset/6948 --=20 Bernhard Froehlich http://www.bluelife.at/