summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-07-09target-m68k: Change gen_intermediate_code_internal() argument to M68kCPUAndreas Färber1-4/+5
Also use bool type while at it. Prepares for moving singlestep_enabled field to CPUState. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-09target-lm32: Change gen_intermediate_code_internal() argument to LM32CPUAndreas Färber1-4/+5
Also use bool type while at it. Prepares for moving singlestep_enabled field to CPUState. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-09target-i386: Change gen_intermediate_code_internal() argument to X86CPUAndreas Färber1-4/+5
Also use bool type while at it. Prepares for moving singlestep_enabled field to CPUState. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-09target-cris: Change gen_intermediate_code_internal() argument to CRISCPUAndreas Färber1-4/+5
Also use bool type while at it. Prepares for moving singlestep_enabled field to CPUState. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-09target-arm: Change gen_intermediate_code_internal() argument to ARMCPUAndreas Färber1-4/+5
Also use bool type while at it. Prepares for moving singlestep_enabled field to CPUState. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-09target-alpha: Change gen_intermediate_code_internal() argument to AlphaCPUAndreas Färber1-4/+5
Also use bool argument while at it. Prepares for moving singlestep_enabled field to CPUState. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-09target-xtensa: gen_intermediate_code_internal() should be inlinedAndreas Färber1-2/+3
Cc: qemu-stable@nongnu.org Reported-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-09target-moxie: gen_intermediate_code_internal() should be inlinedAndreas Färber1-1/+1
Cc: qemu-stable@nongnu.org Reported-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-09target-microblaze: gen_intermediate_code_internal() should be inlinedAndreas Färber1-1/+1
Cc: qemu-stable@nongnu.org Reported-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-09target-lm32: gen_intermediate_code_internal() should be inlinedAndreas Färber1-2/+3
Cc: qemu-stable@nongnu.org Reported-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Richard Henderson <rth@twiddle.net> Acked-by: Michael Walle <michael@walle.cc> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-09target-cris: gen_intermediate_code_internal() should be inlinedAndreas Färber1-1/+1
Cc: qemu-stable@nongnu.org Reported-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-09target-i386: Don't overuse CPUArchStateAndreas Färber1-5/+5
Use CPUX86State instead in dump support code. Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-09target-s390x: Change handle_{hypercall,diag}() argument to S390CPUAndreas Färber1-6/+6
This allows to get rid of the last remaining ENV_GET_CPU() in target-s390x/ by using CPU() cast directly on the argument. Cc: Jason J. Herne <jjherne@us.ibm.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-09target-s390x: Don't overuse ENV_GET_CPU()Andreas Färber1-1/+1
Commit 3474b679486caa8f6448bae974e131370f360c13 (Utilize selective runtime reg sync for hot code paths) introduced two uses of ENV_GET_CPU() inside target-s390x/ KVM code. In one case we can use a direct CPU() cast instead. Cc: Jason J. Herne <jjherne@us.ibm.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-09target-ppc: Don't overuse ENV_GET_CPU()Andreas Färber1-1/+1
Commit b632a148b677b773ff155f9de840b37a653567b9 (target-ppc: QOM method dispatch for MMU fault handling) introduced a use of ENV_GET_CPU() inside target-ppc/ code. Use ppc_env_get_cpu() instead. Purely cosmetic, non-functional change to aid in locating and removing ENV_GET_CPU() usages. Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-09timer/arm_mptimer: Build arm_mptimer only onceAndreas Färber2-1/+2
Since current_cpu is CPUState it no longer depends on CPUARMState. Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-09intc/openpic: Build openpic only onceAndreas Färber5-4/+9
Since current_cpu is CPUState it no longer depends on CPUPPCState. Move ppce500_set_mpic_proxy() to a new hw/ppc/ppc_e500.h because hw/ppc/ppc.h is too heavily using CPUPPCState and PowerPCCPU. Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-09intc/arm_gic: Build arm_gic only onceAndreas Färber2-1/+2
Since current_cpu is CPUState it no longer needs CPUArchState. Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-09bsd-user: Change thread_env to CPUStateAndreas Färber3-6/+8
Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-09linux-user: Change thread_env to CPUStateAndreas Färber6-22/+27
Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-09cpu: Make first_cpu and next_cpu CPUStateAndreas Färber39-234/+266
Move next_cpu from CPU_COMMON to CPUState. Move first_cpu variable to qom/cpu.h. gdbstub needs to use CPUState::env_ptr for now. cpu_copy() no longer needs to save and restore cpu_next. Acked-by: Paolo Bonzini <pbonzini@redhat.com> [AF: Rebased, simplified cpu_copy()] Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-09linux-user: Clean up do_syscall() Coding Style for TARGET_NR_exitAndreas Färber1-36/+37
In particular fix 6-/10-char indentation. Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-09kvm: Change kvm_remove_all_breakpoints() argument to CPUStateAndreas Färber4-6/+6
Acked-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-09cpu: Replace cpu_single_env with CPUState current_cpuAndreas Färber23-115/+120
Move it to qom/cpu.h. Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-09kvm: Free current_cpu identifierAndreas Färber3-30/+25
Since CPU loops are done as last step in kvm_{insert,remove}_breakpoint() and kvm_remove_all_breakpoints(), we do not need to distinguish between invoking CPU and iterated CPUs and can thereby free the identifier for use as a global variable. Acked-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-09cpu: Drop unnecessary dynamic casts in *_env_get_cpu()Andreas Färber16-16/+16
A transition from CPUFooState to FooCPU can be considered safe, just like FooCPU::env access in the opposite direction. The only benefit of the FOO_CPU() casts would be protection against bogus CPUFooState pointers, but then surrounding code would likely break, too. This should slightly improve interrupt etc. performance when going from CPUFooState to FooCPU. For any additional CPU() casts see 3556c233d931ad5ffa46a35cb25cfc057732ebb8 (qom: allow turning cast debugging off). Reported-by: Anthony Liguori <aliguori@us.ibm.com> Acked-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-09linux-user: Move cpu_clone_regs() and cpu_set_tls() into linux-userPeter Maydell31-188/+460
The functions cpu_clone_regs() and cpu_set_tls() are not purely CPU related -- they are specific to the TLS ABI for a a particular OS. Move them into the linux-user/ tree where they belong. target-lm32 had entirely unused implementations, since it has no linux-user target; just drop them. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-09Revert "gdbstub: Simplify find_cpu()"Andreas Färber1-4/+8
This reverts commit c52a6b67c1d7c6fc9fb2e3ba988d7b978e1487d3, which replaced cpu_index() with cpu_index field, leading to deviation from thread ID for NTPL and off-by-one otherwise. Reported-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-09vl: Tighten parsing of -machine option phandle_startMarkus Armbruster2-6/+3
Make it QEMU_OPT_NUMBER, so it gets parsed by generic code, which actually bothers to check for errors, rather than its user, which doesn't. Cc: Alexander Graf <agraf@suse.de> Signed-off-by: Markus Armbruster <armbru@redhat.com> Acked-by: Alexander Graf <agraf@suse.de> Message-id: 1372943363-24081-8-git-send-email-armbru@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-07-09Simplify -machine option queries with qemu_get_machine_opts()Markus Armbruster6-76/+34
The previous two commits fixed bugs in -machine option queries. I can't find fault with the remaining queries, but let's use qemu_get_machine_opts() everywhere, for consistency, simplicity and robustness. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-id: 1372943363-24081-7-git-send-email-armbru@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-07-09microblaze: Fix latent bug with default DTB lookupMarkus Armbruster1-14/+13
microblaze_load_kernel() fails to call qemu_find_file(QEMU_FILE_TYPE_BIOS, dtb_filename) when no -machine options are given. This can't normally happen, because -machine option kernel is mandatory for this target. Fix it anyway, by using qemu_get_machine_opts(). Cc: Peter Crosthwaite <peter.crosthwaite@petalogix.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-id: 1372943363-24081-6-git-send-email-armbru@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-07-09Fix -machine options accel, kernel_irqchip, kvm_shadow_memMarkus Armbruster4-29/+14
Multiple -machine options with the same ID are merged. All but the one without an ID are to be silently ignored. In most places, we query these options with a null ID. This is correct. In some places, we instead query whatever options come first in the list. This is wrong. When the -machine processed first happens to have an ID, options are taken from that ID, and the ones specified without ID are silently ignored. Example: $ upstream-qemu -nodefaults -S -display none -monitor stdio -machine id=foo -machine accel=kvm,usb=on $ upstream-qemu -nodefaults -S -display none -monitor stdio -machine id=foo,accel=kvm,usb=on -machine accel=xen $ upstream-qemu -nodefaults -S -display none -monitor stdio -machine accel=xen -machine id=foo,accel=kvm,usb=on $ qemu-system-x86_64 -nodefaults -S -display none -monitor stdio -machine accel=kvm,usb=on QEMU 1.5.50 monitor - type 'help' for more information (qemu) info kvm kvm support: enabled (qemu) info usb (qemu) q $ qemu-system-x86_64 -nodefaults -S -display none -monitor stdio -machine id=foo -machine accel=kvm,usb=on QEMU 1.5.50 monitor - type 'help' for more information (qemu) info kvm kvm support: disabled (qemu) info usb (qemu) q $ qemu-system-x86_64 -nodefaults -S -display none -monitor stdio -machine id=foo,accel=kvm,usb=on -machine accel=xen QEMU 1.5.50 monitor - type 'help' for more information (qemu) info kvm kvm support: enabled (qemu) info usb USB support not enabled (qemu) q $ qemu-system-x86_64 -nodefaults -S -display none -monitor stdio -machine accel=xen -machine id=foo,accel=kvm,usb=on xc: error: Could not obtain handle on privileged command interface (2 = No such file or directory): Internal error xen be core: can't open xen interface failed to initialize Xen: Operation not permitted Option usb is queried correctly, and the one without an ID wins, regardless of option order. Option accel is queried incorrectly, and which one wins depends on option order and ID. Affected options are accel (and its sugared forms -enable-kvm and -no-kvm), kernel_irqchip, kvm_shadow_mem. Additionally, option kernel_irqchip is normally on by default, except it's off when no -machine options are given. Bug can't bite, because kernel_irqchip is used only when KVM is enabled, KVM is off by default, and enabling always creates -machine options. Downstreams that enable KVM by default do get bitten, though. Use qemu_get_machine_opts() to fix these bugs. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-id: 1372943363-24081-5-git-send-email-armbru@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-07-09vl: New qemu_get_machine_opts()Markus Armbruster2-0/+21
To be used in the next few commits to fix or clean up queries of "machine" options (-machine and its sugared forms). Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-id: 1372943363-24081-4-git-send-email-armbru@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-07-09qemu-option: Fix qemu_opts_set_defaults() for corner casesMarkus Armbruster1-9/+1
Commit 4f6dd9a changed the initialization of opts in opts_parse() to this: if (defaults) { if (!id && !QTAILQ_EMPTY(&list->head)) { opts = qemu_opts_find(list, NULL); } else { opts = qemu_opts_create(list, id, 0); } } else { opts = qemu_opts_create(list, id, 1); } Same as before for !defaults. If defaults is true, and params has no ID, and options exist, we use the first assignment. It sets opts to null if all options have an ID. opts_parse() then returns null. qemu_opts_set_defaults() asserts the value is non-null. It's the only caller that passes true for defaults. To reproduce, try "-M xenpv -machine id=foo" (yes, "id=foo" is silly, but it shouldn't crash). I believe the function attempts to do the following: If options don't yet exist, create new options Else, if defaults, modify the existing options Else, if list->merge_lists, modify the existing options Else, fail A straightforward call of qemu_opts_create() does exactly that. Cc: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-id: 1372943363-24081-3-git-send-email-armbru@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-07-09qemu-option: Fix qemu_opts_find() for null id argumentsMarkus Armbruster1-8/+4
Crashes when the first list member has an ID. Admittedly nonsensical reproducer: $ qemu-system-x86_64 -nodefaults -machine id=foo -machine "" Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1372943363-24081-2-git-send-email-armbru@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-07-09exec: Remove unused global variable phys_ram_fdStefan Weil2-2/+0
It seems to be unused since several years (commit be995c27640a82c7056b6f53d02ec823570114e5 in 2006). Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Andreas Färber <afaerber@suse.de> Message-id: 1373044036-14443-1-git-send-email-sw@weilnetz.de Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-07-09hw/9pfs: Fix memory leak in error pathM. Mohan Kumar1-9/+17
Fix few more memory leaks in virtio-9p-device.c detected using valgrind. Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com> Message-id: 1372929678-14341-1-git-send-email-mohan@in.ibm.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-07-09fsdev: Fix potential memory leakStefan Weil1-0/+2
This leak was reported by cppcheck. Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: M. Mohan Kumar <mohan@in.ibm.com> Message-id: 1371376960-18192-1-git-send-email-sw@weilnetz.de Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-07-09Extend support of SMBUS(module pm_smbus.c) HST_STS register.MRatnikov1-2/+23
Previous realization doesn't consider flags in the status register. Add DS and INTR bits of HST_STS register set after transaction execution. Update bits resetting in HST_STS register. Update error processing: if DEV_ERR bit set transaction isn't execution. Signed-off-by: MRatnikov <m.o.ratnikov@gmail.com> Message-id: 1373230982-9190-1-git-send-email-m.o.ratnikov@gmail.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-07-09trap signals for "-serial mon:stdio"Paolo Bonzini2-7/+14
With mon:stdio you can exit the VM by switching to the monitor and sending the "quit" command. It is then useful to pass Ctrl-C to the VM instead of exiting. This in turn lets us stop tying the default signal handling behavior to -nographic, removing gratuitous differences between "-display none" and "-nographic". This patch changes behavior for "-display none -serial mon:stdio", as expected, but not for "-display none -serial stdio". Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1372868986-25988-1-git-send-email-mjt@msgid.tls.msk.ru Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-07-09configure: Simplify alternate .text segmentRichard Henderson1-17/+31
For bsd-user and linux-user emulation modes QEMU needs to be linked at an alternate .text segment address, so that it's out of the way of the guest executable. Instead of including modified linker scripts for each arch, just set the address with -Ttext-segment if supported, or by using sed to edit the default linker script. Cc: Ed Maste <emaste@freebsd.org> Signed-off-by: Richard Henderson <rth@twiddle.net> Acked-by: Ed Maste <emaste@freebsd.org> Signed-off-by: Ed Maste <emaste@freebsd.org> Message-id: 1371867016-7660-1-git-send-email-rth@twiddle.net Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-07-09target-openrisc: Fix typename in openrisc_cpu_class_by_name()Dongxue Zhang1-1/+3
Commit 478032a93d908e59085c1ac56f10979942e7dc4f (target-openrisc: Rename CPU subtypes) suffixed CPU sub-types with "-or32-cpu" but forgot to update openrisc_cpu_class_by_name(), so that it was still looking for the types without suffix. Make target-openrisc running OK by adding the suffix to the model name. This means it is no longer possible to use -cpu or1200-or32-cpu or -cpu any-or32-cpu though. Cc: qemu-stable@nongnu.org Signed-off-by: Dongxue Zhang <elta.era@gmail.com> Tested-by: Jia Liu <proljc@gmail.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-09tcg-arm: Implement tcg_register_jitRichard Henderson1-9/+67
Allows unwinding past the code_gen_buffer. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-07-09tcg-i386: Use QEMU_BUILD_BUG_ON instead of assert for frame sizeRichard Henderson1-3/+3
We can check the condition at compile time, rather than run time. Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-07-09tcg: Move the CIE and FDE header definitions to common codeRichard Henderson4-76/+51
These will necessarily be the same layout for all hosts. This limits the amount of boilerplate required to implement jit debug for a host. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-07-09tcg: Fix high_pc fields in .debug_infoRichard Henderson1-2/+2
I don't think the debugger actually looks at this for anything, using the correct .debug_frame contents, but might as well get it all correct. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-07-09tcg-arm: Use AT_PLATFORM to detect the host ISARichard Henderson1-4/+16
With this we can generate armv7 insns even when the OS compiles for a lower common denominator. The macros are arranged so that when we do compile for a given ISA, all of the runtime checks for that ISA are optimized away. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-07-09tcg-arm: Simplify logic in detecting the ARM ISA in useRichard Henderson1-39/+23
GCC 4.8 defines a handy __ARM_ARCH symbol that we can use, which will make us nicely forward compatible with ARMv8 AArch32. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-07-09tcg-arm: Rename use_armv5_instructions to use_armvt5_instructionsRichard Henderson1-6/+6
As it really controls the availability of a thumb interworking instruction on armv5t. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-07-09tcg-arm: Make use of conditional availability of opcodes for divideRichard Henderson2-8/+22
We can now detect and use divide instructions at runtime, rather than having to restrict their availability to compile-time. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <rth@twiddle.net>