From: "Luck, Tony" <tony.luck@intel.com>
To: Aili Yao <yaoaili@kingsoft.com>
Cc: x86@kernel.org, naoya.horiguchi@nec.com,
linux-kernel@vger.kernel.org, yangfeng1@kingsoft.com
Subject: Re: [PATCH] x86/fault: Send SIGBUS to user process always for hwpoison page access.
Date: Fri, 29 Jan 2021 14:55:29 -0800 [thread overview]
Message-ID: <20210129225529.GA42172@agluck-desk2.amr.corp.intel.com> (raw)
In-Reply-To: <20210129113334.344377ac.yaoaili@kingsoft.com>
Thanks for the explanation and test code. I think I see better what
is going on here.
[I took your idea for using madvise(...MADV_HWPOISON) and added a new "-S"
option to my einj_mem_uc test program to use madvise instead of ACPI/EINJ
for injections. Update pushed here:
git://git.kernel.org/pub/scm/linux/kernel/git/aegl/ras-tools.git ]
There have been some small changes to arch/x86/mm/fault.c since you wrote
the patch. Can you rebase to v5.11-rc5?
Also maybe this might be a case to use IS_ENABLED() instead of #ifdef to
make the code a little less ugly. At least for the 2nd hunk in your patch
this would work well:
if (IS_ENABLED(CONFIG_MEMORY_FAILURE) &&
(fault & (VM_FAULT_HWPOISON|VM_FAULT_HWPOISON_LARGE)))
no_context(regs, error_code, address, SIGBUS, BUS_MCEERR_AR);
else
no_context(regs, error_code, address, SIGBUS, BUS_ADRERR);
The first hunk might need a bit more thought.
-Tony
next prev parent reply other threads:[~2021-01-29 22:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-28 11:43 Aili Yao
2021-01-28 17:43 ` Luck, Tony
2021-01-29 3:33 ` Aili Yao
2021-01-29 22:55 ` Luck, Tony [this message]
2021-02-01 7:21 ` 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=20210129225529.GA42172@agluck-desk2.amr.corp.intel.com \
--to=tony.luck@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=naoya.horiguchi@nec.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
all inboxes | Powered by JetHome®