All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shannon Zhao <zhaoshenglong@huawei.com>
To: Laszlo Ersek <lersek@redhat.com>
Cc: peter.maydell@linaro.org, hangaohuai@huawei.com, mst@redhat.com,
	a.spyridakis@virtualopensystems.com, claudio.fontana@huawei.com,
	qemu-devel@nongnu.org, wanghaibin.wang@huawei.com,
	peter.huangpeng@huawei.com, hanjun.guo@linaro.org,
	imammedo@redhat.com, pbonzini@redhat.com,
	christoffer.dall@linaro.org
Subject: Re: [Qemu-devel] [RFC PATCH 00/11] Generate ACPI v5.1 tables and expose it to guest over fw_cfg on ARM
Date: Mon, 26 Jan 2015 10:34:34 +0800	[thread overview]
Message-ID: <54C5A7BA.8050107@huawei.com> (raw)
In-Reply-To: <54C42B61.8030408@redhat.com>

On 2015/1/25 7:31, Laszlo Ersek wrote:
> On 01/24/15 10:21, Shannon Zhao wrote:
>> This patch series generate seven ACPI v5.1 tables for machine virt on
>> ARM.
>> The set of generated tables are:
>> - RSDP
>> - XSDT
>> - MADT
>> - GTDT
>> - FADT
>> - FACS
>> - DSDT
>>
>> These tables are created dynamically using the function of
>> acpi-build-utils.c, taking into account the needed information passed
>> from the virt machine model. When the generation is finalized, it use
>> fw_cfg to expose the tables to guest.
>>
>> This patchset is based on Igor Mammedov's branch which can be found at
>> below git tree:
>>  https://github.com/imammedo/qemu/commits/ASL_API_v2
> 
> Awesome! I didn't know you had been coordinating with Igor. This is the
> best (or, put differently, "only" :)) possible way forward. Great!
> 

Thanks, Laszlo. Igor Mammedov's work is awesome and make the ACPI generation simpler.

>> And this patchset refers to Alexander Spyridakis's patches which are
>> sent to qemu-devel mailing list before.
>>  http://lists.gnu.org/archive/html/qemu-devel/2014-10/msg03987.html
>>
>> As UEFI (ArmVirtualizationQemu) doesn't support downloading ACPI
>> tables over fw_cfg, I just do compile test and start a guest with
>> UEFI. But I contacted Laszlo Ersek before, he says that if qemu can
>> expose the generated ACPI tables over fw_cfg, he can quickly add
>> support in UEFI. So just send this out and make it go forward.
> 
> I hope I was quick enough:
> - patches: http://thread.gmane.org/gmane.comp.bios.tianocore.devel/12158
> - branch: https://github.com/lersek/edk2/commits/armvirt_acpi
> - binary: http://people.redhat.com/~lersek/armvirt_acpi/QEMU_EFI.fd
> 

Great work!

>>
>> Todo:
>> 1) add GPIO controller in virt and expose it through ACPI
>> 2) add cpu hotplug support
>>
>> Any comments are welcome.
> 
> I answered with a couple of notes and fixes in the thread. I found those
> via testing. I won't offer a code review; I hope you don't mind.
> 
> For testing on your end (and for further development) before the edk2
> series is applied, you can fetch my patches from github, or even use the
> binary I built for you.
> 

Ok, thanks.

> Note: the binary includes a very small patch that is not upstream. (Well
> it includes some other patches too, but they are not relevant.) This is
> it:
> 
>> --- a/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationQemu.dsc
>> +++ b/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationQemu.dsc
>> @@ -87,7 +87,7 @@
>>    gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|FALSE
>>
>>  [PcdsFixedAtBuild.common]
>> -  gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x8000004F
>> +  gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x8040004F
>>
>>    gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"QEMU"
> 
> It enables the EFI_D_VERBOSE loglevel. The ACPI code logs quite a bit of
> info on this loglevel, so if you build an image yourself, be sure to
> enable EFI_D_VERBOSE manually. Otherwise you'll only see a part of this
> log fragment:
> 

Ok, I see.


