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:
Corvin Köhne 2023-12-18 13:44:04 +01:00
parent 41ee91c64f
commit 5e09c5a1ed
No known key found for this signature in database
GPG key ID: D854DA56315E026A

View file

@ -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);