qemu-patch-raspberry4/hw
Michael S. Tsirkin 72c194f7e7 i386: ACPI table generation code from seabios
This adds C code for generating ACPI tables at runtime,
imported from seabios git tree
    commit 51684b7ced75fb76776e8ee84833fcfb6ecf12dd

Although ACPI tables come from a system BIOS on real hw,
it makes sense that the ACPI tables are coupled with the
virtual machine, since they have to abstract the x86 machine to
the OS's.

This is widely desired as a way to avoid the churn
and proliferation of QEMU-specific interfaces
associated with ACPI tables in bios code.

Notes:
As BIOS can reprogram devices prior to loading
ACPI tables, we pre-format ACPI tables but defer loading
hardware configuration there until tables are loaded.

The code structure was intentionally kept as close
to the seabios original as possible, to simplify
comparison and making sure we didn't lose anything
in translation.

Minor code duplication results, to help ensure there are no functional
regressions, I think it's better to merge it like this and do more code
changes in follow-up patches.

Cross-version compatibility concerns have been addressed:
    ACPI tables are exposed to guest as FW_CFG entries.
    When running with -M 1.5 and older, this patch disables ACPI
    table generation, and doesn't expose ACPI
    tables to guest.

    As table content is likely to change over time,
    the following measures are taken to simplify
    cross-version migration:
    - All tables besides the RSDP are packed in a single FW CFG entry.
      This entry size is currently 23K. We round it up to 64K
      to avoid too much churn there.
    - Tables are placed in special ROM blob (not mapped into guest memory)
      which is automatically migrated together with the guest, same
      as BIOS code.
    - Offsets where hardware configuration is loaded in ACPI tables
      are also migrated, this is in case future ACPI changes make us
      rearrange the tables in memory.

This patch reuses some code from SeaBIOS, which was originally under
LGPLv2 and then relicensed to GPLv3 or LGPLv3, in QEMU under GPLv2+. This
relicensing has been acked by all contributors that had contributed to the
code since the v2->v3 relicense. ACKs approving the v2+ relicensing are
listed below. The list might include ACKs from people not holding
copyright on any parts of the reused code, but it's better to err on the
side of caution and include them.

Affected SeaBIOS files (GPLv2+ license headers added)
<http://thread.gmane.org/gmane.comp.bios.coreboot.seabios/5949>:

 src/acpi-dsdt-cpu-hotplug.dsl
 src/acpi-dsdt-dbug.dsl
 src/acpi-dsdt-hpet.dsl
 src/acpi-dsdt-isa.dsl
 src/acpi-dsdt-pci-crs.dsl
 src/acpi.c
 src/acpi.h
 src/ssdt-misc.dsl
 src/ssdt-pcihp.dsl
 src/ssdt-proc.dsl
 tools/acpi_extract.py
 tools/acpi_extract_preprocess.py

Each one of the listed people agreed to the following:

