summaryrefslogtreecommitdiffstats
path: root/cpu-exec.c
Commit message (Collapse)AuthorAgeFilesLines
* global s/loglevel & X/qemu_loglevel_mask(X)/ (Eduardo Habkost)aliguori2009-01-151-1/+1
| | | | | | | | | | | | These are references to 'loglevel' that aren't on a simple 'if (loglevel & X) qemu_log()' statement. 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@6340 c046a42c-6fe2-441c-8c8c-71466251a162
* Convert references to logfile/loglevel to use qemu_log*() macrosaliguori2009-01-151-19/+14
| | | | | | | | | | | | This is a large patch that changes all occurrences of logfile/loglevel global variables to use the new qemu_log*() macros. 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@6338 c046a42c-6fe2-441c-8c8c-71466251a162
* Get rid of user_mode_onlyaurel322009-01-141-2/+4
| | | | | | Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6305 c046a42c-6fe2-441c-8c8c-71466251a162
* Remove all traces of __powerpc__malc2009-01-141-1/+1
| | | | | | | | According to $GCC/gcc/config/rs6000/rs6000-c.c _ARCH_PPC is the ubiquitous define which should be used to test whether gcc targets PowerPC, on 64bit platforms _ARCH_PPC64 will be also defined. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6301 c046a42c-6fe2-441c-8c8c-71466251a162
* Update FSF address in GPL/LGPL boilerplateaurel322009-01-041-1/+1
| | | | | | | | | | The attached patch updates the FSF address in the GPL/LGPL boilerplate in most GPL/LGPLed files, and also in COPYING.LIB. Signed-off-by: Stuart Brady <stuart.brady@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6162 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix remaining compiler warnings for mips targets.ths2008-12-201-1/+1
| | | | | | | Signed-off-by: Stefan Weil <weil@mail.berlios.de> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6111 c046a42c-6fe2-441c-8c8c-71466251a162
* When -icount is used and a TB is recompiled due to an IO access pbrook2008-12-191-0/+1
| | | | | | | | | | | | | | | | shortly after an IRQ has been raised, env->exception_index will still be set to EXCP_IRQ when cpu_io_recompile calls cpu_resume_from_signal. This causes qemu to repeat the IRQ trap, with disasterous consequences. I suspect this "works" most of the time because linux tends to drop back to svc mode before doing actual IRQ processing, and be fairly tolerant of spurious IRQ traps. Signed-off-by: Paul Brook <paul@codesourcery.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6100 c046a42c-6fe2-441c-8c8c-71466251a162
* target-i386: SVM: acknowledge interrupt only after it is takenaurel322008-12-131-1/+1
| | | | | | | | | | | | | | | | | | | SVM specifies that the V_IRQ mask is only to be removed, if the interrupt that is to be delivered actually is delivered. As of the SVM rewrite, this mask is always unmasked when the main cpu loop is processed, leaving a corner case where calling the interrupt handler causes a #PF. In that case (booting Linux / starting gfxboot) the current implementation tells the VMM the interrupt is taken, even though it is not. This patch modifies the VIRQ unmasking to occur after do_interrupt, making gfxboot work again. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6008 c046a42c-6fe2-441c-8c8c-71466251a162
* target-ppc: rework exception codeaurel322008-12-111-1/+1
| | | | | | | | ... also remove two warnings. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5989 c046a42c-6fe2-441c-8c8c-71466251a162
* Attached patch make cpu-exec.c compile on NetBSD.blueswir12008-12-051-4/+19
| | | | | | | Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5887 c046a42c-6fe2-441c-8c8c-71466251a162
* Use sys-queue.h for break/watchpoint managment (Jan Kiszka)aliguori2008-11-251-1/+1
| | | | | | | | | | | | | 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
* target-ppc: convert exceptions generation to TCGaurel322008-11-221-1/+1
| | | | | | Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5772 c046a42c-6fe2-441c-8c8c-71466251a162
* Add debug exception hook (Jan Kiszka)aliguori2008-11-181-0/+13
| | | | | | | | | | | | This patch allows to hook into the delivery of EXCP_DEBUG so that other use beyond guest debugging becomes possible. 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@5745 c046a42c-6fe2-441c-8c8c-71466251a162
* Introduce BP_WATCHPOINT_HIT flag (Jan Kiszka)aliguori2008-11-181-0/+11
| | | | | | | | | | | | | 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
* Refactor translation block CPU state handling (Jan Kiszka)aliguori2008-11-181-61/+2
| | | | | | | | | | | | | | | 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
* Convert CPU_PC_FROM_TB to static inline (Jan Kiszka)aliguori2008-11-181-2/+2
| | | | | | | | | | | as macros should be avoided when possible. 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@5735 c046a42c-6fe2-441c-8c8c-71466251a162
* TCG variable type checking.pbrook2008-11-171-3/+3
| | | | | | | Signed-off-by: Paul Brook <paul@codesourcery.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5729 c046a42c-6fe2-441c-8c8c-71466251a162
* KVM: simplify kvm_cpu_exec hookaliguori2008-11-101-10/+2
| | | | | | | | | | | We don't need to use cpu_loop_exit() because we never use the condition codes so everything can be folded into a single case. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5669 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix interrupt exclusion via SSTEP_NOIRQmalc2008-11-061-2/+8
| | | | | | | | | | | | | | | | | Commit #5620 revealed an issue of the SSTEP_NOIRQ masking that was applied on all interrupt sources (including internal ones) when single stepping through the guest. Due to that commit, we now ended up in an infinite loop when CPU_INTERRUPT_EXIT was pending on SSTEP resume. That was due to #5620 eating all TBs while CPU_INTERRUPT_EXIT is pending, but SSTEP_NOIRQ preventing CPU_INTERRUPT_EXIT to be processed. What SSTEP_NOIRQ should actually do is to block the delivery of all external, guest visible interrupts. With the fix below applied, single stepping now works again. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5643 c046a42c-6fe2-441c-8c8c-71466251a162
* Remove unused reg_T2 definitionaurel322008-11-061-4/+0
| | | | | | | | | No longer used, remove it. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5641 c046a42c-6fe2-441c-8c8c-71466251a162
* Add KVM support to QEMUaliguori2008-11-051-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add safety net against potential infinite loopmalc2008-11-041-0/+8
| | | | | | | | | | | | cpu_interrupt might be called while translating the TB, but before it is linked into a potentially infinite loop and becomes env->current_tb. Currently this can (and does) cause huge problems only when using dyntick clock, with other (periodic) clocks host_alarm_handler will eventually be executed resulting in a call to cpu_interrupt which will reset the recursion of running TB and the damage is "only" latency. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5620 c046a42c-6fe2-441c-8c8c-71466251a162
* Preliminary BSD user emulator supportblueswir12008-10-261-0/+16
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5544 c046a42c-6fe2-441c-8c8c-71466251a162
* CRIS: Fix brk 8 and add S-flag emulation.edgar_igl2008-10-071-1/+1
| | | | | | | | | * break 8 sets ERP to the current insn. * First shot at S flag single-stepping. * Make it easier to use the local disasm. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5445 c046a42c-6fe2-441c-8c8c-71466251a162
* SH4: Privilege check for instructionsaurel322008-09-151-1/+4
| | | | | | | | | This patch adds check for all SH4 instructions which are executed only in privileged mode. (Shin-ichiro KAWASAKI) git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5224 c046a42c-6fe2-441c-8c8c-71466251a162
* Support for address maskingblueswir12008-07-171-2/+3
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4882 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix r4641 (invalid token "=<" in a preprocessor expression)blueswir12008-07-081-1/+1
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4859 c046a42c-6fe2-441c-8c8c-71466251a162
* Convert remaining __builtin_expect to likely/unlikely, by Jan Kiszka.ths2008-07-031-3/+3
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4840 c046a42c-6fe2-441c-8c8c-71466251a162
* Spelling fixes, spotted by Stuart Brady.ths2008-06-301-1/+1
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4809 c046a42c-6fe2-441c-8c8c-71466251a162
* Add instruction counter.pbrook2008-06-291-30/+63
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4799 c046a42c-6fe2-441c-8c8c-71466251a162
* More efficient target register / TC accesses.ths2008-06-271-1/+1
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4794 c046a42c-6fe2-441c-8c8c-71466251a162
* CRIS: Emulate NMIs.edgar_igl2008-06-091-1/+9
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4719 c046a42c-6fe2-441c-8c8c-71466251a162
* Multithreaded locking fixes.pbrook2008-06-071-14/+11
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4692 c046a42c-6fe2-441c-8c8c-71466251a162
* CRIS: Add the P flag to the tb dependent flags.edgar_igl2008-06-061-1/+1
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4685 c046a42c-6fe2-441c-8c8c-71466251a162
* reworked SVM interrupt handling logic - fixed vmrun EIP saved value - ↵bellard2008-06-041-44/+45
| | | | | | reworked cr8 handling - added CPUState.hflags2 git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4662 c046a42c-6fe2-441c-8c8c-71466251a162
* Restore ARM signal handler compilation on glibc < 2.5 (Blue Swirl).balrog2008-06-021-0/+4
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4641 c046a42c-6fe2-441c-8c8c-71466251a162
* Remove unused (for now) reg_REGWPTR (original patch by Glauber Costa)blueswir12008-05-291-13/+0
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4617 c046a42c-6fe2-441c-8c8c-71466251a162
* SVM reworkbellard2008-05-281-1/+0
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4605 c046a42c-6fe2-441c-8c8c-71466251a162
* removed unused codebellard2008-05-271-7/+0
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4598 c046a42c-6fe2-441c-8c8c-71466251a162
* CRIS: Re-add the X flag to the tb flags, it allows for better code ↵edgar_igl2008-05-271-1/+1
| | | | | | generation and is practially always cleared. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4597 c046a42c-6fe2-441c-8c8c-71466251a162
* Move non-op functions from op_helper.c to helper.c and vice versa.blueswir12008-05-271-2/+3
| | | | | | | Rearrange interrupt handling to match other targets. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4590 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix Sparc32 compilation broken by r4484blueswir12008-05-191-1/+1
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4499 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix Sparc64 host signal handlingblueswir12008-05-181-5/+10
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4484 c046a42c-6fe2-441c-8c8c-71466251a162
* Improved workaround for the annoying glibc global register mangling bugblueswir12008-05-171-47/+11
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4465 c046a42c-6fe2-441c-8c8c-71466251a162
* Always process real timers regardless of singlestep mode (Jason Wessel).edgar_igl2008-05-151-1/+1
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4462 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix compilation on Sparc host, implement ld and stblueswir12008-05-141-5/+0
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4457 c046a42c-6fe2-441c-8c8c-71466251a162
* CRIS: Improve TLB management and handle delayslots at page boundaries.edgar_igl2008-05-131-0/+1
| | | | | | | | | | * Dont flush the entire qemu tlb when the $pid changes. Instead we go through the guests TLB and choose entries that need to be flushed. * Add env->dslot and handle delayslots at pageboundaries. * Remove some unused code. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4450 c046a42c-6fe2-441c-8c8c-71466251a162
* use new helper namebellard2008-05-121-1/+1
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4448 c046a42c-6fe2-441c-8c8c-71466251a162
* the double/triple fault handling was not tested in user mode.bellard2008-05-121-0/+2
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4435 c046a42c-6fe2-441c-8c8c-71466251a162
* initial global prologue/epilogue implementationbellard2008-05-101-62/+3
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4407 c046a42c-6fe2-441c-8c8c-71466251a162
OpenPOWER on IntegriCloud