mirror of
https://github.com/freebsd/freebsd-src
synced 2024-07-22 10:48:02 +00:00
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:
parent
41ee91c64f
commit
5e09c5a1ed
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue