summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-03-13virtio-console-test: Test virtserialport as wellAndreas Färber1-6/+13
A test is only as good as its coverage - testing virtserialport in addition to virtconsole showed that commit 0399a3819b27083ba69b88a9baa9025facab85bd (virtio-console: QOM cast cleanup for VirtConsole) broke virtserialport. Acked-by: Richard W.M. Jones <rjones@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13virtio-console: Fix VIRTIO_CONSOLE() cast macroAndreas Färber1-18/+6
Commit 0399a3819b27083ba69b88a9baa9025facab85bd (virtio-console: QOM cast cleanup for VirtConsole) broke virtserialport since it shares functions and state struct with virtconsole. Let virtconsole inherit from virtserialport, and use virtserialport type for casting. Note that virtio-serial-port is the abstract base type in virtio-serial-bus.c, whereas virtserialport is the user-instantiatable type in virtio-console.c. Therefore using TYPE_VIRTIO_CONSOLE_SERIAL_PORT. Reported-by: Richard W.M. Jones <rjones@redhat.com> Acked-by: Richard W.M. Jones <rjones@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13Merge remote-tracking branch 'remotes/afaerber/tags/prep-for-2.0' into stagingPeter Maydell4-40/+57
PReP machine and devices * ppc_rom.bin update * Raven PCI host bridge preparations for OpenBIOS # gpg: Signature made Thu 13 Mar 2014 19:28:37 GMT using RSA key ID 3E7E013F # gpg: Good signature from "Andreas Färber <afaerber@suse.de>" # gpg: aka "Andreas Färber <afaerber@suse.com>" * remotes/afaerber/tags/prep-for-2.0: raven: Move BIOS loading from board code to PCI host prep: Update ppc_rom.bin Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-03-13spapr: Fix return value of vga initializationMark Wu2-2/+5
Before spapr_vga_init will returned false if the vga is specified by the command '-device VGA' because vga_interface_type was evaluated to VGA_NONE. With the change in previous patch of this series, spapr_vga_init should return true if it's told that the vga will be initialized in flow of the generic devices initialization. To keep '-nodefaults' have the semantics of bare minimum, it adds a check of 'has_defaults' in usb_enabled() to avoid that a USB controller is added by '-nodefautls, -device VGA' implicitly. This patch also makes two cleanups: 1. skip initialization for VGA_NONE 2. remove the useless 'break' Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Mark Wu <wudxw@linux.vnet.ibm.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13Fix vga_interface_type for command line argument '-device VGA'Mark Wu2-21/+23
Some machine (like pseries) initialization code determines if it has graphics according to vga_interface_type. In the original code, vga_interface_type is evaluated to VGA_NONE even if a VGA is added via '-device VGA'. It causes the machine not aware of the graphics device configured. Add a new VGA device type to indicate that it has a VGA device, which will be initialized in QOM device initialization. Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Mark Wu <wudxw@linux.vnet.ibm.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13raven: Move BIOS loading from board code to PCI hostHervé Poussineau2-40/+57
Raven datasheet explains where firmware lives in system memory, so do it there instead of in board code. Other boards using the same PCI host will not have to copy the firmware loading code. Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> [AF: Drop BIOS size workaround in favor of replacing our firmware blob] Signed-off-by: Andreas Färber <andreas.faerber@web.de>
2014-03-13prep: Update ppc_rom.binAndreas Färber2-0/+0
This increases file size from 512 KiB to 1 MiB. Signed-off-by: Andreas Färber <andreas.faerber@web.de>
2014-03-13Merge remote-tracking branch 'remotes/afaerber/tags/qom-cpu-for-2.0' into ↵Peter Maydell155-1882/+2450
staging QOM CPUState refactorings / X86CPU * Deadlock fix for exit requests around CPU reset * X86CPU x2apic for KVM * X86CPU model subclasses * SPARCCPU preparations for model subclasses * -cpu arguments for arm, cris, lm32, moxie, openrisc, ppc, sh4, uc32 * m68k assertion cleanups * CPUClass hooks for cpu.h inline functions * Field movements from CPU_COMMON to CPUState and follow-up cleanups # gpg: Signature made Thu 13 Mar 2014 19:06:56 GMT using RSA key ID 3E7E013F # gpg: Good signature from "Andreas Färber <afaerber@suse.de>" # gpg: aka "Andreas Färber <afaerber@suse.com>" * remotes/afaerber/tags/qom-cpu-for-2.0: (58 commits) user-exec: Change exception_action() argument to CPUState cputlb: Change tlb_set_page() argument to CPUState cputlb: Change tlb_flush() argument to CPUState cputlb: Change tlb_flush_page() argument to CPUState target-microblaze: Replace DisasContext::env field with MicroBlazeCPU target-cris: Replace DisasContext::env field with CRISCPU exec: Change cpu_abort() argument to CPUState exec: Change memory_region_section_get_iotlb() argument to CPUState cputlb: Change tlb_unprotect_code_phys() argument to CPUState cpu-exec: Change cpu_resume_from_signal() argument to CPUState exec: Change cpu_breakpoint_{insert,remove{,_by_ref,_all}} argument exec: Change cpu_watchpoint_{insert,remove{,_by_ref,_all}} argument target-ppc: Use PowerPCCPU in PowerPCCPUClass::handle_mmu_fault hook translate-all: Change tb_flush_jmp_cache() argument to CPUState translate-all: Change tb_gen_code() argument to CPUState translate-all: Change cpu_io_recompile() argument to CPUState translate-all: Change tb_check_watchpoint() argument to CPUState translate-all: Change cpu_restore_state_from_tb() argument to CPUState translate-all: Change cpu_restore_state() argument to CPUState cpu-exec: Change cpu_loop_exit() argument to CPUState ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-03-13user-exec: Change exception_action() argument to CPUStateAndreas Färber1-6/+5
Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13cputlb: Change tlb_set_page() argument to CPUStateAndreas Färber20-34/+33
Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13cputlb: Change tlb_flush() argument to CPUStateAndreas Färber41-87/+143
Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13cputlb: Change tlb_flush_page() argument to CPUStateAndreas Färber18-70/+106
Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13target-microblaze: Replace DisasContext::env field with MicroBlazeCPUAndreas Färber1-44/+43
This cleans up some mb_env_get_cpu() needed for cpu_abort(). Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13target-cris: Replace DisasContext::env field with CRISCPUAndreas Färber2-16/+16
This cleans up repeated cris_env_get_cpu() for cpu_abort(). Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13exec: Change cpu_abort() argument to CPUStateAndreas Färber41-206/+301
Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13Merge remote-tracking branch 'remotes/kraxel/tags/pull-input-6' into stagingPeter Maydell2-0/+24
input: activate legacy kbd gtk: Add mouse wheel support # gpg: Signature made Thu 13 Mar 2014 10:34:17 GMT using RSA key ID D3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" * remotes/kraxel/tags/pull-input-6: gtk: Add mouse wheel support input: activate legacy kbd Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-03-13exec: Change memory_region_section_get_iotlb() argument to CPUStateAndreas Färber3-4/+3
It no longer needs CPUArchState since moving watchpoints to CPUState. Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13cputlb: Change tlb_unprotect_code_phys() argument to CPUStateAndreas Färber3-5/+5
Note that the argument is unused. Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13cpu-exec: Change cpu_resume_from_signal() argument to CPUStateAndreas Färber9-14/+11
Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13exec: Change cpu_breakpoint_{insert,remove{,_by_ref,_all}} argumentAndreas Färber9-46/+43
Use CPUState. Allows to clean up CPUArchState in gdbstub. Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13exec: Change cpu_watchpoint_{insert,remove{,_by_ref,_all}} argumentAndreas Färber10-43/+58
Use CPUState. This lets us drop a few local env usages. Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13target-ppc: Use PowerPCCPU in PowerPCCPUClass::handle_mmu_fault hookAndreas Färber6-10/+14
Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13translate-all: Change tb_flush_jmp_cache() argument to CPUStateAndreas Färber3-4/+3
Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13translate-all: Change tb_gen_code() argument to CPUStateAndreas Färber5-9/+10
Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13translate-all: Change cpu_io_recompile() argument to CPUStateAndreas Färber3-5/+5
Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13translate-all: Change tb_check_watchpoint() argument to CPUStateAndreas Färber3-4/+4
Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13translate-all: Change cpu_restore_state_from_tb() argument to CPUStateAndreas Färber1-8/+7
And normalize the argument order. Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13translate-all: Change cpu_restore_state() argument to CPUStateAndreas Färber24-63/+46
This lets us drop some local variables in tlb_fill() functions. Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13cpu-exec: Change cpu_loop_exit() argument to CPUStateAndreas Färber28-67/+64
Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13exec: Change tlb_fill() argument to CPUStateAndreas Färber18-61/+91
Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13cpu: Move breakpoints field from CPU_COMMON to CPUStateAndreas Färber43-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>
2014-03-13cpu: Move watchpoint fields from CPU_COMMON to CPUStateAndreas Färber13-47/+60
Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13cpu: Move opaque field from CPU_COMMON to CPUStateAndreas Färber13-48/+72
Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13cpu: Move exception_index field from CPU_COMMON to CPUStateAndreas Färber60-319/+389
Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13cpu: Move jmp_env field from CPU_COMMON to CPUStateAndreas Färber4-6/+9
Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13cpu: Move tb_jmp_cache field from CPU_COMMON to CPUStateAndreas Färber6-16/+16
Clear it on reset. Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13cpu: Move icount_decr field from CPU_COMMON to CPUStateAndreas Färber7-38/+40
Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13cpu: Move icount_extra field from CPU_COMMON to CPUStateAndreas Färber5-13/+15
Reset it. Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13cpu: Move can_do_io field from CPU_COMMON to CPUStateAndreas Färber8-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>
2014-03-13cpu: Move mem_io_{pc,vaddr} fields from CPU_COMMON to CPUStateAndreas Färber8-25/+31
Reset them. Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13cpu: Turn cpu_handle_mmu_fault() into a CPUClass hookAndreas Färber61-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>
2014-03-13target-m68k: Remove custom qemu_assert() functionPeter Maydell1-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>
2014-03-13cpu: Factor out cpu_generic_init()Andreas Färber10-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>
2014-03-13cpu: Implement CPUClass::parse_features() for the rest of CPUsAndreas Färber1-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>
2014-03-13target-sparc: Defer SPARCCPU feature inference to QOM realizeAndreas Färber1-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>
2014-03-13target-sparc: Implement CPUClass::parse_features() for SPARCCPUAndreas Färber1-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>
2014-03-13target-sparc: Use error_report() for CPU error reportingAndreas Färber1-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>
2014-03-13cpu: Introduce CPUClass::parse_features() hookAndreas Färber2-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>
2014-03-13target-i386: X86CPU model subclassesEduardo Habkost2-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>
2014-03-13target-i386: Prepare CPUClass::class_by_name for X86CPUAndreas Färber1-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>