qemu-riscv
[Top][All Lists]
Advanced

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

Re: [RFC PATCH 6/7] cpu: Move CPUClass::has_work() to TCGCPUOps


From: Philippe Mathieu-Daudé
Subject: Re: [RFC PATCH 6/7] cpu: Move CPUClass::has_work() to TCGCPUOps
Date: Thu, 4 Mar 2021 20:46:35 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0

On 3/4/21 7:15 AM, Thomas Huth wrote:
> On 02/03/2021 11.27, Philippe Mathieu-Daudé wrote:
>> We can only check if a vCPU has work with TCG.
>> Restrict the has_work() handler to TCG by moving it to
>> the TCGCPUOps structure, and adapt all the targets.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>> ---
>> RFC: PPC target incomplete
>> ---
> [...]
>> diff --git a/hw/core/cpu.c b/hw/core/cpu.c
>> index 00330ba07de..3110867c3a3 100644
>> --- a/hw/core/cpu.c
>> +++ b/hw/core/cpu.c
>> @@ -261,11 +261,6 @@ static void cpu_common_reset(DeviceState *dev)
>>       }
>>   }
>>   -static bool cpu_common_has_work(CPUState *cs)
>> -{
>> -    return false;
>> -}
>> -
>>   ObjectClass *cpu_class_by_name(const char *typename, const char
>> *cpu_model)
>>   {
>>       CPUClass *cc = CPU_CLASS(object_class_by_name(typename));
>> @@ -397,7 +392,6 @@ static void cpu_class_init(ObjectClass *klass,
>> void *data)
>>         k->parse_features = cpu_common_parse_features;
>>       k->get_arch_id = cpu_common_get_arch_id;
>> -    k->has_work = cpu_common_has_work;
>>       k->get_paging_enabled = cpu_common_get_paging_enabled;
>>       k->get_memory_mapping = cpu_common_get_memory_mapping;
>>       k->write_elf32_qemunote = cpu_common_write_elf32_qemunote;
> 
> cpu_common_has_work() is gone without replacement? Can you be sure that
> the pointer in tcg_ops is always initialized?

Oops... Good catch :)



reply via email to

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