aboutsummaryrefslogtreecommitdiff
path: root/hw
AgeCommit message (Collapse)AuthorFilesLines
2012-01-27pci: convert to QEMU Object ModelAnthony Liguori53-1050/+1599
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27unin_pci: Drop unused reset handlerAndreas Färber1-7/+0
Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2012-01-27unin_pci: Drop duplicate busdevAndreas Färber1-9/+20
PCIHostState already has a busdev. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2012-01-27unin_pci: Clean up qdev namesAndreas Färber1-15/+39
Add -pcihost to SysBus devices to resolve name conflicts, and clarify PCI vs. Internal PCI. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2012-01-27virtio-serial: convert to QEMU Object ModelAnthony Liguori3-90/+128
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27spapr: convert to QEMU Object Model (v2)Anthony Liguori5-71/+126
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> --- v1 -> v2 - use QOM to check for the default console
2012-01-27scsi: convert to QEMU Object ModelAnthony Liguori4-113/+201
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27ide: convert to QEMU Object ModelAnthony Liguori2-49/+82
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27hda-codec: convert to QEMU Object ModelAnthony Liguori3-44/+71
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27i2c: smbus: convert to QEMU Object ModelAnthony Liguori15-164/+331
This converts two types because smbus is implemented as a subclass of i2c. It's extremely difficult to convert these two independently. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27i2c: rename i2c_slave -> I2CSlaveAnthony Liguori15-86/+88
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27ssi: convert to QEMU Object ModelAnthony Liguori10-70/+150
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27ccid: convert to QEMU Object ModelAnthony Liguori4-49/+109
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27usb: convert to QEMU Object ModelAnthony Liguori14-263/+469
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27isa: pic: convert to QEMU Object ModelAnthony Liguori28-192/+390
This converts two devices at once because PIC subclasses ISA and converting subclasses independently is extremely hard. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27qdev: prepare source tree for code conversionAnthony Liguori15-312/+304
These are various small stylistic changes which help make things more consistent such that the automated conversion script can be simpler. It's not necessary to agree or disagree with these style changes because all of this code is going to be rewritten by the patch monkey script anyway. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27qdev: add class_init to DeviceInfoAnthony Liguori2-0/+9
Since we are still dynamically creating TypeInfo, we need to chain the class_init function in order to be able to make use of it within subclasses of TYPE_DEVICE. This will disappear once we register TypeInfos directly. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27qdev: add a interface to register subclassesAnthony Liguori2-2/+8
In order to introduce inheritance while still using the qdev registration interfaces, we need to be able to use a parent other than TYPE_DEVICE. Add a new interface that allows this. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27qdev: use a wrapper to access reset and promote reset to a class methodAnthony Liguori4-9/+27
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27qdev: don't access name through infoAnthony Liguori28-44/+44
We already have a QOM interface for this so let's use it. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27qdev: move qdev->info to classAnthony Liguori33-93/+119
Right now, DeviceInfo acts as the class for qdev. In order to switch to a proper ObjectClass derivative, we need to ween all of the callers off of interacting directly with the info pointer. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27qdev: integrate with QEMU Object Model (v2)Anthony Liguori2-2/+35
This is a very shallow integration. We register a TYPE_DEVICE but only use QOM as basically a memory allocator. This will make all devices show up as QOM objects but they will all carry the TYPE_DEVICE. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> --- v1 -> v2 - update for new location of object.h
2012-01-27pci: call reset unconditionallyAnthony Liguori1-5/+2
Because now all PCI devices are converted to qdev. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27openpic: remove dead code to make a PCI device versionAnthony Liguori3-29/+5
bus is always NULL so the code in this if clause is dead (and therefore untested). Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27macio: convert to qdevAnthony Liguori1-13/+30
This is a "shallow", half hearted, and untested conversion. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27Merge remote-tracking branch 'pmaydell/arm-devs.for-upstream' into stagingAnthony Liguori5-17/+860
* pmaydell/arm-devs.for-upstream: arm: SoC model for Calxeda Highbank arm_boot: support board IDs more than 16 bits wide arm: add secondary cpu boot callbacks to arm_boot.c ahci: add support for non-PCI based controllers Add xgmac ethernet model
2012-01-27Merge remote-tracking branch 'kwolf/for-anthony' into stagingAnthony Liguori2-9/+3
* kwolf/for-anthony: (22 commits) scsi: Guard against buflen exceeding req->cmd.xfer in scsi_disk_emulate_command qcow: Use bdrv functions to replace file operation qcow: Return real error code in qcow_open block/vdi: Zero unused parts when allocating a new block (fix #919242) virtio-blk: add virtio_blk_handle_read trace event docs: describe live block operations block: add support for partial streaming add QERR_BASE_NOT_FOUND block: add bdrv_find_backing_image blockdev: make image streaming safe across hotplug qmp: add query-block-jobs qmp: add block_job_cancel command qmp: add block_job_set_speed command qmp: add block_stream command block: rate-limit streaming operations block: add image streaming block job block: add BlockJob interface for long-running operations block: make copy-on-read a per-request flag block: check bdrv_in_use() before blockdev operations coroutine: add co_sleep_ns() coroutine sleep function ...
2012-01-27pcnet: Preserve link state across device resetJan Kiszka1-1/+2
A device reset does not affect the link state, only set_link does. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-01-27e1000: Preserve link state across device resetJan Kiszka1-0/+5
A device reset does not affect the link state, only set_link does. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-01-27qdev-property: Make bit property parsing stricterJan Kiszka1-2/+2
By using strncasecmp, we allow for arbitrary characters after the "on"/"off" string. Fix this by switching to strcasecmp. Reviewed-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-01-26scsi: Guard against buflen exceeding req->cmd.xfer in scsi_disk_emulate_commandThomas Higdon1-9/+1
Limit the return value (corresponding to the length of the buffer to be DMAed back to the intiator) to the value in req->cmd.xfer, which is the amount of data that the initiator expects. Eliminate now-duplicate code that does this guarding in the functions for individual commands. Without this, the SCRIPTS code in the emulated LSI device eventually raises a DMA interrupt for a data overrun when an INQUIRY command whose buflen exceeds req->cmd.xfer is processed. It's the responsibility of the client to provide a request buffer and allocation length that are large enough for the result of the command. Signed-off-by: Thomas Higdon <thigdon@akamai.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-01-26virtio-blk: add virtio_blk_handle_read trace eventStefan Hajnoczi1-0/+2
There already exists a virtio_blk_handle_write trace event as well as completion events. Add the virtio_blk_handle_read event so it's easy to trace virtio-blk requests for both read and write operations. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-01-26arm: SoC model for Calxeda HighbankRob Herring1-0/+330
Adds support for Calxeda's Highbank SoC. Signed-off-by: Rob Herring <rob.herring@calxeda.com> Signed-off-by: Mark Langsdorf <mark.langsdorf@calxeda.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-01-26arm_boot: support board IDs more than 16 bits widePeter Maydell1-6/+5
Support passing a board ID value to the kernel in r1 that is more than 16 bits wide. This is needed to pass the '-1 == invalid' value for boards which only support device tree booting. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Tested-by: Mark Langsdorf <mark.langsdorf@calxeda.com>
2012-01-26arm: add secondary cpu boot callbacks to arm_boot.cMark Langsdorf2-11/+60
Create two functions, write_secondary_boot() and secondary_cpu_reset_hook(), to allow platforms more control of how secondary CPUs are brought up. The new functions default to NULL and aren't called unless they are populated so there are no changes to existing platform models. Signed-off-by: Mark Langsdorf <mark.langsdorf@calxeda.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-01-26ahci: add support for non-PCI based controllersRob Herring1-0/+44
Add support for ahci on sysbus. Signed-off-by: Rob Herring <rob.herring@calxeda.com> Signed-off-by: Mark Langsdorf <mark.langsdorf@calxeda.com> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-01-26Add xgmac ethernet modelRob Herring1-0/+421
This adds very basic support for the xgmac ethernet core. Missing things include: - statistics counters - WoL support - rx checksum offload - chained descriptors (only linear descriptor ring) - broadcast and multicast handling Signed-off-by: Rob Herring <rob.herring@calxeda.com> Signed-off-by: Mark Langsdorf <mark.langsdorf@calxeda.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-01-25vga: compile cirrus_vga in hwlibBlue Swirl1-3/+0
Remove target dependencies and compile Cirrus VGA in hwlib. Address masking can be removed since memory API handles that now. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-01-25memory: change dirty setting APIs to take a sizeBlue Swirl6-37/+17
Instead of each target knowing or guessing the guest page size, just pass the desired size of dirtied memory area. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-01-23Merge remote-tracking branch 'qemu-kvm/uq/master' into stagingAnthony Liguori22-582/+1423
* 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-23Merge remote-tracking branch 'afaerber/prep-up' into stagingAnthony Liguori6-135/+547
* afaerber/prep-up: prep: Use i82378 PCI->ISA bridge for 'prep' machine prep: Add i82378 PCI-to-ISA bridge emulation prep: Add i82374 DMA emulation MAINTAINERS: Add PCI host bridge files to PReP machine prep: qdev'ify Raven host bridge (SysBus) prep_pci: Update I/O to MemoryRegion ops prep_pci: Simplify I/O endianness prep: qdev'ify Raven host bridge (PCIDevice) prep: Use ISA m48t59 prep: Fix offset of BIOS MemoryRegion
2012-01-23e1000: bounds packet size against buffer sizeAnthony Liguori1-0/+3
Otherwise we can write beyond the buffer and corrupt memory. This is tracked as CVE-2012-0029. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-22sga: fix copypastaBlue Swirl1-2/+2
Fix the name of the init function. Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-01-22vga: make Cirrus ISA device optionalBlue Swirl3-14/+30
Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-01-22vga: improve VGA logicBlue Swirl11-47/+10
Improve VGA selection logic, push check for device availabilty to vl.c. Create the devices at board level unconditionally. Remove now unused pci_try_create*() functions. Make PCI VGA devices optional. Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-01-21grackle_pci: Clean up qdev namesAndreas Färber1-5/+12
Rename SysBus device from 'grackle' to 'grackle-pcihost' to resolve a name conflict. Also mark both devices as no_user. Signed-off-by: Andreas Färber <afaerber@suse.de> Cc: Alexander Graf <agraf@suse.de> Cc: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2012-01-21PPC: Pseries: Check for PCI boundariesAlexander Graf1-4/+23
We call pci_host_config_{read,write}_common() which perform PCI config accesses. However they don't do all limit checking the way we expect it to. So let's introduce a small wrapper around them, making them behave the way we would without touching generic code. This patch is based on a patch by David Gibson which put this logic into the generic code. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
2012-01-21pseries: SLOF PCI flag dayBenjamin Herrenschmidt2-166/+103
Currently on the pseries machine the SLOF firmware is used normally, but we bypass it when -kernel is specified. Having these two different boot paths can cause some confusion. In particular at present we need to "probe" the (emulated) PCI bus and produce device tree nodes for the PCI devices in qemu, for the -kernel case. In the SLOF case, it takes the device tree from qemu adds some stuff to it then passes it on to the kernel. It's been decided that a better approach is to always boot through SLOF, even when using -kernel. WIth this approach we can leave PCI probing and device node creation to SLOF in all cases which removes a bunch of code in qemu, and avoids iterating the PCI devices from the machine specific init code which we're not supposed to do. This patch changes qemu to always boot through SLOF, and not to create PCI nodes. Simultaneously it updates the included version of SLOF (submodule and binary image) to one which supports (and requires) the new approach. The new SLOF version also includes a number of unrelated enhancements: support for booting from virtio-pci devices and e1000, greatly improved FCode support and many bugfixes. It also makes SLOF ready to be used even when specifying a kernel on the qemu command line. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
2012-01-21pseries: Use correct dispatcher for PCI config space accessesDavid Gibson1-4/+4
The pseries machine expects a para-virtualized guest and so supplies RTAS functions (via a hypercall) for performing PCI config space access. Currently the implementation of these calls into pci_default_{read,write}_config(). However this would be incorrect for any PCI device which overrides the default config read/write functions. AFAICT there's only one such device today, but we should still get it right. In addition the pci_host_config_{read,write}_common() functions which do correctly do this dispatch, perform bounds checking on the config space address, lack of which currently leads to an exploitable bug. This patch corrects the problem. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
2012-01-21pseries: Support PCI extended config space in RTAS callsBenjamin Herrenschmidt1-4/+10
On the pseries machine (which expexts a paravirtualized guest), guest access to PCI config space is via host-provided RTAS functions. This patch extends these RTAS functions to permit access to PCI extended config space, as specified in PAPR. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>