mm/hmm: add default fault flags to avoid the need to pre-fill pfns arrays

The HMM mirror API can be use in two fashions.  The first one where the
HMM user coalesce multiple page faults into one request and set flags per
pfns for of those faults.  The second one where the HMM user want to
pre-fault a range with specific flags.  For the latter one it is a waste
to have the user pre-fill the pfn arrays with a default flags value.

This patch adds a default flags value allowing user to set them for a
range without having to pre-fill the pfn array.

Signed-off-by: Jérôme Glisse <>
Reviewed-by: Ralph Campbell <>
Cc: John Hubbard <>
Cc: Dan Williams <>
Cc: Arnd Bergmann <>
Cc: Balbir Singh <>
Cc: Dan Carpenter <>
Cc: Ira Weiny <>
Cc: Matthew Wilcox <>
Cc: Souptick Joarder <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
3 files changed