Commit Graph

8 Commits

Author SHA1 Message Date
Conrad Meyer
c76e96edf6 nvdimm(4): Fix Clang build after r353110
Clang spuriously warns about some well-defined C99 static initializers.
Mute it.

X-MFC-With:	r353110
2019-10-04 21:47:09 +00:00
Conrad Meyer
cbd974b4b9 nvdimm(4): Add nvdimm_e820 pseudo-bus
nvdimm_e820 is a newbus pseudo driver that looks for "legacy" e820 PRAM
spans and creates ordinary-looking SPA devfs nodes for them
(/dev/nvdimm_spaN).

As these legacy regions lack real NFIT SPA regions and namespace
definitions, they must be administratively sliced up externally using
device.hints.  This is similar in purpose to the Linux memmap= mechanism.

It is assumed that systems with working NFIT tables will not have any use
for this driver, and that that will be the prevailing style going forward,
so if there are no explicit hints provided, this driver does not
automatically create any devices.

Reviewed by:	kib (previous version)
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D21885
2019-10-04 18:38:47 +00:00
Conrad Meyer
963c89ff4e nvdimm(4): Extract ACPI root bus driver
No functional change intended.

The intent is to add a "legacy" e820 pmem newbus bus for nvdimm device in a
subsequent revision, and it's a little more clear if the parent buses get
independent source files.

Quite a lot of ACPI-specific logic is left in nvdimm.c; disentangling that
is a much larger change (and probably not especially useful).

Reviewed by:	kib
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D21813
2019-09-27 16:32:44 +00:00
Li-Wen Hsu
dac21b8d14 Fix make in sys/modules
Sponsored by:	The FreeBSD Foundation
2019-03-28 08:59:11 +00:00
Ben Widawsky
8ebb6dddb5 nvdimm: Simple namespace support
Add support for simple NVDIMM v1.2 namespaces from the UEFI
version 2.7 specification. The combination of NVDIMM regions and
labels can lead to a wide variety of namespace layouts. Here we
support a simple subset of namespaces where each NVDIMM SPA range
is composed of a single region per member dimm.

Submitted by:	D Scott Phillips <d.scott.phillips@intel.com>
Discussed with:	kib
MFC after:	1 week
Sponsored by:	Intel Corporation
Differential Revision:	https://reviews.freebsd.org/D18736
2019-02-22 19:54:28 +00:00
Konstantin Belousov
7674dce0a4 nvdimm: only enumerate present nvdimm devices
Not all child devices of the NVDIMM root device represent DIMM devices
which are present in the system. The spec says (ACPI 6.2, sec 9.20.2):

    For each NVDIMM present or intended to be supported by platform,
    platform firmware also exposes an NVDIMM device ... under the
    NVDIMM root device.

Present NVDIMM devices are found by walking all of the NFIT table's
SPA ranges, then walking the NVDIMM regions mentioned by those SPA
ranges.

A set of NFIT walking helper functions are introduced to avoid the
need to splat the enumeration logic across several disparate
callbacks.

Submitted by:	D Scott Phillips <d.scott.phillips@intel.com>
Sponsored by:	Intel Corporation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D18439
2019-01-31 22:47:04 +00:00
Bjoern A. Zeeb
ab00aff011 Fix modules/nvdimm build issues after r339391 by adding a dependency
to the SRC list.  Sort the list while changing the line.

Reported by:		ci.f.o, make -j24 buildkernel
Approved by:		re (gjb)
2018-10-18 00:51:42 +00:00
Konstantin Belousov
6db7f8e554 Add initial driver for ACPI NFIT-enumerated NVDIMMs.
Driver enumerates NVDIMMs.  Besides, for each found System Physical
Address (SPA) range, spaN geom provider is created, which allows
formatting and mounting the region as the normal volume.  Also,
/dev/nvdimm_spaN node is created, which can be read/written/mapped by
userspace, the mapping is zero-copy.

No support for block access methods implemented, labels are not
parsed.   No management interfaces are provided.

Tested by:	Intel, NetApp
Sponsored by:	The FreeBSD Foundation
Approved by:	re (gjb)
MFC after:	2 weeks
2018-10-16 20:12:35 +00:00