summaryrefslogtreecommitdiffstats
path: root/hw/acpi
Commit message (Collapse)AuthorAgeFilesLines
* aml-build: fix build for glib < 2.22Michael S. Tsirkin2015-03-031-2/+3
| | | | | | | | g_ptr_array_new_with_free_func is there since glib 2.22, use the older g_ptr_array_foreach instead. Reported-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* acpi, mem-hotplug: use PC_DIMM_SLOT_PROP in acpi_memory_plug_cb().Tang Chen2015-03-011-1/+2
| | | | | | | | | | Replace string "slot" in acpi_memory_plug_cb() with macro PC_DIMM_SLOT_PROP. Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com> Signed-off-by: Zhu Guihua <zhugh.fnst@cn.fujitsu.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* acpi: make build_*() routines static to aml-build.cIgor Mammedov2015-03-011-10/+10
| | | | | | | | | | | | build_*() routines were used for composing AML structures manually in acpi-build.c but after conversion to AML API they are not used outside of aml-build.c anymore, so hide them from external users. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* acpi: add acpi_irq_no_flags() termIgor Mammedov2015-03-011-0/+21
| | | | | | Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* pc: pcihp: expose MMIO base and len as propertiesIgor Mammedov2015-02-262-7/+13
| | | | | | | | | it will be used later to dynamically reserve MMIO region instead of manually punching holes in PCI0._CRS Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* acpi: add aml_word_bus_number(), aml_word_io(), aml_dword_memory(), ↵Igor Mammedov2015-02-261-0/+161
| | | | | | | | aml_qword_memory() terms Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* acpi: add aml_reserved_field() termIgor Mammedov2015-02-261-0/+10
| | | | | | Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* acpi: add aml_eisaid() termIgor Mammedov2015-02-261-0/+29
| | | | | | Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* acpi: add aml_processor() termIgor Mammedov2015-02-261-0/+15
| | | | | | Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* acpi: add aml_equal() termIgor Mammedov2015-02-261-0/+10
| | | | | | Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* acpi: add aml_varpackage() termIgor Mammedov2015-02-261-0/+8
| | | | | | Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* acpi: add aml_string() termIgor Mammedov2015-02-261-0/+25
| | | | | | Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* acpi: add aml_local() termIgor Mammedov2015-02-261-0/+11
| | | | | | Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* acpi: add aml_field() & aml_named_field() termsIgor Mammedov2015-02-261-0/+28
| | | | | | Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* acpi: add aml_operation_region() termIgor Mammedov2015-02-261-0/+14
| | | | | | Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* acpi: include PkgLength size only when requestedIgor Mammedov2015-02-261-5/+15
| | | | | | | | | | | | | | | | | | Named/Reserved{Field} definition uses PkgLength [1] encoding to specify field length, however it doesn't include size of PkgLength field itself, while other block objects that have explicit length of its body account for PkgLength size while encoding it [2]. This special casing isn't mentioned in ACPI spec, but that's what 'iasl' compiles NamedField to so add extra argument to build_prepend_pkg_length() to allow it handle the case. -- 1. ACPI Spec 5.0, 20.2.5.2 Named Objects Encoding, page 822 2. ACPI Spec 5.0, 5.4 Definition Block Encoding Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* acpi: add aml_io() helperIgor Mammedov2015-02-261-0/+16
| | | | | | Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* acpi: add aml_resource_template() helperIgor Mammedov2015-02-261-0/+8
| | | | | | Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* acpi: add aml_buffer() termIgor Mammedov2015-02-261-0/+7
| | | | | | Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* acpi: add aml_package() termIgor Mammedov2015-02-261-0/+8
| | | | | | Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* acpi: add aml_call1(), aml_call2(), aml_call3(), aml_call4() helpersIgor Mammedov2015-02-261-0/+42
| | | | | | Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* acpi: add aml_notify() termIgor Mammedov2015-02-261-0/+9
| | | | | | Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* acpi: add aml_and() termIgor Mammedov2015-02-261-0/+10
| | | | | | Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* acpi: add aml_store() termIgor Mammedov2015-02-261-0/+9
| | | | | | Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* acpi: add aml_arg() termIgor Mammedov2015-02-261-0/+11
| | | | | | Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* acpi: add aml_return() termIgor Mammedov2015-02-261-0/+8
| | | | | | Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* acpi: add aml_int() termIgor Mammedov2015-02-261-21/+22
| | | | | | | | | | | | | * factor out ACPI const int packing out of build_append_value() and rename build_append_value() to build_append_int_noprefix() it will be reused for adding a plain integer value into AML. will be used by is aml_processor() and CRS macro helpers * extend build_append_int{_noprefix}() to support 64-bit values it will be used PCI for generating 64bit _CRS entries Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* acpi: add aml_name() & aml_name_decl() termIgor Mammedov2015-02-261-0/+32
| | | | | | Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* acpi: add aml_if() termIgor Mammedov2015-02-261-0/+8
| | | | | | Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* acpi: add aml_method() termIgor Mammedov2015-02-261-0/+9
| | | | | | Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* acpi: add aml_device() termIgor Mammedov2015-02-261-0/+11
| | | | | | Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* acpi: add aml_scope() termIgor Mammedov2015-02-261-0/+20
| | | | | | Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* acpi: introduce AML composer aml_append()Igor Mammedov2015-02-261-0/+78
| | | | | | | | | | | | | | | | | | | | | | | | | Adds for dynamic AML creation, which will be used for piecing ASL/AML primitives together and hiding from user/caller details about how nested context should be closed/packed leaving less space for mistakes and necessity to know how AML should be encoded, allowing user to concentrate on ASL representation instead. For example it will allow to create AML like this: init_aml_allocator(); ... Aml *scope = aml_scope("PCI0") Aml *dev = aml_device("PM") aml_append(dev, aml_name_decl("_ADR", aml_int(addr))) aml_append(scope, dev); ... free_aml_allocator(); Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* acpi, piix4: Add unplug cb for piix4.Tang Chen2015-02-261-0/+8
| | | | | | | | | | | | | | | | | | Memory and CPU hot unplug are both asynchronous procedures. When the unplug operation happens, unplug request cb is called first. And when guest OS finished handling unplug, unplug cb will be called to do the real removal of device. This patch adds hotunplug cb to piix4, which memory and CPU hot unplug will use it. Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com> Signed-off-by: Zhu Guihua <zhugh.fnst@cn.fujitsu.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* acpi, ich9: Add unplug cb for ich9.Tang Chen2015-02-261-0/+7
| | | | | | | | | | | | | | | | | | Memory and CPU hot unplug are both asynchronous procedures. When the unplug operation happens, unplug request cb is called first. And when guest OS finished handling unplug, unplug cb will be called to do the real removal of device. This patch adds hotunplug cb to ich9, which memory and CPU hot unplug will use it. Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com> Signed-off-by: Zhu Guihua <zhugh.fnst@cn.fujitsu.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* acpi, ich9: Add hotunplug request cb for ich9.Tang Chen2015-02-261-0/+7
| | | | | | | | | | | | | | | | Memory and CPU hot unplug are both asynchronous procedures. They both need unplug request cb when the unplug operation happens. This patch adds hotunplug request cb for ich9, and memory and CPU hot unplug will share it. Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com> Signed-off-by: Zhu Guihua <zhugh.fnst@cn.fujitsu.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* pci: Trivial device model conversions to realizeMarkus Armbruster2015-02-261-3/+2
| | | | | | | | | | | Convert the device models where initialization obviously can't fail. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Gonglei <arei.gonglei@huawei.com>
* acpi: drop min-bytes in build_package()Igor Mammedov2015-02-261-10/+4
| | | | | | | | | | Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Claudio Fontana <claudio.fontana@huawei.com> Reviewed-by: Marcel Apfelbaum <marcel@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* acpi: add build_append_namestring() helperIgor Mammedov2015-02-261-9/+87
| | | | | | | | | | | | | | Use build_append_namestring() instead of build_append_nameseg() So user won't have to care whether name is NameSeg, NamePath or NameString. See for reference ACPI 5.0: 20.2.2 Name Objects Encoding Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* acpi: move generic aml building helpers into dedictated fileIgor Mammedov2015-02-262-0/+188
| | | | | | | | | | | | | the will be later used for composing AML primitives and all that could be reused later for ARM machines as well. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Acked-by: Marcel Apfelbaum <marcel@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* bios linker: validate pointer within tableMichael S. Tsirkin2015-02-261-1/+3
| | | | | | | | | buios linker assumes pointer parameter it gets is within table, validate this. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into stagingPeter Maydell2015-01-273-1/+255
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pci, pc, virtio fixes and cleanups A bunch of fixes all over the place. Also, beginning to generalize acpi build code for reuse by ARM. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Tue 27 Jan 2015 13:12:25 GMT using RSA key ID D28D5469 # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" # gpg: aka "Michael S. Tsirkin <mst@redhat.com>" * remotes/mst/tags/for_upstream: pc-dimm: Add Error argument to pc_existing_dimms_capacity pc-dimm: Make pc_existing_dimms_capacity global pc: Fix DIMMs capacity calculation smbios: Don't report unknown CPU speed (fix SVVP regression) smbios: Fix dimm size calculation when RAM is multiple of 16GB bios-linker-loader: move source to common location bios-linker-loader: move header to common location virtio: fix feature bit checks bios-tables-test: split piix4 and q35 tests acpi: build_append_nameseg(): add padding if necessary acpi: update generated hex files acpi-test: update expected DSDT pc: acpi: fix WindowsXP BSOD when memory hotplug is enabled pci: Split pcie_host_mmcfg_map() Add some trace calls to pci.c. ich9: add disable_s3, disable_s4, s4_val properties Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * bios-linker-loader: move source to common locationMichael S. Tsirkin2015-01-272-0/+158
| | | | | | | | | | | | | | | | | | There are plans to use bios linker by MIPS, ARM. It's only used by ACPI ATM, so put it in hw/acpi and make it depend on CONFIG_ACPI. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * ich9: add disable_s3, disable_s4, s4_val propertiesAmit Shah2015-01-261-1/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PIIX4 has disable_s3 and disable_s4 properties to enable or disable PM functions. Add such properties to the ICH9 chipset as well for the Q35 machine type. S3 / S4 are not guaranteed to always work (needs work in the guest as well as QEMU for things to work properly), and disabling advertising of these features ensures guests don't go into zombie state if something isn't working right. The defaults are kept the same as in PIIX4: both S3 and S4 are enabled by default. These can be disabled via the cmdline: ... -global ICH9-LPC.disable_s3=1 -global ICH9-LPC.disable_s4=1 Note: some guests can fake hibernation by writing a hibernate image and doing a shutdown instead of S4 if S4 isn't available; there's nothing we can do guests to stop doing this, and this patch can't affect that functionality. Signed-off-by: Amit Shah <amit.shah@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
* | vmstate: accept QEMUTimer in VMSTATE_TIMER*, add VMSTATE_TIMER_PTR*Paolo Bonzini2015-01-262-2/+2
|/ | | | | | | Old users of VMSTATE_TIMER* are mechanically changed to VMSTATE_TIMER_PTR variants. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* pc: piix4_pm: init legacy PCI hotplug when running on XenIgor Mammedov2014-11-141-0/+4
| | | | | | | | | | | | | | | | | | If user starts QEMU with "-machine pc,accel=xen", then compat property in xenfv won't work and it would cause error: "Unsupported bus. Bus doesn't have property 'acpi-pcihp-bsel' set" when PCI device is added with -device on QEMU CLI. From: Igor Mammedov <imammedo@redhat.com> In case of Xen instead of using compat property, just use the fact that xen doesn't use QEMU's fw_cfg/acpi tables to switch piix4_pm into legacy PCI hotplug mode when Xen is enabled. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Li Liang <liang.z.li@intel.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com>
* acpi: accurate overflow checkPavel Dovgalyuk2014-11-131-2/+5
| | | | | | | | | Compare clock in ns, because acpi_pm_tmr_update uses rounded to ns value instead of ticks. Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru> [This lets Windows boot in icount mode. - Paolo] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* acpi/cpu-hotplug: introduce helper function to keep bit setting in one placeGu Zheng2014-11-021-9/+13
| | | | | | | | | | Introduce helper function acpi_set_cpu_present_bit() to simplify acpi_cpu_plug_cb and acpi_cpu_hotplug_init, so that we can keep bit setting in one place. Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com>
* cpu-hotplug: rename function for better readabilityGu Zheng2014-11-023-6/+6
| | | | | | | | | | | | | Rename: AcpiCpuHotplug_init --> acpi_cpu_hotplug_init AcpiCpuHotplug_ops --> acpi_cpu_hotplug_ops for better readability, just cleanup. Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com>
* acpi:piix4: convert cpu hotplug to hotplug_handler APIGu Zheng2014-11-022-24/+4
| | | | | | | | | | | Convert notifier based hotplug to hotplug_handler API, and remove the unused AcpiCpuHotplug_add(). Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com>
OpenPOWER on IntegriCloud