summaryrefslogtreecommitdiff
path: root/hw
AgeCommit message (Collapse)AuthorFilesLines
2009-05-10Follow coding conventionsPaul Brook53-857/+856
Remove explicit struct qualifiers and rename structure types. Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-05-08vga: Replace VGA_COMMON with a structureAvi Kivity5-472/+472
All VGA devices share a common field subset; currently they do so by a macro which defines the common fields inline their state structures, relying on the the common state being placed at offset 0 in the structure. This makes refactoring the code difficult and requires a lot of error prone casts. Replace the macro by a new VGACommonState structure, and the casts by regular field access and container_of() for upcasts. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-08e1000: Do not reinit pci config space to 0Amit Shah1-1/+0
pci_register_device already mallocs the pci config space buffer filled with zeroes. Doing this again breaks some default config space writes like setting the subsystem vendor id and subsystem device id. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-08reset state for load_linuxGlauber Costa1-0/+7
The linux loader is just an option rom like any other, just with some special requirements. Right now, our option rom resetting mechanism is not being applied to it. As a result, users using -kernel will not be able to successfully reboot their machines This patch fixes it by saving all the data we generated in the load_linux() function, to be used later by the option rom resetting mechanism. Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-08register reset handler for option_romsGlauber Costa1-0/+25
Currently, boot options are not preserved across a system reset. option roms can modify themselves, or can for instance restore the real int 0x19 vector after they tried to boot from it. To properly do that, we need a reset handler registered to deal with option roms. This patch is based on current version on qemu-kvm.git Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-08Remove superfluous #includes.Paul Brook2-2/+0
Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-05-08Use target_phys_addr_t, not target_ulong.Paul Brook1-12/+13
Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-05-08Replace cpu_abort with hw_errorPaul Brook47-262/+180
Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-05-06Fix PL110 framebuffer byteswapping in 32bpp mode.Paul Brook1-1/+1
Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-05-05ETRAX: Simplify serport control logic.Edgar E. Iglesias1-83/+44
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2009-05-05ETRAX: Drop _t for the serial type.Edgar E. Iglesias1-7/+7
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2009-05-05ETRAX: Use NULL for subwidth serport reg accesses.Edgar E. Iglesias1-18/+2
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2009-05-05ETRAX: Drop the _t for the internal PIC type.Edgar E. Iglesias1-8/+8
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2009-05-05ETRAX: Simplify the interrupt controller model.Edgar E. Iglesias1-57/+24
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2009-05-05ETRAX: Simplify interrupt signaling.Edgar E. Iglesias3-20/+7
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2009-05-03minor fix of pci_register_bus()Isaku Yamahata1-0/+1
keep first_bus linked list correct. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2009-05-03use PCI_HEADER_TYPE.Isaku Yamahata21-32/+37
use symbolic value instead of 0x0e and related value. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2009-05-03Handle NULL bdrv.Paul Brook1-4/+10
Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-05-01Fix hw/acpi.c build w/ DEBUG enabledAlex Williamson1-6/+6
Trivial build warning/fixes when the local DEBUG define is enabled. Signed-off-by: Alex Williamson <alex.williamson@hp.com> Signed-off-by: Avi Kivity <avi@qumranet.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-01Pci nic: pci_register_device can failChris Wright5-0/+17
The pci_register_device() call in PCI nic initialization routines can fail. Handle this failure and propagate a meaningful error message to the user instead of generating a SEGV. Cc: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Chris Wright <chrisw@sous-sol.org> Signed-off-by: Avi Kivity <avi@qumranet.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-01suport device driver initialization modelGlauber Costa1-2/+1
According to PnP specification, Appendix B, Option ROMs that support DDIM (device driver initialization model) should have their memory space writeable. KVM deviates from us here, by removing the IO_MEM_ROM flag, to allow for PCI option ROMs (they require DDIM). However, there's absolutely no reason we can't do the same. Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-01fix virtio_blk_inhdr commentChristoph Hellwig1-1/+1
The inhdr is at the end of the S/G list, not the beginning. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-01Hardware watchdogRichard W.M. Jones5-0/+786
Here is an updated hardware watchdog patch, which should fix everything that was raised about the previous version ... Signed-off-by: Richard W.M. Jones <rjones@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-01virtio-blk: add SGI_IO passthru supportChristoph Hellwig2-7/+128
[had the qemu list address wrong the first time, reply to this message, not the previous if you were on Cc] Add support for SG_IO passthru (packet commands) to the virtio-blk backend. Conceptually based on an older patch from Hannes Reinecke but largely rewritten to match the code structure and layering in virtio-blk. Note that currently we issue the hose SG_IO synchronously. We could easily switch to async I/O, but that would required either bloating the VirtIOBlockReq by the size of struct sg_io_hdr or an additional memory allocation for each SG_IO request. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-01Remove redundant cirrus vga ram functions.Paul Brook1-30/+0
Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-04-30Remove vga LFB accessor hacks.Paul Brook1-8/+0
These are redundant now that we remap the LFB ram area. Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-04-27Synch to VGABlue Swirl1-4/+4
2009-04-27[RESEND] Fix vga segfaults or screen corruption with large memory guestsAvi Kivity1-5/+6
page0 and friends are ram addresses; a smaller size will overflow and cause a segfault or random corruption. Change them to ram_addr_t. Signed-off-by: Avi Kivity <avi@redhat.com>
2009-04-25Fix compilation when x86_64 is definedBlue Swirl2-8/+14
2009-04-25Fix warningBlue Swirl1-1/+1
2009-04-24qemu: create helper for event notification (Marcelo Tosatti)aliguori1-3/+1
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7236 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-23Fix typo, thanks to Andreas Faerber for spottingblueswir11-1/+1
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7235 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-23Use a more natural orderblueswir13-5/+5
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7234 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-22Change RTC time drift IRQ re-injection (Gleb Natapov)aliguori1-15/+47
Currently IRQ are reinjected as soon as they are acknowledged to the RTC, but Windows sometimes do acknowledgement in a loop with global interrupt disabled waiting for interrupt to be cleared and it does not mask RTC vector in PIC/APIC while doing this. In such situation interrupt injection always fails and RTC interrupt is never cleared. Instead of reinjecting coalesced IRQs on acknowledgement the patch below reinjects them by accelerating RTC clock a bit. This way RTC interrupt is not constantly raced after coalesced interrupt. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7231 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-22implement qemu_blockalign (Stefano Stabellini)aliguori1-1/+1
this patch adds a buffer_alignment field to BlockDriverState and implements a qemu_blockalign function that uses that field to allocate a memory aligned buffer to be used by the block driver. buffer_alignment is initialized to 512 but each block driver can set a different value (at the moment none of them do). This patch modifies ide.c, block-qcow.c, block-qcow2.c and block.c to use qemu_blockalign instead of qemu_memalign. There is only one place left that still uses qemu_memalign to allocate buffers used by block drivers that is posix-aio-compat:handle_aiocb_rw because it is not possible to get the BlockDriverState from that function. However I think it is not important because posix-aio-compat already deals with driver specific code so it is supposed to know its own needs. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7229 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-22xen: add -vga xenfb option, configure xenfb (Gerd Hoffmann)aliguori1-0/+6
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7228 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-22xen: pv domain builder. (Gerd Hoffmann)aliguori5-0/+358
This adds domain building support for paravirtual domains to qemu. This allows booting xen guests directly with qemu, without Xend and the management stack. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7226 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-22xen: blk & nic configuration via cmd line. (Gerd Hoffmann)aliguori4-0/+170
This patch makes qemu create backend and frontend device entries in xenstore for devices configured on the command line. It will use qdisk and qnic backend names, so the qemu internal backends will be used. Disks can be created using -drive if=xen,file=... Nics can be created using -net nic,macaddr=... Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7225 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-22xen: add net backend driver. (Gerd Hoffmann)aliguori3-0/+408
This patch adds a network interface backend driver to qemu. It is a pure userspace implemention using the gntdev interface. It uses "qnet" as backend name in xenstore so it doesn't interfere with the netback backend (aka "vnif"). The network backend is hooked into the corrosponding qemu vlan, i.e. vif 0 is hooked into vlan 0. To make the packages actually arrive somewhere you additionally have to link the vlan to the outside world using the usual qemu command line options such as "-net tap,...". Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7224 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-22xen: add block device backend driver. (Gerd Hoffmann)aliguori4-0/+885
This patch adds a block device backend driver to qemu. It is a pure userspace implemention using the gntdev interface. It uses "qdisk" as backend name in xenstore so it doesn't interfere with the other existing backends (blkback aka "vbd" and tapdisk aka "tap"). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7223 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-22xen: add framebuffer backend driver (Gerd Hoffmann)aliguori3-0/+1022
This patch adds a frsamebuffer (and kbd+mouse) backend driver. It it based on current xen-unstable code. It has been changed to make use of the common backend driver code. It also has been changed to compile with xen headers older than release 3.3 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7222 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-22xen: add console backend driver. (Gerd Hoffmann)aliguori3-0/+274
This patch adds a xenconsole backend driver. It it based on current xen-unstable code. It has been changed to make use of the common backend driver code. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7221 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-22xen: backend driver core (Gerd Hoffmann)aliguori4-1/+840
This patch adds infrastructure for xen backend drivers living in qemu, so drivers don't need to implement common stuff on their own. It's mostly xenbus management stuff: some functions to access xentore, setting up xenstore watches, callbacks on device discovery and state changes, handle event channel, ... Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7220 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-22xen: groundwork for xen support (Gerd Hoffmann)aliguori3-0/+83
- configure script and build system changes. - wind up new machine type. - add -xen-* command line options. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7219 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-21sending NUMA topology to BIOS (Andre Przywara)aliguori2-0/+25
uses the QEMU firmware configuration interfacce to send the NUMA topology to the BIOS, which has to setup the tables. Only one firmware configuration channel is used. Signed-off-by: Andre Przywara <andre.przywara@amd.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7212 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-19kqemu: merge CONFIG_KQEMU and USE_KQEMUblueswir11-1/+1
Basically a recursive ":%s/USE_KQEMU/CONFIG_KQEMU/g". Signed-off-by: Paul Bolle <pebolle@tiscali.nl> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7189 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-19Adds SM501 usb host emulation feature.aurel324-44/+109
It makes usb keyboard available for sh4/r2d system emulation. The changes for "hw/usb-ohci.c" are as follows. - 'localmem_base' is introduced as OHCIState struct member. SM501 has a local memory, and it is used to pass and receive data with OHCI driver. OHCI driver accesses it with SH4 physical memory address, and SM501 accesses it with SM501 local address. 'localmem_base' holds where the SM501 local memory is mapped into SH4 physical address space. - Memory access functions modified to adjust address with 'localmem_base'. The functions are, ohci_read_*(), ohci_put_*(), and ohci_copy_*(). - ohci_read_hcca() and ohci_put_hcca() are introduced for more consistent implementation. For other source files, it does, - introduces usb_ohci_init_sm501(). - adds irq argument for SM501 initialization, to emulate USB interrupts. Signed-off-by: Shin-ichiro KAWASAKI <kawasaki@juno.dti.ne.jp> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7188 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-19Fix indices in Menelaus save/load.balrog1-6/+6
Version increase won't be helpful here. Spotted by Sergei Steshenko / Blau Wirbel. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7186 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-17hpet: Fix emulation of HPET_TN_SETVAL (Jan Kiszka)aliguori1-1/+1
While Intel's spec is not that clear here, latest changes to Linux' HPET code (commit c23e253e67c9d8a91a0ffa33c1f571a17f0a2403, "x86: hpet: stop HPET_COUNTER when programming periodic mode") strongly suggest that HPET_TN_SETVAL rather means: Set _both_ the comparator value and register. With this patch applied, I'm again able to boot 2.6.30-rc kernels as they no longer panic like this (which was due to the comparator register remaining 0): ENABLING IO-APIC IRQs ..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1 ..MP-BIOS bug: 8254 timer not connected to IO-APIC ...trying to set up timer (IRQ0) through the 8259A ... ..... (found apic 0 pin 2) ... ....... failed. ...trying to set up timer as Virtual Wire IRQ... ..... failed. ...trying to set up timer as ExtINT IRQ... ..... failed :(. Kernel panic - not syncing: IO-APIC + timer doesn't work! [...] Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7168 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-17qemu: Add support for SMBIOS command line otions (Alex Williamson)aliguori3-0/+395
Create a new -smbios option (x86-only) to allow binary SMBIOS entries to be passed through to the BIOS or modify the default values of individual fields of type 0 and 1 entries on the command line. Binary SMBIOS entries can be generated as follows: dmidecode -t 1 -u | grep $'^\t\t[^"]' | xargs -n1 | \ perl -lne 'printf "%c", hex($_)' > smbios_type_1.bin These can then be passed to the BIOS using this switch: -smbios file=smbios_type_1.bin Command line generation supports the following syntax: -smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d] -smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str] [,uuid=$(uuidgen)][,sku=str][,family=str] For instance, to add a serial number to the type 1 table: -smbios type=1,serial=0123456789 Interface is extensible to support more fields/tables as needed. aliguori: remove texi formatting from help output Signed-off-by: Alex Williamson <alex.williamson@hp.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7163 c046a42c-6fe2-441c-8c8c-71466251a162