#
44246e71 |
| 23-Mar-2025 |
Philippe Mathieu-Daudé <philmd@linaro.org> |
accel: Make AccelCPUClass structure target-agnostic
Move the target-agnostic parts of "accel/accel-cpu-target.h" to "accel/accel-cpu.h".
Doing so we need to include missing "hw/core/cpu.h" header i
accel: Make AccelCPUClass structure target-agnostic
Move the target-agnostic parts of "accel/accel-cpu-target.h" to "accel/accel-cpu.h".
Doing so we need to include missing "hw/core/cpu.h" header in "accel/accel-cpu.h" otherwise we get:
include/accel/accel-cpu-target.h:39:28: error: unknown type name 'CPUClass' 39 | void (*cpu_class_init)(CPUClass *cc); | ^
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20250417165430.58213-7-philmd@linaro.org>
show more ...
|
#
217e7202 |
| 23-Jan-2025 |
Philippe Mathieu-Daudé <philmd@linaro.org> |
accel/accel-cpu-target.h: Include missing 'cpu.h' header
CPU_RESOLVING_TYPE is declared per target in "cpu.h". Include it (along with "qom/object.h") to avoid when moving code around:
include/acc
accel/accel-cpu-target.h: Include missing 'cpu.h' header
CPU_RESOLVING_TYPE is declared per target in "cpu.h". Include it (along with "qom/object.h") to avoid when moving code around:
include/accel/accel-cpu-target.h:26:50: error: expected ')' 26 | DECLARE_CLASS_CHECKERS(AccelCPUClass, ACCEL_CPU, TYPE_ACCEL_CPU) | ^ include/accel/accel-cpu-target.h:23:33: note: expanded from macro 'TYPE_ACCEL_CPU' 23 | #define TYPE_ACCEL_CPU "accel-" CPU_RESOLVING_TYPE | ^ include/accel/accel-cpu-target.h:26:1: note: to match this '(' 26 | DECLARE_CLASS_CHECKERS(AccelCPUClass, ACCEL_CPU, TYPE_ACCEL_CPU) | ^ include/qom/object.h:196:14: note: expanded from macro 'DECLARE_CLASS_CHECKERS' 196 | { return OBJECT_GET_CLASS(ClassType, obj, TYPENAME); } \ | ^ include/qom/object.h:558:5: note: expanded from macro 'OBJECT_GET_CLASS' 558 | OBJECT_CLASS_CHECK(class, object_get_class(OBJECT(obj)), name) | ^ include/qom/object.h:544:74: note: expanded from macro 'OBJECT_CLASS_CHECK' 544 | ((class_type *)object_class_dynamic_cast_assert(OBJECT_CLASS(class), (name), \ | ^
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Acked-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20250123234415.59850-13-philmd@linaro.org>
show more ...
|
#
b12a0f85 |
| 23-Jan-2025 |
Philippe Mathieu-Daudé <philmd@linaro.org> |
accel: Rename 'hw/core/accel-cpu.h' -> 'accel/accel-cpu-target.h'
AccelCPUClass is for accelerator to initialize target specific features of a vCPU. Not really related to hardware emulation, rename
accel: Rename 'hw/core/accel-cpu.h' -> 'accel/accel-cpu-target.h'
AccelCPUClass is for accelerator to initialize target specific features of a vCPU. Not really related to hardware emulation, rename "hw/core/accel-cpu.h" as "accel/accel-cpu-target.h" (using the explicit -target suffix).
More importantly, target specific header often access the target specific definitions which are in each target/FOO/cpu.h header, usually included generically as "cpu.h" relative to target/FOO/. However, there is already a "cpu.h" in hw/core/ which takes precedence. This change allows "accel-cpu-target.h" to include a target "cpu.h".
Mechanical change doing:
$ git mv include/hw/core/accel-cpu.h \ include/accel/accel-cpu-target.h $ sed -i -e 's,hw/core/accel-cpu.h,accel/accel-cpu-target.h,' \ $(git grep -l hw/core/accel-cpu.h)
and renaming header guard 'ACCEL_CPU_TARGET_H'.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20250123234415.59850-12-philmd@linaro.org>
show more ...
|
#
6294e502 |
| 03-Oct-2023 |
Philippe Mathieu-Daudé <philmd@linaro.org> |
accel: Rename AccelCPUClass::cpu_realizefn() -> cpu_target_realize()
The AccelCPUClass::cpu_realizefn handler is meant for target specific code, rename it using '_target_' to emphasis it.
Suggested
accel: Rename AccelCPUClass::cpu_realizefn() -> cpu_target_realize()
The AccelCPUClass::cpu_realizefn handler is meant for target specific code, rename it using '_target_' to emphasis it.
Suggested-by: Claudio Fontana <cfontana@suse.de> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20231003123026.99229-3-philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
#
9ea057dc |
| 22-Mar-2021 |
Claudio Fontana <cfontana@suse.de> |
accel-cpu: make cpu_realizefn return a bool
overall, all devices' realize functions take an Error **errp, but return void.
hw/core/qdev.c code, which realizes devices, therefore does:
local_err =
accel-cpu: make cpu_realizefn return a bool
overall, all devices' realize functions take an Error **errp, but return void.
hw/core/qdev.c code, which realizes devices, therefore does:
local_err = NULL; dc->realize(dev, &local_err); if (local_err != NULL) { goto fail; }
However, we can improve at least accel_cpu to return a meaningful bool value.
Signed-off-by: Claudio Fontana <cfontana@suse.de> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20210322132800.7470-9-cfontana@suse.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
fb6916dd |
| 04-Feb-2021 |
Claudio Fontana <cfontana@suse.de> |
accel: introduce AccelCPUClass extending CPUClass
add a new optional interface to CPUClass, which allows accelerators to extend the CPUClass with additional accelerator-specific initializations.
Th
accel: introduce AccelCPUClass extending CPUClass
add a new optional interface to CPUClass, which allows accelerators to extend the CPUClass with additional accelerator-specific initializations.
This will allow to separate the target cpu code that is specific to each accelerator, and register it automatically with object hierarchy lookup depending on accelerator code availability, as part of the accel_init_interfaces() initialization step.
Signed-off-by: Claudio Fontana <cfontana@suse.de> Message-Id: <20210204163931.7358-19-cfontana@suse.de> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|