> If you allow the use of your contribution in QEMU under the
> terms of GPLv2 or later as proposed by this patch,
> please respond to this mail including the line:
>
> Acked-by: Name <email address>

  Acked-by: Gerd Hoffmann <kraxel@redhat.com>
  Acked-by: Jan Kiszka <jan.kiszka@siemens.com>
  Acked-by: Jason Baron <jbaron@akamai.com>
  Acked-by: David Woodhouse <David.Woodhouse@intel.com>
  Acked-by: Gleb Natapov <gleb@redhat.com>
  Acked-by: Marcelo Tosatti <mtosatti@redhat.com>
  Acked-by: Dave Frodin <dave.frodin@se-eng.com>
  Acked-by: Paolo Bonzini <pbonzini@redhat.com>
  Acked-by: Kevin O'Connor <kevin@koconnor.net>
  Acked-by: Laszlo Ersek <lersek@redhat.com>
  Acked-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
  Acked-by: Isaku Yamahata <yamahata@valinux.co.jp>
  Acked-by: Magnus Christensson <magnus.christensson@intel.com>
  Acked-by: Hu Tao <hutao@cn.fujitsu.com>
  Acked-by: Eduardo Habkost <ehabkost@redhat.com>

Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Tested-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Tested-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-10-14 17:48:57 +03:00
..
9pfs virtio-9p-device: Avoid freeing uninitialized memory 2013-08-01 11:18:24 -05:00
acpi acpi: add interface to access user-installed tables 2013-10-14 17:48:53 +03:00
alpha pc,pci,virtio fixes and cleanups 2013-09-03 12:31:07 -05:00
arm QOM CPUState refactorings / X86CPU 2013-09-03 12:33:32 -05:00
audio hw: set interrupts using pci irq wrappers 2013-10-14 17:11:45 +03:00
block hw: set interrupts using pci irq wrappers 2013-10-14 17:11:45 +03:00
bt Preparation for usb-bt-dongle conditional build 2013-09-10 11:14:41 +02:00
char hw: set interrupts using pci irq wrappers 2013-10-14 17:11:45 +03:00
core loader: allow adding ROMs in done callbacks 2013-10-14 17:48:52 +03:00
cpu QOM CPUState refactorings / X86CPU 2013-09-03 12:33:32 -05:00
cris hw: Clean up bogus default boot order 2013-08-28 10:16:47 +03:00
display hw: set interrupts using pci irq wrappers 2013-10-14 17:11:45 +03:00
dma qom: Pass available size to object_initialize() 2013-08-30 21:15:44 +02:00
gpio gpio/zaurus: QOM cast cleanup 2013-07-29 21:06:57 +02:00
i2c exynos4210_i2c: QOM cast cleanup 2013-07-29 21:07:02 +02:00
i386 i386: ACPI table generation code from seabios 2013-10-14 17:48:57 +03:00
ide hw: set interrupts using pci irq wrappers 2013-10-14 17:11:45 +03:00
input aio / timers: Switch entire codebase to the new timer API 2013-08-22 19:14:24 +02:00
intc QOM device refactorings 2013-09-03 12:30:51 -05:00
isa ich9: APIs for pc guest info 2013-10-14 17:48:52 +03:00
lm32 loader: support for unmapped ROM blobs 2013-10-14 17:48:51 +03:00
m68k hw: Clean up bogus default boot order 2013-08-28 10:16:47 +03:00
microblaze hw: Clean up bogus default boot order 2013-08-28 10:16:47 +03:00
mips mips_malta: support up to 2GiB RAM 2013-09-09 18:42:22 +02:00
misc pvpanic: add API to access io port 2013-10-14 17:48:52 +03:00
moxie memory: add owner argument to initialization functions 2013-07-04 17:42:44 +02:00
net hw: set interrupts using pci irq wrappers 2013-10-14 17:11:45 +03:00
nvram fw_cfg: interface to trigger callback on read 2013-10-14 17:48:51 +03:00
openrisc pc,pci,virtio fixes and cleanups 2013-09-03 12:31:07 -05:00
pci pcie_host: expose address format 2013-10-14 17:48:51 +03:00
pci-bridge hw/pci-bridge: set PCI_INTERRUPT_PIN register before shpc init 2013-10-14 17:11:45 +03:00
pci-host ich9: APIs for pc guest info 2013-10-14 17:48:52 +03:00
ppc QOM CPUState refactorings / X86CPU 2013-09-03 12:33:32 -05:00
s390x Merge remote-tracking branch 'mjt/trivial-patches' into staging 2013-09-03 12:31:44 -05:00
scsi hw: set interrupts using pci irq wrappers 2013-10-14 17:11:45 +03:00
sd aio / timers: Switch entire codebase to the new timer API 2013-08-22 19:14:24 +02:00
sh4 hw: Clean up bogus default boot order 2013-08-28 10:16:47 +03:00
sparc hw: Clean up bogus default boot order 2013-08-28 10:16:47 +03:00
sparc64 pc,pci,virtio fixes and cleanups 2013-09-03 12:31:07 -05:00
ssi xilinx_spi: QOM cast cleanup 2013-07-29 21:07:01 +02:00
timer hpet: add API to find it 2013-10-14 17:48:52 +03:00
tpm aio / timers: Untangle include files 2013-08-22 19:10:27 +02:00
unicore32 hw: Clean up bogus default boot order 2013-08-28 10:16:47 +03:00
usb hw: set interrupts using pci irq wrappers 2013-10-14 17:11:45 +03:00
virtio hw: set interrupts using pci irq wrappers 2013-10-14 17:11:45 +03:00
watchdog aio / timers: Switch entire codebase to the new timer API 2013-08-22 19:14:24 +02:00
xen devices: Associate devices to their logical category 2013-07-29 10:37:09 -05:00
xtensa pc,pci,virtio fixes and cleanups 2013-09-03 12:31:07 -05:00
Makefile.objs virtio: simplify Makefile conditionals 2013-04-19 16:18:11 +02:00