[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 :)
- [RFC PATCH 0/7] cpu: Move CPUClass::has_work() to TCGCPUOps, Philippe Mathieu-Daudé, 2021/03/02
- [PATCH 1/7] sysemu/tcg: Restrict tcg_exec_init() to CONFIG_TCG, Philippe Mathieu-Daudé, 2021/03/02
- [PATCH 2/7] sysemu/tcg: Restrict qemu_tcg_mttcg_enabled() to TCG, Philippe Mathieu-Daudé, 2021/03/02
- [PATCH 3/7] target/arm: Directly use arm_cpu_has_work instead of CPUClass::has_work, Philippe Mathieu-Daudé, 2021/03/02
- [PATCH 4/7] target/s390x: Move s390_cpu_has_work to excp_helper.c, Philippe Mathieu-Daudé, 2021/03/02
- [RFC PATCH 5/7] cpu: Declare cpu_has_work() in 'sysemu/tcg.h', Philippe Mathieu-Daudé, 2021/03/02
- [RFC PATCH 6/7] cpu: Move CPUClass::has_work() to TCGCPUOps, Philippe Mathieu-Daudé, 2021/03/02
- [PATCH 7/7] target/arm: Restrict arm_cpu_has_work() to TCG, Philippe Mathieu-Daudé, 2021/03/02