summaryrefslogtreecommitdiffstats
path: root/exec.c
Commit message (Collapse)AuthorAgeFilesLines
* KVM: Coalesced MMIO supportaliguori2008-12-091-0/+12
| | | | | | | | | | | | | | | | | | MMIO exits are more expensive in KVM or Xen than in QEMU because they involve, at least, privilege transitions. However, MMIO write operations can be effectively batched if those writes do not have side effects. Good examples of this include VGA pixel operations when in a planar mode. As it turns out, we can get a nice boost in other areas too. Laurent mentioned a 9.7% performance boost in iperf with the coalesced MMIO changes for the e1000 when he originally posted this work for KVM. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5961 c046a42c-6fe2-441c-8c8c-71466251a162
* linux-user: Fix h2g usage in page_find_allocaurel322008-12-081-3/+2
| | | | | | | | | | | | | | | | | Paul's comment on my first approach to fix the h2g usage in page_find_alloc finally open my eyes about what the code is actually supposed to do: With the help of h2g_valid we can no cleanly check if a freshly allocate page (for host usage) is guest-reachable and, in case it is, mark it reserved in the guest's address range. Signed-off-by: Jan Kiszka <jan.kiszka@web.de> Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name> Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5957 c046a42c-6fe2-441c-8c8c-71466251a162
* Cosmetic cleanups to previous patch.pbrook2008-12-021-2/+1
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5852 c046a42c-6fe2-441c-8c8c-71466251a162
* Change MMIO callbacks to use offsets, not absolute addresses.pbrook2008-12-011-20/+62
| | | | | | | Signed-off-by: Paul Brook <paul@codesourcery.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5849 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix the comment added in r5844.balrog2008-12-011-1/+1
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5846 c046a42c-6fe2-441c-8c8c-71466251a162
* arm: Reserve code buffer in memory range reachable for pc-relative branch.balrog2008-12-011-0/+6
| | | | | | | | Unfortunately this range is so narrow that I'm not sure if it makes more sense to always use memory load to pc kind of branch instead. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5844 c046a42c-6fe2-441c-8c8c-71466251a162
* Use sys-queue.h for break/watchpoint managment (Jan Kiszka)aliguori2008-11-251-60/+24
| | | | | | | | | | | | | This switches cpu_break/watchpoint_* to TAILQ wrappers, simplifying the code and also fixing a use after release issue in cpu_break/watchpoint_remove_all. 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@5799 c046a42c-6fe2-441c-8c8c-71466251a162
* vga optimization (Glauber Costa)aliguori2008-11-241-0/+6
| | | | | | | | | | | | | | | | | | | | | Hypervisors like KVM perform badly while doing mmio on a loop, because it'll generate an exit on each access. This is the case with VGA, which results in very bad performance. In this patch, we map the linear frame buffer as RAM, make sure it has dirty region tracking enabled, and then just let the region to be written. Cleanups suggestions by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5793 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix Windows buildaliguori2008-11-181-2/+2
| | | | | | | | | | | | ENOBUFS is not defined on Win32. Use ENOMEM instead which is more portable. This was reported by Hervé Poussineau. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5749 c046a42c-6fe2-441c-8c8c-71466251a162
* Introduce BP_CPU as a breakpoint type (Jan Kiszka)aliguori2008-11-181-8/+38
| | | | | | | | | | | | | | | | | Add another breakpoint/watchpoint type to BP_GDB: BP_CPU. This type is intended for hardware-assisted break/watchpoint emulations like the x86 architecture requires. To keep the highest priority for BP_GDB breakpoints, this type is always inserted at the head of break/watchpoint lists, thus is found first when looking up the origin of a debug interruption. 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@5746 c046a42c-6fe2-441c-8c8c-71466251a162
* Introduce BP_WATCHPOINT_HIT flag (Jan Kiszka)aliguori2008-11-181-15/+20
| | | | | | | | | | | | | When one watchpoint is hit, others might have triggered as well. To support users of the watchpoint API which need to detect such cases, the BP_WATCHPOINT_HIT flag is introduced and maintained. 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@5744 c046a42c-6fe2-441c-8c8c-71466251a162
* Remove premature memop TB terminations (Jan Kiszka)aliguori2008-11-181-4/+0
| | | | | | | | | | | | | Now that we can properly restore the pc on watchpoint hits, there is no more need for prematurely terminating TBs if watchpoints are present. Remove all related bits. 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@5742 c046a42c-6fe2-441c-8c8c-71466251a162
* Restore pc on watchpoint hits (Jan Kiszka)aliguori2008-11-181-2/+24
| | | | | | | | | | | | | | | In order to provide accurate information about the triggering instruction, this patch adds the required bits to restore the pc if the access happened inside a TB. With the BP_STOP_BEFORE_ACCESS flag, the watchpoint user can control if the debug trap should be issued on or after the accessing instruction. 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@5741 c046a42c-6fe2-441c-8c8c-71466251a162
* Respect length of watchpoints (Jan Kiszka)aliguori2008-11-181-10/+20
| | | | | | | | | | | | This adds length support for watchpoints. To keep things simple, only aligned watchpoints are accepted. 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@5740 c046a42c-6fe2-441c-8c8c-71466251a162
* Refactor and enhance break/watchpoint API (Jan Kiszka)aliguori2008-11-181-77/+118
| | | | | | | | | | | | | | | | | | | | | This patch prepares the QEMU cpu_watchpoint/breakpoint API to allow the succeeding enhancements this series comes with. First of all, it overcomes MAX_BREAKPOINTS/MAX_WATCHPOINTS by switching to dynamically allocated data structures that are kept in linked lists. This also allows to return a stable reference to the related objects, required for later introduced x86 debug register support. Breakpoints and watchpoints are stored with their full information set and an additional flag field that makes them easily extensible for use beyond pure guest debugging. 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@5738 c046a42c-6fe2-441c-8c8c-71466251a162
* Refactor translation block CPU state handling (Jan Kiszka)aliguori2008-11-181-34/+22
| | | | | | | | | | | | | | | This patch refactors the way the CPU state is handled that is associated with a TB. The basic motivation is to move more arch specific code out of generic files. Specifically the long #ifdef clutter in tb_find_fast() has to be overcome in order to avoid duplicating it for the gdb watchpoint fixes (patch "Restore pc on watchpoint hits"). 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@5736 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix -linux-user build by reverting r5701aliguori2008-11-111-1/+10
| | | | | | | | | | | | | Unfortunately, -linux-user doesn't use osdep as it replaces some of those functions with specific ones. The code #ifdef code in exec.c needs to remain in place so instead of introducing a qemu_getpagesize() let's just use getpagesize() in the non-Windows implementation of qemu_vmalloc. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5703 c046a42c-6fe2-441c-8c8c-71466251a162
* Define OS-dependent qemu_getpagesize() (Hollis Blanchard)aliguori2008-11-111-10/+1
| | | | | | | | Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5701 c046a42c-6fe2-441c-8c8c-71466251a162
* Win32: Fix warningsaurel322008-11-061-1/+0
| | | | | | | | | Attached patch fixes some warnings which only happen on Windows. Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5639 c046a42c-6fe2-441c-8c8c-71466251a162
* Add KVM support to QEMUaliguori2008-11-051-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds very basic KVM support. KVM is a kernel module for Linux that allows userspace programs to make use of hardware virtualization support. It current supports x86 hardware virtualization using Intel VT-x or AMD-V. It also supports IA64 VT-i, PPC 440, and S390. This patch only implements the bare minimum support to get a guest booting. It has very little impact the rest of QEMU and attempts to integrate nicely with the rest of QEMU. Even though this implementation is basic, it is significantly faster than TCG. Booting and shutting down a Linux guest: w/TCG: 1:32.36 elapsed 84% CPU w/KVM: 0:31.14 elapsed 59% CPU Right now, KVM is disabled by default and must be explicitly enabled with -enable-kvm. We can enable it by default later when we have had better testing. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5627 c046a42c-6fe2-441c-8c8c-71466251a162
* page_check_range: fix wrap around test (Lauro Ramos Venancio).balrog2008-10-281-3/+4
| | | | | | | | | Move up the warp around test because line 'end = TARGET_PAGE_ALIGN(start+len);' can interfere with it. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5563 c046a42c-6fe2-441c-8c8c-71466251a162
* Show size for unassigned accesses (Robert Reif)blueswir12008-10-061-12/+50
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5436 c046a42c-6fe2-441c-8c8c-71466251a162
* Add dirty tracking for live migrationaliguori2008-10-061-2/+25
| | | | | | | | | | | This patch adds a dirty tracking bit for live migration. We use 0x08 because kqemu uses 0x04. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5433 c046a42c-6fe2-441c-8c8c-71466251a162
* Variable logfilename is not used outside exec.cblueswir12008-10-051-1/+1
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5420 c046a42c-6fe2-441c-8c8c-71466251a162
* Add some missing static qualifiersblueswir12008-10-041-7/+7
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5415 c046a42c-6fe2-441c-8c8c-71466251a162
* Make CPULogItem tables constblueswir12008-10-021-2/+2
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5397 c046a42c-6fe2-441c-8c8c-71466251a162
* Add missing parenthesis in qemu_ram_alloc()ths2008-10-021-1/+1
| | | | | | | Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5392 c046a42c-6fe2-441c-8c8c-71466251a162
* Allocate code gen buffer properly on FreeBSDaliguori2008-09-271-0/+22
| | | | | | | | | Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5331 c046a42c-6fe2-441c-8c8c-71466251a162
* 64 bit truncation in code_gen_buffer_size calculation (Jes Sorensen)aliguori2008-09-241-1/+1
| | | | | | | | | | | | Don't truncate code_gen_buffer_size calculation to int, as it will give unpredicted results on 64 bit systems when booting large guests. Signed-off-by: Jes Sorensen <jes@sgi.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5310 c046a42c-6fe2-441c-8c8c-71466251a162
* Suppress gcc 4.x -Wpointer-sign (included in -Wall) warningsblueswir12008-09-201-1/+1
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5275 c046a42c-6fe2-441c-8c8c-71466251a162
* Make page_find() return 0 for too-large addresses (Eduardo Habkost)aliguori2008-09-151-6/+16
| | | | | | | | | | | | | | | | | On some cases, such as under KVM, tb_invalidate_phys_page_range() may be called for large addresses, when qemu is configured to more than 4GB of RAM. On these cases, qemu was crashing because it was using an index too large for l1_map[], that supports only 32-bit addresses when compiling without CONFIG_USER_ONLY. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5227 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix warnings that would be caused by gcc flag -Wwrite-stringsblueswir12008-09-141-1/+1
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5206 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix most warnings that would be caused by gcc flag -Wundefblueswir12008-09-061-2/+2
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5173 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix a nit in exec.c, by Tristan Gingold.ths2008-08-291-1/+1
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5104 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix some warnings that would be generated by gcc -Wmissing-prototypesblueswir12008-08-171-1/+1
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5022 c046a42c-6fe2-441c-8c8c-71466251a162
* Map code buffers below 2G on Sparc64blueswir12008-07-261-6/+14
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4951 c046a42c-6fe2-441c-8c8c-71466251a162
* Link ARM prologue closer to code segment to avoid a build failureblueswir12008-07-101-1/+13
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4867 c046a42c-6fe2-441c-8c8c-71466251a162
* Avoid decremented overflow.pbrook2008-07-091-1/+1
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4862 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix typo.pbrook2008-07-011-1/+1
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4819 c046a42c-6fe2-441c-8c8c-71466251a162
* Move interrupt_request and user_mode_only to common cpu state.pbrook2008-07-011-0/+29
| | | | | | | | Save and restore env->interrupt_request and env->halted. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4817 c046a42c-6fe2-441c-8c8c-71466251a162
* Spelling fixes, spotted by Stuart Brady.ths2008-06-301-6/+6
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4809 c046a42c-6fe2-441c-8c8c-71466251a162
* Move CPU save/load registration to common code.pbrook2008-06-301-0/+5
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4808 c046a42c-6fe2-441c-8c8c-71466251a162
* Add instruction counter.pbrook2008-06-291-29/+118
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4799 c046a42c-6fe2-441c-8c8c-71466251a162
* Use qemu_mallocz.pbrook2008-06-091-2/+1
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4711 c046a42c-6fe2-441c-8c8c-71466251a162
* Prevent guest reusing host memory allocations.pbrook2008-06-091-2/+26
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4710 c046a42c-6fe2-441c-8c8c-71466251a162
* Clean up MMIO TLB handling.pbrook2008-06-091-119/+113
| | | | | | | | | | The IO index is now stored in its own field, instead of being wedged into the vaddr field. This eliminates the ROMD and watchpoint host pointer weirdness. The IO index space is expanded by 1 bit, and several additional bits are made available in the TLB vaddr field. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4704 c046a42c-6fe2-441c-8c8c-71466251a162
* Remove dead and bitrotten "qemu-fast" code.pbrook2008-06-081-128/+10
| | | | | | | Only build softmmu+MMIO handlers for system emulation. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4695 c046a42c-6fe2-441c-8c8c-71466251a162
* Multithreaded locking fixes.pbrook2008-06-071-2/+11
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4692 c046a42c-6fe2-441c-8c8c-71466251a162
* Multithreaded locking for mmap().pbrook2008-06-021-1/+19
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4654 c046a42c-6fe2-441c-8c8c-71466251a162
* Mark host brk() area as reserved.pbrook2008-05-311-0/+1
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4637 c046a42c-6fe2-441c-8c8c-71466251a162
OpenPOWER on IntegriCloud