All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH resend v4 0/3] Generate APEI GHES table and dynamically record CPER
@ 2017-07-11  6:46 Dongjiu Geng
  2017-07-11 13:43 ` Laszlo Ersek
  0 siblings, 1 reply; 5+ messages in thread
From: Dongjiu Geng @ 2017-07-11  6:46 UTC (permalink / raw)
  To: lersek, mst, imammedo, famz, qemu-devel, zhaoshenglong,
	peter.maydell, qemu-arm, zhengqiang10, huangshaoyu, wuquanming,
	zhihui.gao
  Cc: gengdongjiu

In the armv8 platform, the mainly hardware error source are ARMv8
SEA/SEI/GSIV. For the ARMv8 SEA/SEI, the KVM or host kernel will signal SIGBUS
or use other interface to notify user space, such as Qemu. After Qemu gets
the notification, it will record the CPER and inject the SEA/SEI to KVM. this
series of patches will generate APEI table when guest OS boot up, and dynamically
record CPER for the guest OS about the generic hardware errors

how to test:
1. In the guest OS, use this command to dump the APEI table: 
	"iasl -p ./HEST -d /sys/firmware/acpi/tables/HEST"
2. And find the address for the generic error status block
   according to the notification type
3. then find the CPER record through the generic error status block.

For example(notification type is SEA):

(1) root@genericarmv8:~# iasl -p ./HEST -d /sys/firmware/acpi/tables/HEST
(2) root@genericarmv8:~# cat HEST.dsl
	/*
	 * Intel ACPI Component Architecture
	 * AML/ASL+ Disassembler version 20170303 (64-bit version)
	 * Copyright (c) 2000 - 2017 Intel Corporation
	 *
	 * Disassembly of /sys/firmware/acpi/tables/HEST, Mon Dec 12 07:19:43 2016
	 *
	 * ACPI Data Table [HEST]
	 *
	 * Format: [HexOffset DecimalOffset ByteLength]  FieldName : FieldValue
	 */
    ..................................................................................
    [228h 0552   2]                Subtable Type : 0009 [Generic Hardware Error Source]
	[22Ah 0554   2]                    Source Id : 0008
	[22Ch 0556   2]            Related Source Id : FFFF
	[22Eh 0558   1]                     Reserved : 00
	[22Fh 0559   1]                      Enabled : 01
	[230h 0560   4]       Records To Preallocate : 00000001
	[234h 0564   4]      Max Sections Per Record : 00000001
	[238h 0568   4]          Max Raw Data Length : 00001000

	[23Ch 0572  12]         Error Status Address : [Generic Address Structure]
	[23Ch 0572   1]                     Space ID : 00 [SystemMemory]
	[23Dh 0573   1]                    Bit Width : 40
	[23Eh 0574   1]                   Bit Offset : 00
	[23Fh 0575   1]         Encoded Access Width : 04 [QWord Access:64]
	[240h 0576   8]                      Address : 00000000785D0040

	[248h 0584  28]                       Notify : [Hardware Error Notification Structure]
	[248h 0584   1]                  Notify Type : 08 [SEA]
	[249h 0585   1]                Notify Length : 1C
	[24Ah 0586   2]   Configuration Write Enable : 0000
	[24Ch 0588   4]                 PollInterval : 00000000
	[250h 0592   4]                       Vector : 00000000
	[254h 0596   4]      Polling Threshold Value : 00000000
	[258h 0600   4]     Polling Threshold Window : 00000000
	[25Ch 0604   4]        Error Threshold Value : 00000000
	[260h 0608   4]       Error Threshold Window : 00000000

	[264h 0612   4]    Error Status Block Length : 00001000
    .....................................................................................
(3) according to above table, the address that contains the physical address of a block
    of memory that holds the error status data for SEA notification error source is 0x00000000785D0040
(4) the address for SEA notification error source is 0x785d8058
	(qemu) xp /2x 0x00000000785D0040
	00000000785d0040: 0x785d8058 0x00000000
(5) check the content of generic error status block and generic error data entry
    (qemu) xp /100x 0x785d8058
    00000000785d8058: 0x00000001 0x00000000 0x00000000 0x00000098
    00000000785d8068: 0x00000001 0xa5bc1114 0x4ede6f64 0x833e63b8
	00000000785d8078: 0xb1837ced 0x00000000 0x00000000 0x00000050
	00000000785d8088: 0x00000000 0x00000000 0x00000000 0x00000000
	00000000785d8098: 0x00000000 0x00000000 0x00000000 0x00000000
	00000000785d80a8: 0x00000000 0x00000000 0x00000000 0x00004002
	00000000785d80b8: 0x00000000 0x00000000 0x00000000 0x00001111
	00000000785d80c8: 0x00000000 0x00000000 0x00000000 0x00000000
	00000000785d80d8: 0x00000000 0x00000000 0x00000000 0x00000000
	00000000785d80e8: 0x00000000 0x00000000 0x00000000 0x00000000
	00000000785d80f8: 0x00000000 0x00000003 0x00000000 0x00000000
	00000000785d8108: 0x00000000 0x00000000 0x00000000 0x00000000
	00000000785d8118: 0x00000000 0x00000000 0x00000000 0x00000000
	00000000785d8128: 0x00000000 0x00000000 0x00000000 0x00000000
	00000000785d8138: 0x00000000 0x00000000 0x00000000 0x00000000

Dongjiu Geng (3):
  ACPI: Add new ACPI structures and macros
  ACPI: Add APEI GHES Table Generation support
  ACPI: build and enable APEI GHES in the Makefile and configuration

 default-configs/arm-softmmu.mak |   1 +
 hw/acpi/Makefile.objs           |   1 +
 hw/acpi/aml-build.c             |   2 +
 hw/acpi/hest_ghes.c             | 219 ++++++++++++++++++++++++++++++++++++++++
 hw/arm/virt-acpi-build.c        |   6 ++
 include/hw/acpi/acpi-defs.h     | 194 +++++++++++++++++++++++++++++++++++
 include/hw/acpi/aml-build.h     |   1 +
 include/hw/acpi/hest_ghes.h     |  47 +++++++++
 include/qemu/uuid.h             |  11 ++
 9 files changed, 482 insertions(+)
 create mode 100644 hw/acpi/hest_ghes.c
 create mode 100644 include/hw/acpi/hest_ghes.h

-- 
2.10.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH resend v4 0/3] Generate APEI GHES table and dynamically record CPER
  2017-07-11  6:46 [Qemu-devel] [PATCH resend v4 0/3] Generate APEI GHES table and dynamically record CPER Dongjiu Geng
@ 2017-07-11 13:43 ` Laszlo Ersek
  2017-07-11 13:58   ` Eric Blake
  0 siblings, 1 reply; 5+ messages in thread
From: Laszlo Ersek @ 2017-07-11 13:43 UTC (permalink / raw)
  To: Dongjiu Geng
  Cc: mst, imammedo, famz, qemu-devel, zhaoshenglong, peter.maydell,
	qemu-arm, zhengqiang10, huangshaoyu, wuquanming, zhihui.gao,
	Eric Blake

Hi Dongjiu,

On 07/11/17 08:46, Dongjiu Geng wrote:
> [...]

So my followup is off-topic, but I'd like to point out that the patch /
email threading in this series is still incorrect.

These are the "sent" timestamps on the messages:

Date: Tue, 11 Jul 2017 14:46:19 +0800
Date: Tue, 11 Jul 2017 14:46:31 +0800 (+12 seconds)
Date: Tue, 11 Jul 2017 14:46:41 +0800 (+10 seconds)
Date: Tue, 11 Jul 2017 14:47:00 +0800 (+19 seconds)

This tells me that you are mailing out the patches one by one. That's
not how most people post their patches.

(Side remark: while git-send-email can still get the threading right
with individual posting, for that you would have to provide the first
email's Message-Id individually to all the subsequent commands, and the
emails show that this didn't happen.)

Instead, you should invoke git-send-email with all the messages *at
once*. Then git-send-email can set up the threading automatically. From
git-send-email(1):

> GIT-SEND-EMAIL(1)            Git Manual            GIT-SEND-EMAIL(1)
>
> NAME
>        git-send-email - Send a collection of patches as emails
>
> SYNOPSIS
>        git send-email [options] <file|directory|rev-list options>...
>        git send-email --dump-aliases
>
> DESCRIPTION
>        Takes the patches given on the command line and emails them
>        out. Patches can be specified as files, directories (which
>        will send all files in the directory), or directly as a
>        revision list. In the last case, any format accepted by git-
>        format-patch(1) can be passed to git send-email.

So send the patches with

  git send-email *.patch

or put all the patches into a temporary directory, and run

  git send-email patch-dir/

Thanks,
Laszlo

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH resend v4 0/3] Generate APEI GHES table and dynamically record CPER
  2017-07-11 13:43 ` Laszlo Ersek
