aboutsummaryrefslogtreecommitdiff
path: root/hw
AgeCommit message (Collapse)AuthorFilesLines
2010-05-03hw: better i440 emulationBernhard M. Wiedemann3-3/+8
updated version of an old patch http://xenon.stanford.edu/~eswierk/misc/qemu-linuxbios/qemu-piix-ram-size.patch that together with http://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. The message on the old patch states: Unfortunately the current version of qemu does not set these registers, but I have patched qemu so that it emulates the i440 more faithfully in this regard. Signed-off-by: Bernhard M. Wiedemann <qemudevbmw@lsmod.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03virtio-9p: Add P9_TFLUSH supportAnthony Liguori1-33/+2
Don't do anything special for flush. 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>
2010-05-03virtio-9p: Add P9_TREMOVE support.Anthony Liguori3-2/+55
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> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03virtio-9p: Add P9_TWSTAT supportAnthony Liguori3-2/+326
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> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03virtio-9p: Add P9_TCREATE supportAnthony Liguori3-2/+357
Implement P9_TCREATE support. [jvrao@linux.vnet.ibm.com: strdup to qemu_strdup conversion] 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>
2010-05-03virtio-9p: Add P9_TWRITE supportAnthony Liguori3-2/+118
Implement P9_TWRITE support. This gets write to file to work 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>
2010-05-03virtio-9p: Add P9_TCLUNK supportAnthony Liguori1-2/+14
Implement P9_TCLUNK support. This patch gets `ls -al` to work. 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>
2010-05-03virtio-9p: Add P9_TREAD supportAnthony Liguori3-2/+275
Implement P9_TREAD 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>
2010-05-03virtio-9p: Add P9_TOPEN support.Anthony Liguori3-5/+162
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>
2010-05-03virtio-9p: Add P9_TWALK supportAnthony Liguori1-2/+171
Implement P9_TWALK 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>
2010-05-03virtio-9p: Add P9_TSTAT supportAnthony Liguori1-2/+53
Implement P9_TSTAT support. This get the mount to work on the guest. [kiran@linux.vnet.ibm.com: malloc to qemu_malloc conversion] 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>
2010-05-03virtio-9p: Add P9_TATTACH support.Anthony Liguori1-2/+31
Implement P9_TATTACH 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>
2010-05-03virtio-9p: Add P9_TVERSION supportAnthony Liguori1-2/+13
Implement P9_TVERSION support. [sripathik@in.ibm.com: Handle unknown 9P versions as per the standards] 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>
2010-05-03virtio-9p: Add sg helper functionsAnthony Liguori1-0/+53
Add scatter-gather helper functions. 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>
2010-05-03virtio-9p: Add stat and mode related helper functions.Anthony Liguori1-0/+186
Add helpers to obtain file stat and mode details. 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>
2010-05-03virtio-9p: Add fid and qid management support.Anthony Liguori1-0/+123
Helper APIs for FID and QID management. 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>
2010-05-03virtio-9p: Add minimal set of FileOperationsAnthony Liguori3-2/+124
Add minimal set of FileOperations and the corresponding implementations for local 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> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03virtio-9p: Add string manipulation support.Anthony Liguori1-0/+127
Add helpers to do string manipulation. 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>
2010-05-03virtio-9p: pdu processing support.Anthony Liguori2-0/+250
Add helpers to process the PDUs. [kiran@linux.vnet.ibm.com: malloc to qemu_malloc coversion] 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>
2010-05-03virtio-9p: Add a virtio 9p device to qemuAnthony Liguori7-0/+1039
This patch doesn't implement the 9p protocol handling code. 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] 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>
2010-05-03virtio-9p: Create a commandline option -fsdevGautham R Shenoy1-0/+32
This patch creates a new command line option named -fsdev to hold any file system specific information. The option will currently hold the following attributes: -fsdev fstype id=id,path=path_to_share where fstype: Type of the file system. id: Identifier used to refer to this fsdev path: The path on the host that is identified by this fsdev. [aneesh.kumar@linux.vnet.ibm.com: Abstraction using FsContext] Signed-off-by: Gautham R Shenoy <ego@in.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03virtio-serial: Fix check for 'assert'; prevent NULL derefsAmit Shah1-1/+1
In the flush_queued_data() function, we expect port to be valid. Assert only for port and not port || discard. Reported-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03lsi: Properly initialize controller state on resetJan Kiszka1-2/+8
The LSI controller was lacking a system reset handler. Simply invoke the existing soft reset handler in this case. This also allows to drop its explicit invocation during init. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03lsi: Purge request queue on soft resetJan Kiszka1-0/+11
Avoid keeping zombie requests across controller reset by purging the queue 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>
2010-05-03Merge remote branch 'qemu-kvm/uq/master' into HEADAnthony Liguori1-2/+2
2010-05-02Fix missing '|' in '|=', spotted by clang analyzerBlue Swirl1-4/+4
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-01cmd646: fix abort due to changed opaque pointer for ioport readIgor V. Kovalenko1-4/+5
We cannot install different opaque pointer for read and write of the same i/o address. - handle zero address in bmdma_writeb_common and install the same opaque pointer for both read and write access. Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-01cmd646: pass pci_dev as it needs itIgor V. Kovalenko3-18/+45
Instead of doing tricks to get the pci_dev, just pass it in the 1st place. Patch is a bit longer that reverting the pci_dev field, but it states more clearly (IMHO) what we are doing. It also fixes the bm test, now that you told me that ->unit is not always valid. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-28vga: fix typo in length passed to kvm_log_stopMarcelo Tosatti1-2/+2
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2010-04-28virtio-serial: Implement flow control for individual portsAmit Shah2-6/+53
Individual ports can now signal to the virtio-serial core to stop sending data if the ports cannot immediately handle new data. When a port later unthrottles, any data queued up in the virtqueue are sent to the port. Disable throttling once a port is closed (and we discard all the unconsumed buffers in the vq). The guest kernel can reclaim the buffers when it receives the port close event or when a port is being removed. Ensure we free up the buffers before we send out any events to the guest. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-28virtio-serial: Discard data that guest sends us when ports aren't connectedAmit Shah1-37/+32
Before the earlier patch, we relied on incorrect virtio api usage to signal to the guest that a particular buffer wasn't consumed by the host. After fixing that, we now just discard the data the guest sends us while a host port is disconnected or doesn't have a handler registered for consuming data. This commit really doesn't change anything from the current behaviour, just makes the code slightly better by spinning off data handling to ports in another function. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-28virtio-serial: Apps should consume all data that guest sends out / Fix ↵Amit Shah3-11/+8
virtio api abuse We cannot indicate to the guest how much data was consumed by an app for out_bufs. So we just have to assume the apps will consume all the data that are handed over to them. Fix the virtio api abuse in control_out() and handle_output(). Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-28virtio-serial: Handle scatter/gather input from the guestAmit Shah1-4/+8
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>
2010-04-28virtio-serial: Handle scatter-gather buffers for control messagesAmit Shah1-3/+28
Current control messages are small enough to not be split into multiple buffers but we could run into such a situation in the future or a malicious guest could cause such a situation. So handle the entire iov request for control messages. Also ensure the size of the control request is >= what we expect otherwise we risk accessing memory that we don't own. Signed-off-by: Amit Shah <amit.shah@redhat.com> CC: Avi Kivity <avi@redhat.com> Reported-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-28iov: Add iov_to_buf and iov_size helpersAmit Shah3-31/+44
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 was used in virtio-ballon.c. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-28iov: Introduce a new file for helpers around iovs, add iov_from_buf()Amit Shah4-25/+59
The virtio-net code uses iov_fill() which fills an iov from a linear buffer. The virtio-serial-bus code does something similar in an open-coded function. Create a new iov.c file that has iov_from_buf(). Convert virtio-net and virtio-serial-bus over to use this functionality. virtio-net used ints to hold sizes, the new function is going to use size_t types. Later commits will add the opposite functionality -- going from an iov to a linear buffer. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-28virtio-serial: Send out guest data to ports only if port is openedAmit Shah1-0/+5
Data should be written only when ports are open. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-28virtio-serial: Propagate errors in initialising ports / devices in guestAmit Shah1-0/+10
If adding of ports or devices in the guest fails we can send out a QMP event so that management software can deal with it. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-28virtio-serial: Update copyright year to 2010Amit Shah3-3/+3
Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-28virtio-serial: Remove redundant check for 0-sized write requestAmit Shah1-3/+0
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 be fine. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-28virtio-serial: whitespace: match surrounding codeAmit Shah1-1/+4
The virtio-serial code doesn't mix declarations and definitions, so separate them out on different lines. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-28virtio-serial: Use control messages to notify guest of new portsAmit Shah3-70/+133
Allow the port 'id's to be set by a user on the command line. This is needed by management apps that will want a stable port numbering scheme for hot-plug/unplug and migration. Since the port numbers are shared with the guest (to identify ports in control messages), we just send a control message to the guest indicating addition of new ports (hot-plug) or notifying the guest of the available ports when the guest sends us a DEVICE_READY control message. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-28virtio-serial: save/load: Send target host connection status if differentAmit Shah1-0/+11
If the host connection to a port is closed on the destination machine after migration, whereas the connection was open on the source, the guest has to be informed of that. Similar for a host connection open on the destination. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-28virtio-serial: save/load: Ensure we have hot-plugged ports instantiatedAmit Shah1-0/+7
If some ports that were hot-plugged on the source are not available on the destination, fail migration instead of trying to deref a NULL pointer. Signed-off-by: Amit Shah <amit.shah@redhat.com> Reported-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-28virtio-serial: save/load: Ensure nr_ports on src and dest are same.Amit Shah1-2/+16
The number of ports on the source as well as the destination machines should match. If they don't, it means some ports that got hotplugged on the source aren't instantiated on the destination. Or that ports that were hot-unplugged on the source are created on the destination. Signed-off-by: Amit Shah <amit.shah@redhat.com> Reported-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-28virtio-serial: save/load: Ensure target has enough portsAmit Shah1-2/+11
The target could be started with max_nr_ports for a virtio-serial device lesser than what was available on the source machine. Fail the migration in such a case. Signed-off-by: Amit Shah <amit.shah@redhat.com> Reported-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-25sh4: remove dead assignments, spotted by clang analyzerBlue Swirl1-2/+1
Value stored is never read. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-25ppc: add missing 'break', spotted by clang analyzerBlue Swirl1-0/+1
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-25ppc: remove dead assignments, spotted by clang analyzerBlue Swirl1-4/+0
Value stored is never read. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-25alpha: remove dead assignments, spotted by clang analyzerBlue Swirl1-2/+0
Value stored is never read. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>