Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Mar 2019 16:05:12 +1300
From:      Andrew Thompson <andy@fud.org.nz>
To:        Chuck Tuffli <chuck@freebsd.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org,  svn-src-head@freebsd.org
Subject:   Re: svn commit: r345171 - head/usr.sbin/bhyve
Message-ID:  <CAFAOGNTT_ZKCe1zs2XN6H7r-G2E%2BU77WUOrutfWshDNGOR36bQ@mail.gmail.com>
In-Reply-To: <201903150211.x2F2BSai079898@repo.freebsd.org>
References:  <201903150211.x2F2BSai079898@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 15 Mar 2019 at 15:11, Chuck Tuffli <chuck@freebsd.org> wrote:

> Author: chuck
> Date: Fri Mar 15 02:11:28 2019
> New Revision: 345171
> URL: https://svnweb.freebsd.org/changeset/base/345171
>
> Log:
>   Fix bhyve PCIe capability emulation
>
>   PCIe devices starting with version 1.1 must set the Role-Based Error
>   Reporting bit.
>
>   And while we're in the neighborhood, generalize the code assigning the
>   device type.
>
>   Reviewed by:  imp, araujo, rgrimes
>   Approved by:  imp (mentor)
>   MFC after:    1 week
>   Differential Revision: https://reviews.freebsd.org/D19580
>
> Modified:
>   head/usr.sbin/bhyve/pci_emul.c
>
> Modified: head/usr.sbin/bhyve/pci_emul.c
>
> ==============================================================================
> --- head/usr.sbin/bhyve/pci_emul.c      Fri Mar 15 02:11:27 2019
> (r345170)
> +++ head/usr.sbin/bhyve/pci_emul.c      Fri Mar 15 02:11:28 2019
> (r345171)
> @@ -953,7 +953,10 @@ pci_emul_add_pciecap(struct pci_devinst *pi, int type)
>         bzero(&pciecap, sizeof(pciecap));
>
>         pciecap.capid = PCIY_EXPRESS;
> -       pciecap.pcie_capabilities = PCIECAP_VERSION | PCIEM_TYPE_ROOT_PORT;
> +       pciecap.pcie_capabilities = PCIECAP_VERSION | type;
> +       /* Devices starting with version 1.1 must set the RBER bit */
> +       if (PCIECAP_VERSION >= 1)
> +               pciecap.dev_capabilities = PCIEM_CAP_ROLE_ERR_RPT;
>         pciecap.link_capabilities = 0x411;      /* gen1, x1 */
>         pciecap.link_status = 0x11;             /* gen1, x1 */
>

If the message you say 'set the bit' but you are overwriting the whole
variable, is this intended?


Andrew



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFAOGNTT_ZKCe1zs2XN6H7r-G2E%2BU77WUOrutfWshDNGOR36bQ>