Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Jun 2024 10:14:35 +0300
From:      Oleksandr Kryvulia <shuriku@shurik.kiev.ua>
To:        virtualization@freebsd.org
Subject:   Re: bhyve passthru problem
Message-ID:  <e4eff810-44ff-4427-92cf-4cb660948dd9@shurik.kiev.ua>
In-Reply-To: <CA%2B1FSijemDhFeGZSW0o9RL_YJZ1xPBx=PCTSZ2Na_vNKvefGtQ@mail.gmail.com>
References:  <a63589a8-2cb2-4952-83b1-7a97e2f8cd44@shurik.kiev.ua> <38c9656c26fc3cee7ba733168c0fa2cdd01209d9.camel@FreeBSD.org> <CA%2B1FSijemDhFeGZSW0o9RL_YJZ1xPBx=PCTSZ2Na_vNKvefGtQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------KilYgKZ0T86fPkH2U738yvWL
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

I can try your files or better a patch against current.
Thank you, Mario.

14.06.24 10:27, Mario Marietto:
> 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.

--------------KilYgKZ0T86fPkH2U738yvWL
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    I can try your files or better a patch against current.<br>
    Thank you, Mario.  <br>
    <br>
    <div class="moz-cite-prefix">14.06.24 10:27, Mario Marietto:<br>
    </div>
    <blockquote type="cite"
cite="mid:CA+1FSijemDhFeGZSW0o9RL_YJZ1xPBx=PCTSZ2Na_vNKvefGtQ@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <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"
            moz-do-not-send="true" class="moz-txt-link-freetext">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'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     = 'Intel Corporation' <br>
          &gt;     device     = 'XMM7560 LTE Advanced Pro Modem' <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'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<br>
          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="https://github.com/freebsd/freebsd-"
            rel="noreferrer" target="_blank" moz-do-not-send="true"
            class="moz-txt-link-freetext">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>
    </blockquote>
    <br>
  </body>
</html>

--------------KilYgKZ0T86fPkH2U738yvWL--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?e4eff810-44ff-4427-92cf-4cb660948dd9>