qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v15 22/23] accel: introduce new accessor functions


From: Claudio Fontana
Subject: Re: [PATCH v15 22/23] accel: introduce new accessor functions
Date: Wed, 3 Feb 2021 15:24:57 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0

On 2/3/21 3:23 PM, Philippe Mathieu-Daudé wrote:
> 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 <cfontana@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"?
> 

Yes, thanks!

Ciao,

Claudio



reply via email to

[Prev in Thread] Current Thread [Next in Thread]