Statistics
| Branch: | Revision:

root / target-arm / cpu.c @ 5b50e790

History | View | Annotate | Download (27.5 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....

00b941e5 07/23/2013 03:41 am Andreas Färber

cpu: Turn cpu_get_phys_page_debug() into a CPUClass hook

Change breakpoint_invalidate() argument to CPUState alongside.

Since all targets now assign a softmmu-only field, we can drop helpers
cpu_class_set_{do_unassigned_access,vmsd}() and device_class_set_vmsd()....

f45748f1 07/23/2013 03:41 am Andreas Färber

cpu: Introduce CPUClass::set_pc() for gdb_set_cpu_pc()

This moves setting the Program Counter from gdbstub into target code.
Use vaddr type as upper-bound replacement for target_ulong.

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

81e69fb0 07/15/2013 04:35 pm Mans Rullgard

target-arm: add feature flag for ARMv8

Signed-off-by: Mans Rullgard <>
Reviewed-by: Peter Maydell <>
Signed-off-by: Peter Maydell <>

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

log: Change log_cpu_state[_mask]() argument to CPUState

Since commit 878096eeb278a8ac1ccd6667af73e026f29b4cf5 (cpu: Turn
cpu_dump_{state,statistics}() into CPUState hooks) CPUArchState is no
longer needed.

Add documentation and make the functions available through qemu/log.h...

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

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

721fae12 06/25/2013 08:16 pm Peter Maydell

target-arm: Convert TCG to using (index,value) list for cp migration

Convert the TCG ARM target to using an (index,value) list for migrating
coprocessors. The primary benefit of the (index,value) list is for
passing state between KVM and QEMU, but it works for TCG-to-TCG...

bdcc150d 06/25/2013 08:16 pm Peter Maydell

target-arm: Make LPAE feature imply V7MP

The v7 ARM ARM specifies that the Large Physical Address
Extension requires implementation of the Multiprocessing
Extensions, so make our LPAE feature imply V7MP rather
than specifying both in the A15 CPU initfn.
...

3cc1d208 04/19/2013 02:24 pm Juan Quintela

target-arm: port ARM CPU save/load to use VMState

Port the ARM CPU save/load code to use VMState. Some state is
saved in a slightly different order to simplify things -- for
example arrays are saved one after the other rather than 'striped',
and we always save all 32 VFP registers even if the CPU happens...

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

cpu: Replace do_interrupt() by CPUClass::do_interrupt method

This removes a global per-target function and thus takes us one step
closer to compiling multiple targets into one executable.

It will also allow to override the interrupt handling for certain CPU...

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

target-arm: Override do_interrupt for ARMv7-M profile

Enable ARMCPUInfo to specify a custom class_init functions.
Introduce arm_v7m_class_init() and use it for "cortex-m3" model.

Instead of forwarding from arm_cpu_do_interrupt() to do_interrupt_v7m(),
override CPUClass::do_interrupt with arm_v7m_cpu_do_interrupt()...

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

cpu: Add CPUArchState pointer to CPUState

The target-specific ENV_GET_CPU() macros have allowed us to navigate
from CPUArchState to CPUState. The reverse direction was not supported.
Avoid introducing CPU_GET_ENV() macros by initializing an untyped
pointer that is initialized in derived instance_init functions....

79614b78 02/16/2013 03:50 pm Andreas Färber

target-arm: Move TCG initialization to ARMCPU initfn

Ensures that a QOM-created ARMCPU is usable.

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

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

target-arm: Update ARMCPU to QOM realizefn

Turn arm_cpu_realize() into a QOM realize function, no longer called
via cpu.h prototype. To maintain the semantics of cpu_init(), set
realized = true explicitly in cpu_arm_init().

Move GDB coprocessor registration, CPU reset and vCPU initialization...

51492fd1 01/30/2013 06:03 pm Andreas Färber

target-arm: Rename CPU types

In the initial conversion of CPU models to QOM types, model names were
mapped 1:1 to type names. As a side effect this gained us a type "any",
which is now a device.

To avoid "-device any" silliness and to pave the way for compiling...

245fb54d 01/28/2013 12:33 am Andreas Färber

target-arm: Catch attempt to instantiate abstract type in cpu_init()

This fixes -cpu arm-cpu asserting.

Cc:
Acked-by: Peter Maydell <>
Signed-off-by: Andreas Färber <>

5900d6b2 01/27/2013 03:52 pm Andreas Färber

target-arm: Detect attempt to instantiate non-CPU type in cpu_init()

Consolidate model checking into a new arm_cpu_class_by_name().

If the name matches an existing type, also check whether that type is
actually (a sub-type of) TYPE_ARM_CPU.

This fixes, e.g., -cpu tmp105 asserting....

55e5c285 01/15/2013 05:09 am Andreas Färber

cpu: Move cpu_index field to CPUState

Note that target-alpha accesses this field from TCG, now using a
negative offset. Therefore the field is placed last in CPUState.

Pass PowerPCCPU to [kvm]ppc_fixup_cpu() to facilitate this change.

Move common parts of mips cpu_state_reset() to mips_cpu_reset()....

918fd083 01/11/2013 05:21 pm Eduardo Habkost

target-arm: use type_register() instead of type_register_static()

The type_register_static() interface is documented as:

type_register_static:
@info: The #TypeInfo of the new type.
@info and all of the strings it points to should exist for the life...
9c17d615 12/19/2012 09:32 am Paolo Bonzini

softmmu: move include files to include/sysemu/

Signed-off-by: Paolo Bonzini <>

de9b05b8 07/12/2012 01:59 pm Peter Maydell

target-arm: Implement privileged-execute-never (PXN)

Implement the privileged-execute-never (PXN) translation table bit.
It is implementation-defined whether this is implemented, so we give
it its own ARM_FEATURE_ flag. LPAE requires PXN, so add also an
LPAE feature flag and the implication logic, as a placeholder...

918f5dca 07/12/2012 01:59 pm Peter Maydell

target-arm: Extend feature flags to 64 bits

Extend feature flags to 64 bits, as we've just run out of space
in the 32 bit integer we were using for them.

Signed-off-by: Peter Maydell <>

b2d06f96 06/20/2012 03:13 pm Peter Maydell

target-arm: Remove ARM_CPUID_* macros

All the uses of ARM_CPUID() to vary behaviour have now been
removed, so we can delete the ARM_CPUID_* macros now.
The one exception is the TI915T/925T, because of its odd behaviour
where the MIDR value can be changed at runtime....

7884849c 06/20/2012 03:11 pm Peter Maydell

target-arm: Convert final ID registers

Convert the final ID registers to the new cp15 scheme.

Signed-off-by: Peter Maydell <>

81bdde9d 06/20/2012 03:10 pm Peter Maydell

target-arm: Convert MPIDR

Convert the MPIDR to the new cp15 register scheme.
This includes giving it its own feature bit rather
than doing a CPUID value check.

Signed-off-by: Peter Maydell <>

776d4e5c 06/20/2012 03:10 pm Peter Maydell

target-arm: Convert cp15 cache ID registers

Convert the cp15 cache ID registers to the new scheme.

Signed-off-by: Peter Maydell <>

8515a092 06/20/2012 03:09 pm Peter Maydell

target-arm: Convert cp15 crn=0 crm={1,2} feature registers

Convert the cp15 crn=0 crm={1,2} features registers to
the new cp reg framework.

Signed-off-by: Peter Maydell <>

2771db27 06/20/2012 03:08 pm Peter Maydell

target-arm: Convert cp15 crn=1 registers

Convert the cp15 crn=1 registers to the new scheme.

Signed-off-by: Peter Maydell <>

34f90529 06/20/2012 03:08 pm Peter Maydell

target-arm: Convert cp15 crn=9 registers

Convert cp15 crn=9 registers (mostly cache lockdown) to the new scheme.

Note that this change makes OMAPCP cores RAZ/WI the whole c9 space. This is
a change from previous behaviour, but a return to the behaviour of commit...

06d76f31 06/20/2012 03:08 pm Peter Maydell

target-arm: Convert cp15 crn=6 registers

Convert the cp15 crn=6 registers to the new scheme.
Note that this includes some minor tidyup: drop an unnecessary
underdecoding of op2 on OMAPCP cores, and only implement the
pre-v6 c6,c0,0,1 IFAR on the 1026 and not on the other ARMv5...

c4804214 06/20/2012 03:07 pm Peter Maydell

target-arm: convert cp15 crn=7 registers

Convert the cp15 crn=7 registers to the new scheme.
Note that to do this we have to distinguish some registers
used on the ARM9 and ARM10 from some which are ARM1176
only. This is because the old code returned a value of 0...

1047b9d7 06/20/2012 03:06 pm Peter Maydell

target-arm: Convert cp15 crn=15 registers

Convert the cp15 crn=15 (implementation specific) registers
to the new scheme.

Signed-off-by: Peter Maydell <>

ecce5c3c 06/20/2012 03:05 pm Peter Maydell

target-arm: Convert cp15 crn=2 registers

Convert the cp15 crn=2 registers (MMU page table control,
MPU cache control) to the new scheme.

Signed-off-by: Peter Maydell <>

200ac0ef 06/20/2012 03:05 pm Peter Maydell

target-arm: Convert performance monitor registers

Convert the v7 performance monitor cp15 registers to
the new scheme.

Signed-off-by: Peter Maydell <>

2ceb98c0 06/20/2012 03:02 pm Peter Maydell

target-arm: Add register_cp_regs_for_features()

Add new function register_cp_regs_for_features() as a place to
register coprocessor registers dependent on feature flags.

Signed-off-by: Peter Maydell <>

4b6a83fb 06/20/2012 03:01 pm Peter Maydell

target-arm: initial coprocessor register framework

Initial infrastructure for data-driven registration of
coprocessor register implementations.

We still fall back to the old-style switch statements pending
complete conversion of all existing registers.
...

200bf596 06/20/2012 03:00 pm Peter Maydell

target-arm: Fix 11MPCore cache type register value

Make the 11MPCore report a valid value in its cache type register
(the previous value appears to have been incorrectly copied from
the 1136/1176). In particular, do not report that we have an
aliasing VIPT cache, because this causes Linux to attempt to use...

c5fad12f 04/27/2012 02:06 pm Peter Maydell

target-arm: Move A9 config_base_address reset value to ARMCPU

Move the A9 config_base_address cp15 register reset value to
ARMCPU. This should become a QOM property so that the Highbank
board can set it without having to pull in cpu-qom.h, but at
least this avoids the implicit dependency on reset ordering...

778c3a06 04/27/2012 02:04 pm Andreas Färber

target-arm: Change cpu_arm_init() return type to ARMCPU

Make cpu_arm_init() return a QOM ARMCPU, so that we don't need to
obtain an ARMCPU through arm_env_get_cpu() in machine init code.
This requires to adjust the inclusion site of cpu-qom.h and in turn,...

3c30dd5a 04/21/2012 09:13 pm Peter Maydell

target-arm: Move reset handling to arm_cpu_reset

Now that cpu_reset_model_id() has gone we can move the
reset code over to the class reset function and have cpu_state_reset
simply do a reset on the CPU QOM object.

Signed-off-by: Peter Maydell <>...

85df3786 04/21/2012 09:12 pm Peter Maydell

target-arm: Move cache ID register setup to cpu specific init fns

Move cache ID register reset out of cpu_reset_model_id() by
creating a field for the reset value in ARMCPU and setting it
up in the cpu specific init functions.

Signed-off-by: Peter Maydell <>...

2e4d7e3e 04/21/2012 09:11 pm Peter Maydell

target-arm: Move feature register setup to per-CPU init fns

Move feature register value setup to per-CPU init functions.

Signed-off-by: Peter Maydell <>
Acked-by: Andreas Färber <>

0ca7e01c 04/21/2012 09:10 pm Peter Maydell

target-arm: Move SCTLR reset value setup to per cpu init fns

Move the reset value of SCTLR to ARMCPU, initialised in
the per-cpu init functions. It can then be reset by a
simple copy, and we can drop the code from cpu_reset_model_id().

Signed-off-by: Peter Maydell <>...

64e1671f 04/21/2012 09:09 pm Peter Maydell

target-arm: Move CTR setup to per cpu init fns

Move CTR (cache type register) value to an ARMCPU field
set up by per-cpu init fns.

Signed-off-by: Peter Maydell <>
Acked-by: Andreas Färber <>

bd35c355 04/21/2012 09:09 pm Peter Maydell

target-arm: Move MVFR* setup to per cpu init fns

Move the MVFR* VFP feature register values to ARMCPU,
so they are set up by the implementation-specific instance
init functions rather than in cpu_reset_model_id().

Signed-off-by: Peter Maydell <>...

325b3cef 04/21/2012 09:08 pm Peter Maydell

target-arm: Move FPSID config to cpu init fns

Move the reset FPSID to the ARMCPU struct, and set it in the
per-implementation instance init function. At reset we then
just copy the reset value into the CPUARMState field.

Signed-off-by: Peter Maydell <>...

581be094 04/21/2012 09:07 pm Peter Maydell

target-arm: Move feature bit settings to CPU init fns

Move the setting of the feature bits from cpu_reset_model_id()
to each CPU's instance init function. This requires us to move
the features field in CPUARMState so that it is not cleared
on reset.

Signed-off-by: Peter Maydell <>...

777dc784 04/21/2012 09:06 pm Peter Maydell

target-arm: Add QOM subclasses for each ARM cpu implementation

Register subclasses for each ARM CPU implementation.

Let arm_cpu_list() enumerate CPU subclasses in alphabetical order,
except for special value "any".

Replace cpu_arm_find_by_name()'s string -> CPUID lookup by storing the...

dec9c2d4 03/29/2012 06:42 pm Andreas Färber

target-arm: Minimalistic CPU QOM'ification

Introduce only one non-abstract type TYPE_ARM_CPU and do not touch
cp15 registers to not interfere with Peter's ongoing remodelling.
Embed CPUARMState as first (additional) field of ARMCPU.

Let CPUClass::reset() call cpu_state_reset() for now....