HomeFreeBSD

amd64/vmm.c: Fix an incorrect memory segment check in vm_iommu_{un}map

Description

amd64/vmm.c: Fix an incorrect memory segment check in vm_iommu_{un}map

This change fixes two checks that conflated memory mapping and memory
segment idenitifers. In both cases the code iterates over all memory
mappings but passes the index to vm_memseg_sysmem, which is wrong.

Fix this by passing the memory mapping's segment identifier instead.

Differential Revision: https://reviews.freebsd.org/D54210
Reviewed by: markj
Fixes: c76c2a19ae37
PR: 290920
Approved by: so
Security: FreeBSD-EN-25:20.vmm

(cherry picked from commit f1809eab82a796845f126b703c01d4a31ccf2193)
(cherry picked from commit 4f7436bf297b93fd9e835ffca3d56288ce934dc5)

Details

Provenance
bnovkovAuthored on Sat, Dec 13, 2:53 PM
markjCommitted on Tue, Dec 16, 4:01 PM
Reviewer
rGc76c2a19ae37: vmm: Consolidate code which manages guest memory regions
Differential Revision
D54210: amd64/vmm.c: Fix an incorrect memory segment check in vm_iommu_{un}map
Parents
rGff6b9c7c1c34: zfs: Merge commit 86b064469dc9c2 from OpenZFS
Branches
Unknown
Tags
Unknown