- first, we try the mapping inside the IOCTL_PRIVCMD_MMAP(BATCH); when
it fails (pmap_enter_ma returns an error), we flag the address as
invalid inside the privcmd_object/uobj.
- second, when privpgop_fault is called. However, we never fall back to
pmap_enter_ma (which will return the same error as before): we check
against INVALID_PAGE, and if positive, issue a continue. Since error is
set to 0 by default, we end up in a loop with privpgop_fault.
IMHO, in case of an INVALID_PAGE, we should return EFAULT, just to
indicate that the thing is indeed wrong, like in [1]. The caller is free
to find through the ioctl which element in the array is faulty.
[1] http://www.netbsd.org/~jym/privcmd.diff
Yes, that may be the right thing to do.