lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20110127150705.f2cfe235.akpm@linux-foundation.org>
Date:	Thu, 27 Jan 2011 15:07:05 -0800
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Huang Ying <ying.huang@...el.com>
Cc:	Linus Torvalds <torvalds@...ux-foundation.org>,
	Avi Kivity <avi@...hat.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"kvm@...r.kernel.org" <kvm@...r.kernel.org>,
	Andi Kleen <andi@...stfloor.org>,
	"Luck, Tony" <tony.luck@...el.com>,
	Dean Nelson <dnelson@...hat.com>,
	Marcelo Tosatti <mtosatti@...hat.com>
Subject: Re: [PATCH 1/2] mm, Make __get_user_pages return -EHWPOISON for
 HWPOISON page optionally

On Thu, 27 Jan 2011 15:29:05 +0800
Huang Ying <ying.huang@...el.com> wrote:

> Hi, Andrew,
> 
> On Thu, 2011-01-20 at 23:50 +0800, Marcelo Tosatti wrote:
> > 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@...el.com>
> > > > > >  >  Cc: Andrew Morton<akpm@...ux-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.
> 
> We really need your comments about this.
> 

Export __get_user_pages(), I guess.  We don't need hwpoison/kvm-specific
stuff in mm/memory.c and
get_user_pages_hwpoison()/get_user_pages_noio() are very thin
wrappers.

The number of args to these functions is getting nutty - you'll
probably find that it is beneficial to inline these wrapepr functions, if
the number of callsites is small.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