- 29 Jun, 2012 12 commits
-
-
Juan Quintela authored
Always use accessors to read/set the dirty bitmap. Signed-off-by:
Juan Quintela <quintela@redhat.com>
-
Juan Quintela authored
Checking each 64 pages is a random magic number as good as any other. We don't want to test too many times, but on the other hand, qemu_get_clock_ns() is not so expensive either. We want to be sure that we spent less than 50ms (half of buffered_file timer), if we spent more than 100ms, all the accounting got wrong. Signed-off-by:
Juan Quintela <quintela@redhat.com>
-
Juan Quintela authored
ram_save_remaining() is an expensive operation when there is a lot of memory. So we only call the function when we need it. Signed-off-by:
Juan Quintela <quintela@redhat.com>
-
Juan Quintela authored
Refactor the code that is only needed for tcg to an static function. Call that only when tcg is enabled. We can't refactor to a dummy function in the kvm case, as qemu can be compiled at the same time with tcg and kvm. Signed-off-by:
Juan Quintela <quintela@redhat.com>
-
Juan Quintela authored
If buffers are full, don't iterate, just exit. Signed-off-by:
Juan Quintela <quintela@redhat.com>
-
Juan Quintela authored
This allows to know how long each section takes to save. An awk script like this tells us sections that takes more that 10ms $1 ~ /savevm_state_iterate_end/ { /* Print savevm_section_end line when > 10ms duration */ if ($2 > 10000) { printf("%s times_missing=%u\n", $0, times_missing++); } } Signed-off-by:
Juan Quintela <quintela@redhat.com> fix ws tracepoints Signed-off-by:
Juan Quintela <quintela@redhat.com>
-
Juan Quintela authored
We add time spent for migration to the output of "info migrate" command. 'total_time' means time since the start fo migration if migration is 'active', and total time of migration if migration is completed. As we are also interested in transferred ram when migration completes, adding all ram statistics Signed-off-by:
Juan Quintela <quintela@redhat.com>
-
Orit Wasserman authored
Signed-off-by:
Orit Wasserman <owasserm@redhat.com>
-
Orit Wasserman authored
Signed-off-by:
Orit Wasserman <owasserm@redhat.com>
-
Orit Wasserman authored
Signed-off-by:
Benoit Hudzia <benoit.hudzia@sap.com> Signed-off-by:
Petter Svard <petters@cs.umu.se> Signed-off-by:
Aidan Shribman <aidan.shribman@sap.com> Signed-off-by:
Orit Wasserman <owasserm@redhat.com>
-
Isaku Yamahata authored
Signed-off-by:
Isaku Yamahata <yamahata@valinux.co.jp>
-
Orit Wasserman authored
Signed-off-by:
Orit Wasserman <owasserm@redhat.com>
-
- 28 Jun, 2012 18 commits
-
-
Blue Swirl authored
Link in oslib objects also for BSD user, but avoid using the version of qemu_vmalloc() defined in oslib-posix.c. Signed-off-by:
Blue Swirl <blauwirbel@gmail.com>
-
Blue Swirl authored
Rename what is remaining of op_helper.c to seg_helper.c. Signed-off-by:
Blue Swirl <blauwirbel@gmail.com>
-
Blue Swirl authored
Move memory access helpers to mem_helper.c. Signed-off-by:
Blue Swirl <blauwirbel@gmail.com>
-
Blue Swirl authored
Move various functions to misc_helper.c. Signed-off-by:
Blue Swirl <blauwirbel@gmail.com>
-
Blue Swirl authored
Move SMM helpers to smm_helper.c. Signed-off-by:
Blue Swirl <blauwirbel@gmail.com>
-
Blue Swirl authored
Move SVM helpers to svm_helper.c. Signed-off-by:
Blue Swirl <blauwirbel@gmail.com>
-
Blue Swirl authored
Move integer and bit field helpers to int_helper.c. Signed-off-by:
Blue Swirl <blauwirbel@gmail.com>
-
Blue Swirl authored
Move condition code helpers to cc_helper.c. Move the shared inline functions lshift(), cpu_load_eflags() and cpu_cc_compute_all() to cpu.h. Signed-off-by:
Blue Swirl <blauwirbel@gmail.com>
-
Blue Swirl authored
Adjust function names and add an explicit CPUX86State parameter instead of relying on AREG0. Signed-off-by:
Blue Swirl <blauwirbel@gmail.com>
-
Blue Swirl authored
Move shift templates from helper_template.h to shift_helper_template.h and the condition code helpers to cc_helper_template.h. Signed-off-by:
Blue Swirl <blauwirbel@gmail.com>
-
Blue Swirl authored
Fix coding style in helper_template.h before next commit. Signed-off-by:
Blue Swirl <blauwirbel@gmail.com>
-
Blue Swirl authored
SSE function tables could easily be corrupted because of use of void pointers. Introduce function pointer types and helper variables in order to improve type safety. Split sse_op_table3 according to types used. Signed-off-by:
Blue Swirl <blauwirbel@gmail.com>
-
Blue Swirl authored
Move FPU and MMX/SSE helpers to fpu_helpers.c. Signed-off-by:
Blue Swirl <blauwirbel@gmail.com>
-
Blue Swirl authored
Fix coding style in ops_sse.h before next commit. Signed-off-by:
Blue Swirl <blauwirbel@gmail.com>
-
Blue Swirl authored
After the previous patch, we can use the proper declaration in a common header file. Signed-off-by:
Blue Swirl <blauwirbel@gmail.com>
-
Blue Swirl authored
Move exception handlers from op_helper.c to excp_helper.c. Signed-off-by:
Blue Swirl <blauwirbel@gmail.com>
-
Blue Swirl authored
Add an explicit CPUX86State parameter instead of relying on AREG0. Merge raise_exception_env() to raise_exception(), likewise with raise_exception_err_env() and raise_exception_err(). Introduce cpu_svm_check_intercept_param() and cpu_vmexit() as wrappers. Signed-off-by:
Blue Swirl <blauwirbel@gmail.com>
-
Blue Swirl authored
Fix coding style and a few typos. Signed-off-by:
Blue Swirl <blauwirbel@gmail.com>
-
- 27 Jun, 2012 10 commits
-
-
Benjamin Herrenschmidt authored
The emulated devices can run simultaneously with the guest, so we need to be careful with ordering of load and stores done by them to the guest system memory, which need to be observed in the right order by the guest operating system. This adds a barrier call to the basic DMA read/write ops which is currently implemented as a smp_mb(), but could be later improved for more fine grained control of barriers. Additionally, a _relaxed() variant of the accessors is provided to easily convert devices who would be performance sensitive and negatively impacted by the change. Signed-off-by:
Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com>
-
David Gibson authored
Currently the pseries machine emulation does not support DMA for emulated PCI devices, because the PAPR spec always requires a (guest visible, paravirtualized) IOMMU which was not implemented. Now that we have infrastructure for IOMMU emulation, we can correct this and allow PCI DMA for pseries. With the existing PAPR IOMMU code used for VIO devices, this is almost trivial. We use a single DMAContext for each (virtual) PCI host bridge, which is the usual configuration on real PAPR machines (which often have _many_ PCI host bridges). Cc: Alex Graf <agraf@suse.de> Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by:
David Gibson <david@gibson.dropbear.id.au> Signed-off-by:
Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com>
-
David Gibson authored
This patch adds some hooks to let PCI devices and busses use the new IOMMU infrastructure. When IOMMU support is enabled, each PCI device now contains a DMAContext * which is used by the pci_dma_*() wrapper functions. By default, the contexts are initialized to NULL, assuming no IOMMU. However the platform or host bridge code which sets up the PCI bus can use pci_setup_iommu() to set a function which will determine the correct DMAContext for a given PCI device. Cc: Michael S. Tsirkin <mst@redhat.com> Cc: Richard Henderson <rth@twiddle.net> Signed-off-by:
David Gibson <david@gibson.dropbear.id.au> Signed-off-by:
Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro> Signed-off-by:
Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com>
-
David Gibson authored
The pseries platform already contains an IOMMU implementation, since it is essential for the platform's paravirtualized VIO devices. This IOMMU support is currently built into the implementation of the VIO "bus" and the various VIO devices. This patch converts this code to make use of the new common IOMMU infrastructure. We don't yet handle synchronization of map/unmap callbacks vs. invalidations, this will require some complex interaction with the kernel and is not a major concern at this stage. Cc: Alex Graf <agraf@suse.de> Signed-off-by:
David Gibson <david@gibson.dropbear.id.au> Signed-off-by:
Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com>
-
David Gibson authored
This patch adds the basic infrastructure necessary to emulate an IOMMU visible to the guest. The DMAContext structure is extended with information and a callback describing the translation, and the various DMA functions used by devices will now perform IOMMU translation using this callback. Cc: Michael S. Tsirkin <mst@redhat.com> Cc: Richard Henderson <rth@twiddle.net> Signed-off-by:
Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro> Signed-off-by:
David Gibson <david@gibson.dropbear.id.au> Signed-off-by:
Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com>
-
David Gibson authored
The USB UHCI and EHCI drivers were converted some time ago to use the pci_dma_*() helper functions. However, this conversion was not complete because in some places both these drivers do DMA via the usb_packet_map() function in usb-libhw.c. That function directly used cpu_physical_memory_map(). Now that the sglist code uses DMA wrappers properly, we can convert the functions in usb-libhw.c, thus conpleting the conversion of UHCI and EHCI to use the DMA wrappers. Note that usb_packet_map() invokes dma_memory_map() with a NULL invalidate callback function. When IOMMU support is added, this will mean that usb_packet_map() and the corresponding usb_packet_unmap() must be called in close proximity without dropping the qemu device lock - otherwise the guest might invalidate IOMMU mappings while they are still in use by the device code. Signed-off-by:
David Gibson <david@gibson.dropbear.id.au> Signed-off-by:
Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com>
-
David Gibson authored
The AHCI device can provide both PCI and SysBus AHCI device emulations. For this reason, it wasn't previously converted to use the pci_dma_*() helper functions. Now that we have universal DMA helper functions, this converts AHCI to use them. The DMAContext is obtained from pci_dma_context() in the PCI case and set to NULL in the SysBus case (i.e. we assume for now that a SysBus AHCI has no IOMMU translation). Cc: Kevin Wolf <kwolf@redhat.com> Cc: Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
David Gibson <david@gibson.dropbear.id.au> Signed-off-by:
Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com>
-
David Gibson authored
dma-helpers.c contains a number of helper functions for doing scatter/gather DMA, and various block device related DMA. Currently, these directly access guest memory using cpu_physical_memory_*(), assuming no IOMMU translation. This patch updates this code to use the new universal DMA helper functions. qemu_sglist_init() now takes a DMAContext * to describe the DMA address space in which the scatter/gather will take place. We minimally update the callers qemu_sglist_init() to pass NULL (i.e. no translation, same as current behaviour). Some of those callers should pass something else in some cases to allow proper IOMMU translation in future, but that will be fixed in later patches. Cc: Kevin Wolf <kwolf@redhat.com> Cc: Michael S. Tsirkin <mst@redhat.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
David Gibson <david@gibson.dropbear.id.au> Signed-off-by:
Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com>
-
David Gibson authored
The OHCI device emulation can provide both PCI and SysBus OHCI implementations. Because of this, it was not previously converted to use the PCI DMA helper functions. This patch converts it to use the new universal DMA helper functions. In the PCI case, it obtains its DMAContext from pci_dma_context(), in the SysBus case, it uses NULL - i.e. assumes for now that there will be no IOMMU translation for a SysBus OHCI. Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
David Gibson <david@gibson.dropbear.id.au> Signed-off-by:
Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com>
-
David Gibson authored
Not that long ago, every device implementation using DMA directly accessed guest memory using cpu_physical_memory_*(). This meant that adding support for a guest visible IOMMU would require changing every one of these devices to go through IOMMU translation. Shortly before qemu 1.0, I made a start on fixing this by providing helper functions for PCI DMA. These are currently just stubs which call the direct access functions, but mean that an IOMMU can be implemented in one place, rather than for every PCI device. Clearly, this doesn't help for non PCI devices, which could also be IOMMU translated on some platforms. It is also problematic for the devices which have both PCI and non-PCI version (e.g. OHCI, AHCI) - we cannot use the the pci_dma_*() functions, because they assume the presence of a PCIDevice, but we don't want to have to check between pci_dma_*() and cpu_physical_memory_*() every time we do a DMA in the device code. This patch makes the first step on addressing both these problems, by introducing new (stub) dma helper functions which can be used for any DMA capable device. These dma functions take a DMAContext *, a new (currently empty) variable describing the DMA address space in which the operation is to take place. NULL indicates untranslated DMA directly into guest physical address space. The intention is that in future non-NULL values will given information about any necessary IOMMU translation. DMA using devices must obtain a DMAContext (or, potentially, contexts) from their bus or platform. For now this patch just converts the PCI wrappers to be implemented in terms of the universal wrappers, converting other drivers can take place over time. Cc: Michael S. Tsirkin <mst@redhat.com> Cc: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro> Cc: Richard Henderson <rth@twiddle.net> Signed-off-by:
David Gibson <david@gibson.dropbear.id.au> Signed-off-by:
Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com>
-