Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Mar 2019 14:35:36 -0700
From:      Chuck Tuffli <chuck@freebsd.org>
To:        freebsd-virtualization@freebsd.org
Subject:   Re: emulated PCI device BAR size
Message-ID:  <CAKAYmML9jAc4WfJ8NP9iiFWY4R7DgU9SKyF_ZiNxt5FvSXQfhA@mail.gmail.com>
In-Reply-To: <CAKAYmMKd5o=f8Z5uzF6pQnZqWLzRLAL3U7iM5inuodQs92pudA@mail.gmail.com>
References:  <CAKAYmMKd5o=f8Z5uzF6pQnZqWLzRLAL3U7iM5inuodQs92pudA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Mar 18, 2019 at 10:15 AM Chuck Tuffli <chuck@freebsd.org> wrote:
>
> In debugging why Windows doesn't like bhyve's NVMe device emulation,
> another developer mentioned that the NVMe specification defines the
> minimum size of BAR[0] to be 16K bytes. And while most OS don't
> enforce this requirement, evidently, Windows does.
>
> On the surface, a "minimum BAR size" sounds odd, but the MMIO BAR in
> NVMe includes the doorbell registers for each queue. And since the
> maximum number of queues is implementation specific, there isn't a
> fixed size for the BAR.
>
> So my question is how to best fix this. The easiest would be to add a
> check to the BAR size calculation in pci_nvme.c along the lines of:
>     #define NVME_MMIO_SPACE_MIN    (1 << 14)
>     ...
>     pci_membar_sz = MAX( <calculation based on queue count>,
> NVME_MMIO_SPACE_MIN);

I went down this route and have a patch up for review
(https://reviews.freebsd.org/D19676) if anyone is interested.

--chuck



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