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.
This commit is contained in:
parent
9c16356ccd
commit
dc935c4f19
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=313111
@ -114,7 +114,7 @@ update_firmware(int fd, uint8_t *payload, int32_t payload_size)
|
|||||||
off = 0;
|
off = 0;
|
||||||
resid = payload_size;
|
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);
|
errx(1, "unable to malloc %d bytes", NVME_MAX_XFER_SIZE);
|
||||||
|
|
||||||
while (resid > 0) {
|
while (resid > 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user