Date: Sat, 12 Dec 2015 14:04:17 +0100 From: "G. Amanakis" <g_amanakis@yahoo.com> To: "freebsd-virtualization@freebsd.org" <freebsd-virtualization@freebsd.org> Subject: Re: BAR and pci passthrough Message-ID: <D887B227-2518-47E8-AD70-E18C9FBF0838@yahoo.com> In-Reply-To: <CAFgRE9H0_h1Dxzjn19n6Tjc9Nt8Ze6ugWnKQiZGRV363Q1z22g@mail.gmail.com> References: <4F251D2F-8C0C-46FF-B5E1-D88DE84904D8@yahoo.com> <CAFgRE9H0_h1Dxzjn19n6Tjc9Nt8Ze6ugWnKQiZGRV363Q1z22g@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Changing #define PCIM_BAR_MEM_BASE 0xfffffffffffffff0ULL to #define PCIM_BAR_MEM_BASE 0xfffffffffffff000ULL in sys/dev/PCI/pcireg.h makes the min size of a memory BAR equal to 0x1000 or 4096 bytes and it lets me passthrough the device. Any objections to this strategy? On December 2, 2015 11:54:03 PM GMT+01:00, Neel Natu <neelnatu@gmail.com> wrote: >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" -- Sent from my Android device with K-9 Mail. Please excuse my brevity.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?D887B227-2518-47E8-AD70-E18C9FBF0838>
