summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* cputlb: Change tlb_flush() argument to CPUStateAndreas Färber2014-03-1341-87/+143
| | | | Signed-off-by: Andreas Färber <afaerber@suse.de>
* cputlb: Change tlb_flush_page() argument to CPUStateAndreas Färber2014-03-1318-70/+106
| | | | Signed-off-by: Andreas Färber <afaerber@suse.de>
* target-microblaze: Replace DisasContext::env field with MicroBlazeCPUAndreas Färber2014-03-131-44/+43
| | | | | | This cleans up some mb_env_get_cpu() needed for cpu_abort(). Signed-off-by: Andreas Färber <afaerber@suse.de>
* target-cris: Replace DisasContext::env field with CRISCPUAndreas Färber2014-03-132-16/+16
| | | | | | This cleans up repeated cris_env_get_cpu() for cpu_abort(). Signed-off-by: Andreas Färber <afaerber@suse.de>
* exec: Change cpu_abort() argument to CPUStateAndreas Färber2014-03-1341-206/+301
| | | | Signed-off-by: Andreas Färber <afaerber@suse.de>
* exec: Change memory_region_section_get_iotlb() argument to CPUStateAndreas Färber2014-03-133-4/+3
| | | | | | It no longer needs CPUArchState since moving watchpoints to CPUState. Signed-off-by: Andreas Färber <afaerber@suse.de>
* cputlb: Change tlb_unprotect_code_phys() argument to CPUStateAndreas Färber2014-03-133-5/+5
| | | | | | Note that the argument is unused. Signed-off-by: Andreas Färber <afaerber@suse.de>
* cpu-exec: Change cpu_resume_from_signal() argument to CPUStateAndreas Färber2014-03-139-14/+11
| | | | Signed-off-by: Andreas Färber <afaerber@suse.de>
* exec: Change cpu_breakpoint_{insert,remove{,_by_ref,_all}} argumentAndreas Färber2014-03-139-46/+43
| | | | | | Use CPUState. Allows to clean up CPUArchState in gdbstub. Signed-off-by: Andreas Färber <afaerber@suse.de>
* exec: Change cpu_watchpoint_{insert,remove{,_by_ref,_all}} argumentAndreas Färber2014-03-1310-43/+58
| | | | | | Use CPUState. This lets us drop a few local env usages. Signed-off-by: Andreas Färber <afaerber@suse.de>
* target-ppc: Use PowerPCCPU in PowerPCCPUClass::handle_mmu_fault hookAndreas Färber2014-03-136-10/+14
| | | | Signed-off-by: Andreas Färber <afaerber@suse.de>
* translate-all: Change tb_flush_jmp_cache() argument to CPUStateAndreas Färber2014-03-133-4/+3
| | | | Signed-off-by: Andreas Färber <afaerber@suse.de>
* translate-all: Change tb_gen_code() argument to CPUStateAndreas Färber2014-03-135-9/+10
| | | | Signed-off-by: Andreas Färber <afaerber@suse.de>
* translate-all: Change cpu_io_recompile() argument to CPUStateAndreas Färber2014-03-133-5/+5
| | | | Signed-off-by: Andreas Färber <afaerber@suse.de>
* translate-all: Change tb_check_watchpoint() argument to CPUStateAndreas Färber2014-03-133-4/+4
| | | | Signed-off-by: Andreas Färber <afaerber@suse.de>
* translate-all: Change cpu_restore_state_from_tb() argument to CPUStateAndreas Färber2014-03-131-8/+7
| | | | | | And normalize the argument order. Signed-off-by: Andreas Färber <afaerber@suse.de>
* translate-all: Change cpu_restore_state() argument to CPUStateAndreas Färber2014-03-1324-63/+46
| | | | | | This lets us drop some local variables in tlb_fill() functions. Signed-off-by: Andreas Färber <afaerber@suse.de>
* cpu-exec: Change cpu_loop_exit() argument to CPUStateAndreas Färber2014-03-1328-67/+64
| | | | Signed-off-by: Andreas Färber <afaerber@suse.de>
* exec: Change tlb_fill() argument to CPUStateAndreas Färber2014-03-1318-61/+91
| | | | Signed-off-by: Andreas Färber <afaerber@suse.de>
* cpu: Move breakpoints field from CPU_COMMON to CPUStateAndreas Färber2014-03-1343-73/+94
| | | | | | | | Most targets were using offsetof(CPUFooState, breakpoints) to determine how much of CPUFooState to clear on reset. Use the next field after CPU_COMMON instead, if any, or sizeof(CPUFooState) otherwise. Signed-off-by: Andreas Färber <afaerber@suse.de>
* cpu: Move watchpoint fields from CPU_COMMON to CPUStateAndreas Färber2014-03-1313-47/+60
| | | | Signed-off-by: Andreas Färber <afaerber@suse.de>
* cpu: Move opaque field from CPU_COMMON to CPUStateAndreas Färber2014-03-1313-48/+72
| | | | Signed-off-by: Andreas Färber <afaerber@suse.de>
* cpu: Move exception_index field from CPU_COMMON to CPUStateAndreas Färber2014-03-1360-319/+389
| | | | Signed-off-by: Andreas Färber <afaerber@suse.de>
* cpu: Move jmp_env field from CPU_COMMON to CPUStateAndreas Färber2014-03-134-6/+9
| | | | Signed-off-by: Andreas Färber <afaerber@suse.de>
* cpu: Move tb_jmp_cache field from CPU_COMMON to CPUStateAndreas Färber2014-03-136-16/+16
| | | | | | Clear it on reset. Signed-off-by: Andreas Färber <afaerber@suse.de>
* cpu: Move icount_decr field from CPU_COMMON to CPUStateAndreas Färber2014-03-137-38/+40
| | | | Signed-off-by: Andreas Färber <afaerber@suse.de>
* cpu: Move icount_extra field from CPU_COMMON to CPUStateAndreas Färber2014-03-135-13/+15
| | | | | | Reset it. Signed-off-by: Andreas Färber <afaerber@suse.de>
* cpu: Move can_do_io field from CPU_COMMON to CPUStateAndreas Färber2014-03-138-16/+24
| | | | | | Rename can_do_io() to cpu_can_do_io() and change argument to CPUState. Signed-off-by: Andreas Färber <afaerber@suse.de>
* cpu: Move mem_io_{pc,vaddr} fields from CPU_COMMON to CPUStateAndreas Färber2014-03-138-25/+31
| | | | | | Reset them. Signed-off-by: Andreas Färber <afaerber@suse.de>
* cpu: Turn cpu_handle_mmu_fault() into a CPUClass hookAndreas Färber2014-03-1361-151/+238
| | | | | | | | Note that while such functions may exist both for *-user and softmmu, only *-user uses the CPUState hook, while softmmu reuses the prototype for calling it directly. Signed-off-by: Andreas Färber <afaerber@suse.de>
* target-m68k: Remove custom qemu_assert() functionPeter Maydell2014-03-131-19/+9
| | | | | | | | | | | | | | | Remove the custom qemu_assert() function defined by target-m68k/translate.c in favour of either using glib g_assert_not_reached() (for the genuinely can't-happen cases) or cpu_abort() (for the "this isn't implemented", in line with other unimplemented cases in the target). This has the benefit of silencing some clang warnings about variables used while uninitialized (which are emitted because clang can't figure out that qemu_assert(0, something) never returns. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Andreas Färber <afaerber@suse.de>
* cpu: Factor out cpu_generic_init()Andreas Färber2014-03-1310-103/+62
| | | | | | | All targets using it gain the ability to set -cpu name,key=value,... options via the default TYPE_CPU CPUClass::parse_features() implementation. Signed-off-by: Andreas Färber <afaerber@suse.de>
* cpu: Implement CPUClass::parse_features() for the rest of CPUsAndreas Färber2014-03-131-1/+30
| | | | | | | | CPUs who do not provide their own implementation of feature parsing will treat each option as a QOM property and set it to the supplied value. Signed-off-by: Andreas Färber <afaerber@suse.de>
* target-sparc: Defer SPARCCPU feature inference to QOM realizeAndreas Färber2014-03-131-5/+8
| | | | | | | Gets it out of cpu_sparc_register() and aligns with target-arm. Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: Andreas Färber <afaerber@suse.de>
* target-sparc: Implement CPUClass::parse_features() for SPARCCPUAndreas Färber2014-03-131-33/+49
| | | | | | | | | Factor cpu_model parsing out of cpu_sparc_find_by_name() by passing cpu_sparc_find_by_name() the name portion only and calling CPUClass::parse_features() from cpu_sparc_register() afterwards. Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: Andreas Färber <afaerber@suse.de>
* target-sparc: Use error_report() for CPU error reportingAndreas Färber2014-03-131-8/+9
| | | | | | | Replace non-debug fprintf() with error_report(). Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: Andreas Färber <afaerber@suse.de>
* cpu: Introduce CPUClass::parse_features() hookAndreas Färber2014-03-132-15/+23
| | | | | | | | Adapt the X86CPU implementation to suit the generic hook. This involves a cleanup of error handling to cope with NULL errp. Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* target-i386: X86CPU model subclassesEduardo Habkost2014-03-132-73/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Register separate QOM types for each x86 CPU model. This will allow management code to more easily probe what each CPU model provides, by simply creating objects using the appropriate class name, without having to restart QEMU. This also allows us to eliminate the qdev_prop_set_globals_for_type() hack to set CPU-model-specific global properties. Instead of creating separate class_init functions for each class, I just used class_data to store a pointer to the X86CPUDefinition struct for each CPU model. This should make the patch shorter and easier to review. Later we can gradually convert each X86CPUDefinition field to lists of per-class property defaults. The "host" CPU model is special, as the feature flags depend on KVM being initialized. So it has its own class_init and instance_init function, and feature flags are set on instance_init instead of class_init. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Tested-by: Eduardo Habkost <ehabkost@redhat.com> [AF: Limit the host CPU type to CONFIG_KVM as build fix] Signed-off-by: Andreas Färber <afaerber@suse.de>
* target-i386: Prepare CPUClass::class_by_name for X86CPUAndreas Färber2014-03-131-3/+21
| | | | | | | Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Tested-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* target-i386: Enable x2apic by default on KVMEduardo Habkost2014-03-133-0/+3
| | | | | | | | | | | | | | | When on KVM mode, enable x2apic by default on all CPU models. Normally we try to keep the CPU model definitions as close as the real CPUs as possible, but x2apic can be emulated by KVM without host CPU support for x2apic, and it improves performance by reducing APIC access overhead. x2apic emulation is available on KVM since 2009 (Linux 2.6.32-rc1), there's no reason for not enabling x2apic by default when running KVM. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* target-i386: Introduce x86_cpu_compat_disable_kvm_features()Eduardo Habkost2014-03-133-7/+7
| | | | | | | | | | Instead of the feature-specific disable_kvm_pv_eoi() function, create a more general function that can be used to disable other feature bits in machine-type compat code. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* target-i386: Make kvm_default_features an arrayEduardo Habkost2014-03-131-4/+13
| | | | | | | | | We will later make the KVM-specific code affect other feature words, too. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* target-i386: Don't declare variables in the middle of blocksEduardo Habkost2014-03-131-3/+4
| | | | | | | | | | | Some of my recent changes introduced variable declarations in the middle of code blocks. Fix the code so that it compiles without warnings when using -Wdeclaration-after-statement. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* target-i386: Rename x86_def_t to X86CPUDefinitionEduardo Habkost2014-03-131-13/+13
| | | | | | | | | As the new X86CPU subclass code is going to change lots of the code invoving x86_def_t, let's rename the struct to match coding style first. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* target-i386: Call x86_cpu_load_def() earlierEduardo Habkost2014-03-131-5/+5
| | | | | | | | | As we will initialize the X86CPU fields on instance_init eventually, move the code that initializes the X86CPU data based on the CPU model name closer to the object_new() call. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* target-i386: Rename cpu_x86_register() to x86_cpu_load_def()Eduardo Habkost2014-03-131-2/+4
| | | | | | | | | | | There isn't any kind of "registration" involved in cpu_x86_register() anymore: it is simply looking up a CPU model name and loading the model definition data into the X86CPU object. Rename it to x86_cpu_load_def() to reflect what it does. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* cpu: Turn cpu_has_work() into a CPUClass hookAndreas Färber2014-03-1336-145/+172
| | | | | | | | | Default to false. Tidy variable naming and inline cast uses while at it. Tested-by: Jia Liu <proljc@gmail.com> (or32) Signed-off-by: Andreas Färber <afaerber@suse.de>
* target-xtensa: Clean up ENV_GET_CPU() usageAndreas Färber2014-03-132-2/+4
| | | | | | | | | | | | | Commits a00817cc4c18b7872e92765a4736fb2227cc237b and fdfba1a298ae26dd44bcfdb0429314139a0bc55a added usages of ENV_GET_CPU() macro in target-specific code. Use xtensa_env_get_cpu() instead. Cc: Max Filippov <jcmvbkbc@gmail.com> Cc: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Cc: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Andreas Färber <afaerber@suse.de>
* target-unicore32: Clean up ENV_GET_CPU() usageAndreas Färber2014-03-131-1/+1
| | | | | | | | | | | Commit fdfba1a298ae26dd44bcfdb0429314139a0bc55a added a usage of ENV_GET_CPU() macro in target-specific code. Use uc32_env_get_cpu() instead. Cc: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Cc: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Andreas Färber <afaerber@suse.de>
* target-sparc: Clean up ENV_GET_CPU() usageAndreas Färber2014-03-132-12/+9
| | | | | | | | | | | | | Commits fdfba1a298ae26dd44bcfdb0429314139a0bc55a, 2c17449b3022ca9623c4a7e2a504a4150ac4ad30 and f606604f1c10b60ef294f1b9b229426521a365e3 added usages of ENV_GET_CPU() macro in target-specific code. Use sparc_env_get_cpu() instead and reuse the variables. Cc: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Cc: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Andreas Färber <afaerber@suse.de>
OpenPOWER on IntegriCloud