History | View | Annotate | Download (25.3 kB)
cpu-exec: Use cpu_reset() in cpu_exec() for TARGET_PPC
CPUState will be needed for all targets in the future, so place it intothe main variable declaration block.
Signed-off-by: Andreas Färber <afaerber@suse.de>Acked-by: Alexander Graf <agraf@suse.de>
target-i386: Pass X86CPU to do_cpu_{init,sipi}()
Allows to use cpu_reset() in place of cpu_state_reset().
Signed-off-by: Andreas Färber <afaerber@suse.de>Reviewed-by: Igor Mammedov <imammedo@redhat.com>
cpu-exec: Remove non-portable type cast and fix format string
This change is needed for w64, but also changes the code for other hosts.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
qtest: add test framework
The idea behind qtest is pretty simple. Instead of executing a CPU via TCG orKVM, rely on an external process to send events to the device model that the CPUwould normally generate.
qtest presents itself as an accelerator. In addition, a new option is added to...
w64: Fix data type of next_tb and tcg_qemu_tb_exec
next_tb is the numeric value of a tcg target (= QEMU host) address.
Using tcg_target_ulong instead of unsigned long shows this and makesthe code portable for hosts with an unusual size of long (w64).
The type cast '(long)(next_tb & ~3)' was not needed (casting...
Rename CPUState -> CPUArchState
Scripted conversion: for file in .[hc] hw/.[hc] hw/kvm/*.[hc] linux-user/*.[hc] linux-user/m68k/*.[hc] bsd-user/*.[hc] darwin-user/*.[hc] tcg/*/*.[hc] target-*/cpu.h; do sed -i "s/CPUState/CPUArchState/g" $file done...
PPC: 405: Use proper CPU reset
On ppc405ep there is a register that allows for software to reset thecore, but not the whole system. Implement this reset using a resetinterrupt.
This gets rid of a bunch of #if 0'ed code.
Reported-by: Andreas Färber <afaerber@suse.de>...
Rename cpu_reset() to cpu_state_reset()
Frees the identifier cpu_reset for QOM CPUs (manual rename).
Don't hide the parameter type behind explicit casts, use staticfunctions with strongly typed argument to indirect.
Signed-off-by: Andreas Färber <afaerber@suse.de>...
cpu-exec.c: Correct comment about this file and indentation cleanup
Each target uses the #define macro (in target-xxx/cpu.h) to renamecpu_exec (cpu-exec.c) to cpu_xxx_exec, then defines its own cpu_loopwhich calls cpu_xxx_exec. So basically, cpu-exec.c is not only the i386...
PPC: Fix sync instructions problem in SMP
In the current emulation of the load-and-reserve (lwarx) andstore-conditional (stwcx.) instructions, the internal reservationmechanism is taken into account, however each CPU has its ownreservation information and this information is not synchronized between...
target-xtensa: implement exceptions
- mark privileged opcodes with ring check;- make debug exception on exception handler entry.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
target-xtensa: add target stubs
cpu-exec: remove unnecessary assignment
Avoid this warning from clang analyzer:/src/qemu/cpu-exec.c:97:5: warning: Value stored to 'phys_page2' is never read phys_page2 = -1;
Adjust the scope of the variable while at it.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
tcg: Reload local variables after return from longjmp
Recent compilers look deep into cpu_exec, find longjmp as a noreturnfunction and decide to smash some stack variables as they won't be usedagain. This may lead to env becoming invalid after return from setjmp,...
cpu-exec.c: avoid AREG0 use
Make functions take a parameter for CPUState instead of relyingon global env. Pass CPUState pointer to TCG prologue, which movesit to AREG0.
Thanks to Peter Maydell and Laurent Desnogues for the ARM prologuechange.
Revert the hacks to avoid AREG0 use on Sparc hosts....
exec.h: fix coding style and change cpu_has_work to return bool
Before the next patch, fix coding style of the areas affected.
Change the type of the return value from cpu_has_work() andqemu_cpu_has_work() to bool.
cpu-exec: unify do_interrupt call
Now that all targets use common function signature for do_interrupt(), there is noneed for the #ifdeffery anymore.
m68k: use caller supplied CPUState for interrupt related stuff
Pass CPUState to do_interrupt(). This is needed by later patches.
It would be cleaner to move the function to helper.c, but there area few dependencies between do_interrupt() and other functions....
x86: use caller supplied CPUState for interrupt related stuff
Several x86 specific functions are called from cpu-exec.c with theassumption that global env register is valid. This will be changedlater, so make the functions use caller supplied CPUState parameter....
cpu_loop_exit: avoid using AREG0
Make cpu_loop_exit() take a parameter for CPUState instead of relyingon global env.
Remove unneeded kvm.h from cpu-exec.c
This was obsoleted by 6792a57bf1.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
target-alpha: Disable interrupts properly.
Interrupts are disabled in PALmode, and when the PS IL is high enough.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Move user emulator stuff from cpu-exec.c to user-exec.c
Simplify cpu-exec.c by refactoring.
cpu-exec: prepare for user and softmmu split
There is little in common with user and softmmu versions of cpu_resume_signal(),split them.
Fix coding style for the user emulator part.
Delete unused tb_invalidate_page_range
tb_invalidate_page_range() was intended to be used to invalidate anarea of a TB which the guest explicitly flushes from i-cache. However,QEMU detects writes to code areas where TBs have been generated, sohis has never been useful....
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
Conflicts: cpu-all.h
irq: Introduce and use CPU_INTERRUPT_SSTEP_MASK.
This mask contains all of the bits that should be ignored while singlestepping in the debugger. The mask contains 2 bits that are not currentlycleared, but are also never set. The bits are included in the mask for...
target-sparc: Do not check CPU_INTERRUPT_TIMER.
This bit is never set, therefore we should not read it either.
Signed-off-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Fix typos in comments and code (occured -> occurred and related)
The code changed here is an unused data type name (evt_flush_occurred).
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Fix typos in comments (interupt -> interrupt)
Remove unused function parameter from cpu_restore_state
The previous patch removed the need for parameter puc.Is is now unused, so remove it.
Cc: Aurelien Jarno <aurelien@aurel32.net>Reviewed-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Stefan Weil <weil@mail.berlios.de>
s390x: Enable s390x-softmmu target
This patch adds some code paths for running s390x guest OSs without theneed for KVM.
Signed-off-by: Alexander Graf <agraf@suse.de>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
unicore32: necessary modifications for other files to support unicore32
Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
x86: Unbreak TCG support for hardware breakpoints
Commit 83f338f73e broke x86 hardware breakpoint emulation by moving thedebug exception handling out of cpu_exec. Fix this by moving all TCGrelated bits back, only leaving the generic guest debugging parts in...
inline cpu_halted into sole caller
All implementations are now the same, and there is only one caller,so inline the function there.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
LatticeMico32 target support
This patch adds support for the LatticeMico32 softcore processor by LatticeSemiconductor.
Signed-off-by: Michael Walle <michael@walle.cc>Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Move debug exception handling out of cpu_exec
To prepare splitting up KVM and TCG CPU entry/exit, move the debugexception into cpus.c and invoke cpu_handle_debug_exception on returnfrom qemu_cpu_exec.
This also allows to clean up the debug request signaling: We can assign...
kvm: Separate TCG from KVM cpu execution
Mixing up TCG bits with KVM already led to problems around eflagsemulation on x86. Moreover, quite some code that TCG requires on cpuenty/exit is useless for KVM. So dispatch between tcg_cpu_exec andkvm_cpu_exec as early as possible....
target-mips: fix host CPU consumption when guest is idle
When the CPU is in wait state, do not wake-up if an interrupt can't betaken. This avoid host CPU running at 100% if a device (e.g. timer) hasan interrupt line left enabled.
Also factorize code to check if interrupts are enabled in...
Speedup 'tb_find_slow' by using the same heuristic as during memory page lookup
Move the last found TB to the head of the list so it will be found more quickly next time it will be looked for.
Signed-off-by: Kirill Batuzov <batuzovk@ispras.ru>Signed-off-by: Pavel Yushchenko <pau@ispras.ru>...
mips: Add support for VInt and VEIC irq modes
Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
Fix cpu_unlink_tb race
If a signal hit after the env->exit_request check but before cpu_execupdated env->current_tb, cpu_unlink_tb called from the signal handerwill not unlink the current TB. This may leave us stuck in a guest loopif no further unlink is invoked....
Fix cpu_exit for tcp_cpu_exec
If a cpu_exit request is pending, ensure that we leave the CPU loopquickly. For this purpose, keep the global exit_request pending untilwe are about to leave tcg_cpu_exec. Also, immediately break out of theSMP loop if the request is set, do not run till the end of the chain....
Introduce proper compiler barrier
Define barrier() as optimization barrier and replace (potentiallyunreliable) asm("") fences.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Acked-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com>...
tcg-s390: Compute is_write in cpu_signal_handler.
Signed-off-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
make SIG_IPI to tcg vcpu thread reliable
Store tcg loop exit request on a global variable, and transfer it toper-CPUState exit_request after assignment of cpu_single_env.
This makes exit request signal from robust. Drop the timedlock hack.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>...
Enable -d cpu logging by default.
When -d cpu logging was handled by target-foo/translate.c,it was controled by DEBUG_DISAS, which is enabled by default.Use the same condition in cpu_exec.
At the same time, reduce the if-deffery by assuming no flagsupdate is required for the target....
tcg-hppa: Compute is_write in cpu_signal_handler.
linux-user/ia64: workaround ia64 strangenesses
ia64 has some strangenesses that need to be workaround:- it has a __clone2() syscall instead of the using clone() one, with different arguments, and which is not declared in the usual headers.- ucontext.uc_sigmask is declared with type long int, while it is...
Add tb_page_addr_t
The page tracking code in exec.c is used by both userspace and systememulation. Userspace emulation uses it to track virtual pages, andsystem emulation to track ram pages. Introduce a new type to hold thiskind of address.
Signed-off-by: Paul Brook <paul@codesourcery.com>
declare saved_env_reg as volatile
This ensures that the compiler does not move it away fromthe "env = env1;" assignment. Fixes a miscompilationon gcc 4.4, reported by Jay Foad.
Cc: <jay.foad@gmail.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
Merge remote branch 'qemu-kvm/uq/master' into staging
kvm: Fix eflags corruption in kvm mode
This should explain a lot of the weird breakages of upstream KVM we'veseen recently (actually we should have seen it much earlier):
Stop translating eflags into TCG format when in kvm mode as we nevertranslate it back and rather sync this broken state into the kernel....
Add FreeBSD/ppc host ucontext definitions.
Submitted by: Andreas Tobler <andreast@fgznet.ch>
Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>Signed-off-by: malc <av1474@comtv.ru>
get rid of hostregs_helper.h
Since b567b38 (target-arm: remove T0 and T1, 2009-10-16) the only globalregister that is used is AREG0, so the complexity of hostregs_helper.his unused. Use regular assignments and a compiler optimization barrier.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
cris: Prepare for CRISv10.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
fix wrong indentation
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
clean up env->current_tb
There are three paths from the innermost while loop of cpu_execto the top of the outermost for loop. Two do not resetenv->current_tb. Fix this.
add assertions about env->current_tb
By virtue of the previous patch env->current_tb will always be NULL atthe top of cpu_exec's outermost for loop, and at the end of the innermostwhile loop.
change while to if
The while loop will be executed exactly 0 or 1 times, depending onenv->exit_request.
remove assertions
avoid unreachable statement after break
kill regs_to_env and env_to_regs
sparc64: interrupt trap handling
cpu_check_irqs- handle SOFTINT register TICK and STICK timer bits- only check interrupt levels greater than PIL value- handle preemption by higher level traps
cpu_exec- handle CPU_INTERRUPT_HARD only if interrupts are enabled...
S/390 CPU fake emulation
Because Qemu currently requires a TCG target to exist and there are quite someuseful helpers here to lay the groundwork for out KVM target, let's create astub TCG emulation target for S390X CPUs.
This is required to make tcg happy. The emulation target itself won't work...
PPC: rename cpu_ppc_reset to cpu_reset for consistency
bsd-user: FreeBSD update
basic FreeBSD sysarch(2) handlingfixed syscall errno return
Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Fix sys-queue.h conflict for good
Problem: Our file sys-queue.h is a copy of the BSD file, but there aresome additions and it's not entirely compatible. Because of that, there havebeen conflicts with system headers on BSD systems. Some hacks have beenintroduced in the commits 15cc9235840a22c289edbe064a9b3c19c5f49896,...
cleanup cpu-exec.c, part 0/N: consolidate handle_cpu_signal
handle_cpu_signal is very nearly copy-paste code for each target, with afew minor variations. This patch sets up appropriate defaults for ageneric handle_cpu_signal and provides overrides for particular targets...
Unbreak large mem support by removing kqemu
kqemu introduces a number of restrictions on the i386 target. The worst is thatit prevents large memory from working in the default build.
Furthermore, kqemu is fundamentally flawed in a number of ways. It relies on...
sparc32 remove an unnecessary cpu irq set
Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
rename DEBUG_EXEC to CONFIG_DEBUG_EXEC
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
change HOST_SOLARIS to CONFIG_SOLARIS{_VERSION}
Update to a hopefully more future proof FSF address
sparc64: trap handling corrections
On Sun, Jul 12, 2009 at 12:09 PM, Blue Swirl<blauwirbel@gmail.com> wrote:
On 7/12/09, Igor Kovalenko <igor.v.kovalenko@gmail.com> wrote: Good trap handling is required to process interrupts. This patch fixes the following:...
On 7/12/09, Igor Kovalenko <igor.v.kovalenko@gmail.com> wrote:
Good trap handling is required to process interrupts. This patch fixes the following:...
QEMU: MCE: Add MCE simulation to qemu/tcg
- MCE features are initialized when VCPU is intialized according to CPUID.- A monitor command "mce" is added to inject a MCE.- A new interrupt mask: CPU_INTERRUPT_MCE is added to inject the MCE.
aliguori: fix build for linux-user...
Handle init/sipi in a main cpu exec loop. (v2)
This should fix compilation problem in case of CONFIG_USER_ONLY.
Currently INIT/SIPI is handled in the context of CPU that sends IPI.This patch changes this to handle them like all other events in a maincpu exec loop. When KVM will gain thread per vcpu capability it will...
microblaze: linux-user support.
Recognize V9 stores and CAS accesses as writes
qemu: per-arch cpu_has_work (Marcelo Tosatti)
Blue Swirl: fix Sparc32 breakage
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7238 c046a42c-6fe2-441c-8c8c-71466251a162
kqemu: merge CONFIG_KQEMU and USE_KQEMU
Basically a recursive ":%s/USE_KQEMU/CONFIG_KQEMU/g".
Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7189 c046a42c-6fe2-441c-8c8c-71466251a162
BSD user: add support for OpenBSD/amd64 host
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7066 c046a42c-6fe2-441c-8c8c-71466251a162
BSD user: add support for OpenBSD/i386 host
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7065 c046a42c-6fe2-441c-8c8c-71466251a162
Make i386-softmmu boot on Sparc host
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6971 c046a42c-6fe2-441c-8c8c-71466251a162
Delete some unused macros detected with -Wp,-Wunused-macros use
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6856 c046a42c-6fe2-441c-8c8c-71466251a162
Fix race condition on access to env->interrupt_request
env->interrupt_request is accessed as the bit level from both main codeand signal handler, making a race condition possible even on CISC CPU.This causes freeze of QEMU under high load when running the dyntick...
global s/loglevel & X/qemu_loglevel_mask(X)/ (Eduardo Habkost)
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>...
Convert references to logfile/loglevel to use qemu_log*() macros
This is a large patch that changes all occurrences of logfile/loglevelglobal variables to use the new qemu_log*() macros.
Get rid of user_mode_only
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
According to $GCC/gcc/config/rs6000/rs6000-c.c _ARCH_PPC is theubiquitous define which should be used to test whether gcc targetsPowerPC, 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 boilerplate
The attached patch updates the FSF address in the GPL/LGPL boilerplatein 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>...
Fix remaining compiler warnings for mips targets.
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 accessshortly after an IRQ has been raised, env>exception_index will still be setto EXCP_IRQ when cpu_io_recompile calls cpu_resume_from_signal.This causes qemu to repeat the IRQ trap, with disasterous consequences....
target-i386: SVM: acknowledge interrupt only after it is taken
SVM specifies that the V_IRQ mask is only to be removed, if theinterrupt that is to be delivered actually is delivered.
As of the SVM rewrite, this mask is always unmasked when the main cpu...
target-ppc: rework exception code
... also remove two warnings.
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.
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)
This switches cpu_break/watchpoint_* to TAILQ wrappers, simplifying thecode and also fixing a use after release issue incpu_break/watchpoint_remove_all.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
target-ppc: convert exceptions generation to TCG
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5772 c046a42c-6fe2-441c-8c8c-71466251a162
Add debug exception hook (Jan Kiszka)
This patch allows to hook into the delivery of EXCP_DEBUG so that otheruse beyond guest debugging becomes possible.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>...
Introduce BP_WATCHPOINT_HIT flag (Jan Kiszka)
When one watchpoint is hit, others might have triggered as well. Tosupport users of the watchpoint API which need to detect such cases,the BP_WATCHPOINT_HIT flag is introduced and maintained.