target-ppc: remove dead code
This function had been disabled from the beginning:see 9fddaa0c0cabb610947146a79b4a9a38b0a216e5
cpu_reset() function is in target-ppc/helper.c
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>Acked-by: Alexander Graf <agraf@suse.de>...
target-s390: add firmware code
This patch adds a firmware blob to the S390 target. The blob is a simpleimplementation of a virtio client that tries to read the second stagebootloader from sectors described as of offset 0x20 in the MBR.
In combination with an updated zipl this allows for booting from virtio...
Merge remote branch 'kwolf/for-anthony' into staging
Merge remote branch 'mst/for_anthony' into staging
ide: Fix ide_dma_cancel
When cancelling a request, bdrv_aio_cancel may decide that it waits forcompletion of a request rather than for cancellation. IDE therefore can'tabandon its DMA status before calling bdrv_aio_cancel; otherwise the callbackof a completed request would use invalid data....
Update to a hopefully more future proof FSF address
See also 70539e1850ddd3a7ee6f9a8db7bd8e81b85225a4,8167ee883931cb20c6264fc19d040ce2dc6ceaaa,530e7615ce3c01882e582c84dc6304ab98a3d5c5 andfad6cb1a565bb73f83fc0e2654489457b489e436.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Trim unnecessary includes
mc146818rtc: remove #ifdef DEBUG_CMOS.
remove #ifdef DEBUG_CMOS by using macro.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Acked-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
apm: remove #ifdef DEBUG.
remove #ifdef DEBUG by using macro.
acpi_piix4: remove #ifdef DEBUG.
removed #ifdef DEBUG by using macro.
pm_smbus: remove #ifdef DEBUG.
pci hotadd, acpi_piix4: remove global variables
remove global variables, gpe and pci0_status by moving theminto PIIX4PMState.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Acked-by: Gerd Hoffmann <kraxel@redhat.com>...
pci hotplug: add argument to pci hot plug callback.
Add argument, DeviceState*, to pci hot plug callback.The argument will be used later to remove global variable.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Acked-by: Gerd Hoffmann <kraxel@redhat.com>...
acpi_piix4: qdevfy.
qdevfy acpi_piix4.
rtc: make rtc_xxx accept/return ISADevice instead of RTCState.
To match rtc_xxx with qdev, make rtc_xxx accept and return ISADeviceinstead of RTCState.
pc: move rtc declarations from pc.h into a dedicated header file.
Move rtc_xxx declarations from pc.h into mc146818rtc.h.
pc: split out piix specific part from pc.c into pc_piix.c
Finally, we can safely split out the piix specific part from pc.cinto pc_piix.c.
pc: split out pci device init from pc_init1() into pc_pci_device_init()
Split out pci device initialization from pc_init1() into pc_pci_device_init().and removed unnecessary braces.
pc: split out basic device init from pc_init1() into pc_basic_device_init()
Split out basic device, i.e. legacy devices like floppy, initializationfrom pc_init1() into pc_basic_device_init().Later it will be used.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>...
pc: split out vga initialization from pc_init1() into pc_vga_init().
Split out vga initialization which is independent of piixfrom pc_init1() as pc_vga_init().Later it will be used.
pc: split out memory allocation from pc_init1() into pc_memory_init()
Split out memory allocation and rom/bios loading which doesn't dependon piix from pc_init1() into pc_memory_init().Later it will be used.
pc: split out cpu initialization from pc_init1() into pc_cpus_init().
split out cpu initialization which is piix independent from pc_init1()into pc_cpus_init(). Later it will be used.
pc: make pc_init1() not refer ferr_irq directly.
By introducing a registering function, make pc_init1() not refer toferr_irq directly in order to make ferr_irq piix independent.Later pc_init1() will be split out into another file keeping ferr_irqstatic....
pc: introduce a function to allocate cpu irq.
Introduce a function, pc_allocate_cpu_irq(), to allocate cpu irqin order to make pic_irq_request() piix independent.Later piix code will be split out to another file keeping pic_irq_request()static.
pc: remove global variable rtc_state by using qemu_irq.
Remove the reference to the global variable, rtc_state, by passingfunction argument to cmos_init_hd(), cmos_init().
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Cc: Paolo Bonzini <bonzini@gnu.org>...
pc: remove a global variable, floppy_controller.
Remove a global variable, floppy_controller.Since it is unnecessarily global, make it local and pass it asa function argument.
pc: make an unnecessary global variable, pit, local.
remove unnecessary global static variables, pit.Make it local.
pc, i440fx: Make smm enable/disable function i440fx independent.
make cpu_smm_update() generic to be independent on i440fx byregistering a callback.
pc: initialize ioapic before use.
The changeset of 2c8d9340203c7f19265fd4cb2341f568217a3af6prevents isa_irq_handler() from NULL refering of IsaIrqState::ioapic.However it would be better to initialize the member before reference.
acpi: split acpi.c into the common part and the piix4 part.
Split acpi.c into the common part and the piix4 specific part.The common part will be used later.
acpi: add acpi constants from linux header files and use them.
add acpi constants from linux header files andreplace the old constants with them.The acpi constants will be used by other file.
acpi: split out apm register emulation from acpi.c
Split out apm register emulation for acpi.c into apm.c.The apm emulation will be used later.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Acked-by: Gerd Hoffmann <kraxel@redhat.com>Cc: Aurelien Jarno <aurelien@aurel32.net>...
acpi: split out piix4 smbus routines from acpi.c into pm_smbus.c
Split out piix4 smbus routines from acpi.c into pm_smbus.c anduse it.The split out smbus emulation will be used later.
mc146818rtc: Register vmstate via qdev
After defining the required alias ID, we can push vmstate registrationof mc146818rtc to qdev.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
fdc: Register vmstate via qdev
Establish vmstate containers for ISA and sysbus variant, define theiobase as instance ID alias, and let qdev do the vmstate registrationwork.
serial: Register vmstate via qdev
At least for isa-serial, we can already let qdev do the vmstateregistration for us. It just takes wrapping vmstate for theencapsulating ISASerialState and defining the proper instance IDaliases.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
vmstate: Add support for alias ID
Some legacy users (mostly PC devices) of vmstate_register manageinstance IDs on their own, and that unfortunately in a way that isincompatible with automatically generated ones. This so far preventsswitching those users to vmstates that are registered by qdev....
vmstate: Drop unused post_save handler
No device makes use of it anymore.
sh: sm501: add 2D engine support
In linux kernel v2.6.33, sm501 frame buffer driver modified to support2D graphics engine on sm501 chip. One example is "fill rectangle" operation.But current qemu's sm501 emulation doesn't support it. This results ingraphics console disturbance....
tmp105: update the register in post_load where it needs updating.
This was the only user of .post_save as noticed by Jan Kiszka andseems to have been added there wrongly during conversion toVMStateDescription.
Signed-off-by: Andrzej Zaborowski <balrogg@gmail.com>
e1000: make some tables 'const'
ide: make a table 'const'
vga: make some tables 'const'
apb: don't use any static state
pckbd: don't use any static state
virtio-net: return with value in void function
virtio-net has return with value in a void function.No idea why does it compile with gcc,but this isn't standard C.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
virtio: invoke set_features on load
After migration, vhost was not getting featuresacked because set_features callback was never invoked.The fix is just to invoke that callback.
Reported-by: David L Stevens <dlstevens@us.ibm.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>...
pci: irq_state vmstate breakage
Code for saving irq_state got vm_statemacros wrong, passing in the wrong parameter.As a result, we both saved a wrong valueand restored it to a wrong offset.
This leads to device and bus irq counts gettingout of sync, which in turn leads to interrupts getting lost or...
pci: cleanly backout of pci_qdev_init()
If the init function of a device fails, as might happen with deviceassignment, we never undo the work done by do_pci_register_device().This not only causes a bit of a memory leak, but also leaves a boguspointer in the bus devices array that can cause a segfault or...
lsi: Handle removal of selected devices
We must not store references to selected devices as they may behot-removed. Instead, look up the device based on its tag right beforeusing it. If the device disappeared, throw an interrupt and disconnect.
iov: Move from hw/ to topdir
The iov functions can be useful to other code as well.
Signed-off-by: Amit Shah <amit.shah@redhat.com>CC: Christoph Hellwig <hch@lst.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
SCSI: Add disk reset handler
Ensure that pending requests of an SCSI disk are purged on system resetand also restore max_lba. The latter is no only present in the resethandler as that one is called after init as well.
scsi-disk: Clear aiocb on read completion
Once the I/O completion callback returned, aiocb will be released by thecontroller. So we have to clear the reference not only inscsi_write_complete, but also in scsi_read_complete. Otherwise we riskinconsistencies when a reset hits us before the related request is...
lsi: Purge message queue on reset
Declare the input message queue empty and initialize the related statemachine properly on controller reset. This fixes unrecoverable errorswhen the controller was reset during ongoing requests.
lsi: Adjust some register reset values
According to the LSI spec, the reset value of dcmd, dstat, and ctest2were wrong, and sdid as well as ssid require zero initialization. Thereare surely more discrepancies, this is just another increment.
hw: better i440 emulation
updated version of an old patchhttp://xenon.stanford.edu/~eswierk/misc/qemu-linuxbios/qemu-piix-ram-size.patchthat together withhttp://www.mail-archive.com/linuxbios@linuxbios.org/msg02390.html(which is already in coreboot trunk) allows coreboot to autodetect the amount of RAM within qemu/kvm from a register in i440 northbridge....
virtio-9p: Add P9_TOPEN support.
Implement P9_TOPEN support.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
virtio-9p: Add P9_TREAD support
Implement P9_TREAD support.
virtio-9p: Add P9_TCLUNK support
Implement P9_TCLUNK support.This patch gets `ls -al` to work.
virtio-9p: Add P9_TWRITE support
Implement P9_TWRITE support.This gets write to file to work
virtio-9p: Add P9_TCREATE support
Implement P9_TCREATE support.[jvrao@linux.vnet.ibm.com: strdup to qemu_strdup conversion]
virtio-9p: Add P9_TWSTAT support
Implement P9_TWSTAT support.This gets file and directory creation to work.
[jvrao@linux.vnet.ibm.com: strdup to qemu_strdup conversion][aneesh.kumar@linux.vnet.ibm.com: v9fs_fix_path]
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>...
virtio-9p: Add P9_TREMOVE support.
Implement P9_TREMOVE support.This gets file deletion to work.
[mohan@in.ibm.com: Fix truncate to use the relative path]
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>...
virtio-9p: Add P9_TFLUSH support
Don't do anything special for flush.
virtio-9p: Add string manipulation support.
Add helpers to do string manipulation.
virtio-9p: Add minimal set of FileOperations
Add minimal set of FileOperations and the corresponding implementations forlocal fstype. These will be required for the FID management patches later on.
[aneesh.kumar@linux.vnet.ibm.com: rpath fix ]Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>...
virtio-9p: Add fid and qid management support.
Helper APIs for FID and QID management.
virtio-9p: Add stat and mode related helper functions.
Add helpers to obtain file stat and mode details.
virtio-9p: Add sg helper functions
Add scatter-gather helper functions.
virtio-9p: Add P9_TVERSION support
Implement P9_TVERSION support.
[sripathik@in.ibm.com: Handle unknown 9P versions as per the standards]
virtio-9p: Add P9_TATTACH support.
Implement P9_TATTACH support.
virtio-9p: Add P9_TSTAT support
Implement P9_TSTAT support. This get the mount to work on the guest.
[kiran@linux.vnet.ibm.com: malloc to qemu_malloc conversion]
virtio-9p: Add P9_TWALK support
Implement P9_TWALK support.
virtio-9p: Create a commandline option -fsdev
This patch creates a new command line option named -fsdev to hold any filesystem specific information.
The option will currently hold the following attributes:-fsdev fstype id=id,path=path_to_sharewherefstype: Type of the file system....
virtio-9p: Add a virtio 9p device to qemu
This patch doesn't implement the 9p protocol handlingcode. It adds a simple device which dump the protocol data.
[jvrao@linux.vnet.ibm.com: Little-Endian to host format conversion][aneesh.kumar@linux.vnet.ibm.com: Multiple-mounts support]...
virtio-9p: pdu processing support.
Add helpers to process the PDUs.
[kiran@linux.vnet.ibm.com: malloc to qemu_malloc coversion]
lsi: Purge request queue on soft reset
Avoid keeping zombie requests across controller reset by purging thequeue and also dropping the currently active request.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
lsi: Properly initialize controller state on reset
The LSI controller was lacking a system reset handler. Simply invoke theexisting soft reset handler in this case. This also allows to drop itsexplicit invocation during init.
virtio-serial: Fix check for 'assert'; prevent NULL derefs
In the flush_queued_data() function, we expect port to be valid. Assertonly for port and not port || discard.
Reported-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Amit Shah <amit.shah@redhat.com>...
Merge remote branch 'qemu-kvm/uq/master' into HEAD
Fix missing '|' in '|=', spotted by clang analyzer
cmd646: fix abort due to changed opaque pointer for ioport read
We cannot install different opaque pointer for read and writeof the same i/o address.
- handle zero address in bmdma_writeb_common and install the same opaque pointer for both read and write access....
cmd646: pass pci_dev as it needs it
Instead of doing tricks to get the pci_dev, just pass it in the 1stplace. Patch is a bit longer that reverting the pci_dev field, but itstates more clearly (IMHO) what we are doing.
It also fixes the bm test, now that you told me that ->unit is not...
vga: fix typo in length passed to kvm_log_stop
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
iov: Introduce a new file for helpers around iovs, add iov_from_buf()
The virtio-net code uses iov_fill() which fills an iov from a linearbuffer. The virtio-serial-bus code does something similar in anopen-coded function.
Create a new iov.c file that has iov_from_buf()....
iov: Add iov_to_buf and iov_size helpers
iov_to_buf() puts the buffer contents in the iov in a linearized buffer.
iov_size() gets the length of the contents in the iov.
The iov_to_buf() function is the memcpy_to_iovec() function that wasused in virtio-ballon.c....
virtio-serial: Handle scatter-gather buffers for control messages
Current control messages are small enough to not be split into multiplebuffers but we could run into such a situation in the future or amalicious guest could cause such a situation.
So handle the entire iov request for control messages....
virtio-serial: Handle scatter/gather input from the guest
Current guests don't send more than one iov but it can change later.Ensure we handle that case.
Signed-off-by: Amit Shah <amit.shah@redhat.com>CC: Avi Kivity <avi@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
virtio-serial: Apps should consume all data that guest sends out / Fix virtio api abuse
We cannot indicate to the guest how much data was consumed by an app forout_bufs. So we just have to assume the apps will consume all the datathat are handed over to them....
virtio-serial: Discard data that guest sends us when ports aren't connected
Before the earlier patch, we relied on incorrect virtio api usage tosignal to the guest that a particular buffer wasn't consumed by thehost.
After fixing that, we now just discard the data the guest sends us while...
virtio-serial: Implement flow control for individual ports
Individual ports can now signal to the virtio-serial core to stopsending data if the ports cannot immediately handle new data. When aport later unthrottles, any data queued up in the virtqueue are sent to...
virtio-serial: save/load: Ensure nr_ports on src and dest are same.
The number of ports on the source as well as the destination machinesshould match. If they don't, it means some ports that got hotplugged onthe source aren't instantiated on the destination. Or that ports that...
virtio-serial: save/load: Ensure we have hot-plugged ports instantiated
If some ports that were hot-plugged on the source are not available onthe destination, fail migration instead of trying to deref a NULLpointer.
Signed-off-by: Amit Shah <amit.shah@redhat.com>...
virtio-serial: save/load: Send target host connection status if different
If the host connection to a port is closed on the destination machineafter migration, whereas the connection was open on the source, theguest has to be informed of that.
Similar for a host connection open on the destination....
virtio-serial: Use control messages to notify guest of new ports
Allow the port 'id's to be set by a user on the command line. This isneeded by management apps that will want a stable port numbering schemefor hot-plug/unplug and migration.
Since the port numbers are shared with the guest (to identify ports in...
virtio-serial: whitespace: match surrounding code
The virtio-serial code doesn't mix declarations and definitions, soseparate them out on different lines.
Signed-off-by: Amit Shah <amit.shah@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
virtio-serial: Remove redundant check for 0-sized write request
The check for a 0-sized write request to a guest port is not necessary;the while loop below won't be executed in this case and all will befine.
virtio-serial: Update copyright year to 2010
virtio-serial: Propagate errors in initialising ports / devices in guest
If adding of ports or devices in the guest fails we can send out a QMPevent so that management software can deal with it.
virtio-serial: Send out guest data to ports only if port is opened
Data should be written only when ports are open.