David Hildenbrand cdc5021cda mm: add early FAULT_FLAG_UNSHARE consistency checks
For now, FAULT_FLAG_UNSHARE only applies to anonymous pages, which
implies a COW mapping. Let's hide FAULT_FLAG_UNSHARE early if we're not
dealing with a COW mapping, such that we treat it like a read fault as
documented and don't have to worry about the flag throughout all fault
handlers.

While at it, centralize the check for mutual exclusion of
FAULT_FLAG_UNSHARE and FAULT_FLAG_WRITE and just drop the check that
either flag is set in the WP handler.

Link: https://lkml.kernel.org/r/20221116102659.70287-5-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2022-11-30 15:58:57 -08:00
..
2022-11-30 15:58:53 -08:00
2022-09-26 19:46:16 -07:00
2022-11-30 15:58:54 -08:00
2022-03-23 18:03:08 -07:00
2022-11-30 15:58:55 -08:00
2022-10-03 14:03:04 -07:00
2022-10-03 14:02:43 -07:00
2022-09-26 19:46:09 -07:00
2022-09-26 19:46:28 -07:00
2022-09-26 19:46:26 -07:00
2022-11-30 15:58:55 -08:00
2022-11-30 15:58:46 -08:00
2022-01-15 16:30:31 +02:00