Skip site navigation (1)Skip section navigation (2)
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

[-- Attachment #1 --]
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 AM Corvin Köhne <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=0x0d4000 rev=0x01 hdr=0x00
> > vendor=0x8086 device=0x7560 subvendor=0x1cf8 subdevice=0x8654
> >     vendor     = 'Intel Corporation'
> >     device     = 'XMM7560 LTE Advanced Pro Modem'
> >     class      = wireless controller
> >     subclass   = 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
>


-- 
Mario.

[-- Attachment #2 --]
<div dir="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 you want. I suspect that they may fix your problem. Let me know if you want to try.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jun 14, 2024 at 8:35 AM Corvin Köhne &lt;<a href="mailto:corvink@freebsd.org">corvink@freebsd.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Thu, 2024-06-13 at 10:53 +0300, Oleksandr Kryvulia wrote:<br>
&gt;  I&#39;m trying to passthru a wwan-adapter to linux guest using<br>
&gt; sysutils/vm-bhyve-devel.<br>
&gt;  <br>
&gt;  ppt0@pci0:8:0:0:        class=0x0d4000 rev=0x01 hdr=0x00<br>
&gt; vendor=0x8086 device=0x7560 subvendor=0x1cf8 subdevice=0x8654 <br>
&gt;     vendor     = &#39;Intel Corporation&#39; <br>
&gt;     device     = &#39;XMM7560 LTE Advanced Pro Modem&#39; <br>
&gt;     class      = wireless controller <br>
&gt;     subclass   = cellular controller/modem<br>
&gt;  <br>
&gt;  The guest does not start with an error:<br>
&gt;  <br>
&gt;  bhyve: passthru device 8/0/0 BAR 2: base 0xbc201000 or size 0x100<br>
&gt; not page aligned <br>
&gt;  bhyve: failed to initialize BARs for PCI 8/0/0 <br>
&gt;  Device emulation initialization error: No such file or directory<br>
&gt;  <br>
&gt;  What I am doing wrong?<br>
&gt;   <br>
<br>
The BAR size of your device is smaller than a page. Unfortunately, you<br>
can&#39;t change it, so there&#39;s nothing you can do right now.<br>
<br>
I don&#39;t know why bhyve validates the BAR size. The commit adding this<br>
check is old [1] and doesn&#39;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="https://github.com/freebsd/freebsd-" rel="noreferrer" target="_blank">https://github.com/freebsd/freebsd-</a><br>;
src/commit/7a902ec0eccc752c9c38533ed123121eaaea1225<br>
<br>
<br>
-- <br>
Kind regards,<br>
Corvin<br>
</blockquote></div><br clear="all"><br><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature">Mario.<br></div>

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2B1FSijemDhFeGZSW0o9RL_YJZ1xPBx=PCTSZ2Na_vNKvefGtQ>