Date: Fri, 14 Jun 2024 09:27:18 +0200 From: Mario Marietto <marietto2008@gmail.com> To: =?UTF-8?Q?Corvin_K=C3=B6hne?= <corvink@freebsd.org> Cc: Oleksandr Kryvulia <shuriku@shurik.kiev.ua>, virtualization@freebsd.org Subject: Re: bhyve passthru problem Message-ID: <CA%2B1FSijemDhFeGZSW0o9RL_YJZ1xPBx=PCTSZ2Na_vNKvefGtQ@mail.gmail.com> In-Reply-To: <38c9656c26fc3cee7ba733168c0fa2cdd01209d9.camel@FreeBSD.org> References: <a63589a8-2cb2-4952-83b1-7a97e2f8cd44@shurik.kiev.ua> <38c9656c26fc3cee7ba733168c0fa2cdd01209d9.camel@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000d6a81d061ad48d75 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Oleksandr,I would like to try an experiment to try to fix your problem. If you agree,I could send you my bhyve and vmm.ko files,if you want. I suspect that they may fix your problem. Let me know if you want to try. On Fri, Jun 14, 2024 at 8:35=E2=80=AFAM Corvin K=C3=B6hne <corvink@freebsd.= org> wrote: > On Thu, 2024-06-13 at 10:53 +0300, Oleksandr Kryvulia wrote: > > I'm trying to passthru a wwan-adapter to linux guest using > > sysutils/vm-bhyve-devel. > > > > ppt0@pci0:8:0:0: class=3D0x0d4000 rev=3D0x01 hdr=3D0x00 > > vendor=3D0x8086 device=3D0x7560 subvendor=3D0x1cf8 subdevice=3D0x8654 > > vendor =3D 'Intel Corporation' > > device =3D 'XMM7560 LTE Advanced Pro Modem' > > class =3D wireless controller > > subclass =3D cellular controller/modem > > > > The guest does not start with an error: > > > > bhyve: passthru device 8/0/0 BAR 2: base 0xbc201000 or size 0x100 > > not page aligned > > bhyve: failed to initialize BARs for PCI 8/0/0 > > Device emulation initialization error: No such file or directory > > > > What I am doing wrong? > > > > The BAR size of your device is smaller than a page. Unfortunately, you > can't change it, so there's nothing you can do right now. > > I don't know why bhyve validates the BAR size. The commit adding this > check is old [1] and doesn't explain it. What bhyve could do is > rounding up the BAR size to a full page size when allocating memory for > the BAR. > > [1] https://github.com/freebsd/freebsd- > src/commit/7a902ec0eccc752c9c38533ed123121eaaea1225 > > > -- > Kind regards, > Corvin > --=20 Mario. --000000000000d6a81d061ad48d75 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">Oleksandr,I would like to try an experiment to try to fix = your problem. If you agree,I could send you my bhyve and vmm.ko files,if yo= u want. I suspect that they may fix your problem. Let me know if you want t= o try.<br></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gm= ail_attr">On Fri, Jun 14, 2024 at 8:35=E2=80=AFAM Corvin K=C3=B6hne <<a = href=3D"mailto:corvink@freebsd.org">corvink@freebsd.org</a>> wrote:<br><= /div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;bo= rder-left:1px solid rgb(204,204,204);padding-left:1ex">On Thu, 2024-06-13 a= t 10:53 +0300, Oleksandr Kryvulia wrote:<br> > =C2=A0I'm trying to passthru a wwan-adapter to linux guest using<b= r> > sysutils/vm-bhyve-devel.<br> > =C2=A0<br> > =C2=A0ppt0@pci0:8:0:0: =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0class= =3D0x0d4000 rev=3D0x01 hdr=3D0x00<br> > vendor=3D0x8086 device=3D0x7560 subvendor=3D0x1cf8 subdevice=3D0x8654 = <br> > =C2=A0=C2=A0=C2=A0=C2=A0vendor =C2=A0=C2=A0=C2=A0=C2=A0=3D 'Intel = Corporation' <br> > =C2=A0=C2=A0=C2=A0=C2=A0device =C2=A0=C2=A0=C2=A0=C2=A0=3D 'XMM756= 0 LTE Advanced Pro Modem' <br> > =C2=A0=C2=A0=C2=A0=C2=A0class =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=3D wirele= ss controller <br> > =C2=A0=C2=A0=C2=A0=C2=A0subclass =C2=A0=C2=A0=3D cellular controller/m= odem<br> > =C2=A0<br> > =C2=A0The guest does not start with an error:<br> > =C2=A0<br> > =C2=A0bhyve: passthru device 8/0/0 BAR 2: base 0xbc201000 or size 0x10= 0<br> > not page aligned <br> > =C2=A0bhyve: failed to initialize BARs for PCI 8/0/0 <br> > =C2=A0Device emulation initialization error: No such file or directory= <br> > =C2=A0<br> > =C2=A0What I am doing wrong?<br> > =C2=A0=C2=A0<br> <br> The BAR size of your device is smaller than a page. Unfortunately, you<br> can't change it, so there's nothing you can do right now.<br> <br> I don't know why bhyve validates the BAR size. The commit adding this<b= r> check is old [1] and doesn't explain it. What bhyve could do is<br> rounding up the BAR size to a full page size when allocating memory for<br> the BAR.<br> <br> [1] <a href=3D"https://github.com/freebsd/freebsd-" rel=3D"noreferrer" targ= et=3D"_blank">https://github.com/freebsd/freebsd-</a><br> src/commit/7a902ec0eccc752c9c38533ed123121eaaea1225<br> <br> <br> -- <br> Kind regards,<br> Corvin<br> </blockquote></div><br clear=3D"all"><br><span class=3D"gmail_signature_pre= fix">-- </span><br><div dir=3D"ltr" class=3D"gmail_signature">Mario.<br></d= iv> --000000000000d6a81d061ad48d75--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2B1FSijemDhFeGZSW0o9RL_YJZ1xPBx=PCTSZ2Na_vNKvefGtQ>