summaryrefslogtreecommitdiffstats
path: root/hw/acpi.c
Commit message (Collapse)AuthorAgeFilesLines
* acpi: Fix an infinite loop in acpi_table_addVincent Minet2010-10-091-1/+1
| | | | | | | | | Commit d729bb9a7700e364b1c5f9893d61f07a9e002bce has a typo, causing an infinite loop in acpi_table_add. Signed-off-by: Vincent Minet <vincent@vincent-minet.net> Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* acpi: fix file size check with -acpitable.Isaku Yamahata2010-08-301-9/+19
| | | | | | | | | acpi table file can be modified during load so file size check should be more strict. pointer calculation should be after qemu_realloc(). not before realloc(). Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Trim unnecessary includesBlue Swirl2010-05-151-2/+0
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* acpi: split acpi.c into the common part and the piix4 part.Isaku Yamahata2010-05-151-562/+0
| | | | | | | | | Split acpi.c into the common part and the piix4 specific part. The common part will be used later. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* acpi: add acpi constants from linux header files and use them.Isaku Yamahata2010-05-151-31/+25
| | | | | | | | | | add acpi constants from linux header files and replace the old constants with them. The acpi constants will be used by other file. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* acpi: split out apm register emulation from acpi.cIsaku Yamahata2010-05-151-43/+18
| | | | | | | | | | Split out apm register emulation for acpi.c into apm.c. The apm emulation will be used later. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Cc: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* acpi: split out piix4 smbus routines from acpi.c into pm_smbus.cIsaku Yamahata2010-05-151-156/+8
| | | | | | | | | | | Split out piix4 smbus routines from acpi.c into pm_smbus.c and use it. The split out smbus emulation will be used later. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Cc: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* x86: remove dead assignments, spotted by clang analyzerBlue Swirl2010-04-251-3/+2
| | | | | | Value stored is never read. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Fix -enable-kvmAnthony Liguori2010-04-011-1/+2
| | | | | | | Make vl.o compiled per target and fix a thinko in hw/acpi.c. It's not trivial to make kvm.h consumable by compiled-once files. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Compile acpi only onceBlue Swirl2010-03-291-10/+15
| | | | | | | | Use qemu_irqs to trigger CMOS S3 and SMI events. Avoid using kvm.h, which uses CPUState. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* acpi: use range helper function.Isaku Yamahata2009-12-231-1/+1
| | | | | | | use range helper function in pm_write_config(). Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* Fix qemu_free use in acpi.cJean-Christophe DUBOIS2009-12-021-1/+1
| | | | | | | | acpi.c is using free() instead of qemu_free(). Fix it. Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* kill dead nic unplug code.Gerd Hoffmann2009-10-271-3/+0
| | | | | | | Cleanup on unplug happens via qdev->exit() callback now. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* hotplug: safely iterate bus's sibling list while removing a deviceMark McLoughlin2009-10-151-2/+2
| | | | | | | | | Without this, I'm seeing a segfault when unpluging a NIC. Cc: Gerd Hoffmann <kraxel@redhat.com> Patchworks-ID: 35519 Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* pci: windup acpi-based hotplugGerd Hoffmann2009-10-051-20/+21
| | | | | | | | Switch over acpi-based PCI hotplug for pc over to the new qdev-based pci hotplugging. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vmstate: add version_id argument to post_loadJuan Quintela2009-10-051-1/+1
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vmstate: rename run_after_load() -> post_load()Juan Quintela2009-09-111-2/+2
| | | | | | | This naming was used in kvm tree, and is easier to remember Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Unexport ticks_per_sec variable. Create get_ticks_per_sec() functionJuan Quintela2009-09-111-4/+5
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Port ACPI to VMStateJuan Quintela2009-08-271-34/+21
| | | | | | | | | This uses a run_after_load() function, and VMSTATE_PCI_DEVICE() It could be made smaller changing the type of pm_io_space_update() to return an int. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Use qemu_irq for system_powerdownBlue Swirl2009-08-091-12/+16
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Update to a hopefully more future proof FSF addressBlue Swirl2009-07-161-2/+1
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Revert "Introduce reset notifier order"Jan Kiszka2009-06-291-1/+1
| | | | | | | | | This reverts commit 8217606e6edb49591b4a6fd5a0d1229cebe470a9 (and updates later added users of qemu_register_reset), we solved the problem it originally addressed less invasively. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* acpi.c: make qemu_system_device_hot_add piix independent.Isaku Yamahata2009-06-221-2/+18
| | | | | | | | introruce piix4_device_hot_add() for piix4 specific code and make qemu_system_device_hot_add() generic. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Add common BusStatePaul Brook2009-05-231-1/+1
| | | | | | | | | | | Implement and use a common device bus state. The main side-effect is that creating a bus and attaching it to a parent device are no longer separate operations. For legacy code we allow a NULL parent, but that should go away eventually. Also tweak creation code to veriry theat a device in on the right bus. Signed-off-by: Paul Brook <paul@codesourcery.com>
* Introduce reset notifier orderJan Kiszka2009-05-221-1/+1
| | | | | | | | | | | | | | | Add the parameter 'order' to qemu_register_reset and sort callbacks on registration. On system reset, callbacks with lower order will be invoked before those with higher order. Update all existing users to the standard order 0. Note: At least for x86, the existing users seem to assume that handlers are called in their registration order. Therefore, the patch preserves this property. If someone feels bored, (s)he could try to identify this dependency and express it properly on callback registration. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* use PCI_HEADER_TYPE.Isaku Yamahata2009-05-031-1/+1
| | | | | | use symbolic value instead of 0x0e and related value. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
* Fix hw/acpi.c build w/ DEBUG enabledAlex Williamson2009-05-011-6/+6
| | | | | | | | Trivial build warning/fixes when the local DEBUG define is enabled. Signed-off-by: Alex Williamson <alex.williamson@hp.com> Signed-off-by: Avi Kivity <avi@qumranet.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* kvm: Apply SMM-already-initialized workaround on reset (Jan Kiszka)aliguori2009-04-171-6/+11
| | | | | | | | Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7136 c046a42c-6fe2-441c-8c8c-71466251a162
* Remove some warnings and fix windows build.aliguori2009-02-271-2/+2
| | | | | | | | | | | Initialize some variables to make GCC happy and switch from using index to strchr. index is not available on Windows. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6653 c046a42c-6fe2-441c-8c8c-71466251a162
* Allow additions of ACPI tables from command line (Gleb Natapov)aliguori2009-02-271-0/+169
| | | | | | | | | | | | This is needed to dynamically add SLIC tables with Windows activation keys. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6650 c046a42c-6fe2-441c-8c8c-71466251a162
* Generate PCI hotplug interrupt only if corespondent EN bit is set. (Gleb ↵aliguori2009-02-161-4/+4
| | | | | | | | | | Natapov) Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6625 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix GPE registers read/write handling. (Gleb Natapov)aliguori2009-02-161-12/+31
| | | | | | | | | | For STS register bit are cleared by writing 1 into it. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6624 c046a42c-6fe2-441c-8c8c-71466251a162
* qemu: PCI device, disk and host network hot-add / hot-remove (Marcelo Tosatti)aliguori2009-02-111-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | Add monitor command to hot-add PCI devices (nic and storage). Syntax is: pci_add pci_addr=[[<domain>:]<bus>:]<slot> nic|storage params It returns the domain, bus and slot for the newly added device on success. It is possible to attach a disk to a device after PCI initialization via the drive_add command. If so, a manual scan of the SCSI bus on the guest is necessary. Save QEMUMachine necessary for drive_init. Add monitor command to hot-remove devices, remove device data on _EJ0 notification. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6610 c046a42c-6fe2-441c-8c8c-71466251a162
* qemu: pci hotplug GPE support (Marcelo Tosatti)aliguori2009-02-111-0/+94
| | | | | | | | | | | Enable the corresponding bit on the PCIST region and trigger the SCI and handle the _EJ0 notifications. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6608 c046a42c-6fe2-441c-8c8c-71466251a162
* qemu: initialize hot add system / acpi gpe (Marcelo Tosatti)aliguori2009-02-111-0/+68
| | | | | | | | | | | ACPI GPE support, used by PCI (and CPU) hotplug. From: Glauber Costa <gcosta@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6607 c046a42c-6fe2-441c-8c8c-71466251a162
* Add and use #defines for PCI device classesblueswir12009-02-011-2/+1
| | | | | | | | | | | | | This patch adds and uses #defines for PCI device classes and subclases, using a new pci_config_set_class() function, similar to the recently added pci_config_set_vendor_id() and pci_config_set_device_id(). Change since v1: fixed compilation of hw/sun4u.c Signed-off-by: Stuart Brady <stuart.brady@gmail.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6491 c046a42c-6fe2-441c-8c8c-71466251a162
* Define PCI vendor and device IDs in pci.h (Stuart Brady)aliguori2009-01-261-4/+2
| | | | | | | | | | | | | | | This patch defines PCI vendor and device IDs in pci.h (matching those from Linux's pci_ids.h), and uses those definitions where appropriate. Change from v1: Introduces pci_config_set_vendor_id() / pci_config_set_device_id() accessors as suggested by Anthony Liguori. Signed-off-by: Stuart Brady <stuart.brady@gmail.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6442 c046a42c-6fe2-441c-8c8c-71466251a162
* Always return latest pmsts instead of the old one (Xiantao Zhang)aliguori2009-01-211-1/+1
| | | | | | | | | | | | It may lead to the issue when booting windows guests with acpi=1 if return the old pmsts. Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6375 c046a42c-6fe2-441c-8c8c-71466251a162
* Update FSF address in GPL/LGPL boilerplateaurel322009-01-041-1/+1
| | | | | | | | | | The attached patch updates the FSF address in the GPL/LGPL boilerplate in most GPL/LGPLed files, and also in COPYING.LIB. Signed-off-by: Stuart Brady <stuart.brady@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6162 c046a42c-6fe2-441c-8c8c-71466251a162
* Handle suspend in qemu (Gleb Natapov)aliguori2008-12-171-0/+23
| | | | | | | | | | | Reset a PC and tell BIOS that resume from ram is required on the next boot. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6080 c046a42c-6fe2-441c-8c8c-71466251a162
* Add KVM support to QEMUaliguori2008-11-051-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds very basic KVM support. KVM is a kernel module for Linux that allows userspace programs to make use of hardware virtualization support. It current supports x86 hardware virtualization using Intel VT-x or AMD-V. It also supports IA64 VT-i, PPC 440, and S390. This patch only implements the bare minimum support to get a guest booting. It has very little impact the rest of QEMU and attempts to integrate nicely with the rest of QEMU. Even though this implementation is basic, it is significantly faster than TCG. Booting and shutting down a Linux guest: w/TCG: 1:32.36 elapsed 84% CPU w/KVM: 0:31.14 elapsed 59% CPU Right now, KVM is disabled by default and must be explicitly enabled with -enable-kvm. We can enable it by default later when we have had better testing. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5627 c046a42c-6fe2-441c-8c8c-71466251a162
* x86: Fix powerdown for non-ACPI caseaurel322008-09-021-2/+4
| | | | | | | | | | | Trivial fix for a corner case: system_shutdown on isapc machines causes qemu to segfaults due to accessing the uninitialized pm_state. Issue a system shutdown instead. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5130 c046a42c-6fe2-441c-8c8c-71466251a162
* ACPI suspend type field is 3 bits longaurel322008-08-191-1/+1
| | | | | | | | | According to ACPI spec table 4-13 suspend type field should be 3 bits long. (Gleb Natapov) git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5027 c046a42c-6fe2-441c-8c8c-71466251a162
* Revert "fix power management timer overflow handling" (Avi Kivity).balrog2008-07-191-1/+0
| | | | | | | | | | | | The fix is bogus, causing sci to be deferred for longer and longer. Noticed by Alex Williamson. Signed-off-by: Avi Kivity <avi@qumranet.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4904 c046a42c-6fe2-441c-8c8c-71466251a162
* Ignore the wrapping of acpi timer counter again.balrog2008-04-271-46/+38
| | | | | | | Revert problematic change to restore system_powerdown. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4268 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix sci irq set when acpi timer about to wrap (Dor Laor, Yaniv Kamay).balrog2008-04-261-38/+46
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4258 c046a42c-6fe2-441c-8c8c-71466251a162
* SCI fixesaurel322008-03-181-2/+19
| | | | | | | (Anthony Liguori) git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4081 c046a42c-6fe2-441c-8c8c-71466251a162
* Bump ACPI/SMBus PIIX4 controller revision to 3 (Marcelo Tosatti).balrog2008-01-141-1/+1
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3915 c046a42c-6fe2-441c-8c8c-71466251a162
* qemu_put signedness fixes, by Andre Przywara.ths2007-12-161-2/+2
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3824 c046a42c-6fe2-441c-8c8c-71466251a162
* Break up vl.h.pbrook2007-11-171-1/+7
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3674 c046a42c-6fe2-441c-8c8c-71466251a162
OpenPOWER on IntegriCloud