summaryrefslogtreecommitdiff
path: root/hw
AgeCommit message (Collapse)AuthorFilesLines
2011-11-18pseries: Default reg for vty should be SPAPR_VTY_BASE_ADDRESSMichael Ellerman1-1/+1
In commit b4a78527359a4540d84d4cdf629d01cbb262f698 ("Place pseries vty devices at addresses more similar to existing machines"), we changed the default reg for the vty to 0x30000000, however we didn't update the default value for a user specified vty device. Fix that. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
2011-11-18pseries: Check we have a chardev in spapr_vty_init()Michael Ellerman1-0/+5
If qemu is run like: qemu-system-ppc64 -nodefaults -device spapr-vty We end up in spapr_vty_init() with dev->chardev == NULL. Currently that leads to a segfault because we unconditionally call qemu_chr_add_handlers(). Although we could make that call conditional, I think a spapr-vty without a chardev is basically useless so fail the init. This is similar to what the serial code does for example. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
2011-11-18pseries: Fix buggy spapr_vio_find_by_reg()David Gibson1-2/+2
The spapr_vio_find_by_reg() function in hw/spapr_vio.c is supposed to find the device structure for a PAPR virtual IO device with the given reg value, and return NULL if none exists. It does the first ok, but if no device with that reg exists, it just returns the last device traversed in the list. This patch fixes it. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
2011-11-18pseries: Correct RAM size check for SLOFDavid Gibson1-3/+3
The SLOF firmware used on the pseries machine needs a reasonable amount of (guest) RAM in order to run, so we have a check in the machine init function to check that this is available. However, SLOF runs in real mode (MMU off) which means it can only actually access the RMA (Real Mode Area), not all of RAM. In many cases the RMA is the same as all RAM, but when running with Book3S HV KVM on PowerPC 970, the RMA must be especially allocated to be (host) physically contiguous. In this case, the RMA size is determined by what the host admin allocated at boot time, and will usually be less than the whole guest RAM size. This patch corrects the test to see if SLOF has enough memory for this case. In addition, more recent versions of SLOF that were committed earlier don't need quite as much memory as earlier versions. Therefore, this patch also reduces the amount of RAM we require to run SLOF. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
2011-11-11pseries: Fix initialization of sPAPREnvironment structureDavid Gibson1-1/+3
Since we added PCI support to the pseries machine, we include a qlist of PCI host bridges in the sPAPREnvironment structure. However this list was never properly initialized it. Somehow we got away with this until some other recent change broke it, and we now segfault immediately on startup. This patch adds the required QLIST_INIT(), and while we're at it makes sure we initialize the rest of the sPAPREnvironment structure to 0, to avoid future nasty surprises. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
2011-11-10hw/lan9118.c: Add missing 'break' to fix buffer overrunPeter Maydell1-0/+1
Add a missing 'break' statement to fix a buffer overrun when executing the EEPROM write-all command. Spotted by Coverity (see bug 887883). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-11-10qdev: Fix crash on -device '?=x'Markus Armbruster1-1/+1
Spotted by Coverity. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-11-09hpet: fix infinite loop in qemu_run_timers with -icount enabledMax Filippov1-2/+2
hpet_timer timer callback rearms itself based on difference between current HPET tick counter and comparator value. Difference calculated by the hpet_calculate_diff function is limited to non-negative values. cur_tick is calculated via hpet_get_ticks that uses qemu_get_clock_ns(vm_clock). With -icount enabled vm_clock doesn't advance during qemu_run_timers loop thus once difference is zero, qemu_run_timers loops forever handling hpet_timer. Limit hpet_calculate_diff results to positive only values to avoid that infinite loop. This fixes the following qemu-system-x86_64 hang when it reaches timer_irq_works() in the linux bootup: [ 0.000000] Fast TSC calibration using PIT [ 0.000000] Detected 1000.054 MHz processor. [ 0.000031] Calibrating delay loop (skipped), value calculated using timer frequency.. 2000.10 BogoMIPS (lpj=10000540) [ 0.000404] pid_max: default: 32768 minimum: 301 [ 0.001138] Mount-cache hash table entries: 256 [ 0.003883] Initializing cgroup subsys ns [ 0.004035] Initializing cgroup subsys cpuacct [ 0.004280] Initializing cgroup subsys freezer [ 0.004790] Performance Events: AMD PMU driver. [ 0.004985] ... version: 0 [ 0.005134] ... bit width: 48 [ 0.005285] ... generic registers: 4 [ 0.005437] ... value mask: 0000ffffffffffff [ 0.005625] ... max period: 00007fffffffffff [ 0.005807] ... fixed-purpose events: 0 [ 0.005957] ... event mask: 000000000000000f [ 0.006275] SMP alternatives: switching to UP code Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-09hw/omap_gpmc.c: Add missing 'break's to fix 8 bit NAND writesPeter Maydell1-0/+2
Add missing 'break' statements which would have meant that writing to an 8 bit NAND device was broken. Spotted by Coverity (see bug 887883). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-09hw/omap_dss.c: Fix !-vs-~ bug in handling DISPC_CONTROLPeter Maydell1-4/+5
Fix a bug revealed by a coverity scan (see bug 887883) which meant that we would never print the warning about unpredictable behaviour if a nonexistent overlay is enabled. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-09configure: fix detection for xattr.h on modern distributionsAvi Kivity4-4/+4
Modern distributions place xattr.h in /usr/include/sys, and fold libattr.so into libc. They also don't have an ENOATTR. Make configure detect this, and add a qemu-xattr.h file that directs the #include to the right place. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-08virtex: Remove memset of clk_setupEdgar E. Iglesias1-1/+0
clk_setup is now a function. Fixes a segfault. Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-11-07qxl: fix vga port initialization.Gerd Hoffmann1-5/+17
Commit 0a039dc70096b768d3810afa50ba1d214768aaf4 broke vga modes for qxl-vga by loosing vga_ioport_read windup. qxl needs to hook into vga port writes only and used to realize that by letting vga_init() do the work for both reads and writes, then overwrite the write function. That little detail was missed while doing the conversion ... This patch fixes it. It also switch qxl vga ioport registration to portio lists while being at it. Cc: Hans de Goede <hdegoede@redhat.com> Acked-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-07ac97: don't override the pci subsystem idGerd Hoffmann2-5/+27
This patch removes the code lines which set the subsystem id for the emulated ac97 card to 8086:0000. Due to the device id being zero the subsystem id isn't vaild anyway. With the patch applied the sound card gets the default qemu subsystem id (1af4:1100) instead. [ v2: old & broken id is maintained for -M pc-$oldqemuversion ] Cc: Takashi Iwai <tiwai@suse.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-07pc: add 1.0 machine typeGerd Hoffmann1-3/+11
This patch adds a pc-1.0 machine type. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-07disable automatic loading of sgabios when -nographicPaolo Bonzini1-9/+0
sgabios hasn't gotten a lot of coverage since it was not shipped. For 1.0, let's disable the automatic loading of the option ROM in -nographic mode. We can put it back for 1.1. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-07Merge remote-tracking branch 'kwolf/for-anthony' into stagingAnthony Liguori1-0/+10
2011-11-07Merge remote-tracking branch 'stefanha/trivial-patches' into stagingAnthony Liguori1-9/+9
2011-11-07xen-platform: Fix IO port read/write functionsAnthony PERARD1-9/+9
Somehow, the read/write functions handle an offset that does not exist anymore. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-11-06arm_gic: handle banked enable bits for per-cpu interruptsRabin Vincent1-15/+20
The first enable set/clear register (which controls the PPIs and SGIs) is supposed to be banked for each processor. Currently it is just handled globally and this prevents recent SMP Linux kernels from booting, because CPU0 stops receiving localtimer interrupts when CPU1 disables them locally. To fix this, allow the enable bits to be enabled per-cpu. For SPIs, always enable/disable ALL_CPU_MASK. Signed-off-by: Rabin Vincent <rabin@rab.in> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2011-11-04dma: Avoid reentrancy in DMA transfer handlersKevin Wolf1-0/+10
With the conversion of the block layer to coroutines, bdrv_read/write have changed to run a nested event loop that calls qemu_bh_poll. Consequently a scheduled BH can be called while a DMA transfer handler runs and this means that DMA_run becomes reentrant. Devices haven't been designed to cope with that, so instead of running a nested transfer handler just wait for the next invocation of the BH from the main loop. This fixes some problems with the floppy device. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-11-02Merge branch 'xtensa' of git://jcmvbkbc.spb.ru/dumb/qemu-xtensaBlue Swirl2-16/+120
* 'xtensa' of git://jcmvbkbc.spb.ru/dumb/qemu-xtensa: xtensa_lx60: fix build date code and change memory region names xtensa_lx60: pass kernel arguments from -append xtensa_lx60: add FLASH support target-xtensa: raise an exception for invalid and reserved opcodes target-xtensa: handle cache options in the overlay tool target-xtensa: mask out undefined bits of WINDOWSTART SR
2011-11-02Merge remote-tracking branch 'aneesh/for-upstream-8' into stagingAnthony Liguori1-99/+4
2011-11-02Fix X86 CPU topology in KVM modeBharata B Rao1-1/+0
apic id returned to guest kernel in ebx for cpuid(function=1) depends on CPUX86State->cpuid_apic_id which gets populated after the cpuid information is cached in the host kernel. This results in broken CPU topology in guest. Fix this by setting cpuid_apic_id before cpuid information is passed to the host kernel. This is done by moving the setting of cpuid_apic_id to cpu_x86_init() where it will work for both KVM as well as TCG modes. Acked-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Bharata B Rao <bharata.rao@gmail.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-02intel-hda: fix stream searchGerd Hoffmann1-1/+1
commit ba43d28916c4f51c19bd7366089155ce81bee058 introduces a bug: The stream-not-found case doesn't error out any more, instead the code silently uses the first stream. Fix it. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-02virtio-blk: pass full status to the guestPaolo Bonzini1-1/+15
When SCSI passthrough is being used by the guest with virtio-blk, the guest is not able to detect disk failures. This is because the status field is expected by the guest driver to include also the msg_status, host_status and driver_status fields, but the device is only passing down the SCSI status. The patch fixes this, and also makes sure that the guest always sees a CHECK_CONDITION status when there is valid sense data. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-02hw/9pfs: use g_vasprintf() instead of rolling our ownStefan Hajnoczi1-99/+4
Markus Armbruster <armbru@redhat.com> sent fixes for va_list vararg issues in v9fs_string_alloc_printf(). It turns out the function duplicates g_vasprintf() and can therefore be eliminated entirely. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-11-02xtensa_lx60: fix build date code and change memory region namesMax Filippov1-4/+4
Fix date code to uses MMDDYYYY notation. Change memory region names to reflect specification that defines them. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2011-11-02xtensa_lx60: pass kernel arguments from -appendMax Filippov2-4/+45
Create boot parameters in the end of SRAM region, insert kernel arguments specified in -append there. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2011-11-02xtensa_lx60: add FLASH supportMax Filippov1-8/+71
LX60 carry 4 Mbyte FLASH and 128 Kbyte SRAM, LX200 carry 16 Mbyte FLASH and 32 Mbyte SRAM. Either of these memories may be mapped to the system ROM region. Select boot from FLASH if -kernel option is not specified, otherwise boot from SRAM. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2011-11-01Revert "virtio: Add PCI memory BAR in addition to PIO BAR"Anthony Liguori1-2/+0
This reverts commit 46d95bfec7f9429d5228078219413d7e33496d65.
2011-11-01pcnet: Add link state supportJan Kiszka4-0/+10
Update lnkst on link state changes so that guests can obtain this information via reading back the LED output pin. Works for Linux but not for guests that depend on the missing PHY. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-01pcnet-pci: Fix PIO word access to PROMJan Kiszka1-12/+36
Implement the various IO access widths according to the spec. This specifically unbreaks word and dword access to the PROM area that is mapped into IO space. It also drops redundant upper limit checks and spurious "return void". Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-01pcnet: Move BCR defines to headerJan Kiszka3-20/+21
This moves BCR defines to the common header and immediately makes use of them to add BCR_APROMWE, replacing the open-coded write check in pcnet_aprom_writeb. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-01event_notifier: move to top-level directoryAvi Kivity2-78/+0
Has no business in hw/. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-01virtio: Add PCI memory BAR in addition to PIO BARDavid Gibson1-0/+2
Currently, virtio devices are usually presented to the guest as an emulated PCI device, virtio_pci. Although the actual IO operations are done through system memory, the configuration of the virtio device is done through the one PCI IO space BAR that virtio_pci presents. But PCI IO space (aka PIO) is deprecated for modern PCI devices, and on some systems with many PCI domains accessing PIO space can be problematic. For example on the existing PowerVM implementation of the PAPR spec, PCI PIO access is not supported at all. We're hoping that our KVM implementation will support PCI PIO (once we support PCI at all), but it will probably have some irritating limitations. This patch, therefore, extends the virtio_pci device to have a PCI memory space (MMIO) BAR as well as the IO BAR. The MMIO BAR contains exactly the same registers, in exactly the same layout as the existing PIO BAR. Because the PIO BAR is still present, existing guest drivers should still work fine. With this change in place, future guest drivers can check for an MMIO BAR and use that if present (falling back to PIO when possible to support older qemu versions). Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-01usb-uhci: Use PCI DMA stub functionsDavid Gibson1-11/+11
This updates the usb-uhci device emulation to use the explicit PCI DMA wrapper to initialize its scatter/gathjer structure. This means this driver should not need further changes when the sglist interface is extended to support IOMMUs. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-01usb-ehci: Use PCI DMA stub functionsDavid Gibson1-19/+25
This updates the usb-ehci device emulation to use the explicit PCI DMA wrapper to initialize its scatter/gathjer structure. This means this driver should not need further changes when the sglist interface is extended to support IOMMUs. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-01PCI IDE: Use PCI DMA stub functionsDavid Gibson1-9/+10
This updates the PCI IDE device emulation to use the explicit PCI DMA wrapper to initialize its scatter/gathjer structure. This means this driver should not need further changes when the sglist interface is extended to support IOMMUs. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-01intel-hda: Use PCI DMA stub functionsDavid Gibson1-7/+7
This updates the intel-hda device emulation to use the explicit PCI DMA functions, instead of directly calling physical memory access functions. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-01pcnet-pci: Use PCI DMA stub functionsEduard - Gabriel Munteanu1-2/+4
This updates the pcnet-pci device emulation to use the explicit PCI DMA functions, instead of directly calling physical memory access functions. Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-01lsi53c895a: Use PCI DMA stub functionsEduard - Gabriel Munteanu1-17/+16
This updates the lsi53c895a device emulation to use the explicit PCI DMA functions, instead of directly calling physical memory access functions. Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-01e1000: Use PCI DMA stub functionsEduard - Gabriel Munteanu1-14/+15
This updates the e1000 device emulation to use the explicit PCI DMA functions, instead of directly calling physical memory access functions. Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-01es1370: Use PCI DMA stub functionsEduard - Gabriel Munteanu1-2/+3
This updates the es1370 device emulation to use the explicit PCI DMA functions, instead of directly calling physical memory access functions. Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-01ac97: Use PCI DMA stub functionsEduard - Gabriel Munteanu1-3/+4
This updates the ac97 device emulation to use the explicit PCI DMA functions, instead of directly calling physical memory access functions. Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-01eepro100: Use PCI DMA stub functionsEduard - Gabriel Munteanu1-72/+49
This updates the eepro100 device emulation to use the explicit PCI DMA functions, instead of directly calling physical memory access functions. Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro> Signed-off-by: David Gibson <dwg@au1.ibm.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-01rtl8139: Use PCI DMA stub functionsEduard - Gabriel Munteanu1-52/+54
This updates the rtl8139 device emulation to use the explicit PCI DMA functions, instead of directly calling physical memory access functions. Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-01Add stub functions for PCI device models to do PCI DMADavid Gibson1-0/+67
This patch adds functions to pci.[ch] to perform PCI DMA operations. At present, these are just stubs which perform directly cpu physical memory accesses. Stubs are included which are analogous to cpu_physical_memory_{read,write}(), the stX_phys() and ldX_phys() functions and cpu_physical_memory_{map,unmap}(). In addition, a wrapper around qemu_sglist_init() is provided, which also takes a PCIDevice *. It's assumed that _init() is the only sglist function which will need wrapping, the idea being that once we have IOMMU support whatever IOMMU context handle the wrapper derives from the PCI device will be stored within the sglist structure for later use. Using these stubs, however, distinguishes PCI device DMA transactions from other accesses to physical memory, which will allow PCI IOMMU support to be added in one place, rather than updating every PCI driver at that time. That is, it allows us to update individual PCI drivers to support an IOMMU without having yet determined the details of how the IOMMU emulation will operate. This will let us remove the most bitrot-sensitive part of an IOMMU patch in advance. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-01ps2: migrate ledstateChristophe Fergeau1-2/+44
Make the ps2 device track its ledstate so that we can migrate it. Otherwise it gets lost across migration, and spice-server gets confused about the actual keyboard state and sends bogus caps/scroll/num key events. This fixes RH bug #729294 We only need to migrate the state when it is different of the default one (0). Signed-off-by: Christophe Fergeau <cfergeau@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-01spapr: fix buildAnthony Liguori1-2/+2
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>