Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Feb 2018 19:35:34 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r328713 - stable/11/sbin/nvmecontrol
Message-ID:  <201802011935.w11JZYTx025991@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201802011935.w11JZYTx025991>