@ 2017-07-11 13:58   ` Eric Blake
  2017-07-12  1:52     ` gengdongjiu
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Blake @ 2017-07-11 13:58 UTC (permalink / raw)
  To: Laszlo Ersek, Dongjiu Geng
  Cc: mst, imammedo, famz, qemu-devel, zhaoshenglong, peter.maydell,
	qemu-arm, zhengqiang10, huangshaoyu, wuquanming, zhihui.gao

[-- Attachment #1: Type: text/plain, Size: 692 bytes --]

On 07/11/2017 08:43 AM, Laszlo Ersek wrote:
> So send the patches with
> 
>   git send-email *.patch
> 
> or put all the patches into a temporary directory, and run
> 
>   git send-email patch-dir/

Or you can even skip patch files, and directly send things with one lass
chance in your editor:

git send-email -v5 -3 --annotate --cover-letter

[send the top three commits in my current git branch as a version 5
patch series, where I get to write the cover letter and tweak any of the
patches in my preferred $EDITOR before sending anything]

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH resend v4 0/3] Generate APEI GHES table and dynamically record CPER
  2017-07-11 13:58   ` Eric Blake
@ 2017-07-12  1:52     ` gengdongjiu
  0 siblings, 0 replies; 5+ messages in thread
From: gengdongjiu @ 2017-07-12  1:52 UTC (permalink / raw)
  To: Eric Blake, Laszlo Ersek
  Cc: mst, imammedo, famz, qemu-devel, Zhaoshenglong, peter.maydell,
	qemu-arm, Zhengqiang (turing),
	Huangshaoyu, Wuquanming

