svn commit: r328713 - stable/11/sbin/nvmecontrol
Alexander Motin
mav at FreeBSD.org
Thu Feb 1 19:35:35 UTC 2018
Author: mav
Date: Thu Feb 1 19:35:34 2018
New Revision: 328713
URL: https://svnweb.freebsd.org/changeset/base/328713
Log:
MFC r313111 (by imp):
Use aligned buffer for the firmware data. Otherwise, when loading a
MAXPHYS bytes of data, the I/O would require MAXPHYS + PAGE_SIZE worth
of pages to do the I/O and we'd hit an assertion in
vm_fault_quick_hold_pages unless MAXPHYS was larger than 1M +
PAGE_SIZE.
Modified:
stable/11/sbin/nvmecontrol/firmware.c
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/sbin/nvmecontrol/firmware.c
==============================================================================
--- stable/11/sbin/nvmecontrol/firmware.c Thu Feb 1 19:33:51 2018 (r328712)
+++ stable/11/sbin/nvmecontrol/firmware.c Thu Feb 1 19:35:34 2018 (r328713)
@@ -114,7 +114,7 @@ update_firmware(int fd, uint8_t *payload, int32_t payl
off = 0;
resid = payload_size;
- if ((chunk = malloc(NVME_MAX_XFER_SIZE)) == NULL)
+ if ((chunk = aligned_alloc(NVME_MAX_XFER_SIZE, PAGE_SIZE)) == NULL)
errx(1, "unable to malloc %d bytes", NVME_MAX_XFER_SIZE);
while (resid > 0) {
More information about the svn-src-stable
mailing list