From owner-freebsd-virtualization@freebsd.org Wed Dec 2 11:15:47 2015 Return-Path: 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 5D34FA3E182 for ; Wed, 2 Dec 2015 11:15:47 +0000 (UTC) (envelope-from g_amanakis@yahoo.com) Received: from nm19-vm5.bullet.mail.ne1.yahoo.com (nm19-vm5.bullet.mail.ne1.yahoo.com [98.138.91.241]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23C8C1B40 for ; Wed, 2 Dec 2015 11:15:46 +0000 (UTC) (envelope-from g_amanakis@yahoo.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1449054808; bh=3qi2XuWsZMI7MnPwfCOWbaWhInBnQQtLXdKRIymrW7I=; h=Subject:From:Date:To:From:Subject; b=aVC9X0peDKdvoikmCJNgkmzYUY0EcsCXV3KYm+S1ev+nd9l1WWnbdNN5linBDehiUQ5Uho1m6QgvRgfa7U0X3sWMsEPQ6R+ZWVns24F39SegjovSaxMxqw2a8WF85QbpDIueRoCjGZ80Anj2a/YHTp4CWdm9BHUtGrmgejRF+KTQcdzUDZRCEk1WjfXMifg1vZbv0TFAMlO/nl3f5dlpRNSArBgPSAiWbgfJ3Po49derWVf9VvVxkotKvdVoo/V4B9jHMFUvZatN9fV/UGs4nsnH+X0tYIjf28Ej3N85THSAEJ1dISGdjaS47qH6SggU1uYHJk7z4eXAVY77JyZkJQ== Received: from [98.138.226.176] by nm19.bullet.mail.ne1.yahoo.com with NNFMP; 02 Dec 2015 11:13:28 -0000 Received: from [98.138.226.124] by tm11.bullet.mail.ne1.yahoo.com with NNFMP; 02 Dec 2015 11:13:28 -0000 Received: from [127.0.0.1] by smtp203.mail.ne1.yahoo.com with NNFMP; 02 Dec 2015 11:13:28 -0000 X-Yahoo-Newman-Id: 949074.35217.bm@smtp203.mail.ne1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: CpN7xVsVM1k217TzwnX0RK0X8jX72N1iqfo7L6y38w0p64c VN6K0FhP6gaGQLSS2p05KMYk5Nj3VCW1w3s__dD8mgJfba9m6WaAkCBvfbi3 XFxPrb3Bb4hoIYM0Y1dFz.hzVpotgNWKmfjrHaEm9XBnyMtqSyv6V9vHxfK6 ypFG5dtTTrr.zuw44nR3mUpIX_08TV_8PgFwnb09yWQmFTpt4AheYcJhQTOc H8_7OlMcagLD.9a0gro.gtZJnGwb_L.I0nt6.QlkGsV_YAAw9vPVATs3MfLd 1UFggPL2N0DaMIPI_ybl7FMNMhMZGPGi5qkKwb0RzdiLHQl2q3MCGI8aIERt aN6qnBGPEkKwbbFN6HpgDbqKnyM3rJLVDshJabLX1nP_lHwtz1r_sjVBhCQt Zc7ir188WG01srl8psh8W_v3H6Qov4dWuXW_DlpQQ.bKx4v.1l6U.5w1.thW A9m_5lsndrFVhsC54Y1aIDfBIgyTv_j_JMfCnvmIo7DK.D9gQjwWa0cZ0FRo Nv.b4pYyDj0IMxDTosbfNKvCarALRdBy1 X-Yahoo-SMTP: 6sUo5IiswBDB2TZm6JKJ6DaI.Rsz4O0- User-Agent: K-9 Mail for Android MIME-Version: 1.0 Subject: BAR and pci passthrough From: "G. Amanakis" Date: Wed, 02 Dec 2015 12:13:25 +0100 To: freebsd-virtualization@freebsd.org Message-ID: <4F251D2F-8C0C-46FF-B5E1-D88DE84904D8@yahoo.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2015 11:15:47 -0000 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: 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 ; 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 ; Wed, 2 Dec 2015 22:54:04 +0000 (UTC) (envelope-from neelnatu@gmail.com) Received: by wmuu63 with SMTP id u63so235050538wmu.0 for ; 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: Subject: Re: BAR and pci passthrough From: Neel Natu To: "G. Amanakis" Cc: "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." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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 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"