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=2Eh makes the min size of a memory BAR equal to 0x1000 = or 4096 bytes and it lets me passthrough the device=2E Any objections to th= is strategy? On December 2, 2015 11:54:03 PM GMT+01:00, Neel Natu <neelnatu@gmail=2Ecom= > wrote: >On Wed, Dec 2, 2015 at 3:13 AM, G=2E Amanakis via freebsd-virtualization ><freebsd-virtualization@freebsd=2Eorg> wrote: >> I am facing the following problem: >> on a X9SCM with an E3-1220Lv2 I am trying to passthrough the >onboard usb controllers=2E I disable the usb module from the kernel >config and using pptdev the controllers are assigned to ppt devices=2E >However running bhyve on FreeBSD 10=2E2 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,=2E/linux=2Eimg -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=2E 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=2E 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)=2E > >It is hard to fix this in the general case if you want to truly >passthrough the BAR to the guest=2E > >best >Neel > >> -- >> Sent from my Android device with K-9 Mail=2E Please excuse my brevity= =2E >> _______________________________________________ >> freebsd-virtualization@freebsd=2Eorg mailing list >> https://lists=2Efreebsd=2Eorg/mailman/listinfo/freebsd-virtualization >> To unsubscribe, send any mail to >"freebsd-virtualization-unsubscribe@freebsd=2Eorg" --=20 Sent from my Android device with K-9 Mail=2E Please excuse my brevity=2E
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?D887B227-2518-47E8-AD70-E18C9FBF0838>