mm: make __get_user_pages return -EHWPOISON for HWPOISON page optionally

Make __get_user_pages return -EHWPOISON for HWPOISON page only if
FOLL_HWPOISON is specified.  With this patch, the interested callers
can distinguish HWPOISON pages from general FAULT pages, while other
callers will still get -EFAULT for all these pages, so the user space
interface need not to be changed.

This feature is needed by KVM, where UCR MCE should be relayed to
guest for HWPOISON page, while instruction emulation and MMIO will be
tried for general FAULT page.

The idea comes from Andrew Morton.

Signed-off-by: Huang Ying <ying.huang@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
这个提交包含在:
Huang Ying
2011-01-30 11:15:48 +08:00
提交者 Marcelo Tosatti
父节点 0014bd990e
当前提交 69ebb83e13
修改 7 个文件,包含 21 行新增3 行删除

查看文件

@@ -112,4 +112,6 @@
#define ERFKILL 134 /* Operation not possible due to RF-kill */
#define EHWPOISON 135 /* Memory page has hardware error */
#endif