HomeFreeBSD

Unwire the kcov buffer when freeing the info struct.

Description

Unwire the kcov buffer when freeing the info struct.

Without this the physical memory will not be returned to the kernel.

While here call vm_object_reference on the object when mmapping the buffer.
This removed the need for buggy tracking of if it has been mapped or not.

This fixes issues where kcov could use all the system memory.

Reported by: tuexen
Reviewed by: kib
Sponsored by: DARPA, AFTL
Differential Revision: https://reviews.freebsd.org/D19252

Details

Provenance
andrewAuthored on
Reviewer
kib
Differential Revision
D19252: Unwire pages when cleaning up the kcov state
Parents
rS344390: Call pmap_qenter for each page when creating the kcov buffer.
Branches
Unknown
Tags
Unknown