aboutsummaryrefslogtreecommitdiffstats
path: root/hw
AgeCommit message (Collapse)AuthorFilesLines
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>
2011-04-04lm32: add support for the Milkymist boardMichael Walle1-0/+216
This patch adds almost complete support for the Milkymist system-on-chip (http://www.milkymist.org). Additional to running bare metal applications, booting a linux kernel with initrd is supported. Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-04-04lm32: add milkymist hw support functionsMichael Walle1-0/+204
This patch adds wrappers for easy creation of the qdev devices. Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-04-04lm32: add Milkymist VGAFB supportMichael Walle2-0/+392
This patch adds support for Milkymist's VGA framebuffer. Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-04-04lm32: add Milkymist UART supportMichael Walle1-0/+180
This patch adds support for Milkymist's simple UART. Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-04-04lm32: add Milkymist TMU2 supportMichael Walle1-0/+481
This patch adds support for Milkymist's texture mapping unit. For fast computation this model needs hardware accelerated 3D graphics support (OpenGL). There is no graphical output, all computations belong to internal framebuffers only. Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-04-04lm32: add Milkymist System Controller supportMichael Walle1-0/+330
This patch adds support for Milkymist's System Controller core. The model has the following features: - support for shutting down and restarting the board - provide two timers and GPIO - provide registers for system identification and reading the boards capabilities Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-04-04lm32: add Milkymist SoftUSB supportMichael Walle1-0/+357
This patch adds support for Milkymist's SoftUSB core. This model differ from the real hardware in its functionality. The real hardware consits of a tiny freely programmable microcontroller which controls the USB ports. For simplicity reasons, this model emulates only keyboard and mouse input devices, eg. input events translates directly to the corresponding expected messages. Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-04-04lm32: add Milkymist PFPU supportMichael Walle1-0/+536
This patch adds support for Milkymist's Programmable FPU. Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-04-04lm32: add Milkymist Minimac supportMichael Walle1-0/+568
This patch adds support for Milkymist's minimal Ethernet MAC. Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-04-04lm32: add Milkymist memory card supportMichael Walle1-0/+294
This patch adds support for Milkymist's memory card core. Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-04-04lm32: add Milkymist HPDMC supportMichael Walle1-0/+161
This patch adds support for the Milkymist's High Performance Dynamic Memory Controller. This is just a dumb model without any functionality. While the real hardware acts for example as a bridge between software and hardware for sending SDRAM commans, this model will only eat up these commands and always returns the expected hardware states, eg. PLL locked etc. Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-04-04lm32: add Milkymist AC97 supportMichael Walle1-0/+335
This patch adds support for the Milkymist AC97 compatible sound output and input core. Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-04-04Revert "ioapic: when switches to level trigger mode, interrupts raised ↵Aurelien Jarno1-1/+0
repeatedly." This reverts commit 9bcfc7daabb138b0fe3d64d74892942d482e5bbd.
2011-04-04s390x: fix s390-virtio-serialAlexander Graf2-5/+5
Commit 6b331efb733a0f913ddc0b7762a1307dec304061 broke the s390 proxy version of virtio-serial by only taking its PCI brother into account. So let's adjust s390-virtio-serial the same way as its PCI counterpart, making it compile and work again. Signed-off-by: Alexander Graf <agraf@suse.de> CC: Amit Shah <amit.shah@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-04virtio: use generic name when possibleAlexander Graf2-0/+5
We have two different virtio buses: pci and s390. The abstraction path taken in qemu is to have generic aliases for each device type in the architecture specific qdev devices. So let's make use of these aliases whenever we can and define them whenever we can. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-04w32: Fix compilation (wrong include file)Stefan Weil1-2/+1
arpa/inet.h is not available for w32, so commit edbb21363fbfe40e050f583df921484cbc31c79d breaks w32 compilations. This is fixed by using qemu_socket.h. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Reviewed-by: Alon Levy <alevy@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-04e1000: Mask out lower bits of RDBAL/TDBALKevin Wolf1-3/+18
Rx and Tx descriptors are 16 byte aligned, so the lower bits are ignored by real hardware. In fact, they always read back as zero on real hardware, but probably nobody relies on that. Signed-off-by: Kevin Wolf <mail@kevin-wolf.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-03ioapic: when switches to level trigger mode, interrupts raised repeatedly.Isaku Yamahata1-0/+1
- the trigger mode is edge at first - During initializatoin, the interrupt is raised as edge which is masked. The corresponding bit of irr is set. - Then the mode is switched to level and it's unmasked. - the bit of irr is set, so the interrupt is raised repeatedly by ioapic_service(). - OS considers that the irq line is broken and falls back to polling mode. This patch fixes the issues. After raising edige, clear the bit of irr. > Bringing up interface eth0: > Determining IP information for eth0...irq 18: nobody cared (try booting with the "irqpoll" option) > Pid: 4126, comm: ip Not tainted 2.6.38-rc7 #1 > Call Trace: > <IRQ> [<ffffffff8105b009>] ? __report_bad_irq+0x38/0x87 > [<ffffffff8105b177>] ? note_interrupt+0x11f/0x188 > [<ffffffff8105bacf>] ? handle_fasteoi_irq+0xa7/0xd1 > [<ffffffff810046ff>] ? handle_irq+0x83/0x8c > [<ffffffff81003eb9>] ? do_IRQ+0x48/0xaf > [<ffffffff81300513>] ? ret_from_intr+0x0/0xe > [<ffffffff81031ab8>] ? __do_softirq+0x4f/0x114 > [<ffffffff81002d6c>] ? call_softirq+0x1c/0x28 > [<ffffffff81004647>] ? do_softirq+0x33/0x68 > [<ffffffff810316fb>] ? irq_exit+0x36/0x38 > [<ffffffff81015f2c>] ? smp_apic_timer_interrupt+0x88/0x96 > [<ffffffff81002853>] ? apic_timer_interrupt+0x13/0x20 > <EOI> [<ffffffff810177ed>] ? __ioapic_set_affinity+0x68/0x7c > [<ffffffff813000f0>] ? _raw_spin_unlock_irqrestore+0x8/0xa > [<ffffffff8105a84f>] ? __setup_irq+0x224/0x2cb > [<ffffffff8120e3c5>] ? e1000_intr+0x0/0x103 > [<ffffffff8105a9c7>] ? request_threaded_irq+0xd1/0x114 > [<ffffffff8120e396>] ? e1000_request_irq+0x34/0x63 > [<ffffffff8121237d>] ? e1000_open+0x81/0x11f > [<ffffffff8129097c>] ? call_netdevice_notifiers+0x45/0x4a > [<ffffffff81290d8d>] ? __dev_open+0x97/0xc4 > [<ffffffff8128e9c5>] ? __dev_change_flags+0xb9/0x13d > [<ffffffff81290cc1>] ? dev_change_flags+0x1c/0x51 > [<ffffffff812d0542>] ? devinet_ioctl+0x26e/0x594 > [<ffffffff812d174c>] ? inet_ioctl+0x92/0xaa > [<ffffffff81281d75>] ? T.1003+0x13/0x32 > [<ffffffff81282152>] ? sock_ioctl+0x1f2/0x1ff > [<ffffffff810ae2d3>] ? do_vfs_ioctl+0x498/0x4e7 > [<ffffffff81281203>] ? sock_alloc_file+0xb3/0x115 > [<ffffffff8109f79f>] ? fd_install+0x31/0x5d > [<ffffffff810ae364>] ? sys_ioctl+0x42/0x65 > [<ffffffff81001f3b>] ? system_call_fastpath+0x16/0x1b > handlers: > [<ffffffff8120e3c5>] (e1000_intr+0x0/0x103) > Disabling IRQ #18 Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-03hw/vexpress.c: Add model of ARM Versatile Express boardPeter Maydell1-0/+224
Add a model of the ARM Versatile Express board (with A9MPx4 daughterboard). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-01ccid: add ccid-card-emulated deviceAlon Levy1-0/+595
This devices uses libcacard (internal) to emulate a smartcard conforming to the CAC standard. It attaches to the usb-ccid bus. Usage instructions (example command lines) are in the following patch in docs/ccid.txt. It uses libcacard which uses nss, so it can work with both hw cards and certificates (files). Signed-off-by: Alon Levy <alevy@redhat.com> --- changes from v20->v21: (Jes Sorenson review) * cosmetics * use qemu-thread and qemu_malloc/qemu_free changes from v19->v20: * checkpatch.pl changes from v18->v19: * add qdev.desc * backend: drop the enumeration property, back to using a string one. changes from v16->v17: * use PROP_TYPE_ENUM for backend changes from v15->v16: * fix error reporting in initfn * bump copyright year * update copyright license changes from v1: * remove stale comments, use only c-style comments * bugfix, forgot to set recv_len * change reader name to 'Virtual Reader'
2011-04-01ccid: add passthru card deviceAlon Levy1-0/+340
The passthru ccid card is a device sitting on the usb-ccid bus and using a chardevice to communicate with a remote device using the VSCard protocol defined in libcacard/vscard_common.h Usage docs available in following patch in docs/ccid.txt Signed-off-by: Alon Levy <alevy@redhat.com> --- Changes from v23->v24: * fixed double license line in header. Changes from v20->v21: (Jes Sorensen review) * add reference to COPYING in header * long comment reformatting Changes from v19->v20: * checkpatch.pl Changes from v18->v19: * add qdev.desc * remove .qdev.unplug (no hot unplug support for ccid bus) Changes from v16->v17: * fix wrong cast when receiving VSC_Error * ccid-card-passthru: force chardev user wakeup by sending Init see lengthy comment below. Changes from v15->v16: Behavioral changes: * return correct size * return error instead of assert if client sent too large ATR * don't assert if client sent too large a size, but add asserts for indices to buffer * reset vscard_in indices on chardev disconnect * handle init from client * error if no chardev supplied * use ntoh, hton * eradicate reader_id_t * remove Reconnect usage (removed from VSCARD protocol) * send VSC_SUCCESS on card insert/remove and reader add/remove Style fixes: * width of line fix * update copyright * remove old TODO's * update file header comment * use macros for debug levels * c++ style comment replacement * update copyright license * fix ATR size comment * fix whitespace in struct def * fix DPRINTF prefix * line width fix ccid-card-passthru: force chardev user wakeup by sending Init The problem: how to wakeup the user of the smartcard when the smartcard device is initialized? Long term solution: have a callback interface. This was done via the deprecated so called chardev ioctl interface. Short term solution: do a write. Specifically we write an Init message. And we change the client to send it's own Init message regardless of receiving this one. Additional Init messages will be regarded as acceptable, the first one received after connection establishment is the determining one wrt capabilities.
2011-04-01usb-ccid: add CCID busAlon Levy2-0/+1478
A CCID device is a smart card reader. It is a USB device, defined at [1]. This patch introduces the usb-ccid device that is a ccid bus. Next patches will introduce two card types to use it, a passthru card and an emulated card. [1] http://www.usb.org/developers/devclass_docs/DWG_Smart-Card_CCID_Rev110. Signed-off-by: Alon Levy <alevy@redhat.com> --- changes from v20->v21: (Jes Sorenson review) * cosmetic changes - fix multi line comments. * reorder fields in USBCCIDState * add reference to COPYING * add --enable-smartcard and --disable-smartcard here (moved from last patch) changes from v19->v20: * checkpatch.pl changes from v18->v19: * merged: ccid.h: add copyright, fix define and remove non C89 comments * add qdev.desc changes from v15->v16: Behavioral changes: * fix abort on client answer after card remove * enable migration * remove side affect code from asserts * return consistent self-powered state * mask out reserved bits in ccid_set_parameters * add missing abRFU in SetParameters (no affect on linux guest) whitefixes / comments / consts defines: * remove stale comment * remove ccid_print_pending_answers if no DEBUG_CCID * replace printf's with DPRINTF, remove DEBUG_CCID, add verbosity defines * use error_report * update copyright (most of the code is not original) * reword known bug comment * add missing closing quote in comment * add missing whitespace on one line * s/CCID_SetParameter/CCID_SetParameters/ * add comments * use define for max packet size Comment for "return consistent self-powered state": the Configuration Descriptor bmAttributes claims we are self powered, but we were returning not self powered to USB_REQ_GET_STATUS control message. In practice, this message is not sent by a linux 2.6.35.10-74.fc14.x86_64 guest (not tested on other guests), unless you issue lsusb -v as root (for example).
2011-04-01hw/versatilepb, realview: Fix condition for instantiation of onboard NICPeter Maydell2-3/+3
Correct the condition determining whether we instantiate the onboard NIC or a PCI card NIC on VersatilePB and Realview boards. This was broken in two ways: (1) if the user asked for two default NICs ("-net nic -net nic") we would crash trying to strcmp() a NULL pointer (2) if the user asked for two NICs explicitly of the same model as the onboard NIC (eg "-net nic,model=smc91c111 -net nic,model=smc91c111") we would try to instantiate two onboard NICs at the same address. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-01pcnet: Fix sign extension: make ipxe work with >2G RAMMichael Brown1-15/+15
The problem is with definitions in hw/pcnet.c such as: #define CSR_CRDA(S) ((S)->csr[28] | ((S)->csr[29] << 16)) "(S)->csr[29]" is a uint16_t, but "(S)->csr[29] << 16" gets promoted to int, so the overall CSR_CRDA(s) is a (signed) int rather than a uint32_t. This then gets assigned to a uint64_t using target_phys_addr_t crda = CSR_CRDA(s); so when (S)->csr[29] has the high bit set, we end up with crda=0xffffffffxxxxxxxx. From: Michael Brown <mcb30@ipxe.org> Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-01lsi53c895a: add support for ABORT messagesBernhard Kohl1-0/+57
If these messages are not handled correctly the guest driver may hang. Always mandatory: - ABORT - BUS DEVICE RESET Mandatory if tagged queuing is implemented (which disks usually do): - ABORT TAG - CLEAR QUEUE Signed-off-by: Bernhard Kohl <bernhard.kohl@nsn.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-01fix build errors when we enable acpi_piix4 debugWen Congyang1-2/+3
I enable acpi_piix4 debug, and got the following build errors: # make CC libhw64/acpi_piix4.o cc1: warnings being treated as errors /home/wency/source/qemu/hw/acpi_piix4.c: In function ‘pm_ioport_write’: /home/wency/source/qemu/hw/acpi_piix4.c:193: error: format ‘%04x’ expects type ‘unsigned int’, but argument 2 has type ‘uint64_t’ /home/wency/source/qemu/hw/acpi_piix4.c:193: error: format ‘%04x’ expects type ‘unsigned int’, but argument 3 has type ‘uint64_t’ /home/wency/source/qemu/hw/acpi_piix4.c: In function ‘pm_ioport_read’: /home/wency/source/qemu/hw/acpi_piix4.c:219: error: format ‘%04x’ expects type ‘unsigned int’, but argument 2 has type ‘uint64_t’ make[1]: *** [acpi_piix4.o] Error 1 make: *** [subdir-libhw64] Error 2 Signed-off-by: Wen Congyang <wency@cn.fujitsu.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-01Add SLOF-based partition firmware for pSeries machine, allowing more boot ↵David Gibson2-4/+109
options Currently, the emulated pSeries machine requires the use of the -kernel parameter in order to explicitly load a guest kernel. This means booting from the virtual disk, cdrom or network is not possible. This patch addresses this limitation by inserting a within-partition firmware image (derived from the "SLOF" free Open Firmware project). If -kernel is not specified, qemu will now load the SLOF image, which has access to the qemu boot device list through the device tree, and can boot from any of the usual virtual devices. In order to support the new firmware, an extension to the emulated machine/hypervisor is necessary. Unlike Linux, which expects multi-CPU entry to be handled kexec() style, the SLOF firmware expects only one CPU to be active at entry, and to use a hypervisor RTAS method to enable the other CPUs one by one. This patch also implements this 'start-cpu' method, so that SLOF can start the secondary CPUs and marshal them into the kexec() holding pattern ready for entry into the guest OS. Linux should, and in the future might directly use the start-cpu method to enable initially disabled CPUs, but for now it does require kexec() entry. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: David Gibson <dwg@au1.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2011-04-01Implement PAPR VPA functions for pSeries shared processor partitionsDavid Gibson2-1/+193
Shared-processor partitions are those where a CPU is time-sliced between partitions, rather than being permanently dedicated to a single partition. qemu emulated partitions, since they are just scheduled with the qemu user process, behave mostly like shared processor partitions. In order to better support shared processor partitions (splpar), PAPR defines the "VPA" (Virtual Processor Area), a shared memory communication channel between the hypervisor and partitions. There are also two additional shared memory communication areas for specialized purposes associated with the VPA. A VPA is not essential for operating an splpar, though it can be necessary for obtaining accurate performance measurements in the presence of runtime partition switching. Most importantly, however, the VPA is a prerequisite for PAPR's H_CEDE, hypercall, which allows a partition OS to give up it's shared processor timeslices to other partitions when idle. This patch implements the VPA and H_CEDE hypercalls in qemu. We don't implement any of the more advanced statistics which can be communicated through the VPA. However, this is enough to make normal pSeries kernels do an effective power-save idle on an emulated pSeries, significantly reducing the host load of a qemu emulated pSeries running an idle guest OS. Signed-off-by: David Gibson <dwg@au1.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2011-04-01Add a PAPR TCE-bypass mechanism for the pSeries machineBen Herrenschmidt2-0/+87
Usually, PAPR virtual IO devices use a virtual IOMMU mechanism, TCEs, to mediate all DMA transfers. While this is necessary for some sorts of operation, it can be complex to program and slow for others. This patch implements a mechanism for bypassing TCE translation, treating "IO" addresses as plain (guest) physical memory addresses. This has two main uses: * Simple, but 64-bit aware programs like firmwares can use the VIO devices without the complexity of TCE setup. * The guest OS can optionally use the TCE bypass to improve performance in suitable situations. The mechanism used is a per-device flag which disables TCE translation. The flag is toggled with some (hypervisor-implemented) RTAS methods. Signed-off-by: Ben Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: David Gibson <dwg@au1.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2011-04-01Implement PAPR virtual SCSI interface (ibmvscsi)Ben Herrenschmidt5-0/+1455
This patch implements the infrastructure and hypercalls necessary for the PAPR specified Virtual SCSI interface. This is the normal method for providing (virtual) disks to PAPR partitions. Signed-off-by: Ben Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: David Gibson <dwg@au1.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2011-04-01Implement PAPR CRQ hypercallsBen Herrenschmidt3-1/+173
This patch implements the infrastructure and hypercalls necessary for the PAPR specified CRQ (Command Request Queue) mechanism. This general request queueing system is used by many of the PAPR virtual IO devices, including the virtual scsi adapter. Signed-off-by: Ben Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: David Gibson <dwg@au1.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>