Revision history   OpenPOWER Library

 B.4.3. Protection Fault

 A protection fault occurs when the operation being performed to the requested memory is not permitted by the page protection mechanisms; page protection and key protection. A protection fault is in the data storage class of faults. A protection fault can either be an indication to the operating system to perform a "copy on write" or an indication that the application is performing an operation that is not allowed.

 A "copy on write" occurs when the content of the page needs to be copied when a write is performed by a thread. This typically occurs after a new process has been forked. In this case, the operating system initially marks the page as read-only and only creates a new page when a write is performed. The following steps lead up to a "copy on write" protection fault and describe how the fault is resolved.

  1. The PSL successfully converts the effective address (EA) to a virtual address (VA).

  2. The PSL locates a hardware page table entry for the requested page.

  3. The PSL checks the page protection and key protection in the page table entry and determines a write operation is being performed to a page marked as read-only and the operation is allowed by the key protection.

  4. The PSL sets the appropriate state in the PSL_DSISR_An Register (PSL_DSISR_An[DM,P,S]) and sends an interrupt to the associated operating system using LISN0.

  5. The operating system determines the page is resident in memory and that a copy must be performed before allowing the write operation.

  6. The operating system copies the page data to another real memory location, updates the hardware page table with a mapping to the new page, and writes the PSL_TFC_An[R] bit to a '1' to indicate the PSL should restart the corresponding operation.

  7. The PSL restarts the operation and translates the EA to a RA. The PSL should find the new mapping to allow the write operation.

 When the access being performed by the AFU is not allowed by either the page protection or key protection in the hardware page table, the steps are as follows:

  1. The PSL successfully converts the effective address (EA) to a virtual address (VA).

  2. The PSL locates a hardware page table entry for the requested page.

  3. The PSL checks the page protection and key protection in the page table entry and determines the operation being performed is not allowed.

  4. The PSL sets the appropriate state in the PSL_DSISR_An Register (PSL_DSISR_An[DM,P,K]) and sends an interrupt to the associated operating system using LISN0.

  5. The operating system determines that the AFU is not allowed to perform the requested operation.

  6. The operating system purges the current running process from the PSL and sends a signal to the corresponding application running in the host.

  7. The operating system restarts the PSL by writing the PSL_TFC_An[A] bit to a '1'.

  8. The PSL will resume with a new process from the schedule processes area if operating in a virtualized model or remain idle if operating in a dedicated-process model.


loading table of contents...