summaryrefslogtreecommitdiffstats
path: root/qom/cpu.c
Commit message (Collapse)AuthorAgeFilesLines
* cpu: Move cpu_write_elfXX_note() functions to CPUStateJens Freimann2013-05-011-0/+63
| | | | | | | | | Convert cpu_write_elfXX_note() functions to CPUClass methods and pass CPUState as argument. Update target-i386 accordingly. Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com> [AF: Retain stubs as CPUClass' default method implementation; style changes] Signed-off-by: Andreas Färber <afaerber@suse.de>
* cpu: Add helper cpu_exists(), to check if CPU with specified id existsIgor Mammedov2013-05-011-0/+26
| | | | | Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* cpu: Introduce get_arch_id() method and override it for X86CPUIgor Mammedov2013-05-011-0/+6
| | | | | | | | | | | | | | get_arch_id() adds possibility for generic code to get a guest-visible CPU ID without accessing CPUArchState. If derived classes don't override it, it will return cpu_index. Override it on target-i386 in X86CPU to return the APIC ID. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: liguang <lig.fnst@cn.fujitsu.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* cpu: Introduce CPU hot-plug notifierIgor Mammedov2013-05-011-0/+12
| | | | | | | Hot-add CPU event will be distributed to acpi_piix4 and rtc_cmos. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* cpu: Resume CPU from DeviceClass::realize() if hot-pluggedIgor Mammedov2013-05-011-0/+1
| | | | | Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* cpu: Call cpu_synchronize_post_init() from DeviceClass::realize()Igor Mammedov2013-05-011-0/+6
| | | | | | | | If hotplugged, synchronize CPU state to KVM. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* exec: Pass CPUState to cpu_reset_interrupt()Andreas Färber2013-03-121-0/+5
| | | | | | | | | | | | Move it to qom/cpu.c to avoid build failures depending on include order of cpu-qom.h and exec/cpu-all.h. Change opaques of various ..._irq_handler() functions to the appropriate CPU type to facilitate using cpu_reset_interrupt(). Fix Coding Style issues while at it (missing braces, indentation). Signed-off-by: Andreas Färber <afaerber@suse.de>
* cpu: Move halted and interrupt_request fields to CPUStateAndreas Färber2013-03-121-0/+2
| | | | | | | | | | Both fields are used in VMState, thus need to be moved together. Explicitly zero them on reset since they were located before breakpoints. Pass PowerPCCPU to kvmppc_handle_halt(). Signed-off-by: Andreas Färber <afaerber@suse.de>
* cpu: Move current_tb field to CPUStateAndreas Färber2013-02-161-0/+1
| | | | | | | | | | Explictly NULL it on CPU reset since it was located before breakpoints. Change vapic_report_tpr_access() argument to CPUState. This also resolves the use of void* for cpu.h independence. Change vAPIC patch_instruction() argument to X86CPU. Signed-off-by: Andreas Färber <afaerber@suse.de>
* cpu: Move exit_request field to CPUStateAndreas Färber2013-02-161-0/+1
| | | | | | Since it was located before breakpoints field, it needs to be reset. Signed-off-by: Andreas Färber <afaerber@suse.de>
* cpu: Prepare QOM realizefnAndreas Färber2013-02-161-0/+5
| | | | | | | Overwrite the default implementation with a no-op, no longer attempting to call DeviceClass::init. Signed-off-by: Andreas Färber <afaerber@suse.de>
* cpu: Add model resolution support to CPUClassAndreas Färber2013-01-271-0/+13
| | | | | | | | | Introduce CPUClass::class_by_name and add a default implementation. Hook up the alpha and ppc implementations. Introduce a wrapper function cpu_class_by_name(). Signed-off-by: Andreas Färber <afaerber@suse.de>
* cpu: Change parent type to DeviceEduardo Habkost2013-01-081-2/+4
| | | | | | | | | | | This finally makes the CPU class a subclass of the Device class, allowing us to start using DeviceState properties on CPU subclasses. It has no_user=1, as creating CPUs using -device doesn't work yet. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* qom: move include files to include/qom/Paolo Bonzini2012-12-191-1/+1
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* qom: Introduce CPU classAndreas Färber2012-03-141-0/+58
Reintroduce CPUState as QOM object: It's abstract and derived directly from TYPE_OBJECT for compatibility with the user emulators. The identifier CPUState avoids conflicts between CPU() and the struct. Introduce $(qom-twice-y) to build it separately for system and for user emulators. Prepare a virtual reset method, (re)introduce cpu_reset() as wrapper. Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
OpenPOWER on IntegriCloud