aboutsummaryrefslogtreecommitdiffstats
path: root/hw/acpi.c
AgeCommit message (Collapse)AuthorFilesLines
2009-09-11vmstate: rename run_after_load() -> post_load()Juan Quintela1-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>
2009-09-11Unexport ticks_per_sec variable. Create get_ticks_per_sec() functionJuan Quintela1-4/+5
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27Port ACPI to VMStateJuan Quintela1-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>
2009-08-09Use qemu_irq for system_powerdownBlue Swirl1-12/+16
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-16Update to a hopefully more future proof FSF addressBlue Swirl1-2/+1
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-06-29Revert "Introduce reset notifier order"Jan Kiszka1-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>
2009-06-22acpi.c: make qemu_system_device_hot_add piix independent.Isaku Yamahata1-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>
2009-05-23Add common BusStatePaul Brook1-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>
2009-05-22Introduce reset notifier orderJan Kiszka1-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>
2009-05-03use PCI_HEADER_TYPE.Isaku Yamahata1-1/+1
use symbolic value instead of 0x0e and related value. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2009-05-01Fix hw/acpi.c build w/ DEBUG enabledAlex Williamson1-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>
2009-04-17kvm: Apply SMM-already-initialized workaround on reset (Jan Kiszka)aliguori1-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
2009-02-27Remove some warnings and fix windows build.aliguori1-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
2009-02-27Allow additions of ACPI tables from command line (Gleb Natapov)aliguori1-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
2009-02-16Generate PCI hotplug interrupt only if corespondent EN bit is set. (Gleb ↵aliguori1-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
2009-02-16Fix GPE registers read/write handling. (Gleb Natapov)aliguori1-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
2009-02-11qemu: PCI device, disk and host network hot-add / hot-remove (Marcelo Tosatti)aliguori1-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
2009-02-11qemu: pci hotplug GPE support (Marcelo Tosatti)aliguori1-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
2009-02-11qemu: initialize hot add system / acpi gpe (Marcelo Tosatti)aliguori1-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
2009-02-01Add and use #defines for PCI device classesblueswir11-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
2009-01-26Define PCI vendor and device IDs in pci.h (Stuart Brady)aliguori1-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
2009-01-21Always return latest pmsts instead of the old one (Xiantao Zhang)aliguori1-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
2009-01-04Update FSF address in GPL/LGPL boilerplateaurel321-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
2008-12-17Handle suspend in qemu (Gleb Natapov)aliguori1-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
2008-11-05Add KVM support to QEMUaliguori1-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
2008-09-02x86: Fix powerdown for non-ACPI caseaurel321-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
2008-08-19ACPI suspend type field is 3 bits longaurel321-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
2008-07-19Revert "fix power management timer overflow handling" (Avi Kivity).balrog1-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
2008-04-27Ignore the wrapping of acpi timer counter again.balrog1-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
2008-04-26Fix sci irq set when acpi timer about to wrap (Dor Laor, Yaniv Kamay).balrog1-38/+46
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4258 c046a42c-6fe2-441c-8c8c-71466251a162
2008-03-18SCI fixesaurel321-2/+19
(Anthony Liguori) git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4081 c046a42c-6fe2-441c-8c8c-71466251a162
2008-01-14Bump ACPI/SMBus PIIX4 controller revision to 3 (Marcelo Tosatti).balrog1-1/+1
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3915 c046a42c-6fe2-441c-8c8c-71466251a162
2007-12-16qemu_put signedness fixes, by Andre Przywara.ths1-2/+2
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3824 c046a42c-6fe2-441c-8c8c-71466251a162
2007-11-17Break up vl.h.pbrook1-1/+7
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3674 c046a42c-6fe2-441c-8c8c-71466251a162
2007-10-09Match values with the ones documented in the PIIX4 datasheet.ths1-1/+3
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3377 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-17find -type f | xargs sed -i 's/[\t ]*$//g' # Yes, again. Note the star in ↵ths1-4/+4
the regex. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3177 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-16find -type f | xargs sed -i 's/[\t ]$//g' # on most filesths1-8/+8
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3173 c046a42c-6fe2-441c-8c8c-71466251a162
2007-07-31Implement ACPI specs 3.0, 4.7.2.5, by Michael Hanselmann.ths1-0/+11
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3103 c046a42c-6fe2-441c-8c8c-71466251a162
2007-05-28SMBus support for MIPS Malta.ths1-4/+1
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2893 c046a42c-6fe2-441c-8c8c-71466251a162
2007-05-23I2C/SMBus framework.pbrook1-39/+18
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2845 c046a42c-6fe2-441c-8c8c-71466251a162
2007-04-15Remove unused variable.pbrook1-1/+1
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2675 c046a42c-6fe2-441c-8c8c-71466251a162
2007-04-07Unify IRQ handling.pbrook1-1/+1
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2635 c046a42c-6fe2-441c-8c8c-71466251a162
2007-02-02PIIX4 SMBus host, EEPROM device emulation, by Ed Swierk.ths1-0/+185
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2379 c046a42c-6fe2-441c-8c8c-71466251a162
2006-10-02SMI enable bit supportbellard1-13/+2
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2190 c046a42c-6fe2-441c-8c8c-71466251a162
2006-09-24moved ACPI table init to BIOS - preliminary SMM supportbellard1-379/+113
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2170 c046a42c-6fe2-441c-8c8c-71466251a162
2006-06-14more ACPI definition to keep Solaris Happy (Juergen Kiel)bellard1-1/+7
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1981 c046a42c-6fe2-441c-8c8c-71466251a162
2006-05-13Rearrange PCI host emulation code.pbrook1-3/+2
Add ARM PCI emulation. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1916 c046a42c-6fe2-441c-8c8c-71466251a162
2006-05-08alignment fixbellard1-1/+2
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1910 c046a42c-6fe2-441c-8c8c-71466251a162
2006-05-05typobellard1-1/+1
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1904 c046a42c-6fe2-441c-8c8c-71466251a162
2006-05-03ACPI supportbellard1-0/+609
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1902 c046a42c-6fe2-441c-8c8c-71466251a162