Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'libnvdimm-fixes-5.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm

Pull libnvdimm fixes from Dan Williams:
"A regression fix for a bootup crash condition introduced in this merge
window and some other minor fixups:

- Fix regression in ACPI NFIT table handling leading to crashes and
driver load failures.

- Move the nvdimm mailing list

- Miscellaneous minor fixups"

* tag 'libnvdimm-fixes-5.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
ACPI: NFIT: Fix support for variable 'SPA' structure size
MAINTAINERS: Move nvdimm mailing list
tools/testing/nvdimm: Make symbol '__nfit_test_ioremap' static
libnvdimm: Remove duplicate struct declaration

+69 -55
+1 -1
Documentation/ABI/obsolete/sysfs-class-dax
··· 1 1 What: /sys/class/dax/ 2 2 Date: May, 2016 3 3 KernelVersion: v4.7 4 - Contact: linux-nvdimm@lists.01.org 4 + Contact: nvdimm@lists.linux.dev 5 5 Description: Device DAX is the device-centric analogue of Filesystem 6 6 DAX (CONFIG_FS_DAX). It allows memory ranges to be 7 7 allocated and mapped without need of an intervening file
+1 -1
Documentation/ABI/removed/sysfs-bus-nfit
··· 1 1 What: /sys/bus/nd/devices/regionX/nfit/ecc_unit_size 2 2 Date: Aug, 2017 3 3 KernelVersion: v4.14 (Removed v4.18) 4 - Contact: linux-nvdimm@lists.01.org 4 + Contact: nvdimm@lists.linux.dev 5 5 Description: 6 6 (RO) Size of a write request to a DIMM that will not incur a 7 7 read-modify-write cycle at the memory controller.
+20 -20
Documentation/ABI/testing/sysfs-bus-nfit
··· 5 5 What: /sys/bus/nd/devices/nmemX/nfit/serial 6 6 Date: Jun, 2015 7 7 KernelVersion: v4.2 8 - Contact: linux-nvdimm@lists.01.org 8 + Contact: nvdimm@lists.linux.dev 9 9 Description: 10 10 (RO) Serial number of the NVDIMM (non-volatile dual in-line 11 11 memory module), assigned by the module vendor. ··· 14 14 What: /sys/bus/nd/devices/nmemX/nfit/handle 15 15 Date: Apr, 2015 16 16 KernelVersion: v4.2 17 - Contact: linux-nvdimm@lists.01.org 17 + Contact: nvdimm@lists.linux.dev 18 18 Description: 19 19 (RO) The address (given by the _ADR object) of the device on its 20 20 parent bus of the NVDIMM device containing the NVDIMM region. ··· 23 23 What: /sys/bus/nd/devices/nmemX/nfit/device 24 24 Date: Apr, 2015 25 25 KernelVersion: v4.1 26 - Contact: linux-nvdimm@lists.01.org 26 + Contact: nvdimm@lists.linux.dev 27 27 Description: 28 28 (RO) Device id for the NVDIMM, assigned by the module vendor. 29 29 ··· 31 31 What: /sys/bus/nd/devices/nmemX/nfit/rev_id 32 32 Date: Jun, 2015 33 33 KernelVersion: v4.2 34 - Contact: linux-nvdimm@lists.01.org 34 + Contact: nvdimm@lists.linux.dev 35 35 Description: 36 36 (RO) Revision of the NVDIMM, assigned by the module vendor. 37 37 ··· 39 39 What: /sys/bus/nd/devices/nmemX/nfit/phys_id 40 40 Date: Apr, 2015 41 41 KernelVersion: v4.2 42 - Contact: linux-nvdimm@lists.01.org 42 + Contact: nvdimm@lists.linux.dev 43 43 Description: 44 44 (RO) Handle (i.e., instance number) for the SMBIOS (system 45 45 management BIOS) Memory Device structure describing the NVDIMM ··· 49 49 What: /sys/bus/nd/devices/nmemX/nfit/flags 50 50 Date: Jun, 2015 51 51 KernelVersion: v4.2 52 - Contact: linux-nvdimm@lists.01.org 52 + Contact: nvdimm@lists.linux.dev 53 53 Description: 54 54 (RO) The flags in the NFIT memory device sub-structure indicate 55 55 the state of the data on the nvdimm relative to its energy ··· 68 68 What: /sys/bus/nd/devices/nmemX/nfit/formats 69 69 Date: Apr, 2016 70 70 KernelVersion: v4.7 71 - Contact: linux-nvdimm@lists.01.org 71 + Contact: nvdimm@lists.linux.dev 72 72 Description: 73 73 (RO) The interface codes indicate support for persistent memory 74 74 mapped directly into system physical address space and / or a ··· 84 84 What: /sys/bus/nd/devices/nmemX/nfit/vendor 85 85 Date: Apr, 2016 86 86 KernelVersion: v4.7 87 - Contact: linux-nvdimm@lists.01.org 87 + Contact: nvdimm@lists.linux.dev 88 88 Description: 89 89 (RO) Vendor id of the NVDIMM. 90 90 ··· 92 92 What: /sys/bus/nd/devices/nmemX/nfit/dsm_mask 93 93 Date: May, 2016 94 94 KernelVersion: v4.7 95 - Contact: linux-nvdimm@lists.01.org 95 + Contact: nvdimm@lists.linux.dev 96 96 Description: 97 97 (RO) The bitmask indicates the supported device specific control 98 98 functions relative to the NVDIMM command family supported by the ··· 102 102 What: /sys/bus/nd/devices/nmemX/nfit/family 103 103 Date: Apr, 2016 104 104 KernelVersion: v4.7 105 - Contact: linux-nvdimm@lists.01.org 105 + Contact: nvdimm@lists.linux.dev 106 106 Description: 107 107 (RO) Displays the NVDIMM family command sets. Values 108 108 0, 1, 2 and 3 correspond to NVDIMM_FAMILY_INTEL, ··· 118 118 What: /sys/bus/nd/devices/nmemX/nfit/id 119 119 Date: Apr, 2016 120 120 KernelVersion: v4.7 121 - Contact: linux-nvdimm@lists.01.org 121 + Contact: nvdimm@lists.linux.dev 122 122 Description: 123 123 (RO) ACPI specification 6.2 section 5.2.25.9, defines an 124 124 identifier for an NVDIMM, which refelects the id attribute. ··· 127 127 What: /sys/bus/nd/devices/nmemX/nfit/subsystem_vendor 128 128 Date: Apr, 2016 129 129 KernelVersion: v4.7 130 - Contact: linux-nvdimm@lists.01.org 130 + Contact: nvdimm@lists.linux.dev 131 131 Description: 132 132 (RO) Sub-system vendor id of the NVDIMM non-volatile memory 133 133 subsystem controller. ··· 136 136 What: /sys/bus/nd/devices/nmemX/nfit/subsystem_rev_id 137 137 Date: Apr, 2016 138 138 KernelVersion: v4.7 139 - Contact: linux-nvdimm@lists.01.org 139 + Contact: nvdimm@lists.linux.dev 140 140 Description: 141 141 (RO) Sub-system revision id of the NVDIMM non-volatile memory subsystem 142 142 controller, assigned by the non-volatile memory subsystem ··· 146 146 What: /sys/bus/nd/devices/nmemX/nfit/subsystem_device 147 147 Date: Apr, 2016 148 148 KernelVersion: v4.7 149 - Contact: linux-nvdimm@lists.01.org 149 + Contact: nvdimm@lists.linux.dev 150 150 Description: 151 151 (RO) Sub-system device id for the NVDIMM non-volatile memory 152 152 subsystem controller, assigned by the non-volatile memory ··· 156 156 What: /sys/bus/nd/devices/ndbusX/nfit/revision 157 157 Date: Jun, 2015 158 158 KernelVersion: v4.2 159 - Contact: linux-nvdimm@lists.01.org 159 + Contact: nvdimm@lists.linux.dev 160 160 Description: 161 161 (RO) ACPI NFIT table revision number. 162 162 ··· 164 164 What: /sys/bus/nd/devices/ndbusX/nfit/scrub 165 165 Date: Sep, 2016 166 166 KernelVersion: v4.9 167 - Contact: linux-nvdimm@lists.01.org 167 + Contact: nvdimm@lists.linux.dev 168 168 Description: 169 169 (RW) This shows the number of full Address Range Scrubs (ARS) 170 170 that have been completed since driver load time. Userspace can ··· 177 177 What: /sys/bus/nd/devices/ndbusX/nfit/hw_error_scrub 178 178 Date: Sep, 2016 179 179 KernelVersion: v4.9 180 - Contact: linux-nvdimm@lists.01.org 180 + Contact: nvdimm@lists.linux.dev 181 181 Description: 182 182 (RW) Provides a way to toggle the behavior between just adding 183 183 the address (cache line) where the MCE happened to the poison ··· 196 196 What: /sys/bus/nd/devices/ndbusX/nfit/dsm_mask 197 197 Date: Jun, 2017 198 198 KernelVersion: v4.13 199 - Contact: linux-nvdimm@lists.01.org 199 + Contact: nvdimm@lists.linux.dev 200 200 Description: 201 201 (RO) The bitmask indicates the supported bus specific control 202 202 functions. See the section named 'NVDIMM Root Device _DSMs' in ··· 205 205 What: /sys/bus/nd/devices/ndbusX/nfit/firmware_activate_noidle 206 206 Date: Apr, 2020 207 207 KernelVersion: v5.8 208 - Contact: linux-nvdimm@lists.01.org 208 + Contact: nvdimm@lists.linux.dev 209 209 Description: 210 210 (RW) The Intel platform implementation of firmware activate 211 211 support exposes an option let the platform force idle devices in ··· 225 225 What: /sys/bus/nd/devices/regionX/nfit/range_index 226 226 Date: Jun, 2015 227 227 KernelVersion: v4.2 228 - Contact: linux-nvdimm@lists.01.org 228 + Contact: nvdimm@lists.linux.dev 229 229 Description: 230 230 (RO) A unique number provided by the BIOS to identify an address 231 231 range. Used by NVDIMM Region Mapping Structure to uniquely refer
+2 -2
Documentation/ABI/testing/sysfs-bus-papr-pmem
··· 1 1 What: /sys/bus/nd/devices/nmemX/papr/flags 2 2 Date: Apr, 2020 3 3 KernelVersion: v5.8 4 - Contact: linuxppc-dev <linuxppc-dev@lists.ozlabs.org>, linux-nvdimm@lists.01.org, 4 + Contact: linuxppc-dev <linuxppc-dev@lists.ozlabs.org>, nvdimm@lists.linux.dev, 5 5 Description: 6 6 (RO) Report flags indicating various states of a 7 7 papr-pmem NVDIMM device. Each flag maps to a one or ··· 36 36 What: /sys/bus/nd/devices/nmemX/papr/perf_stats 37 37 Date: May, 2020 38 38 KernelVersion: v5.9 39 - Contact: linuxppc-dev <linuxppc-dev@lists.ozlabs.org>, linux-nvdimm@lists.01.org, 39 + Contact: linuxppc-dev <linuxppc-dev@lists.ozlabs.org>, nvdimm@lists.linux.dev, 40 40 Description: 41 41 (RO) Report various performance stats related to papr-scm NVDIMM 42 42 device. Each stat is reported on a new line with each line
+1 -1
Documentation/driver-api/nvdimm/nvdimm.rst
··· 4 4 5 5 libnvdimm - kernel / libndctl - userspace helper library 6 6 7 - linux-nvdimm@lists.01.org 7 + nvdimm@lists.linux.dev 8 8 9 9 Version 13 10 10
+7 -7
MAINTAINERS
··· 5237 5237 M: Dan Williams <dan.j.williams@intel.com> 5238 5238 M: Vishal Verma <vishal.l.verma@intel.com> 5239 5239 M: Dave Jiang <dave.jiang@intel.com> 5240 - L: linux-nvdimm@lists.01.org 5240 + L: nvdimm@lists.linux.dev 5241 5241 S: Supported 5242 5242 F: drivers/dax/ 5243 5243 ··· 7006 7006 R: Matthew Wilcox <willy@infradead.org> 7007 7007 R: Jan Kara <jack@suse.cz> 7008 7008 L: linux-fsdevel@vger.kernel.org 7009 - L: linux-nvdimm@lists.01.org 7009 + L: nvdimm@lists.linux.dev 7010 7010 S: Supported 7011 7011 F: fs/dax.c 7012 7012 F: include/linux/dax.h ··· 10378 10378 M: Dan Williams <dan.j.williams@intel.com> 10379 10379 M: Vishal Verma <vishal.l.verma@intel.com> 10380 10380 M: Dave Jiang <dave.jiang@intel.com> 10381 - L: linux-nvdimm@lists.01.org 10381 + L: nvdimm@lists.linux.dev 10382 10382 S: Supported 10383 10383 Q: https://patchwork.kernel.org/project/linux-nvdimm/list/ 10384 10384 P: Documentation/nvdimm/maintainer-entry-profile.rst ··· 10389 10389 M: Vishal Verma <vishal.l.verma@intel.com> 10390 10390 M: Dan Williams <dan.j.williams@intel.com> 10391 10391 M: Dave Jiang <dave.jiang@intel.com> 10392 - L: linux-nvdimm@lists.01.org 10392 + L: nvdimm@lists.linux.dev 10393 10393 S: Supported 10394 10394 Q: https://patchwork.kernel.org/project/linux-nvdimm/list/ 10395 10395 P: Documentation/nvdimm/maintainer-entry-profile.rst ··· 10399 10399 M: Dan Williams <dan.j.williams@intel.com> 10400 10400 M: Vishal Verma <vishal.l.verma@intel.com> 10401 10401 M: Dave Jiang <dave.jiang@intel.com> 10402 - L: linux-nvdimm@lists.01.org 10402 + L: nvdimm@lists.linux.dev 10403 10403 S: Supported 10404 10404 Q: https://patchwork.kernel.org/project/linux-nvdimm/list/ 10405 10405 P: Documentation/nvdimm/maintainer-entry-profile.rst ··· 10407 10407 10408 10408 LIBNVDIMM: DEVICETREE BINDINGS 10409 10409 M: Oliver O'Halloran <oohall@gmail.com> 10410 - L: linux-nvdimm@lists.01.org 10410 + L: nvdimm@lists.linux.dev 10411 10411 S: Supported 10412 10412 Q: https://patchwork.kernel.org/project/linux-nvdimm/list/ 10413 10413 F: Documentation/devicetree/bindings/pmem/pmem-region.txt ··· 10418 10418 M: Vishal Verma <vishal.l.verma@intel.com> 10419 10419 M: Dave Jiang <dave.jiang@intel.com> 10420 10420 M: Ira Weiny <ira.weiny@intel.com> 10421 - L: linux-nvdimm@lists.01.org 10421 + L: nvdimm@lists.linux.dev 10422 10422 S: Supported 10423 10423 Q: https://patchwork.kernel.org/project/linux-nvdimm/list/ 10424 10424 P: Documentation/nvdimm/maintainer-entry-profile.rst
+11 -4
drivers/acpi/nfit/core.c
··· 686 686 return -1; 687 687 } 688 688 689 + static size_t sizeof_spa(struct acpi_nfit_system_address *spa) 690 + { 691 + if (spa->flags & ACPI_NFIT_LOCATION_COOKIE_VALID) 692 + return sizeof(*spa); 693 + return sizeof(*spa) - 8; 694 + } 695 + 689 696 static bool add_spa(struct acpi_nfit_desc *acpi_desc, 690 697 struct nfit_table_prev *prev, 691 698 struct acpi_nfit_system_address *spa) ··· 700 693 struct device *dev = acpi_desc->dev; 701 694 struct nfit_spa *nfit_spa; 702 695 703 - if (spa->header.length != sizeof(*spa)) 696 + if (spa->header.length != sizeof_spa(spa)) 704 697 return false; 705 698 706 699 list_for_each_entry(nfit_spa, &prev->spas, list) { 707 - if (memcmp(nfit_spa->spa, spa, sizeof(*spa)) == 0) { 700 + if (memcmp(nfit_spa->spa, spa, sizeof_spa(spa)) == 0) { 708 701 list_move_tail(&nfit_spa->list, &acpi_desc->spas); 709 702 return true; 710 703 } 711 704 } 712 705 713 - nfit_spa = devm_kzalloc(dev, sizeof(*nfit_spa) + sizeof(*spa), 706 + nfit_spa = devm_kzalloc(dev, sizeof(*nfit_spa) + sizeof_spa(spa), 714 707 GFP_KERNEL); 715 708 if (!nfit_spa) 716 709 return false; 717 710 INIT_LIST_HEAD(&nfit_spa->list); 718 - memcpy(nfit_spa->spa, spa, sizeof(*spa)); 711 + memcpy(nfit_spa->spa, spa, sizeof_spa(spa)); 719 712 list_add_tail(&nfit_spa->list, &acpi_desc->spas); 720 713 dev_dbg(dev, "spa index: %d type: %s\n", 721 714 spa->range_index,
-1
include/linux/libnvdimm.h
··· 141 141 142 142 struct nvdimm_bus; 143 143 struct module; 144 - struct device; 145 144 struct nd_blk_region; 146 145 struct nd_blk_region_desc { 147 146 int (*enable)(struct nvdimm_bus *nvdimm_bus, struct device *dev);
+1 -1
tools/testing/nvdimm/test/iomap.c
··· 62 62 } 63 63 EXPORT_SYMBOL(get_nfit_res); 64 64 65 - void __iomem *__nfit_test_ioremap(resource_size_t offset, unsigned long size, 65 + static void __iomem *__nfit_test_ioremap(resource_size_t offset, unsigned long size, 66 66 void __iomem *(*fallback_fn)(resource_size_t, unsigned long)) 67 67 { 68 68 struct nfit_test_resource *nfit_res = get_nfit_res(offset);
+25 -17
tools/testing/nvdimm/test/nfit.c
··· 1871 1871 } 1872 1872 } 1873 1873 1874 + static size_t sizeof_spa(struct acpi_nfit_system_address *spa) 1875 + { 1876 + /* until spa location cookie support is added... */ 1877 + return sizeof(*spa) - 8; 1878 + } 1879 + 1874 1880 static int nfit_test0_alloc(struct nfit_test *t) 1875 1881 { 1876 - size_t nfit_size = sizeof(struct acpi_nfit_system_address) * NUM_SPA 1882 + struct acpi_nfit_system_address *spa = NULL; 1883 + size_t nfit_size = sizeof_spa(spa) * NUM_SPA 1877 1884 + sizeof(struct acpi_nfit_memory_map) * NUM_MEM 1878 1885 + sizeof(struct acpi_nfit_control_region) * NUM_DCR 1879 1886 + offsetof(struct acpi_nfit_control_region, ··· 1944 1937 1945 1938 static int nfit_test1_alloc(struct nfit_test *t) 1946 1939 { 1947 - size_t nfit_size = sizeof(struct acpi_nfit_system_address) * 2 1940 + struct acpi_nfit_system_address *spa = NULL; 1941 + size_t nfit_size = sizeof_spa(spa) * 2 1948 1942 + sizeof(struct acpi_nfit_memory_map) * 2 1949 1943 + offsetof(struct acpi_nfit_control_region, window_size) * 2; 1950 1944 int i; ··· 2008 2000 */ 2009 2001 spa = nfit_buf; 2010 2002 spa->header.type = ACPI_NFIT_TYPE_SYSTEM_ADDRESS; 2011 - spa->header.length = sizeof(*spa); 2003 + spa->header.length = sizeof_spa(spa); 2012 2004 memcpy(spa->range_guid, to_nfit_uuid(NFIT_SPA_PM), 16); 2013 2005 spa->range_index = 0+1; 2014 2006 spa->address = t->spa_set_dma[0]; ··· 2022 2014 */ 2023 2015 spa = nfit_buf + offset; 2024 2016 spa->header.type = ACPI_NFIT_TYPE_SYSTEM_ADDRESS; 2025 - spa->header.length = sizeof(*spa); 2017 + spa->header.length = sizeof_spa(spa); 2026 2018 memcpy(spa->range_guid, to_nfit_uuid(NFIT_SPA_PM), 16); 2027 2019 spa->range_index = 1+1; 2028 2020 spa->address = t->spa_set_dma[1]; ··· 2032 2024 /* spa2 (dcr0) dimm0 */ 2033 2025 spa = nfit_buf + offset; 2034 2026 spa->header.type = ACPI_NFIT_TYPE_SYSTEM_ADDRESS; 2035 - spa->header.length = sizeof(*spa); 2027 + spa->header.length = sizeof_spa(spa); 2036 2028 memcpy(spa->range_guid, to_nfit_uuid(NFIT_SPA_DCR), 16); 2037 2029 spa->range_index = 2+1; 2038 2030 spa->address = t->dcr_dma[0]; ··· 2042 2034 /* spa3 (dcr1) dimm1 */ 2043 2035 spa = nfit_buf + offset; 2044 2036 spa->header.type = ACPI_NFIT_TYPE_SYSTEM_ADDRESS; 2045 - spa->header.length = sizeof(*spa); 2037 + spa->header.length = sizeof_spa(spa); 2046 2038 memcpy(spa->range_guid, to_nfit_uuid(NFIT_SPA_DCR), 16); 2047 2039 spa->range_index = 3+1; 2048 2040 spa->address = t->dcr_dma[1]; ··· 2052 2044 /* spa4 (dcr2) dimm2 */ 2053 2045 spa = nfit_buf + offset; 2054 2046 spa->header.type = ACPI_NFIT_TYPE_SYSTEM_ADDRESS; 2055 - spa->header.length = sizeof(*spa); 2047 + spa->header.length = sizeof_spa(spa); 2056 2048 memcpy(spa->range_guid, to_nfit_uuid(NFIT_SPA_DCR), 16); 2057 2049 spa->range_index = 4+1; 2058 2050 spa->address = t->dcr_dma[2]; ··· 2062 2054 /* spa5 (dcr3) dimm3 */ 2063 2055 spa = nfit_buf + offset; 2064 2056 spa->header.type = ACPI_NFIT_TYPE_SYSTEM_ADDRESS; 2065 - spa->header.length = sizeof(*spa); 2057 + spa->header.length = sizeof_spa(spa); 2066 2058 memcpy(spa->range_guid, to_nfit_uuid(NFIT_SPA_DCR), 16); 2067 2059 spa->range_index = 5+1; 2068 2060 spa->address = t->dcr_dma[3]; ··· 2072 2064 /* spa6 (bdw for dcr0) dimm0 */ 2073 2065 spa = nfit_buf + offset; 2074 2066 spa->header.type = ACPI_NFIT_TYPE_SYSTEM_ADDRESS; 2075 - spa->header.length = sizeof(*spa); 2067 + spa->header.length = sizeof_spa(spa); 2076 2068 memcpy(spa->range_guid, to_nfit_uuid(NFIT_SPA_BDW), 16); 2077 2069 spa->range_index = 6+1; 2078 2070 spa->address = t->dimm_dma[0]; ··· 2082 2074 /* spa7 (bdw for dcr1) dimm1 */ 2083 2075 spa = nfit_buf + offset; 2084 2076 spa->header.type = ACPI_NFIT_TYPE_SYSTEM_ADDRESS; 2085 - spa->header.length = sizeof(*spa); 2077 + spa->header.length = sizeof_spa(spa); 2086 2078 memcpy(spa->range_guid, to_nfit_uuid(NFIT_SPA_BDW), 16); 2087 2079 spa->range_index = 7+1; 2088 2080 spa->address = t->dimm_dma[1]; ··· 2092 2084 /* spa8 (bdw for dcr2) dimm2 */ 2093 2085 spa = nfit_buf + offset; 2094 2086 spa->header.type = ACPI_NFIT_TYPE_SYSTEM_ADDRESS; 2095 - spa->header.length = sizeof(*spa); 2087 + spa->header.length = sizeof_spa(spa); 2096 2088 memcpy(spa->range_guid, to_nfit_uuid(NFIT_SPA_BDW), 16); 2097 2089 spa->range_index = 8+1; 2098 2090 spa->address = t->dimm_dma[2]; ··· 2102 2094 /* spa9 (bdw for dcr3) dimm3 */ 2103 2095 spa = nfit_buf + offset; 2104 2096 spa->header.type = ACPI_NFIT_TYPE_SYSTEM_ADDRESS; 2105 - spa->header.length = sizeof(*spa); 2097 + spa->header.length = sizeof_spa(spa); 2106 2098 memcpy(spa->range_guid, to_nfit_uuid(NFIT_SPA_BDW), 16); 2107 2099 spa->range_index = 9+1; 2108 2100 spa->address = t->dimm_dma[3]; ··· 2589 2581 /* spa10 (dcr4) dimm4 */ 2590 2582 spa = nfit_buf + offset; 2591 2583 spa->header.type = ACPI_NFIT_TYPE_SYSTEM_ADDRESS; 2592 - spa->header.length = sizeof(*spa); 2584 + spa->header.length = sizeof_spa(spa); 2593 2585 memcpy(spa->range_guid, to_nfit_uuid(NFIT_SPA_DCR), 16); 2594 2586 spa->range_index = 10+1; 2595 2587 spa->address = t->dcr_dma[4]; ··· 2603 2595 */ 2604 2596 spa = nfit_buf + offset; 2605 2597 spa->header.type = ACPI_NFIT_TYPE_SYSTEM_ADDRESS; 2606 - spa->header.length = sizeof(*spa); 2598 + spa->header.length = sizeof_spa(spa); 2607 2599 memcpy(spa->range_guid, to_nfit_uuid(NFIT_SPA_PM), 16); 2608 2600 spa->range_index = 11+1; 2609 2601 spa->address = t->spa_set_dma[2]; ··· 2613 2605 /* spa12 (bdw for dcr4) dimm4 */ 2614 2606 spa = nfit_buf + offset; 2615 2607 spa->header.type = ACPI_NFIT_TYPE_SYSTEM_ADDRESS; 2616 - spa->header.length = sizeof(*spa); 2608 + spa->header.length = sizeof_spa(spa); 2617 2609 memcpy(spa->range_guid, to_nfit_uuid(NFIT_SPA_BDW), 16); 2618 2610 spa->range_index = 12+1; 2619 2611 spa->address = t->dimm_dma[4]; ··· 2747 2739 /* spa0 (flat range with no bdw aliasing) */ 2748 2740 spa = nfit_buf + offset; 2749 2741 spa->header.type = ACPI_NFIT_TYPE_SYSTEM_ADDRESS; 2750 - spa->header.length = sizeof(*spa); 2742 + spa->header.length = sizeof_spa(spa); 2751 2743 memcpy(spa->range_guid, to_nfit_uuid(NFIT_SPA_PM), 16); 2752 2744 spa->range_index = 0+1; 2753 2745 spa->address = t->spa_set_dma[0]; ··· 2757 2749 /* virtual cd region */ 2758 2750 spa = nfit_buf + offset; 2759 2751 spa->header.type = ACPI_NFIT_TYPE_SYSTEM_ADDRESS; 2760 - spa->header.length = sizeof(*spa); 2752 + spa->header.length = sizeof_spa(spa); 2761 2753 memcpy(spa->range_guid, to_nfit_uuid(NFIT_SPA_VCD), 16); 2762 2754 spa->range_index = 0; 2763 2755 spa->address = t->spa_set_dma[1];