From owner-freebsd-virtualization@freebsd.org Tue May 22 19:43:19 2018 Return-Path: Delivered-To: freebsd-virtualization@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D28EEAD792 for ; Tue, 22 May 2018 19:43:19 +0000 (UTC) (envelope-from neelnatu@gmail.com) Received: from mail-io0-x236.google.com (mail-io0-x236.google.com [IPv6:2607:f8b0:4001:c06::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B63AF86917 for ; Tue, 22 May 2018 19:43:18 +0000 (UTC) (envelope-from neelnatu@gmail.com) Received: by mail-io0-x236.google.com with SMTP id z4-v6so19922680iof.5 for ; Tue, 22 May 2018 12:43:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=fH3KzzYE+SJ/Z4W4Hm19Ap5QUAwN1YXK6lWdgGdWNk0=; b=F6g/ycb000IJgoVuIWaCx3Nec7PzPMLEKo/KX64y9l0ytlAFrjKeknfdeLDod77rZp yKya4Wmj5uT5iDxc9iMN/xWtsqES5sUvwWdHWnuqKsOvw85yXOM8frRPLUnKGajQoU0x tsWSB+5FNkSJfoSWSrBCj58PpJHJfR0hCKC8Ld/WHKQV8koK9AaReauBnZazJGT6LTZO GT97AAqJr1FuFihlIhLLHMCZryHguP1KesC4pqpANj26KE6GJ0UDaaCNYp9wGWRdu0iO iT1Y0M1LNcECupUJsVjsYMu2Jr/7N5dC7d+y1sNPXppcXh15lpD8ZTCgVNdFVJY/iNIc ipbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=fH3KzzYE+SJ/Z4W4Hm19Ap5QUAwN1YXK6lWdgGdWNk0=; b=jglU6wReUJaPc0U4m0KQYiDltiVk6zGwY4dsjaGL+Bfs+ENooRxbDEJ4UKqQnDJMN8 vcWSsFCzjXBKKDkRuzlw1em4D67BUQis7Qf2YAlBvBx3ux+0XjZh3bMEkgBca3voaN6Q 8FLKHe8bsOKpdAz478h0nUfdb5vGPVvNTD5vFp8APWh8QGDM28iPY0+hwQL+VxIsiJbZ qX5EbJz0rIIlvxwDg3bAc9N/DB1VtUGhO92j1lxSQIqL8QMf9sintM7xGf7zQijUbq6/ Q4+Ekp+j585lxe7Uz6DjhTRh1c4/ZRztwSJCQ07NX5JLigOfiaSyqXBuCoJKUNjKt+ez C7jw== X-Gm-Message-State: ALKqPwchayLreWmjDl4gREVhnEpED1HF6/bGOdwvu6PsgnZInArLRpxL 7f7JAOOIjENM0Gq7It9Qsi2bbzLGZ1w8/7XxhPeIZA== X-Google-Smtp-Source: AB8JxZoFTpsiWmsCb4sQaXqM0TF8PUkW0X5KrAeF7AuYCPgCBrGm2QySPPx/pwInfffsNIQPWJ0ucT0s+IwmAE3aNfc= X-Received: by 2002:a6b:b9c6:: with SMTP id j189-v6mr1811569iof.230.1527018198112; Tue, 22 May 2018 12:43:18 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:7145:0:0:0:0:0 with HTTP; Tue, 22 May 2018 12:43:17 -0700 (PDT) In-Reply-To: References: <7167ea46-ee07-8ffa-615e-0f3d3eb92e64@palmen-it.de> From: Neel Natu Date: Tue, 22 May 2018 12:43:17 -0700 Message-ID: Subject: Re: bhyve: passthrough of PCIe device without MSI possible? To: Mario Lobo Cc: Felix Palmen , "freebsd-virtualization@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2018 19:43:19 -0000 On Sun, May 20, 2018 at 12:04 PM, Mario Lobo wrote: > Hi Felix; > > I had the same impression and I was attempting to do the same with no > success. > > Have you managed to make it work? > > 2018-05-11 12:26 GMT-03:00 Felix Palmen : > >> I have the following PCIe card on a host running 11.1-RELEASE: >> >> | ppt0@pci0:5:0:0: class=0x078000 card=0x00011b74 chip=0x08101b74 >> rev=0x14 hdr=0x00 >> | vendor = 'OpenVox Communication Co. Ltd.' >> | class = simple comms >> >> it doesn't support MSI according to `pciconf -lbc`: >> >> | ppt0@pci0:5:0:0: class=0x078000 card=0x00011b74 chip=0x08101b74 >> rev=0x14 hdr=0x00 >> | bar [10] = type Memory, range 32, base 0xdfe00000, size 524288, >> enabled >> >> Trying to pass this card to a guest using `vm-bhyve` gives me the >> following in `bhyve.log`: >> >> | bhyve: failed to initialize MSI for PCI 5/0/0 >> >> and this in `vm-byve.log`: >> >> | [bhyve options: -c 2 -m 2G -Hwl bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd >> -U 9f2546f5-5464-11e8-8b52-d05099c0f275 -S] >> | [bhyve devices: -s 0,hostbridge -s 31,lpc -s >> 4:0,virtio-blk,/dev/zvol/zroot/vm/pbx/disk0 -s >> 5:0,virtio-net,tap2,mac=58:9c:fc:00:d7:6b -s 6:0,passthru,5/0/0 -s >> 7:0,fbuf,tcp=0.0.0.0:5900] >> | [bhyve console: -l com1,/dev/nmdm0A] >> | [bhyve iso device: -s 3:0,ahci-cd,/var/vm/.config/null.iso] >> | starting bhyve (run 1) >> | bhyve exited with status 1 >> >> Now .. is it actually possible to pass such a device to a bhyve guest? >> From the code comment here: >> > ve/pci_passthru.c#L257> >> I assumed MSI would be "emulated" if necessary? >> I suspect that your PCI device does not advertise the capabilities bit in its status register. MSI emulation depends on this bit being set: https://github.com/freebsd/freebsd/blob/master/usr.sbin/bhyve/pci_passthru.c#L263 I can't see any reason this wouldn't work by emulating that bit and the capabilities pointer in config space. best Neel >> TIA, Felix >> >> -- >> Dipl.-Inform. Felix Palmen ,.//.......... >> {web} http://palmen-it.de {jabber} [see email] ,//palmen-it.de >> {pgp public key} http://palmen-it.de/pub.txt // """"""""""" >> {pgp fingerprint} ED9B 62D0 BE39 32F9 2488 5D0C 8177 9D80 5ECF F683 >> _______________________________________________ >> freebsd-virtualization@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization >> To unsubscribe, send any mail to "freebsd-virtualization-unsubs >> cribe@freebsd.org" >> > > > > -- > Mario Lobo > http://www.mallavoodoo.com.br > FreeBSD since version 2.2.8 [not Pro-Audio.... YET!!] > _______________________________________________ > freebsd-virtualization@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization > To unsubscribe, send any mail to "freebsd-virtualization-unsubscribe@freebsd.org"