Eric,
  I have submitted patch version 5 to fix the issue that you are concerned, hope you can have a review this series of patches, thanks.

Result: 250 2.6.0 <1499825297-20335-1-git-send-email-gengdongjiu@huawei.com> [InternalId=34134279] Queued mail for delivery
Result: 250 2.6.0 <1499825297-20335-2-git-send-email-gengdongjiu@huawei.com> [InternalId=34134285] Queued mail for delivery
Result: 250 2.6.0 <1499825297-20335-3-git-send-email-gengdongjiu@huawei.com> [InternalId=34134289] Queued mail for delivery
Result: 250 2.6.0 <1499825297-20335-4-git-send-email-gengdongjiu@huawei.com> [InternalId=34134294] Queued mail for delivery



On 2017/7/11 21:58, Eric Blake wrote:
> On 07/11/2017 08:43 AM, Laszlo Ersek wrote:
>> So send the patches with
>>
>>   git send-email *.patch
>>
>> or put all the patches into a temporary directory, and run
>>
>>   git send-email patch-dir/
> 
> Or you can even skip patch files, and directly send things with one lass
> chance in your editor:
> 
> git send-email -v5 -3 --annotate --cover-letter
> 
> [send the top three commits in my current git branch as a version 5
> patch series, where I get to write the cover letter and tweak any of the
> patches in my preferred $EDITOR before sending anything]
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH resend v4 0/3] Generate APEI GHES table and dynamically record CPER
@ 2017-07-11 14:50 gengdongjiu
  0 siblings, 0 replies; 5+ messages in thread
From: gengdongjiu @ 2017-07-11 14:50 UTC (permalink / raw)
  To: Eric Blake, Laszlo Ersek
  Cc: mst, imammedo, famz, qemu-devel, Zhaoshenglong, peter.maydell,
	qemu-arm, Zhengqiang (turing),
	Huangshaoyu, Wuquanming

Eric,
  Thanks for your follow up. 
It is indeed that I send the patches one by one. they should be sent together.
I will use below commands to fix this issue, now the chines time is midnight, so I will have to update it tomorrow. 

> So send the patches with
> 
>   git send-email *.patch
> 
> or put all the patches into a temporary directory, and run
> 
>   git send-email patch-dir/


-----邮件原件-----
发件人: Eric Blake [mailto:eblake@redhat.com] 
发送时间: 2017年7月11日 21:58
收件人: Laszlo Ersek <lersek@redhat.com>; gengdongjiu <gengdongjiu@huawei.com>
抄送: mst@redhat.com; imammedo@redhat.com; famz@redhat.com; qemu-devel@nongnu.org; Zhaoshenglong <zhaoshenglong@huawei.com>; peter.maydell@linaro.org; qemu-arm@nongnu.org; Zhengqiang (turing) <zhengqiang10@huawei.com>; Huangshaoyu <huangshaoyu@huawei.com>; Wuquanming <wuquanming@huawei.com>; Gaozhihui <zhihui.gao@huawei.com>
主题: Re: [PATCH resend v4 0/3] Generate APEI GHES table and dynamically record CPER

On 07/11/2017 08:43 AM, Laszlo Ersek wrote:
> So send the patches with
> 
>   git send-email *.patch
> 
> or put all the patches into a temporary directory, and run
> 
>   git send-email patch-dir/

Or you can even skip patch files, and directly send things with one lass chance in your editor:

git send-email -v5 -3 --annotate --cover-letter

[send the top three commits in my current git branch as a version 5 patch series, where I get to write the cover letter and tweak any of the patches in my preferred $EDITOR before sending anything]

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-07-12  1:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-11  6:46 [Qemu-devel] [PATCH resend v4 0/3] Generate APEI GHES table and dynamically record CPER Dongjiu Geng
2017-07-11 13:43 ` Laszlo Ersek
2017-07-11 13:58   ` Eric Blake
2017-07-12  1:52     ` gengdongjiu
2017-07-11 14:50 gengdongjiu

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.