Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 02 Dec 2015 12:13:25 +0100
From:      "G. Amanakis" <g_amanakis@yahoo.com>
To:        freebsd-virtualization@freebsd.org
Subject:   BAR and pci passthrough
Message-ID:  <4F251D2F-8C0C-46FF-B5E1-D88DE84904D8@yahoo.com>

next in thread | raw e-mail | index | archive | help
I am facing the following problem:
    on a X9SCM with an E3-1220Lv2 I am trying to passthrough the onboard u=
sb controllers=2E I disable the usb module from the kernel config and using=
 pptdev the controllers are assigned to ppt devices=2E However running bhyv=
e on FreeBSD 10=2E2 with:

    sudo bhyve -AI -H -P -s 0:0,hostbridge -s 1:0,lpc -s 2:0,virtio-net,ta=
p0 -s 3:0,virtio-blk,=2E/linux=2Eimg -s 4:0,passthru,0/29/0 -l com1,stdio -=
c 2 -m 2048M linuxguest=20

returns :

    passthru device 0/29/0 BAR 0: base 0xdf823000 or size 0x400 not page a=
ligned

The problem probably that the length of the bar is smaller and not aligned=
 with the pagesize=2E Could the length of the BAR be modified in order to p=
erform the pci passthrough?
--=20
Sent from my Android device with K-9 Mail=2E Please excuse my brevity=2E
From owner-freebsd-virtualization@freebsd.org  Wed Dec  2 22:54:05 2015
Return-Path: <owner-freebsd-virtualization@freebsd.org>
Delivered-To: freebsd-virtualization@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3DA88A3FCEC
 for <freebsd-virtualization@mailman.ysv.freebsd.org>;
 Wed,  2 Dec 2015 22:54:05 +0000 (UTC)
 (envelope-from neelnatu@gmail.com)
Received: from mail-wm0-x22e.google.com (mail-wm0-x22e.google.com
 [IPv6:2a00:1450:400c:c09::22e])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id CE4401E5E
 for <freebsd-virtualization@freebsd.org>; Wed,  2 Dec 2015 22:54:04 +0000 (UTC)
 (envelope-from neelnatu@gmail.com)
Received: by wmuu63 with SMTP id u63so235050538wmu.0
 for <freebsd-virtualization@freebsd.org>; Wed, 02 Dec 2015 14:54:03 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:in-reply-to:references:date:message-id:subject:from:to
 :cc:content-type;
 bh=fg7Se6nqdfT2EKM18lzYTYSWNeJoFXARCn6JdtdHshI=;
 b=OXCGKfmub/TW3ieFcFyOrhd9qmtsqoLL7s2ol4Yi565aYevMNC1DenntsVQ8DnQiLb
 Uf0djQqdOeLJNBwwmOem2hy7AzlqvT8XTW9V6X1OotAc77KTalGCmUiRclzgp765zQVq
 24lmD0jyeYWPvIyyUdA2/YLiuOj69awx4OjN+U/6HHfoJJeQVEZYNbuAO7Elt3sguY0D
 nWX6IdPnc7IDpZQYRuqgPH7INg19/1XDA17XqqU16UkBS2mb5U8u3DLNrZl0mhFiyXD0
 /95cCsFkuIRERLnDSRZgQLzaQjfGO68EtBchq1XGML1UWsXBOTImWY/jH57LdezNf1Ee
 u/2Q==
MIME-Version: 1.0
X-Received: by 10.28.129.82 with SMTP id c79mr9091189wmd.80.1449096843064;
 Wed, 02 Dec 2015 14:54:03 -0800 (PST)
Received: by 10.27.172.77 with HTTP; Wed, 2 Dec 2015 14:54:03 -0800 (PST)
In-Reply-To: <4F251D2F-8C0C-46FF-B5E1-D88DE84904D8@yahoo.com>
References: <4F251D2F-8C0C-46FF-B5E1-D88DE84904D8@yahoo.com>
Date: Wed, 2 Dec 2015 14:54:03 -0800
Message-ID: <CAFgRE9H0_h1Dxzjn19n6Tjc9Nt8Ze6ugWnKQiZGRV363Q1z22g@mail.gmail.com>
Subject: Re: BAR and pci passthrough
From: Neel Natu <neelnatu@gmail.com>
To: "G. Amanakis" <g_amanakis@yahoo.com>
Cc: "freebsd-virtualization@freebsd.org" <freebsd-virtualization@freebsd.org>
Content-Type: text/plain; charset=UTF-8
X-BeenThere: freebsd-virtualization@freebsd.org
X-Mailman-Version: 2.1.20
Precedence: list
List-Id: "Discussion of various virtualization techniques FreeBSD supports."
 <freebsd-virtualization.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/freebsd-virtualization>, 
 <mailto:freebsd-virtualization-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-virtualization/>;
List-Post: <mailto:freebsd-virtualization@freebsd.org>
List-Help: <mailto:freebsd-virtualization-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization>, 
 <mailto:freebsd-virtualization-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 02 Dec 2015 22:54:05 -0000

On Wed, Dec 2, 2015 at 3:13 AM, G. Amanakis via freebsd-virtualization
<freebsd-virtualization@freebsd.org> wrote:
> I am facing the following problem:
>     on a X9SCM with an E3-1220Lv2 I am trying to passthrough the onboard usb controllers. I disable the usb module from the kernel config and using pptdev the controllers are assigned to ppt devices. However running bhyve on FreeBSD 10.2 with:
>
>     sudo bhyve -AI -H -P -s 0:0,hostbridge -s 1:0,lpc -s 2:0,virtio-net,tap0 -s 3:0,virtio-blk,./linux.img -s 4:0,passthru,0/29/0 -l com1,stdio -c 2 -m 2048M linuxguest
>
> returns :
>
>     passthru device 0/29/0 BAR 0: base 0xdf823000 or size 0x400 not page aligned
>
> The problem probably that the length of the bar is smaller and not aligned with the pagesize. Could the length of the BAR be modified in order to perform the pci passthrough?

Yes, that's correct - the size of the BAR is not a multiple of the
page size which leads to the error. If this BAR is mapped into the
guest's address space then it will "leak" an additional 3K into the
guest (since the minimum nested mapping is 4KB in size).

It is hard to fix this in the general case if you want to truly
passthrough the BAR to the guest.

best
Neel

> --
> Sent from my Android device with K-9 Mail. Please excuse my brevity.
> _______________________________________________
> freebsd-virtualization@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
> To unsubscribe, send any mail to "freebsd-virtualization-unsubscribe@freebsd.org"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4F251D2F-8C0C-46FF-B5E1-D88DE84904D8>