All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Morse <james.morse@arm.com>
To: gengdongjiu <gengdj.1984@gmail.com>
Cc: Punit Agrawal <punit.agrawal@arm.com>,
	Marc Zyngier <marc.zyngier@arm.com>,
	Tyler Baicar <tbaicar@codeaurora.org>,
	gengdongjiu <gengdongjiu@huawei.com>,
	wuquanming@huawei.com, linux-arm-kernel@lists.infradead.org,
	kvmarm@lists.cs.columbia.edu
Subject: Re: [PATCH] KVM: arm/arm64: Signal SIGBUS when stage2 discovers hwpoison memory
Date: Thu, 06 Apr 2017 10:25:02 +0100	[thread overview]
Message-ID: <58E6096E.4060206@arm.com> (raw)
In-Reply-To: <CAMj-D2A2QyvjUvbEcnaPcPsgySvAguWFkZSS1WxxT+T3uNU7aw@mail.gmail.com>

Hi gengdongjiu,

On 05/04/17 00:05, gengdongjiu wrote:
> thanks for the patch, have you consider to told Qemu or KVM tools
> the reason for this bus error(SEA/SEI)?

They should never need to know. We should treat Qemu/kvmtool like any other
program. Programs should only need to know about the affect on them, not the
underlying reason or mechanism.


> when Qemu or KVM tools get this SIGBUS signal, it do not know receive
> this SIGBUS due to SEA or SEI.

Why would this matter?

Firmware signalled Linux that something bad happened. Linux handles the problem
and everything keeps running.

The interface with firmware has to be architecture specific. When signalling
user-space it should be architecture agnostic, otherwise we can't write portable
user space code.


If Qemu was affected by the error (currently only if some of its memory was
hwpoisoned) we send it SIGBUS as we would for any other program. Qemu can choose
if and how to signal the guest about this error, it doesn't have to use the same
interface as firmware and the host used. With TCG Qemu may be emulating a
totally different architecture!


Looking at the list of errors in table 250 of UEFI 2.6, cache-errors are the
only case I can imagine we would want to report to a guest, these are
effectively transient memory errors. SIGBUS is still appropriate here, but we
probably need a new si_code value to indicate the error can be cleared. (unlike
hwpoison which appears to never re-use the affected page).


Thanks,

James

WARNING: multiple messages have this Message-ID (diff)
From: james.morse@arm.com (James Morse)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] KVM: arm/arm64: Signal SIGBUS when stage2 discovers hwpoison memory
Date: Thu, 06 Apr 2017 10:25:02 +0100	[thread overview]
Message-ID: <58E6096E.4060206@arm.com> (raw)
In-Reply-To: <CAMj-D2A2QyvjUvbEcnaPcPsgySvAguWFkZSS1WxxT+T3uNU7aw@mail.gmail.com>

Hi gengdongjiu,

On 05/04/17 00:05, gengdongjiu wrote:
> thanks for the patch, have you consider to told Qemu or KVM tools
> the reason for this bus error(SEA/SEI)?

They should never need to know. We should treat Qemu/kvmtool like any other
program. Programs should only need to know about the affect on them, not the
underlying reason or mechanism.


> when Qemu or KVM tools get this SIGBUS signal, it do not know receive
> this SIGBUS due to SEA or SEI.

Why would this matter?

Firmware signalled Linux that something bad happened. Linux handles the problem
and everything keeps running.

The interface with firmware has to be architecture specific. When signalling
user-space it should be architecture agnostic, otherwise we can't write portable
user space code.


If Qemu was affected by the error (currently only if some of its memory was
hwpoisoned) we send it SIGBUS as we would for any other program. Qemu can choose
if and how to signal the guest about this error, it doesn't have to use the same
interface as firmware and the host used. With TCG Qemu may be emulating a
totally different architecture!


Looking at the list of errors in table 250 of UEFI 2.6, cache-errors are the
only case I can imagine we would want to report to a guest, these are
effectively transient memory errors. SIGBUS is still appropriate here, but we
probably need a new si_code value to indicate the error can be cleared. (unlike
hwpoison which appears to never re-use the affected page).


Thanks,

James

  reply	other threads:[~2017-04-06  9:23 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-15 16:07 [PATCH] KVM: arm/arm64: Signal SIGBUS when stage2 discovers hwpoison memory James Morse
2017-03-15 16:07 ` James Morse
2017-03-17 15:06 ` Punit Agrawal
2017-03-17 15:06   ` Punit Agrawal
2017-03-17 15:48   ` James Morse
2017-03-17 15:48     ` James Morse
2017-03-24 18:30 ` Christoffer Dall
2017-03-24 18:30   ` Christoffer Dall
2017-03-27 11:20   ` Punit Agrawal
2017-03-27 11:20     ` Punit Agrawal
2017-03-27 12:00     ` James Morse
2017-03-27 12:00       ` James Morse
2017-03-27 12:44       ` Christoffer Dall
2017-03-27 12:44         ` Christoffer Dall
2017-03-27 13:31         ` Punit Agrawal
2017-03-27 13:31           ` Punit Agrawal
2017-03-27 13:38           ` Marc Zyngier
2017-03-27 13:38             ` Marc Zyngier
2017-03-27 14:04             ` Punit Agrawal
2017-03-27 14:04               ` Punit Agrawal
2017-03-27 14:47           ` Christoffer Dall
2017-03-27 14:47             ` Christoffer Dall
2017-03-28 14:50             ` Punit Agrawal
2017-03-28 14:50               ` Punit Agrawal
2017-03-28 15:12               ` Christoffer Dall
2017-03-28 15:12                 ` Christoffer Dall
2017-04-04 23:05 ` gengdongjiu
2017-04-04 23:05   ` gengdongjiu
2017-04-06  9:25   ` James Morse [this message]
2017-04-06  9:25     ` James Morse
2017-04-06 15:06     ` gengdongjiu
2017-04-06 15:06       ` gengdongjiu
2017-04-07 16:12       ` James Morse
2017-04-07 16:12         ` James Morse

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=58E6096E.4060206@arm.com \
    --to=james.morse@arm.com \
    --cc=gengdj.1984@gmail.com \
    --cc=gengdongjiu@huawei.com \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=marc.zyngier@arm.com \
    --cc=punit.agrawal@arm.com \
    --cc=tbaicar@codeaurora.org \
    --cc=wuquanming@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.