aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/nvdimm
Commit message (Collapse)AuthorAgeFilesLines
* nvdimm: Use a bus_child_deleted method to free ivars for childrenJohn Baldwin2024-11-301-8/+8
| | | | | | | Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47363 (cherry picked from commit 5c7af84925aa0916983551b0d470b461a70c0f1f)
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-236-12/+0
| | | | | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/ Similar commit in current: (cherry picked from commit 685dc743dc3b)
* sys: Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-231-2/+0
| | | | | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/ Similar commit in current: (cherry picked from commit 95ee2897e98f)
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-07-251-1/+1
| | | | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix (cherry picked from commit 4d846d260e2b9a3d4d0a701462568268cbfe7a5b)
* nvdimm_e820: Use driver->name in identify method.John Baldwin2022-05-191-5/+5
| | | | | | | Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D35077 (cherry picked from commit 216ca4cee1189ce1dd38b293c9dd431eb5ff8b02)
* nvdimm(4): Export NVDIMM health flags via sysctlRavi Pokala2021-02-213-1/+77
| | | | | | | | | | | | | | | | | | The ACPI NFIT specification defines a set of "NVDIMM State Flags". These flags are already reported by `acpidump -t', but this change makes them available on a per-device basis, in a format that is more easily parsed. To simplify this, introduce acpi_nfit_get_memory_maps_by_dimm(), which locates the (ACPI_NFIT_MEMORY_MAP)s associated with a given (nfit_handle_t). Reviewed by: mav, cem Tested by: mav, rpokala (version for stable/12) MFC after: 3 days Sponsored by: Panasas Differential Revision: https://reviews.freebsd.org/D28700 (cherry picked from commit bdde49b7c7232c6936525f84ffb90856a7cd8e74)
* kernel: provide panicky version of __unreachableKyle Evans2020-05-131-1/+2
| | | | | | | | | | | | | | | | | | | | | __builtin_unreachable doesn't raise any compile-time warnings/errors on its own, so problems with its usage can't be easily detected. While it would be nice for this situation to change and compilers to at least add a warning for trivial cases where local state means the instruction can't be reached, this isn't the case at the moment and likely will not happen. This commit adds an __assert_unreachable, whose intent is incredibly clear: it asserts that this instruction is unreachable. On INVARIANTS builds, it's a panic(), and on non-INVARIANTS it expands to __unreachable(). Existing users of __unreachable() are converted to __assert_unreachable, to improve debuggability if this assumption is violated. Reviewed by: mjg Differential Revision: https://reviews.freebsd.org/D23793 Notes: svn path=/head/; revision=361011
* Use atomic for start_count in devstat_start_transaction().Alexander Motin2019-12-302-6/+0
| | | | | | | | | | | Combined with earlier nstart/nend removal it allows to remove several locks from request path of GEOM and few other places. It would be cool if we had more SMP-friendly statistics, but this helps too. Sponsored by: iXsystems, Inc. Notes: svn path=/head/; revision=356200
* nvdimm(4): Fix various problems when the using the second label index blockD Scott Phillips2019-11-121-11/+23
| | | | | | | | | | | | | | | struct nvdimm_label_index is dynamically sized, with the `free` bitfield expanding to hold `slot_cnt` entries. Fix a few places where we were treating the struct as though it had a fixed sized. Reviewed by: cem Approved by: scottl (mentor) MFC after: 1 week Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D22253 Notes: svn path=/head/; revision=354648
* nvdimm(4): Only expose namespaces for accessible data SPAsD Scott Phillips2019-11-123-1/+13
| | | | | | | | | | | | | | | Apply the same user accessible filter to namespaces as is applied to full-SPA devices. Also, explicitly filter out control region SPAs which don't expose the nvdimm data area. Reviewed by: cem Approved by: scottl (mentor) MFC after: 1 week Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D21987 Notes: svn path=/head/; revision=354645
* nvdimm(4): Persist unit numbers in cdevConrad Meyer2019-10-183-4/+5
| | | | | | | | | | | | They're formatted into the device name like unit numbers, anyway; store the number in mda_unit => si_drv0 like dev2unit() expects. No functional change intended. Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=353740
* nvdimm_e820: Fix braino in size=all SPA hintConrad Meyer2019-10-181-2/+2
| | | | | | | | | | | The sentinel value for "use the rest of the region," -1, isn't zero modulo PAGE_SIZE. Relax the check to permit the intended special value. X-MFC-With: r353110 Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=353714
* nvdimm(4): Calculate and save memattr once; it never changesConrad Meyer2019-10-103-12/+14
| | | | | | | | | | | | | | Refactor nvdimm_spa_memattr() routine and callers to just save the value at initialization and use the value directly. The reference value from NFIT, MemoryMapping, is read only once, so the associated memattr could never change. No functional change. Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=353417
* nvdimm(4): Add nvdimm_e820 pseudo-busConrad Meyer2019-10-043-0/+408
| | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=353110
* nvdimm: Fix error path mis-freeConrad Meyer2019-10-021-1/+1
| | | | | | | | | | | | | Regression introduced in r343629 when malloc result was renamed from spa to spa_mapping and the 'spa' name was instead used to iterate a table, but the free() target was not updated. Reviewed by: kib, scottph Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D21871 Notes: svn path=/head/; revision=353020
* nvdimm(4): Extract ACPI root bus driverConrad Meyer2019-09-273-225/+288
| | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=352798
* Don't set the string "unknown" as a device's location_strD Scott Phillips2019-08-191-1/+1
| | | | | | | | | | | | | | | Return an empty string when the location is unknown instead of the string "unknown". This ensures that all location entries are of the form key=val. Suggested by: imp Approved by: jhb (mentor) MFC after: 1 week Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D21326 Notes: svn path=/head/; revision=351225
* nvdimm: Provide nvdimm location informationD Scott Phillips2019-06-061-0/+19
| | | | | | | | | | | | | | Provide the acpi handle path as the location string for the nvdimm children of the nvdimm_root device. Reviewed by: kib Approved by: jhb (mentor) MFC after: 1 week Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D20528 Notes: svn path=/head/; revision=348757
* zero inputs to vm_page_initfake() for predictable resultsTycho Nightingale2019-05-061-1/+2
| | | | | | | | | | Reviewed by: kib Submitted by: Anton Rang <rang at acm.org> Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20162 Notes: svn path=/head/; revision=347168
* nvdimm: Simple namespace supportBen Widawsky2019-02-223-0/+108
| | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=344476
* nvdimm: Read NVDIMM namespace labelsBen Widawsky2019-02-222-0/+295
| | | | | | | | | | | | | | | When attaching to NVDIMM devices, read and verify the namespace labels from the special namespace label storage area. A later change will expose NVDIMM namespaces derived from this label data. 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/D18735 Notes: svn path=/head/; revision=344475
* nvdimm: split spa dev into a separate entityBen Widawsky2019-02-222-140/+205
| | | | | | | | | | | | | | | | Separate code for exposing a device backed by a system physical address range away from the NVDIMM spa code. This will allow a future patch to add support for NVDIMM namespaces while using the same device code. Submitted by: D Scott Phillips <d.scott.phillips@intel.com> Reviewed by: bwidawsk MFC after: 1 week Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D18736 Notes: svn path=/head/; revision=344474
* nvdimm: only enumerate present nvdimm devicesKonstantin Belousov2019-01-313-150/+303
| | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=343629
* nvdimm: enumerate NVDIMM SPA ranges from the root deviceKonstantin Belousov2019-01-313-111/+60
| | | | | | | | | | | | | | | Move the enumeration of NVDIMM SPA ranges from the spa GEOM class initializer into the NVDIMM root device. This will be necessary for a later change where NVDIMM namespaces require NVDIMM device enumeration to be reliably ordered before SPA enumeration. Submitted by: D Scott Phillips <d.scott.phillips@intel.com> Sponsored by: Intel Corporation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D18734 Notes: svn path=/head/; revision=343628
* nvdimm: initialize SPA uuids statically.Konstantin Belousov2019-01-182-37/+51
| | | | | | | | | | | | | The SPA ids are published numbers, so it's safe (if not a bit annoying) to copy them into a source file. Submitted by: D Scott Phillips <d.scott.phillips@intel.com> Sponsored by: Intel Corporation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D18733 Notes: svn path=/head/; revision=343144
* nvdimm: add a driver for the NVDIMM root deviceKonstantin Belousov2019-01-182-196/+141
| | | | | | | | | | | | | | | The NVDIMM root device is parent to the individual ACPI NVDIMM devices. Add a driver for the NVDIMM root device that can own enumeration of NVDIMM devices as well as NVDIMM SPA ranges that the system has. Submitted by: D Scott Phillips <d.scott.phillips@intel.com> Sponsored by: Intel Corporation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D18346 Notes: svn path=/head/; revision=343143
* nvdimm SPA geom: Update bio fields needed for devstat_end_transaction_bio().Konstantin Belousov2018-12-231-0/+4
| | | | | | | | | Reported by: bde MFC after: 1 week Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=342382
* Initializer error variable in nvdimm_spa_uio().Konstantin Belousov2018-10-231-0/+1
| | | | | | | | | | | Several code paths might result in returning uninitialized value. Reported by: coverity through cem CID: 1396315 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=339663
* nvdimm(4): Fix GCC 6.4.0 buildConrad Meyer2018-10-201-1/+1
| | | | | | | | | | -Wformat= pedantically complains that the void* pointer is passed to a %s format. Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=339461
* Add initial driver for ACPI NFIT-enumerated NVDIMMs.Konstantin Belousov2018-10-163-0/+1146
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 Notes: svn path=/head/; revision=339391