HomeFreeBSD

Implement proper support for memory map operations in the LinuxKPI,

Description

Implement proper support for memory map operations in the LinuxKPI,
like open, close and fault using the character device pager.

Some notes about the implementation:

  1. Linux drivers set the vm_ops and vm_private_data fields during a

mmap() call to indicate that the driver wants to use the LinuxKPI VM
operations. Else these operations are not used.

  1. The vm_private_data pointer is associated with a VM area structure

and inserted into an internal LinuxKPI list. If the vm_private_data
pointer already exists, the existing VM area structure is used instead
of the allocated one which gets freed.

  1. The LinuxKPI's vm_private_data pointer is used as the callback

handle for the FreeBSD VM object. The VM subsystem in FreeBSD has a
similar list to identify equal handles and will only call the
character device pager's close function once.

  1. All LinuxKPI VM operations are serialized through the mmap_sem

sempaphore, which is per procedure, which prevents simultaneous access
to the shared VM area structure when receiving page faults.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies

Details

Provenance
hselaskyAuthored on
Parents
rS316561: Before registering a new mm_struct in the LinuxKPI check if other
Branches
Unknown
Tags
Unknown