forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mm: Probe for sub-page faults in fault_in_*()
On hardware with features like arm64 MTE or SPARC ADI, an access fault can be triggered at sub-page granularity. Depending on how the fault_in_*() functions are used, the caller can get into a live-lock by continuously retrying the fault-in on an address different from the one where the uaccess failed. In the majority of cases progress is ensured by the following conditions: 1. copy_{to,from}_user_nofault() guarantees at least one byte access if the user address is not faulting. 2. The fault_in_*() loop is resumed from the next address that could not be accessed by copy_{to,from}_user_nofault(). If the loop iteration is restarted from an earlier point, the loop is repeated with the same conditions and it would live-lock. The same problem exists if the fault_in_*() is attempted on the fault address reported by copy_*_user_nofault() since the latter does not guarantee the maximum possible bytes are written and fault_in_*() will succeed in probing a single byte. Introduce probe_subpage_*() and call them from the corresponding fault_in_*() functions on the requested 'min_size' range. The arch code with sub-page faults will have to implement the specific probing functionality. Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
- Loading branch information
1 parent
69f9334
commit a258178
Showing
3 changed files
with
66 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters