linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andy Lutomirski <luto@amacapital.net>
To: Aili Yao <yaoaili@kingsoft.com>
Cc: "Luck, Tony" <tony.luck@intel.com>,
	Andy Lutomirski <luto@kernel.org>,
	 HORIGUCHI NAOYA <naoya.horiguchi@nec.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	 Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	 Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	"H. Peter Anvin" <hpa@zytor.com>,  X86 ML <x86@kernel.org>,
	yangfeng1@kingsoft.com, Linux-MM <linux-mm@kvack.org>,
	 LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3] x86/fault: Send a SIGBUS to user process always for hwpoison page access.
Date: Sun, 7 Mar 2021 11:16:24 -0800	[thread overview]
Message-ID: <CALCETrWFXgOtFYycpY7A5Z1yM2oiZwP4sRh4e7Rfu32N85Kxig@mail.gmail.com> (raw)
In-Reply-To: <20210303205129.0a66f7a7@alex-virtual-machine>

On Wed, Mar 3, 2021 at 4:51 AM Aili Yao <yaoaili@kingsoft.com> wrote:
>
> On Wed, 3 Mar 2021 20:24:02 +0800
> Aili Yao <yaoaili@kingsoft.com> wrote:
>
> > On Mon, 1 Mar 2021 11:09:36 -0800
> > Andy Lutomirski <luto@amacapital.net> wrote:
> >
> > > > On Mar 1, 2021, at 11:02 AM, Luck, Tony <tony.luck@intel.com> wrote:
> > > >
> > > > 
> > > >>
> > > >> Some programs may use read(2), write(2), etc as ways to check if
> > > >> memory is valid without getting a signal.  They might not want
> > > >> signals, which means that this feature might need to be configurable.
> > > >
> > > > That sounds like an appalling hack. If users need such a mechanism
> > > > we should create some better way to do that.
> > > >
> > >
> > > Appalling hack or not, it works. So, if we’re going to send a signal to user code that looks like it originated from a bina fide architectural recoverable fault, it needs to be recoverable.  A load from a failed NVDIMM page is such a fault. A *kernel* load is not. So we need to distinguish it somehow.
> >
> > Sorry for my previous mis-understanding, and i have some questions:
> > if programs use read,write to check if if memory is valid, does it really want to cover the poison case?

I don't know.

> > When for such a case, an error is returned,  can the program realize it's hwposion issue not other software error and process correctly?

Again, I don't know.  But changing the API like this seems potentialy
dangerous and needs to be done with care.

> >
> > if this is the proper action, the original posion flow in current code from read and write need to change too.
> >
>
> Sorry, another question:
>   When programs use read(2), write(2) as ways to check if memory is valid, does it really want to check if the user page the program provided is valid, not the destination or disk space valid?

They may well be trying to see if their memory is valid.

>   the patch will not affect this purpose as it's only valid for user page which program provide to write or some syscall similiar parameter
>
> --
> Thanks!
> Aili Yao



-- 
Andy Lutomirski
AMA Capital Management, LLC


  reply	other threads:[~2021-03-07 19:16 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-01  8:17 [PATCH v2] x86/fault: Send a SIGBUS to user process always for hwpoison page access Aili Yao
2021-02-01 16:58 ` Andy Lutomirski
2021-02-01 21:10   ` Luck, Tony
2021-02-01 22:09     ` Andy Lutomirski
2021-02-02  6:42   ` Aili Yao
2021-02-04  7:25 ` HORIGUCHI NAOYA(堀口 直也)
2021-02-05  5:06   ` Aili Yao
2021-02-05  9:01   ` [PATCH v3] " Aili Yao
2021-02-23 12:44     ` Aili Yao
2021-02-23 15:33       ` Andy Lutomirski
2021-02-23 16:42         ` Luck, Tony
2021-02-25  4:47           ` Aili Yao
2021-02-27  3:40             ` Andy Lutomirski
2021-03-01  7:57               ` Aili Yao
2021-03-01 18:12                 ` Luck, Tony
2021-03-01 19:02               ` Luck, Tony
2021-03-01 19:09                 ` Andy Lutomirski
2021-03-03 12:24                   ` Aili Yao
2021-03-03 12:51                     ` Aili Yao
2021-03-07 19:16                       ` Andy Lutomirski [this message]
2021-03-08  9:49                         ` Aili Yao
2021-03-08 18:14                           ` Andy Lutomirski
2021-03-08 18:31                             ` Luck, Tony
2021-03-08 19:00                               ` Andy Lutomirski
2021-03-11  1:19                                 ` Aili Yao
2021-03-11  1:28                                   ` Andy Lutomirski
2021-03-11  2:01                                     ` Aili Yao
2021-03-11 16:52                                     ` Luck, Tony
2021-03-11 16:56                                       ` Peter Zijlstra
2021-03-09  2:14                               ` Aili Yao
2021-03-09  2:25                                 ` Aili Yao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CALCETrWFXgOtFYycpY7A5Z1yM2oiZwP4sRh4e7Rfu32N85Kxig@mail.gmail.com \
    --to=luto@amacapital.net \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=naoya.horiguchi@nec.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    --cc=yangfeng1@kingsoft.com \
    --cc=yaoaili@kingsoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).