Statistics
| Branch: | Revision:

root / qom / cpu.c @ 5b50e790

History | View | Annotate | Download (7.1 kB)

# Date Author Comment
5b50e790 07/27/2013 01:04 am Andreas Färber

cpu: Introduce CPUClass::gdb_{read,write}_register()

Completes migration of target-specific code to new target-*/gdbstub.c.

Acked-by: Michael Walle <> (for lm32)
Acked-by: Max Filippov <> (for xtensa)
Signed-off-by: Andreas Färber <>

a0e372f0 07/27/2013 12:23 am Andreas Färber

cpu: Introduce CPUState::gdb_num_regs and CPUClass::gdb_num_core_regs

CPUState::gdb_num_regs replaces num_g_regs.
CPUClass::gdb_num_core_regs replaces NUM_CORE_REGS.

Allows building gdb_register_coprocessor() for xtensa, too.

As a side effect this should fix coprocessor register numbering for SMP....

91b1df8c 07/09/2013 10:33 pm Andreas Färber

cpu: Move reset logging to CPUState

x86 was using additional CPU_DUMP_* flags, so make that configurable in
CPUClass::reset_dump_flags.

This adds reset logging for alpha, unicore32 and xtensa.

Acked-by: Michael Walle <> (for lm32)
Reviewed-by: Richard Henderson <>...

c643bed9 06/28/2013 02:25 pm Andreas Färber

cpu: Change qemu_init_vcpu() argument to CPUState

This allows to move the call into CPUState's realizefn.
Therefore move the stub into libqemustub.a.

Reviewed-by: Richard Henderson <>
Signed-off-by: Andreas Färber <>

60a3e17a 06/28/2013 02:25 pm Andreas Färber

cpu: Change cpu_exit() argument to CPUState

It no longer depends on CPUArchState, so move it to qom/cpu.c.

Prepares for changing GDBState::c_cpu to CPUState.

Signed-off-by: Andreas Färber <>

878096ee 06/28/2013 02:25 pm Andreas Färber

cpu: Turn cpu_dump_{state,statistics}() into CPUState hooks

Make cpustats monitor command available unconditionally.

Prepares for changing kvm_handle_internal_error() and kvm_cpu_exec()
arguments to CPUState.

Signed-off-by: Andreas Färber <>

6db297ea 06/11/2013 07:18 pm Andreas Färber

cpu: Change default for CPUClass::get_paging_enabled()

qemu_get_guest_memory_mapping() uses cpu_paging_enabled() to determine
whether to use cpu_get_memory_mapping() to return mappings or whether to
fall back to a simple identity map.

Since by default CPUClass::get_memory_mapping() is not implemented,...

a23bbfda 06/11/2013 07:03 pm Andreas Färber

cpu: Turn cpu_get_memory_mapping() into a CPUState hook

Change error reporting from return value to Error argument.

Reviewed-by: Jens Freimann <>
Reviewed-by: Luiz Capitulino <>
[AF: Fixed cpu_get_memory_mapping() documentation]...

444d5590 06/11/2013 06:50 pm Andreas Färber

cpu: Turn cpu_paging_enabled() into a CPUState hook

Relocate assignment of x86 get_arch_id to have all hooks in one place.

Reviewed-by: Jens Freimann <>
Reviewed-by: Luiz Capitulino <>
Signed-off-by: Andreas Färber <>

c72bf468 05/01/2013 02:04 pm Jens Freimann

cpu: Move cpu_write_elfXX_note() functions to CPUState

Convert cpu_write_elfXX_note() functions to CPUClass methods and pass
CPUState as argument. Update target-i386 accordingly.

Signed-off-by: Jens Freimann <>
[AF: Retain stubs as CPUClass' default method implementation; style changes]...

997395d3 05/01/2013 02:04 pm Igor Mammedov

cpu: Introduce get_arch_id() method and override it for X86CPU

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....

69e5ff06 05/01/2013 02:04 pm Igor Mammedov

cpu: Add helper cpu_exists(), to check if CPU with specified id exists

Signed-off-by: Igor Mammedov <>
Signed-off-by: Andreas Färber <>

13eed94e 05/01/2013 02:04 pm Igor Mammedov

cpu: Call cpu_synchronize_post_init() from DeviceClass::realize()

If hotplugged, synchronize CPU state to KVM.

Signed-off-by: Igor Mammedov <>
Reviewed-by: Eduardo Habkost <>
Signed-off-by: Andreas Färber <>

6afb4721 05/01/2013 02:04 pm Igor Mammedov

cpu: Resume CPU from DeviceClass::realize() if hot-plugged

Signed-off-by: Igor Mammedov <>
Signed-off-by: Andreas Färber <>

066e9b27 05/01/2013 02:04 pm Igor Mammedov

cpu: Introduce CPU hot-plug notifier

Hot-add CPU event will be distributed to acpi_piix4 and rtc_cmos.

Signed-off-by: Igor Mammedov <>
Signed-off-by: Andreas Färber <>

259186a7 03/12/2013 11:35 am Andreas Färber

cpu: Move halted and interrupt_request fields to CPUState

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 <>

d8ed887b 03/12/2013 11:35 am Andreas Färber

exec: Pass CPUState to cpu_reset_interrupt()

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()....

fcd7d003 02/16/2013 03:51 pm Andreas Färber

cpu: Move exit_request field to CPUState

Since it was located before breakpoints field, it needs to be reset.

Signed-off-by: Andreas Färber <>

d77953b9 02/16/2013 03:51 pm Andreas Färber

cpu: Move current_tb field to CPUState

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....

4f658099 02/16/2013 03:50 pm Andreas Färber

cpu: Prepare QOM realizefn

Overwrite the default implementation with a no-op, no longer
attempting to call DeviceClass::init.

Signed-off-by: Andreas Färber <>

2b8c2754 01/27/2013 03:52 pm Andreas Färber

cpu: Add model resolution support to CPUClass

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 <>

961f8395 01/08/2013 10:03 pm Eduardo Habkost

cpu: Change parent type to Device

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 <>...

14cccb61 12/19/2012 09:31 am Paolo Bonzini

qom: move include files to include/qom/

Signed-off-by: Paolo Bonzini <>

dd83b06a 03/14/2012 11:20 pm Andreas Färber

qom: Introduce CPU class

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...