lkml.org 
[lkml]   [2011]   [Jan]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] mm, Make __get_user_pages return -EHWPOISON for HWPOISON page optionally
On Mon, Jan 17, 2011 at 08:47:39AM +0800, Huang Ying wrote:
> Hi, Andrew,
>
> On Sun, 2011-01-16 at 23:35 +0800, Avi Kivity wrote:
> > On 01/14/2011 03:37 AM, Huang Ying wrote:
> > > On Thu, 2011-01-13 at 18:43 +0800, Avi Kivity wrote:
> > > > On 01/13/2011 10:42 AM, Huang Ying wrote:
> > > > > Make __get_user_pages return -EHWPOISON for HWPOISON page only if
> > > > > FOLL_HWPOISON is specified. With this patch, the interested callers
> > > > > can distinguish HWPOISON page from general FAULT page, while other
> > > > > callers will still get -EFAULT for pages, so the user space interface
> > > > > need not to be changed.
> > > > >
> > > > > get_user_pages_hwpoison is added as a variant of get_user_pages that
> > > > > can return -EHWPOISON for HWPOISON page.
> > > > >
> > > > > 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>
> > > > >
> > > > > +#ifdef CONFIG_MEMORY_FAILURE
> > > > > +int get_user_pages_hwpoison(struct task_struct *tsk, struct mm_struct *mm,
> > > > > + unsigned long start, int nr_pages, int write,
> > > > > + int force, struct page **pages,
> > > > > + struct vm_area_struct **vmas);
> > > > > +#else
> > > >
> > > > Since we'd also like to add get_user_pages_noio(), perhaps adding a
> > > > flags field to get_user_pages() is better.
> > >
> > > Or export __get_user_pages()?
> >
> > That's better, yes.
>
> Do you think it is a good idea to export __get_user_pages() instead of
> adding get_user_pages_noio() and get_user_pages_hwpoison()?

Better Andrew and/or Linus should decide it.



\
 
 \ /
  Last update: 2011-01-20 23:27    [W:0.091 / U:0.452 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site