Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Jun 2024 08:35:31 +0200
From:      Corvin =?ISO-8859-1?Q?K=F6hne?= <corvink@FreeBSD.org>
To:        Oleksandr Kryvulia <shuriku@shurik.kiev.ua>, virtualization@freebsd.org
Subject:   Re: bhyve passthru problem
Message-ID:  <38c9656c26fc3cee7ba733168c0fa2cdd01209d9.camel@FreeBSD.org>
In-Reply-To: <a63589a8-2cb2-4952-83b1-7a97e2f8cd44@shurik.kiev.ua>
References:  <a63589a8-2cb2-4952-83b1-7a97e2f8cd44@shurik.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
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

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEgvRSla3m2t/H2U9G2FTaVjFeAmoFAmZr5LMACgkQ2FTaVjFe
Amqv1BAAhxkVxkbnXXiBMXJqt/ffFep1kC2pgl6+MUXEDL8omvX1vT5+8NQJ8prZ
xNg74NtYPTWrQOGCUuAimKJ0kXGjLjR3ZN54vXJhelq6o57tJg3+dDn5unj6TyHw
cp+Gjlmwi4sk9KdXjpOj+JG61gi3GNW3hrcym3WvYgP8TyCrxVEkbOPJ3o2fksXk
HWQ8yeqW5e7V7qIk5sPgorYMI+608jLzxgN+5eDwPmGteuNtgaNGD0junoX3v9Gc
NgHG4uF0rpXiE8PTeMN36rLirml7ZJoSC6ZIXez0AAgWILPspJgvuC0MRzcMLwem
mGMp5ZFiQxMUxdeIqzbs2OoX2zO3+4JDXg6O2vvsyMyNH/q3kgKFn9VPGzaL3Bn6
Imqvihl1fouj1fhNgS+x8pyzwBuUv0RAIWlkjsPlN+Ie5lR/f7CraEWHe2h5yZvc
/TRRso4P+Rf7s9gs2JnEUBkjsR/xUCzWzVaLUG65DHBAjQ6wmxgtlrySRgcE6bEr
Gr210NHDO0xjt1EwdkFqvB0+NGUDloqBqlwwIPwZ38FCm165bu8pOBkW8VtWDBxG
KAfFj0v+WU4c0PdMrhV76J3U4bL6/Z9RVdOS8iZwrS4HJTDtG6ys0DjrdQ+OkzIy
tI/PYbG0u8vzPj4QIZWizzfgRiNYKm6waxzNduCksG5xronFqak=
=1mhu
-----END PGP SIGNATURE-----

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?38c9656c26fc3cee7ba733168c0fa2cdd01209d9.camel>