summaryrefslogtreecommitdiff
path: root/hw
AgeCommit message (Collapse)AuthorFilesLines
2011-04-22vmstate: port ads7846Juan Quintela1-23/+18
Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-22vmstate: port adb_mouseJuan Quintela1-28/+15
Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-22vmstate: port adb_kbdJuan Quintela1-26/+14
Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-20hw/arm_boot.c: move initrd load address up to accommodate large kernelsPeter Maydell1-1/+1
Newer kernels are large enough that they can overlap the address where qemu places the initrd. Move the initrd up so that there is enough space for the kernel again. Unfortunately it's not possible to automatically determine the size of the kernel if it is compressed, so this is the best we can do. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-20Basic implementation of Sharp Zaurus SL-5500 collie PDADmitry Eremin-Solenikov1-0/+69
Add very basic implementation of collie PDA emulation. The system lacks LoCoMo and graphics/sound emulation. Linux kernel boots up to mounting rootfs (theoretically it can be provided in pflash images). Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-20Implement basic part of SA-1110/SA-1100Dmitry Eremin-Solenikov2-0/+1662
Basic implementation of DEC/Intel SA-1100/SA-1110 chips emulation. Implemented: - IRQs - GPIO - PPC - RTC - UARTs (no IrDA/etc.) - OST reused from pxa25x Everything else is TODO (esp. PM/idle/sleep!) - see the todo in the hw/strongarm.c Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-18s390x: virtio machine storage keysAlexander Graf1-12/+9
For emulation (and migration) we need to know about the guest's storage keys. These are separate from actual RAM contents, so we need to allocate them in parallel to RAM. While touching the file, this patch also adjusts the hypercall function to a new syntax that aligns better with tcg emulated code. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-18s390x: Dispatch interrupts to KVM or the real CPUAlexander Graf1-2/+8
The KVM interrupt injection path is non-generic for now. So we need to push knowledge of how to inject a device interrupt using KVM into the actual device code. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-18s390x: Prepare cpu.h for emulationAlexander Graf1-1/+1
We need to add some more logic to the CPU description to leverage emulation of an s390x CPU. This patch adds all the required helpers, fields in CPUState and constant definitions required for user and system emulation. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-16usb: trivial spelling fixesBrad Hards1-2/+2
Signed-off-by: Brad Hards <bradh@frogmouth.net> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-04-15Use qemu-common.h or qemu-timer.h in place of sysemu.hBlue Swirl2-3/+2
In some cases qemu-common.h or qemu-timer.h can be used in place of sysemu.h. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-04-15Remove unused sysemu.h include directivesBlue Swirl37-37/+0
Remove unused sysemu.h include directives to speed up build with the following patches. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-04-15sparc: Fix assertion caused by empty memory slot with 0 byteStefan Weil1-9/+12
If the memory size given on the command line is equal to the maximum size of memory defined by the hardware, there is no "empty slot" after physical memory. The following command qemu-system-sparc -m 256 raised an assertion: exec.c:2614: cpu_register_physical_memory_offset: Assertion `size' failed This can be fixed either at the caller side (don't call empty_slot_init) or in empty_slot_init (do nothing) when size == 0. The second solution was choosen here because it is more robust. Signed-off-by: Stefan Weil <weil@mail.berlios.de>
2011-04-13lm32: fix build breakage due to uninitialized variable 'r'Anthony Liguori1-1/+1
gcc 4.5.2 correctly complains that r is potentially uninitialized in this function. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-04-13atapi: GESN: implement 'media' subcommandAmit Shah2-4/+115
Implement the 'media' sub-command of the GET_EVENT_STATUS_NOTIFICATION command. This helps us report tray open, tray closed, no media, media present states to the guest. Newer Linux kernels (2.6.38+) rely on this command to revalidate discs after media change. This patch also sends out tray open/closed status to the guest driver when requested e.g. via the CDROM_DRIVE_STATUS ioctl (thanks Markus). Without such notification, the guest and qemu's tray open/close status was frequently out of sync, causing installers like Anaconda detecting no disc instead of tray open, confusing them terribly. Signed-off-by: Amit Shah <amit.shah@redhat.com> Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-04-13atapi: GESN: Standardise event response handling for future additionsAmit Shah1-6/+19
Handle GET_EVENT_STATUS_NOTIFICATION's No Event Available response in a generic way so that future additions to the code to handle other response types is easier. Signed-off-by: Amit Shah <amit.shah@redhat.com> Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-04-13atapi: GESN: Use structs for commonly-used field typesAmit Shah1-2/+14
Instead of using magic numbers, use structs that are more descriptive of the fields being used. Signed-off-by: Amit Shah <amit.shah@redhat.com> Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-04-13atapi: Move GET_EVENT_STATUS_NOTIFICATION command handling to its own functionAmit Shah1-13/+24
This makes the code more readable. Also, there's a block like: if () { ... } else { ... } Split that into if () { ... return; } ... Signed-off-by: Amit Shah <amit.shah@redhat.com> Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-04-13atapi: Allow GET_EVENT_STATUS_NOTIFICATION after media changeAmit Shah1-6/+14
After a media change, the only commands allowed from the guest were REQUEST_SENSE and INQUIRY. The guest may also issue GET_EVENT_STATUS_NOTIFICATION commands to get media changed notification. Signed-off-by: Amit Shah <amit.shah@redhat.com> Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-04-13atapi: Report correct errors on guest eject requestAmit Shah1-2/+6
Table 629 of the MMC-5 spec mentions two different error conditions when a CDROM eject is requested: a) while a disc is inserted and b) while a disc is not inserted. Ensure we return the appropriate error for the present condition of the drive and disc status. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-04-13atapi: Drives can be locked without media presentAmit Shah1-7/+2
Drivers are free to lock drives without any media present. Such a condition should not result in an error condition. See Table 341 in MMC-5 spec for details. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-04-12fix acpi regressionWen Congyang1-1/+1
This bug is introduced by commit 23910d3f. Signed-off-by: Wen Congyang <wency@cn.fujitsu.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-12Replace cpu_physical_memory_rw were possibleStefan Weil5-14/+13
Using cpu_physical_memory_read, cpu_physical_memory_write and ldub_phys improves readability and allows removing some type casts. lduw_phys and ldl_phys were not used because both require aligned addresses. Therefore it is not possible to simply replace existing calls by one of these functions. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-11ppc: remove a write-only variableBlue Swirl1-2/+0
Remove a write-only variable, spotted by GCC 4.6.0: /src/qemu/hw/ppc.c: In function 'power7_set_irq': /src/qemu/hw/ppc.c:255:9: error: variable 'cur_level' set but not used [-Werror=unused-but-set-variable] Acked-by: Alexander Graf <agraf@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-04-10s390x: fix virtio feature bitmapAlexander Graf1-2/+2
The feature bitmap in the s390 virtio machine is little endian. To address for that, we need to bswap the values after reading them out. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-10musicpal: Fix registration of MMIO-less sysbus devicesJan Kiszka1-2/+2
The proper way to signal that a sysbus devices need no MMIO region is to pass -1 to sysbus_create_simple. Signed-off-by: Jan Kiszka <jan.kiszka@web.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-10acpi, acpi_piix: factor out GPE logicIsaku Yamahata3-70/+108
factor out ACPI GPE logic. Later it will be used by ICH9 ACPI. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-09smbus_eeprom: consolidate smbus eeprom creation oc pc_piix, mips_mapta, ↵Isaku Yamahata5-28/+28
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-09lan9118: Ignore write to MAC_VLAN1 registerAtsushi Nemoto1-0/+6
On Mon, 4 Apr 2011 20:15:30 +0200, Aurelien Jarno <aurelien@aurel32.net> wrote: > Is it really safe ignoring write to this register? If yes, it's probably > a good idea to explain why in a comment. In any case, if supporting this > register is easy to do, it would be the best option. I think it is safe. Please see an updated comment below. And though implementing this register might be possible, I suppose it is not worth to supporting FrameTooLong detection, for now at least. Thank you for comments. >8--------------------------------------------------------------------- From: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Date: Tue, 5 Apr 2011 23:12:07 +0900 Subject: [PATCH] lan9118: Ignore write to MAC_VLAN1 register Since linux 2.6.38, smsc911x driver writes to VLAN1 registger. Since this register only affects FrameTooLong detection, ignoring write to this register should be safe. Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-09acpi, acpi_piix, vt82c686: factor out PM1_CNT logicIsaku Yamahata4-52/+74
factor out ACPI PM1_CNT logic. This will be used by ich9 acpi. Cc: Blue Swirl <blauwirbel@gmail.com> Cc: Huacai Chen <zltjiangshi@gmail.com> Cc: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-09acpi, acpi_piix, vt82c686: factor out PM1a EVT logicIsaku Yamahata4-75/+81
factor out ACPI PM1a EVT logic. Later this will be used by ich9 acpi. Cc: Blue Swirl <blauwirbel@gmail.com> Cc: Huacai Chen <zltjiangshi@gmail.com> Cc: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-09acpi, acpi_piix, vt82c686: factor out PM_TMR logicIsaku Yamahata4-65/+96
factor out PM_TMR logic. Later This will be used by ich9 acpi. Also fixes the same bug in vt82c686.c that was fixed by the following commits. > commit 055479feab63607b8042bb8ebb2e0523f17cbc4e > Author: aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> > Date: Wed Jan 21 16:31:20 2009 +0000 > > Always return latest pmsts instead of the old one (Xiantao Zhang) > > It may lead to the issue when booting windows guests with acpi=1 > if return the old pmsts. > > Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com> > Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Cc: Blue Swirl <blauwirbel@gmail.com> Cc: Huacai Chen <zltjiangshi@gmail.com> Cc: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-09hw/pflash_cfi02: Fix lazy reset of ROMD modeJordan Justen1-1/+1
When checking pfl->rom_mode for when to lazily reenter ROMD mode, the value was check was the opposite of what it should have been. This prevent the part from returning to ROMD mode after a write was made to the CFI rom region. Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-09mpc85xx_pci_map_irq: change "unknow" to "unknown"Scott Wood1-1/+1
Signed-off-by: Scott Wood <scottwood@freescale.com> Acked-by: Alexander Graf <agraf@suse.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-04-09multiboot: Quote filename in error messageAdam Lackorzynski1-1/+1
Quote filename in error message to spot possible whitespace character in the filename and make error message more meaningful. Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de> Acked-by: Alexander Graf <agraf@suse.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-04-08Delay creation of pseries device tree until resetDavid Gibson2-48/+75
At present, the 'pseries' machine creates a flattened device tree in the machine->init function to pass to either the guest kernel or to firmware. However, the machine->init function runs before processing of -device command line options, which means that the device tree so created will be (incorrectly) missing devices specified that way. Supplying a correct device tree is, in any case, part of the required platform entry conditions. Therefore, this patch moves the creation and loading of the device tree from machine->init to a reset callback. The setup of entry point address and initial register state moves with it, which leads to a slight cleanup. This is not, alas, quite enough to make a fully working reset for pseries. For that we would need to reload the firmware images, which on this machine are loaded into RAM. It's a step in the right direction, though. Signed-off-by: David Gibson <dwg@au1.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2011-04-08pseries: Abolish envs arrayDavid Gibson3-38/+46
Currently the pseries machine init code builds up an array, envs, of CPUState pointers for all the cpus in the system. This is kind of pointless, given the generic code already has a perfectly good linked list of the cpus. In addition, there are a number of places which assume that the cpu's cpu_index field is equal to its index in this array. This is true in practice, because cpu_index values are just assigned sequentially, but it's conceptually incorrect and may not always be true. Therefore, this patch abolishes the envs array, and explicitly uses the generic cpu linked list and cpu_index values throughout. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
2011-04-08spapr_vscsi: Set uninitialized variableStefan Weil1-1/+1
cppcheck reports this error: hw/spapr_vscsi.c:274: error: Uninitialized variable: rc If llen == 0, rc was indeed used without being initialized. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2011-04-08Don't call cpu_synchronize_state() from machine init.Scott Wood2-4/+0
This will deadlock when the I/O thread is used, since the CPU thread is blocked waiting for qemu_system_ready. The synchronization is unnecessary since this is before cpu_synchronize_all_post_init(). Signed-off-by: Scott Wood <scottwood@freescale.com> Acked-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2011-04-07Merge remote branch 'kwolf/for-anthony' into stagingAnthony Liguori13-72/+94
2011-04-07virtio-blk: fail unaligned requestsChristoph Hellwig1-0/+8
Like all block drivers virtio-blk should not allow small than block size granularity access. But given that the protocol specifies a byte unit length field we currently accept such requests, which cause qemu to abort() in lower layers. Add checks to the main read and write handlers to catch them early. Reported-by: Conor Murphy <conor_murphy_virt@hotmail.com> Tested-by: Conor Murphy <conor_murphy_virt@hotmail.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-04-07virtio-balloon: fixed endianness bug in the config spaceAlexey Kardashevskiy1-1/+1
The specification for the virtio balloon device requres that the values in the config space be encoded little-endian. This differs from most virtio things, where guest-native endian is the norm. Currently, the qemu virtio-balloon code correctly makes the conversion on get_config(), but doesn't on set_config for the 'actual' field. The kernel driver, on the other hand, correctly converts when setting the actual field, but does not convert when reading the config space. The upshot is that virtio-balloon will only work correctly if both host and guest are LE, making all the conversions nops. This patch corrects the qemu side, correctly doing host-native <-> LE conversions when accessing the config space. This won't break any setups that aren't already broken, and fixes the case of BE host, LE guest. Fixing the BE guest case will require kernel fixes as well. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-04-07virtio-9p: fixed LE-to-host conversion bug when QEMU is called from guestAlexey Kardashevskiy1-6/+3
The 9p code already contains an attempt at the necessary endian conversions, but it's broken. The code which does conversion from host to guest does it correctly and this code was copied to the function which does guest to host conversion. However the copied code hasn't been correctly updated, so it first endian converts some garbage on the stack and then overwrites it with a field from incoming packet without conversion. The patch fixes the mistakes. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-04-07spapr_llan: Fix warning when compiled with -dDEBUGAlexey Kardashevskiy1-3/+0
Compiling with the DEBUG macro causes leaves hw/spapr_llan.c with an unused variable, which is treated as an error in the qemu build. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-04-07qdev: Fix comment around qdev_init_nofail()Michael Tokarev1-1/+2
In previous life qdev_init_nofail() used to call hw_error() which did register dump and other scary things. Now it calls error_report() and does a regular exit(1). Fix the comment to match reality. Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-04-07usb-ccid: Spelling fixesBrad Hards1-4/+4
While looking at David Gibson's build-fix for hw/usb-ccid.c, I noticed a spello in a comment on the following (unchanged) line. Signed-off-by: Brad Hards <bradh@frogmouth.net> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-04-07floppy: save and restore DIR registerJason Wang1-1/+50
We need to keep DIR register unchanged across migration, but currently it depends on the media_changed flags from block layer. Since we do not save/restore it and the bdrv_open() called in dest node may set the media_changed flag when trying to open floppy image, guest driver may think the floppy have changed after migration. To fix this, a new filed media_changed in FDrive strcutre was introduced in order to save and restore the it from block layer through pre_save/post_load callbacks. Signed-off-by: Jason Wang <jasowang@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-04-07ide: consolidate drive_get(IF_IDE)Isaku Yamahata10-69/+28
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-04-07hw/xen_disk: ioreq not finished on errorFeiran Zheng1-2/+8
Bug fix: routines 'ioreq_runio_qemu_sync' and 'ioreq_runio_qemu_aio' won't call 'ioreq_unmap' or 'ioreq_finish' on errors, leaving ioreq in the blkdev->inflight list and a leak. Signed-off-by: Feiran Zheng <famcool@gmail.com> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-04-04Fix non-portable format string in usb-ccid.cDavid Gibson1-1/+1
At one point, usb-ccid.c attempts to use a %lX format specifier to print a uint64_t, which is only correct on some host platforms. This patch corrects the statement to use the stdint specified PRIX64 constant instead. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>