diff options
author | Huang Ying <ying.huang@intel.com> | 2011-01-29 22:15:48 -0500 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2011-03-17 12:08:27 -0400 |
commit | 69ebb83e13e514222b0ae4f8bd813a17679ed876 (patch) | |
tree | 62ccc7ee1e840d0a6cc01a9fc1c44a5f4e6f1edd /include/linux | |
parent | 0014bd990e69063b0fb78940b35439d7980ce3ee (diff) |
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>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/mm.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h index 46150c66318e..a77c82c56e05 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -1532,6 +1532,7 @@ struct page *follow_page(struct vm_area_struct *, unsigned long address, | |||
1532 | #define FOLL_FORCE 0x10 /* get_user_pages read/write w/o permission */ | 1532 | #define FOLL_FORCE 0x10 /* get_user_pages read/write w/o permission */ |
1533 | #define FOLL_MLOCK 0x40 /* mark page as mlocked */ | 1533 | #define FOLL_MLOCK 0x40 /* mark page as mlocked */ |
1534 | #define FOLL_SPLIT 0x80 /* don't return transhuge pages, split them */ | 1534 | #define FOLL_SPLIT 0x80 /* don't return transhuge pages, split them */ |
1535 | #define FOLL_HWPOISON 0x100 /* check page is hwpoisoned */ | ||
1535 | 1536 | ||
1536 | typedef int (*pte_fn_t)(pte_t *pte, pgtable_t token, unsigned long addr, | 1537 | typedef int (*pte_fn_t)(pte_t *pte, pgtable_t token, unsigned long addr, |
1537 | void *data); | 1538 | void *data); |