summaryrefslogtreecommitdiff
path: root/hw/pc_piix.c
AgeCommit message (Collapse)AuthorFilesLines
2011-09-25pc: Re-order pc_init1 to initialize the ISA bus before ISA devicesRichard Henderson1-10/+12
In particular, the i8259 was being initialized before the ISA bus, leading to a crash. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Avi Kivity <avi@redhat.com>
2011-09-25isa: Pass i/o address space to isa_bus_newRichard Henderson1-1/+1
Not used yet, but at least we're provided with the correct region. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Avi Kivity <avi@redhat.com>
2011-09-23isapc: give system address space when pci is disabledHervé Poussineau1-1/+1
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-09-23pc: Disable HPET for ISA machineJan Kiszka1-0/+1
There was no HPET on ISA boxes. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-09-23pc: Unbreak ROM mapping for ISA machineJan Kiszka1-3/+10
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-6/+17
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-20Use glib memory allocation and free functionsAnthony Liguori1-1/+1
qemu_malloc/qemu_free no longer exist after this commit. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-08pci: pass I/O address space to new PCI busAvi Kivity1-1/+5
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-29Merge remote-tracking branch 'agraf/xen-next' into stagingAnthony Liguori1-1/+5
2011-07-29pci: pass address space to pci bus when createdAvi Kivity1-1/+2
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: move global memory map out of pc_init1() and into its callersAvi Kivity1-7/+8
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/+7
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-07-26xen: implement unplug protocol in xen_platformStefano Stabellini1-1/+5
The unplug protocol is necessary to support PV drivers in the guest: the drivers expect to be able to "unplug" emulated disks and nics before initializing the Xen PV interfaces. It is responsibility of the guest to make sure that the unplug is done before the emulated devices or the PV interface start to be used. We use pci_for_each_device to walk the PCI bus, identify the devices and disks that we want to disable and dynamically unplug them. Changes in v2: - use PCI_CLASS constants; - replace pci_unplug_device with qdev_unplug; - do not import hw/ide/internal.h in xen_platform.c; Changes in v3: - introduce piix3-ide-xen, that support hot-unplug; - move the unplug code to hw/ide/piix.c; - just call qdev_unplug from xen_platform.c to unplug the IDE disks; Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2011-06-22Merge remote-tracking branch 'mst/for_anthony' into stagingAnthony Liguori1-0/+48
Conflicts: hw/usb-uhci.c
2011-06-19xen: Add the Xen platform pci deviceSteven Smith1-0/+4
Introduce a new emulated PCI device, specific to fully virtualized Xen guests. The device is necessary for PV on HVM drivers to work. Signed-off-by: Steven Smith <ssmith@xensource.com> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2011-06-19xen: fix interrupt routingStefano Stabellini1-5/+1
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-06-15Merge remote-tracking branch 'origin/master' into pciMichael S. Tsirkin1-7/+64
Conflicts: hw/virtio-pci.c
2011-06-14virtio: compat event idx supportMichael S. Tsirkin1-0/+48
Disable event index for compat machine types. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-05-08xen: Add Xen hypercall for sleep state in the cmos_s3 callback.Anthony PERARD1-1/+5
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2011-05-08xen: Introduce Xen Interrupt ControllerAnthony PERARD1-2/+6
Every set_irq call makes a Xen hypercall. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> 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-1/+5
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/+1
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-08xen: Add xenfv machineAnthony PERARD1-2/+39
Introduce the Xen FV (Fully Virtualized) machine to Qemu, some more Xen specific call will be added in further patches. 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-2/+10
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-04-09smbus_eeprom: consolidate smbus eeprom creation oc pc_piix, mips_mapta, ↵Isaku Yamahata1-8/+2
mips_fulong consolidate smbus initialization for pc_piix, mips_malta and mips_fulong. Cc: Aurelien Jarno <aurelien@aurel32.net> Cc: Huacai Chen <zltjiangshi@gmail.com> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Reviewed-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-07ide: consolidate drive_get(IF_IDE)Isaku Yamahata1-9/+1
factor out ide initialization to call drive_get(IF_IDE) Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-02-21isa-bus: Remove bogus IRQ sharing checkJan Kiszka1-2/+2
Nothing prevented IRQ sharing on the ISA bus in principle. Not all boards supported this, neither each and every card nor driver and OS. Still, there existed valid IRQ sharing scenarios, (at least) two of them can also be found in QEMU: >2 PC UARTs and the PREP IDE buses. So remove this artificial restriction from our ISA model. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-02-20fdc: refactor device creationBlue Swirl1-3/+2
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-14kvm: x86: Introduce kvmclock device to save/restore its stateJan Kiszka1-7/+25
If kvmclock is used, which implies the kernel supports it, register a kvmclock device with the sysbus. Its main purpose is to save and restore the kernel state on migration, but this will also allow to visualize it one day. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> CC: Glauber Costa <glommer@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2011-02-12vmport: convert to qdevBlue Swirl1-2/+0
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-01-25audio: consolidate audio_init()Isaku Yamahata1-1/+2
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>
2010-12-22pc/piix: fix mismerge of b1aeb92666d2fde413c34578b3b42bbfe5f2a506Isaku Yamahata1-8/+4
The change set of b1aeb92666d2fde413c34578b3b42bbfe5f2a506 in pci branch was mismerged. The compatibility should be kept for 0.13, not for 0.14. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-12-09pci: make command SERR bit writableIsaku Yamahata1-0/+20
pcie aer needs SERR bit to be writable, and the PCI spec requires this as well. For compatibility, introduce compat global property command_serr_enable and make this bit readonly for a pre 0.14 pc machine. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-11-21vgabios update: handle compatibility with older qemu versionsGerd Hoffmann1-0/+16
As pointed out by avi the vgabios update is guest-visible and thus has migration implications. One change is that the vga has a valid pci rom bar now. We already have a pci bus property to enable/disable the rom bar and we'll load the bios via fw_cfg as fallback for the no-rom-bar case. So we just have to add compat properties to handle this case. A second change is that the magic bochs lfb @ 0xe0000000 is gone. When live-migrating a guest from a older qemu version it might be using the lfb though, so we have to keep it for the old machine types. The patch enables the bochs lfb in case we don't have the pci rom bar enabled (i.e. we are in 0.13+older compat mode). This patch depends on these patches which add (and use) the pc-0.13 machine type: http://patchwork.ozlabs.org/patch/70797/ http://patchwork.ozlabs.org/patch/70798/ Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Cc: avi@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-11-21virtfs: enable MSI-XGerd Hoffmann1-0/+8
This patch enables MSI-X for virtfs-9p-pci. It also adds a compat property to pc-0.13 which turns it of there to stay compatible to 0.13-stable. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-11-21pc: add 0.13 pc machine typeGerd Hoffmann1-1/+9
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-08-28isapc: fix segfault.Isaku Yamahata1-0/+1
https://bugs.launchpad.net/bugs/611646 reports that ./i386-softmmu/qemu -M isapc segfaults. This patch fixes the segfault introduced by f885f1eaa8711c06033ceb1599e3750fb37c306f It's because i440fx_state in pc_init1() isn't initialized. > Core was generated by `./i386-softmmu/qemu -M isapc'. > Program terminated with signal 11, Segmentation fault. > [New process 19686] > at qemu/hw/piix_pci.c:136 > (gdb) where > at qemu/hw/piix_pci.c:136 > boot_device=0x7fffe1f5b040 "cad", kernel_filename=0x0, > kernel_cmdline=0x6469bf "", initrd_filename=0x0, > cpu_model=0x654d10 "486", pci_enabled=0) > at qemu/hw/pc_piix.c:178 > boot_device=0x7fffe1f5b040 "cad", kernel_filename=0x0, > kernel_cmdline=0x6469bf "", initrd_filename=0x0, cpu_model=0x654d10 "486") > at qemu/hw/pc_piix.c:207 > envp=0x7fffe1f5b188) > at qemu/vl.c:2871 Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-08-24Rearrange block headersBlue Swirl1-0/+1
Changing block.h or blockdev.h resulted in recompiling most objects. Move DriveInfo typedef and BlockInterfaceType enum definitions to qemu-common.h and rearrange blockdev.h use to decrease churn. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-07-22virtio-serial: Fix compat property nameAmit Shah1-3/+3
Starting with qemu -M pc-0.12 -device virtio-serial results in -device virtio-serial: Property 'virtio-serial-pci.max_nr_ports' not found The property name 'max_ports' is incorrectly named 'max_nr_ports'. Fix that. Also fix the ppc440 machine type bamboo-0.12 which has this typo. Reported-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-07-02pc: Fix CMOS info for drives defined with -deviceMarkus Armbruster1-5/+11
Drives defined with -drive if=ide get get created along with the IDE controller, inside machine->init(). That's before cmos_init(). Drives defined with -device get created during generic device init. That's after cmos_init(). Because of that, CMOS has no information on them (type, geometry, translation). Older versions of Windows such as XP reportedly choke on that. Split off the part of CMOS initialization that needs to know about -device devices, and turn it into a reset handler, so it runs after device creation. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-06-27Remove useless device dependency of HAS_AUDIOBlue Swirl1-2/+0
System architecture dictates whether HAS_AUDIO is defined. It's then useless to check for HAS_AUDIO in files which are only used on those architectures which always have audio. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-06-19ioapic: convert to qdevBlue Swirl1-1/+18
Convert to qdev. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-06-04blockdev: Collect block device code in new blockdev.cMarkus Armbruster1-0/+1
Anything that moves hundreds of lines out of vl.c can't be all bad. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-05-15pci hotadd, acpi_piix4: remove global variablesIsaku Yamahata1-1/+0
remove global variables, gpe and pci0_status by moving them into PIIX4PMState. Signed-off-by: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15rtc: make rtc_xxx accept/return ISADevice instead of RTCState.Isaku Yamahata1-1/+1
To match rtc_xxx with qdev, make rtc_xxx accept and return ISADevice instead of RTCState. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15pc: split out piix specific part from pc.c into pc_piix.cIsaku Yamahata1-0/+317
Finally, we can safely split out the piix specific part from pc.c into pc_piix.c. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>