qemu-arm
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-arm] [Qemu-devel] [PATCH v5 1/3] ACPI: Add new ACPI structures


From: gengdongjiu
Subject: Re: [Qemu-arm] [Qemu-devel] [PATCH v5 1/3] ACPI: Add new ACPI structures and macros
Date: Sat, 15 Jul 2017 00:14:43 +0000

Hi Michael
  Thanks for your comments.

> -----邮件原件-----
> 发件人: Michael S. Tsirkin [mailto:address@hidden
> 主题: Re: [Qemu-devel] [PATCH v5 1/3] ACPI: Add new ACPI structures and
> macros
> 
> On Thu, Jul 13, 2017 at 08:00:26PM +0800, gengdongjiu wrote:
> >    Laszlo, I pasted Michael's comments here, as shown below. Michael
> > said the definition should use build_append_int_noprefix to add data.
> > but I think it may not good, becuase the section
> > "UEFI_CPER_SEC_PLATFORM_MEM" is runtime recorded as CPER,
> 
> One thing I wanted to understand is how are races avoided. E.g. what if you 
> are
> in the process of writing out CPER and guest reads it.
> I tried to find where is this function writing CPER called and couldn't.
> Can you clarify pls?

Michael, I understand your idea. You want to see the read-write race condition.
this function writing CPER is called in another series of patches. Because they 
are needed
to be review together with KVM kernel, so I put it in another series.
I clarify the method to avoid the read-write race condition

ACPI 6.1, "Generic Hardware Error Source version 2 (GHESv2 - Type 10)" has 
mentioned the avoid method.
For GHESv2 error sources, the OS must acknowledge the consumption of the Error 
Status Block by writing to the “Read Ack Register” listed in the GHESv2 
structure

These are the steps the OS must take once detecting an error from a particular 
GHESv2 error source:
• OS detects error (via interrupt/exception or polling the block status)
• OS copies the error status block
• OS clears the block status field of the error status block
• OS acknowledges the error via Read Ack register. For example:
—OS reads the Read Ack register  X
—OS writes  (( X & ReadAckPreserve) | ReadAckWrite)

So in the Qemu, before Qemu writes the next CPER, it needs to check the "Read 
Ack register". If the "Read Ack Register" does not been written with the 
response, Qemu will wait until 
OS responds the "Read Ack Register", so can avoid the read-write race condition.

In my patch, it misses the check to "Read Ack Register" to avoid the read-write 
race condition. I will add the code in the next code version. 
> 
> > not a ACPI/HEST
> > table member, so it is not generated when system boot up. On the other
> > hand,UEFI_CPER_SEC_PLATFORM_MEM definition is from UEFI spec 2.6,
> N.2.2 Section Descriptor: {0xA5BC1114, 0x6F64, 0x4EDE, {0xB8, 0x63, 0x3E,
> 0x83, 0xED, 0x7C, 0x83, 0xB1}}.
> > if use  build_append_int_noprefix to add, may confuse others.
> 
> Right but ACPI/HEST generation could use cleanup, and
> build_append_int_noprefix would be a nice way to do it.

Ok, I will follow your method to do it. Thanks for the suggestion.


> 
> --
> MST

reply via email to

[Prev in Thread] Current Thread [Next in Thread]