Centralize calculation of signal and ucode delivered on unhandled page fault.
Change the delivered signal for accesses to mapped area after the backing object was truncated.
According to POSIX description for mmap(2),
The system shall always zero-fill any partial page at the end of an object. Further, the system shall never write out any modified portions of the last page of an object which are beyond its end. References within the address range starting at pa and continuing for len bytes to whole pages following the end of an object shall result in delivery of a SIGBUS signal. An implementation may generate SIGBUS signals when a reference would cause an error in the mapped object, such as out-of-space condition.
Adjust according to the description, keeping the existing compatibility code for SIGSEGV/SIGBUS on protection failures.
Use the opportunity and move the signal calculation to trap_pfault().
Not sure what better ucode to specify when SIGBUS is delivered for swap reservation failure on CoW.