public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Achin Gupta <achin.gupta@arm.com>,
	gengdongjiu <gengdongjiu@huawei.com>,
	ard.biesheuvel@linaro.org, edk2-devel@lists.01.org,
	qemu-devel@nongnu.org, zhaoshenglong@huawei.com,
	James Morse <james.morse@arm.com>,
	Christoffer Dall <cdall@linaro.org>,
	xiexiuqi@huawei.com, Marc Zyngier <marc.zyngier@arm.com>,
	catalin.marinas@arm.com, will.deacon@arm.com,
	christoffer.dall@linaro.org, rkrcmar@redhat.com,
	suzuki.poulose@arm.com, andre.przywara@arm.com,
	mark.rutland@arm.com, vladimir.murzin@arm.com,
	linux-arm-kernel@lists.infradead.org,
	kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org,
	linux-kernel@vger.kernel.org, wangxiongfeng2@huawei.com,
	wuquanming@huawei.com, huangshaoyu@huawei.com,
	Leif.Lindholm@linaro.com, nd@arm.com,
	Igor Mammedov <imammedo@redhat.com>
Subject: Re: [PATCH] kvm: pass the virtual SEI syndrome to guest OS
Date: Wed, 29 Mar 2017 15:36:59 +0200	[thread overview]
Message-ID: <756e3032-e619-a70d-3e29-d2797e52fecf@redhat.com> (raw)
In-Reply-To: <20170329154539-mutt-send-email-mst@kernel.org>

On 03/29/17 14:51, Michael S. Tsirkin wrote:
> On Wed, Mar 29, 2017 at 01:58:29PM +0200, Laszlo Ersek wrote:
>> (8) When QEMU gets SIGBUS from the kernel -- I hope that's going to come
>> through a signalfd -- QEMU can format the CPER right into guest memory,
>> and then inject whatever interrupt (or assert whatever GPIO line) is
>> necessary for notifying the guest.
> 
> I think I see a race condition potential - what if guest accesses
> CPER in guest memory while it's being written?

I'm not entirely sure about the data flow here (these parts of the ACPI
spec are particularly hard to read...), but I thought the OS wouldn't
look until it got a notification.

Or, are you concerned about the next CPER write by QEMU, while the OS is
reading the last one (and maybe the CPER area could wrap around?)

> 
> We can probably use another level of indirection to fix this:
> 
> allocate twice the space, add a pointer to where the valid
> table is located and update that after writing CPER completely.
> The pointer can be written atomically but also needs to
> be read atomically, so I suspect it should be a single byte
> as we don't know how are OSPMs implementing this.
> 

A-B-A problem? (Is that usually solved with a cookie or a wider
generation counter? But that would again require wider atomics.)

I do wonder though how this is handled on physical hardware. Assuming
the hardware error traps to the firmware first (which, on phys hw, is
responsible for depositing the CPER), in that scenario the phys firmware
would face the same issue (i.e., asynchronously interrupting the OS,
which could be reading the previously stored CPER).

Thanks,
Laszlo


  parent reply	other threads:[~2017-03-29 13:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <76795e20-2f20-1e54-cfa5-7444f28b18ee@huawei.com>
     [not found] ` <20170321113428.GC15920@cbox>
     [not found]   ` <58D17AF0.2010802@arm.com>
     [not found]     ` <20170321193933.GB31111@cbox>
     [not found]       ` <58DA3F68.6090901@arm.com>
     [not found]         ` <20170328112328.GA31156@cbox>
     [not found]           ` <20170328115413.GJ23682@e104320-lin>
     [not found]             ` <b1c6e747-2fa7-b7a1-60d5-4a9c480b9dc9@huawei.com>
     [not found]               ` <58DA67BA.8070404@arm.com>
     [not found]                 ` <5b7352f4-4965-3ed5-3879-db871797be47@huawei.com>
2017-03-29 10:36                   ` [PATCH] kvm: pass the virtual SEI syndrome to guest OS Achin Gupta
2017-03-29 11:58                     ` Laszlo Ersek
     [not found]                       ` <20170329154539-mutt-send-email-mst@kernel.org>
2017-03-29 13:36                         ` Laszlo Ersek [this message]
2017-04-06 12:35                       ` gengdongjiu
2017-04-06 18:55                         ` Laszlo Ersek
2017-04-07  2:52                           ` gengdongjiu
2017-04-07  9:21                             ` Laszlo Ersek
2017-04-21 13:27                           ` gengdongjiu
2017-04-24 11:27                             ` Laszlo Ersek
     [not found]                     ` <CAMj-D2BT3ByY-iFrRVVK7y=G7zhRBtM031VgLn6JzwUE-WCdWQ@mail.gmail.com>
     [not found]                       ` <20170329144822.GA1020@cbox>
2017-03-29 15:37                         ` Laszlo Ersek

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-list 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=756e3032-e619-a70d-3e29-d2797e52fecf@redhat.com \
    --to=devel@edk2.groups.io \
    /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