bhyve: use correct size to map the OpRegion
We're already converting the size reported by the OpRegion header from kilobytes to bytes. We don't have to do that twice when mapping the OpRegion. Reviewed by: markj MFC after: 1 week Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D45334
This commit is contained in:
@@ -222,8 +222,8 @@ gvt_d_setup_opregion(struct pci_devinst *const pi)
|
||||
opregion->len = header->size * KB;
|
||||
munmap(header, sizeof(*header));
|
||||
|
||||
opregion->hva = mmap(NULL, opregion->len * KB, PROT_READ, MAP_SHARED,
|
||||
memfd, opregion->hpa);
|
||||
opregion->hva = mmap(NULL, opregion->len, PROT_READ, MAP_SHARED, memfd,
|
||||
opregion->hpa);
|
||||
if (opregion->hva == MAP_FAILED) {
|
||||
warn("%s: Unable to map host OpRegion", __func__);
|
||||
close(memfd);
|
||||
|
||||
Reference in New Issue
Block a user