summaryrefslogtreecommitdiff
path: root/hw/pc.h
AgeCommit message (Collapse)AuthorFilesLines
2012-02-24suspend: switch acpi s3 to new infrastructure.Gerd Hoffmann1-2/+1
This patch switches pc s3 suspend over to the new infrastructure. The cmos_s3 qemu_irq is killed, the new notifier is used instead. The xen hack goes away with that too, the hypercall can simply be done in a notifier function now. This patch also makes the guest actually stay suspended instead of leaving suspend instantly, so it is useful for more than just testing whenever the suspend/resume cycle actually works. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-22hw/pc: move rom init to pc_sysfw.cJordan Justen1-0/+3
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-17pcspk: Convert to qdevJan Kiszka1-4/+0
Convert the PC speaker device to a qdev ISA model. Move the public interface to a dedicated header file at this chance. CC: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-17i8254: Factor out interface headerJan Kiszka1-25/+0
Move the public interface of the PIT into its own header file and update all users. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-23Merge remote-tracking branch 'qemu-kvm/uq/master' into stagingAnthony Liguori1-4/+4
* qemu-kvm/uq/master: kvm: Activate in-kernel irqchip support kvm: x86: Add user space part for in-kernel IOAPIC kvm: x86: Add user space part for in-kernel i8259 kvm: x86: Add user space part for in-kernel APIC kvm: x86: Establish IRQ0 override control kvm: Introduce core services for in-kernel irqchip support memory: Introduce memory_region_init_reservation ioapic: Factor out base class for KVM reuse ioapic: Drop post-load irr initialization i8259: Factor out base class for KVM reuse i8259: Completely privatize PicState apic: Open-code timer save/restore apic: Factor out base class for KVM reuse apic: Introduce apic_report_irq_delivered apic: Inject external NMI events via LINT1 apic: Stop timer on reset kvm: Move kvmclock into hw/kvm folder msi: Generalize msix_supported to msi_supported hyper-v: initialize Hyper-V CPUID leaves. hyper-v: introduce Hyper-V support infrastructure. Conflicts: Makefile.target Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-22vga: make Cirrus ISA device optionalBlue Swirl1-1/+0
Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-01-19kvm: x86: Add user space part for in-kernel i8259Jan Kiszka1-0/+1
Introduce the alternative 'kvm-i8259' device model that exploits KVM in-kernel acceleration. The PIIX3 initialization code is furthermore extended by KVM specific IRQ route setup. GSI injection differs in KVM mode from the user space model. As we can dispatch ISA-range IRQs to both IOAPIC and PIC inside the kernel, we do not need to inject them separately. This is reflected by a KVM-specific GSI handler. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2012-01-19i8259: Completely privatize PicStateJan Kiszka1-4/+3
Use DeviceState instead of PicState in the public i8259 API. This is cleaner and allows to reorganize the PIC data structures for KVM reuse. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2011-12-20audio: remove unused parameter isa_picHervé Poussineau1-1/+1
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-12-20malta: give ISA bus to ISA methodsHervé Poussineau1-1/+1
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-12-20pc: give ISA bus to ISA methodsHervé Poussineau1-1/+1
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-12-20isa: give ISABus/ISADevice to isa_create(), isa_bus_irqs() and isa_get_irq() ↵Hervé Poussineau1-17/+18
functions NULL is a valid bus/device, so there is no change in behaviour. Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-12-15qom: add vga node to the pc composition treeAnthony Liguori1-7/+7
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-24parallel: convert to memory APIAvi Kivity1-1/+2
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-10-21pc: Fix floppy drives with if=noneKevin Wolf1-1/+2
Commit 63ffb564 broke floppy devices specified on the command line like -drive file=...,if=none,id=floppy -global isa-fdc.driveA=floppy because it relies on drive_get() which works only with -fda/-drive if=floppy. This patch resembles what we're already doing for IDE, i.e. remember the floppy device that was created and use that to extract the BlockDriverStates where needed. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
2011-10-16i8259: Eliminate PicState2Jan Kiszka1-4/+4
Introduce a reference to the slave PIC for the few cases we need to access it without a proper pointer at hand and drop PicState2. We could even live without slave_pic if we had a better way of modeling the cascade bus the PICs are attached to (in addition to the ISA bus). Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-10-16i8259: PREP: Replace pic_intack_read with pic_read_irqJan Kiszka1-1/+0
There is nothing in the i8259 spec that justifies the special pic_intack_read. At least the Linux PREP kernels configure the PICs properly so that pic_read_irq returns identical values, and setting read_reg_select in PIC0 cannot be derived from any special i8259 mode. So switch ppc_prep to pic_read_irq and drop the now unused PIC code. CC: Andreas Färber <andreas.faerber@web.de> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-10-16i8259: Drop obsolete prototypesJan Kiszka1-2/+0
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-10-16pc: Fix and clean up PIC-to-APIC IRQ pathJan Kiszka1-1/+1
The master PIC is connected to the LINTIN0 of the APICs. As the APIC currently does not track the state of that line, we have to ask the PIC to reinject its IRQ after the CPU picked up an event from the APIC. This introduces pic_get_output to read the master PIC IRQ line state without changing it. The APIC uses this function to decide if a PIC IRQ should be reinjected on apic_update_irq. This reflects better how the real hardware works. The patch fixes some failures of the kvm unit tests apic and eventinj by allowing to enable the proper CPU IRQ deassertion when the guest masks some pending IRQs at PIC level. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-10-16pc: Convert GSIState::i8259_irq into arrayJan Kiszka1-1/+1
Will be required when we no longer let i8259_init allocate the PIC IRQs but convert that chips to qdev. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-10-16pc: Generalize ISA IRQs to GSIsJan Kiszka1-8/+10
The ISA bus IRQ range is 0..15. What isa_irq_handler and IsaIrqState are actually dealing with are the Global System Interrupts. Refactor the code to clarify this. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-10-02serial: Add MemoryRegion parameter to serial_mm_initRichard Henderson1-3/+4
Remove the get_system_memory() call from serial_mm_init, pushing it back into the callers. In many cases we already have the system memory region available. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Avi Kivity <avi@redhat.com>
2011-10-02serial: Remove ioregister parameter from serial_mm_initRichard Henderson1-2/+1
All callers passed 1. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Avi Kivity <avi@redhat.com>
2011-10-02serial: Use enum device_endian in serial_mm_init parameterRichard Henderson1-1/+1
The use of DEVICE_NATIVE_ENDIAN cleans up lots of ifdefs in many of the callers. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Avi Kivity <avi@redhat.com>
2011-09-25pckbd: Convert to MemoryRegionRichard Henderson1-1/+1
Slightly non-obvious with mips_jazz passing in the region structure to populate. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Avi Kivity <avi@redhat.com>
2011-09-23pc: Unbreak ROM mapping for ISA machineJan Kiszka1-1/+1
This is based on the original fix by Hervé Poussineau: pc_memory_init actually takes a memory region for mapping BIOS and extension ROMs. That equals the PCI memory region if PCI is available, but must be system memory in the ISA case. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22440fx: fix PAM, PCI holesAvi Kivity1-3/+10
The current implementation of PAM and the PCI holes is broken in several ways: - PCI BARs are not restricted to the PCI hole (a BAR may hide memory) - PCI devices do not respect PAM (if a PCI device maps a region while PAM maps the region to RAM, the request will be honored) This patch fixes things by introducing a pci address space, and using memory region aliases to represent PAM regions, SMRAM, and PCI holes. The memory hierarchy looks something like system_memory | +--- low memory alias (0-0xe0000000) | | | +-- ram@0 | +--- high memory alias (0x100000000-EOM) | | | +-- ram@0xe0000000 | +--- pci hole alias (end of low memory-0x100000000) | | | +-- pci@end-of-low-memory | | +--- pam[n] (0xc0000-0xc3fff etc) (when set to pci, priority 1) | | | +-- pci@0xc4000 etc | +--- smram (0xa0000-0xbffff) (when set to pci/vga, priority 1) | +-- pci@0xa0000 etc ram (simple ram region) pci | +--- BARn | +--- VGA 0xa0000-0xbffff | +--- ROMs Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22vga: drop get_system_memory() from vga devices and derivativesAvi Kivity1-2/+3
Instead, use the bus accessors, or get the address space directly from the board constructor. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-08pci: pass I/O address space to new PCI busAvi Kivity1-1/+3
This lets us register BARs in the I/O address space. Reviewed-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-07-29pci: pass address space to pci bus when createdAvi Kivity1-1/+3
This is now done sloppily, via get_system_memory(). Eventually callers will be converted to stop using that. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-07-29pc: convert pc_memory_init() to memory APIAvi Kivity1-0/+1
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-07-29pc: grab system_memoryAvi Kivity1-1/+3
While eventually this should come from the machine initialization function, take a short cut to avoid converting all machines now. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-06-19xen: fix interrupt routingStefano Stabellini1-1/+0
Compared to the last version I only added a comment to the code. - remove i440FX-xen and i440fx_write_config_xen we don't need to intercept pci config writes to i440FX anymore; - introduce PIIX3-xen and piix3_write_config_xen we do need to intercept pci config write to the PCI-ISA bridge to update the PCI link routing; - set the number of PIIX3-xen interrupts line to 128; Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2011-05-08piix_pci: Introduces Xen specific call for irq.Anthony PERARD1-0/+1
This patch introduces Xen specific call in piix_pci. The specific part for Xen is in write_config, set_irq and get_pirq. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Alexander Graf <agraf@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2011-05-08pc, Disable vmport initialisation with Xen.Anthony PERARD1-1/+2
This is because there is not synchronisation of the vcpu register between Xen and QEMU, so vmport can't work properly. This patch introduces no_vmport parameter to pc_basic_device_init. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2011-05-08pc_memory_init: Move memory calculation to the caller.Anthony PERARD1-4/+3
This patch moves above_4g_mem_size and below_4g_mem_size calculation in the caller of pc_memory_init (pc_init1). And the prototype of pc_memory_init is changed because there is no need anymore to have variable pointer and the ram_size parameter. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2011-02-20i8254: convert to qdevBlue Swirl1-8/+17
Convert to qdev. Don't expose PITState. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-02-20vga-isa: make optionalBlue Swirl1-2/+8
Ignore failure with vga-isa device creation, but print a warning message. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-02-20vga-isa: convert to qdevBlue Swirl1-1/+7
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-02-20fdc: refactor device creationBlue Swirl1-2/+1
Turn fdc_init_isa into an inline function. Get floppy geometry directly from the drives. Don't expose FDCtrl. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-02-20serial: make optionalBlue Swirl1-1/+4
Ignore failure with serial device creation. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-02-20serial: refactor device creationBlue Swirl1-1/+13
Turn serial_init into an inline function. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-02-20ne2000_isa: make optionalBlue Swirl1-2/+7
Ignore failure with ne2000_isa device creation. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-02-20ne2000_isa: refactor device creationBlue Swirl1-1/+11
Turn isa_ne2000_init into an inline function. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-02-20parallel: make optionalBlue Swirl1-1/+4
Ignore failure with parallel device creation. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-02-20parallel: refactor device creationBlue Swirl1-3/+14
Turn parallel_init into an inline function. Don't expose ParallelState. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-02-12x86: make vmmouse optionalBlue Swirl1-0/+2
Compile vmmouse in hwlib. Ignore failure if vmmouse device can't be created. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-02-12vmmouse: convert to qdevBlue Swirl1-3/+0
Convert to qdev, also add a proper reset function. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-02-12vmport: convert to qdevBlue Swirl1-1/+4
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-01-25audio: consolidate audio_init()Isaku Yamahata1-3/+0
consolidate audio_init() and remove references to shoundhw. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Acked-by: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>