Author: imp
Date: Thu Feb  2 23:04:00 2017
New Revision: 313111
URL: https://svnweb.freebsd.org/changeset/base/313111

Log:
  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:
  head/sbin/nvmecontrol/firmware.c

Modified: head/sbin/nvmecontrol/firmware.c
==============================================================================
--- head/sbin/nvmecontrol/firmware.c    Thu Feb  2 23:01:29 2017        
(r313110)
+++ head/sbin/nvmecontrol/firmware.c    Thu Feb  2 23:04:00 2017        
(r313111)
@@ -114,7 +114,7 @@ update_firmware(int fd, uint8_t *payload
        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) {
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to