>> Loading driver at 0x000BEE66000 EntryPoint=0x000BEE662B0 AcpiPlatformDxe.efi
>> InstallProtocolInterface: BC62157E-3E33-4FEC-9920-2D3B36D750DF BB7BBE98
>> ProcessCmdAllocate: File="etc/acpi/rsdp" Alignment=0x10 Zone=2 Size=0x24 Address=0xB7048000
>> ProcessCmdAllocate: File="etc/acpi/tables" Alignment=0x40 Zone=1 Size=0xBC0 Address=0xB7047000
>> ProcessCmdAddChecksum: File="etc/acpi/tables" ResultOffset=0x49 Start=0x40 Length=0x8F4
>> ProcessCmdAddPointer: PointerFile="etc/acpi/tables" PointeeFile="etc/acpi/tables" PointerOffset=0x9B8 PointerSize=8
>> ProcessCmdAddPointer: PointerFile="etc/acpi/tables" PointeeFile="etc/acpi/tables" PointerOffset=0x9C0 PointerSize=8
>> ProcessCmdAddChecksum: File="etc/acpi/tables" ResultOffset=0x93D Start=0x934 Length=0x10C
>> ProcessCmdAddChecksum: File="etc/acpi/tables" ResultOffset=0xA49 Start=0xA40 Length=0xDC
>> ProcessCmdAddChecksum: File="etc/acpi/tables" ResultOffset=0xB25 Start=0xB1C Length=0x60
>> ProcessCmdAddPointer: PointerFile="etc/acpi/tables" PointeeFile="etc/acpi/tables" PointerOffset=0xBA0 PointerSize=8
>> ProcessCmdAddPointer: PointerFile="etc/acpi/tables" PointeeFile="etc/acpi/tables" PointerOffset=0xBA8 PointerSize=8
>> ProcessCmdAddPointer: PointerFile="etc/acpi/tables" PointeeFile="etc/acpi/tables" PointerOffset=0xBB0 PointerSize=8
>> ProcessCmdAddChecksum: File="etc/acpi/tables" ResultOffset=0xB85 Start=0xB7C Length=0x44
>> ProcessCmdAddPointer: PointerFile="etc/acpi/rsdp" PointeeFile="etc/acpi/tables" PointerOffset=0x18 PointerSize=8
>> ProcessCmdAddChecksum: File="etc/acpi/rsdp" ResultOffset=0x8 Start=0x0 Length=0x24
>> Process2ndPassCmdAddPointer: checking for ACPI header in "etc/acpi/tables" at 0xB7047000 (remaining: 0xBC0): found "FACS" size 0x40
>> Process2ndPassCmdAddPointer: checking for ACPI header in "etc/acpi/tables" at 0xB7047040 (remaining: 0xB80): found "DSDT" size 0x8F4
>> Process2ndPassCmdAddPointer: checking for ACPI header in "etc/acpi/tables" at 0xB7047934 (remaining: 0x28C): found "FACP" size 0x10C
>> Process2ndPassCmdAddPointer: checking for ACPI header in "etc/acpi/tables" at 0xB7047A40 (remaining: 0x180): found "APIC" size 0xDC
>> Process2ndPassCmdAddPointer: checking for ACPI header in "etc/acpi/tables" at 0xB7047B1C (remaining: 0xA4): found "GTDT" size 0x60
>> Process2ndPassCmdAddPointer: checking for ACPI header in "etc/acpi/tables" at 0xB7047B7C (remaining: 0x44): found "XSDT" size 0x44
>> InstallAllQemuLinkedTables: installed 5 tables
>> InstallAllQemuLinkedTables: freeing "etc/acpi/rsdp"
>> InstallAllQemuLinkedTables: freeing "etc/acpi/tables"
> 
> Before you ask:
> - The fact that RSDP is not listed in the log above is not a problem;
>   it's intentional.
> - The fact that XSDT (and RSDT, if it were there) is not installed,
>   despite being listed, it's intentional too.
> - Yes, your code is correct, and you should continue generating those
>   things; I need them.
> The short explanation is that UEFI handles these tables automatically in
> "some place", but I still need them "elsewhere".
> 
> So that's why 5 tables are installed for OSPM: FACS, DSDT, FACP, ACPI,
> GTDT.
> 
> Also, I decompiled those tables that were visible under
> /sys/firmware/acpi/tables/ inside the guest. Please find them attached.
> The FACS won't be there, but I explained that in another email -- the
> kernel ignores the FACS because it sees the hw-reduced mode.
> 

