On 2/1/21 11:09 AM, Claudio Fontana wrote: > avoid open coding the accesses to cpu->accel_cpu interfaces, > and instead introduce: > > accel_cpu_instance_init, > accel_cpu_realizefn > > to be used by the targets/ initfn code, > and by cpu_exec_realizefn respectively. > > Add warnings about the use of target-specific headers. > > Signed-off-by: Claudio Fontana <cfont...@suse.de> > --- > include/hw/core/accel-cpu.h | 11 +++++++---- > include/qemu/accel.h | 13 +++++++++++++ > accel/accel-common.c | 19 +++++++++++++++++++ > cpu.c | 6 +----- > target/i386/cpu.c | 9 ++------- > 5 files changed, 42 insertions(+), 16 deletions(-) > > diff --git a/include/hw/core/accel-cpu.h b/include/hw/core/accel-cpu.h > index c7c137dc9a..24a6697412 100644 > --- a/include/hw/core/accel-cpu.h > +++ b/include/hw/core/accel-cpu.h > @@ -1,5 +1,6 @@ > /* > * Accelerator interface, specializes CPUClass > + * This header is used only by target-specific code. > * > * Copyright 2021 SUSE LLC > * > @@ -11,10 +12,12 @@ > #define ACCEL_CPU_H > > /* > - * these defines cannot be in cpu.h, because we are using > - * CPU_RESOLVING_TYPE here. > - * Use this header to define your accelerator-specific > - * cpu-specific accelerator interfaces. > + * This header is used to define new accelerator-specific target-specific > + * accelerator cpu subclasses. > + * It uses CPU_RESOLVING_TYPE, so this is clearly target-specific. > + * > + * Do not try to use for any other purpose than the implementation of new > + * subclasses in target/, or the accel implementation itself in accel/ > */
Squash to patch #18 "accel: introduce AccelCPUClass extending CPUClass"?