summaryrefslogtreecommitdiffstats
path: root/hw/pc_piix.c
Commit message (Collapse)AuthorAgeFilesLines
* Use glib memory allocation and free functionsAnthony Liguori2011-08-201-1/+1
| | | | | | qemu_malloc/qemu_free no longer exist after this commit. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* pci: pass I/O address space to new PCI busAvi Kivity2011-08-081-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>
* Merge remote-tracking branch 'agraf/xen-next' into stagingAnthony Liguori2011-07-291-1/+5
|\
| * xen: implement unplug protocol in xen_platformStefano Stabellini2011-07-261-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>
* | pci: pass address space to pci bus when createdAvi Kivity2011-07-291-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>
* | pc: move global memory map out of pc_init1() and into its callersAvi Kivity2011-07-291-7/+8
| | | | | | | | | | Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | pc: grab system_memoryAvi Kivity2011-07-291-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>
* Merge remote-tracking branch 'mst/for_anthony' into stagingAnthony Liguori2011-06-221-0/+48
|\ | | | | | | | | Conflicts: hw/usb-uhci.c
| * Merge remote-tracking branch 'origin/master' into pciMichael S. Tsirkin2011-06-151-7/+64
| |\ | | | | | | | | | | | | Conflicts: hw/virtio-pci.c
| * | virtio: compat event idx supportMichael S. Tsirkin2011-06-141-0/+48
| | | | | | | | | | | | | | | | | | Disable event index for compat machine types. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* | | xen: Add the Xen platform pci deviceSteven Smith2011-06-191-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>
* | | xen: fix interrupt routingStefano Stabellini2011-06-191-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>
* | xen: Add Xen hypercall for sleep state in the cmos_s3 callback.Anthony PERARD2011-05-081-1/+5
| | | | | | | | | | Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* | xen: Introduce Xen Interrupt ControllerAnthony PERARD2011-05-081-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>
* | piix_pci: Introduces Xen specific call for irq.Anthony PERARD2011-05-081-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>
* | pc, Disable vmport initialisation with Xen.Anthony PERARD2011-05-081-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>
* | xen: Add xenfv machineAnthony PERARD2011-05-081-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>
* | pc_memory_init: Move memory calculation to the caller.Anthony PERARD2011-05-081-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>
* smbus_eeprom: consolidate smbus eeprom creation oc pc_piix, mips_mapta, ↵Isaku Yamahata2011-04-091-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>
* ide: consolidate drive_get(IF_IDE)Isaku Yamahata2011-04-071-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>
* isa-bus: Remove bogus IRQ sharing checkJan Kiszka2011-02-211-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>
* fdc: refactor device creationBlue Swirl2011-02-201-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>
* kvm: x86: Introduce kvmclock device to save/restore its stateJan Kiszka2011-02-141-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>
* vmport: convert to qdevBlue Swirl2011-02-121-2/+0
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* audio: consolidate audio_init()Isaku Yamahata2011-01-251-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>
* pc/piix: fix mismerge of b1aeb92666d2fde413c34578b3b42bbfe5f2a506Isaku Yamahata2010-12-221-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>
* pci: make command SERR bit writableIsaku Yamahata2010-12-091-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>
* vgabios update: handle compatibility with older qemu versionsGerd Hoffmann2010-11-211-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>
* virtfs: enable MSI-XGerd Hoffmann2010-11-211-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>
* pc: add 0.13 pc machine typeGerd Hoffmann2010-11-211-1/+9
| | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* isapc: fix segfault.Isaku Yamahata2010-08-281-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>
* Rearrange block headersBlue Swirl2010-08-241-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>
* virtio-serial: Fix compat property nameAmit Shah2010-07-221-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>
* pc: Fix CMOS info for drives defined with -deviceMarkus Armbruster2010-07-021-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>
* Remove useless device dependency of HAS_AUDIOBlue Swirl2010-06-271-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>
* ioapic: convert to qdevBlue Swirl2010-06-191-1/+18
| | | | | | Convert to qdev. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* blockdev: Collect block device code in new blockdev.cMarkus Armbruster2010-06-041-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>
* pci hotadd, acpi_piix4: remove global variablesIsaku Yamahata2010-05-151-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>
* rtc: make rtc_xxx accept/return ISADevice instead of RTCState.Isaku Yamahata2010-05-151-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>
* pc: split out piix specific part from pc.c into pc_piix.cIsaku Yamahata2010-05-151-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>
OpenPOWER on IntegriCloud