Thanks for your explanation and great support.
Thanks,
Shannon

      reply	other threads:[~2015-01-26  2:36 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-24  9:21 [Qemu-devel] [RFC PATCH 00/11] Generate ACPI v5.1 tables and expose it to guest over fw_cfg on ARM Shannon Zhao
2015-01-24  9:21 ` [Qemu-devel] [RFC PATCH 01/11] hw/i386: Move ACPI header definitions in an arch-independent location Shannon Zhao
2015-01-24  9:21 ` [Qemu-devel] [RFC PATCH 02/11] hw/arm/virt-acpi-build: Basic framework for building ACPI tables Shannon Zhao
2015-01-24 16:22   ` Michael S. Tsirkin
2015-01-26  2:37     ` Shannon Zhao
2015-01-26 10:19   ` Igor Mammedov
2015-01-27  6:47     ` Shannon Zhao
2015-01-27 10:30       ` Igor Mammedov
2015-01-28  6:28         ` Shannon Zhao
2015-01-27 12:12   ` Hanjun Guo
2015-01-24  9:21 ` [Qemu-devel] [RFC PATCH 03/11] hw/arm/virt-acpi-build: Generate RSDP table Shannon Zhao
2015-01-26 10:22   ` Igor Mammedov
2015-01-27  6:50     ` Shannon Zhao
2015-01-27  9:36     ` Shannon Zhao
2015-01-27  9:42       ` Igor Mammedov
2015-01-24  9:21 ` [Qemu-devel] [RFC PATCH 04/11] hw/arm/virt-acpi-build: Generate XSDT table and add a build_header function Shannon Zhao
2015-01-24 22:04   ` Laszlo Ersek
2015-01-26  1:45     ` Shannon Zhao
2015-01-24  9:21 ` [Qemu-devel] [RFC PATCH 05/11] hw/arm/virt-acpi-build: Generate MADT table Shannon Zhao
2015-01-24  9:21 ` [Qemu-devel] [RFC PATCH 06/11] hw/arm/virt-acpi-build: Generate GTDT table Shannon Zhao
2015-01-24  9:21 ` [Qemu-devel] [RFC PATCH 07/11] hw/arm/virt-acpi-build: Generate FADT table and update ACPI headers Shannon Zhao
2015-01-24 22:05   ` Laszlo Ersek
2015-01-26  1:48     ` Shannon Zhao
2015-01-24  9:21 ` [Qemu-devel] [RFC PATCH 08/11] hw/arm/virt-acpi-build: Generate FACS " Shannon Zhao
2015-01-24  9:21 ` [Qemu-devel] [RFC PATCH 09/11] hw/acpi/acpi-build-utils: Add acpi_fixed_memory32() and acpi_extended_irq() Shannon Zhao
2015-01-25  8:39   ` Michael S. Tsirkin
2015-01-26  1:58     ` Shannon Zhao
2015-01-26 10:46     ` Igor Mammedov
2015-01-24  9:21 ` [Qemu-devel] [RFC PATCH 10/11] hw/arm/virt-acpi-build: Generation of DSDT table for virt devices Shannon Zhao
2015-01-26 10:40   ` Igor Mammedov
2015-01-27  7:19     ` Shannon Zhao
2015-01-24  9:21 ` [Qemu-devel] [RFC PATCH 11/11] hw/arm/virt: Enable dynamic generation of ACPI v5.1 tables Shannon Zhao
2015-01-24 18:56   ` Laszlo Ersek
2015-01-26  1:59     ` Shannon Zhao
2015-01-24 23:31 ` [Qemu-devel] [RFC PATCH 00/11] Generate ACPI v5.1 tables and expose it to guest over fw_cfg on ARM Laszlo Ersek
2015-01-26  2:34   ` Shannon Zhao [this message]

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=54C5A7BA.8050107@huawei.com \
    --to=zhaoshenglong@huawei.com \
    --cc=a.spyridakis@virtualopensystems.com \
    --cc=christoffer.dall@linaro.org \
    --cc=claudio.fontana@huawei.com \
    --cc=hangaohuai@huawei.com \
    --cc=hanjun.guo@linaro.org \
    --cc=imammedo@redhat.com \
    --cc=lersek@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.huangpeng@huawei.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=wanghaibin.wang@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.