diff mbox series

[v16,02/23] target/riscv: remove CONFIG_TCG, as it is always TCG

Message ID 20210204163931.7358-3-cfontana@suse.de (mailing list archive)
State New, archived
Headers show
Series i386 cleanup PART 2 | expand

Commit Message

Claudio Fontana Feb. 4, 2021, 4:39 p.m. UTC
for now only TCG is allowed as an accelerator for riscv,
so remove the CONFIG_TCG use.

Signed-off-by: Claudio Fontana <cfontana@suse.de>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
---
 target/riscv/cpu.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Roman Bolshakov Feb. 10, 2021, 12:22 p.m. UTC | #1
On Thu, Feb 04, 2021 at 05:39:10PM +0100, Claudio Fontana wrote:
> for now only TCG is allowed as an accelerator for riscv,
> so remove the CONFIG_TCG use.
> 
> Signed-off-by: Claudio Fontana <cfontana@suse.de>
> Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>  target/riscv/cpu.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
> index 567f6790a9..60d0b43153 100644
> --- a/target/riscv/cpu.c
> +++ b/target/riscv/cpu.c
> @@ -617,10 +617,9 @@ static void riscv_cpu_class_init(ObjectClass *c, void *data)
>  #endif
>      cc->gdb_arch_name = riscv_gdb_arch_name;
>      cc->gdb_get_dynamic_xml = riscv_gdb_get_dynamic_xml;
> -#ifdef CONFIG_TCG
>      cc->tcg_ops.initialize = riscv_translate_init;
>      cc->tlb_fill = riscv_cpu_tlb_fill;
> -#endif
> +
>      device_class_set_props(dc, riscv_cpu_properties);
>  }
>  

I'm not sure if it should be dropped because it might be readded soon
because of: https://lwn.net/Articles/830078/

Regards,
Roman
Claudio Fontana Feb. 10, 2021, 12:37 p.m. UTC | #2
On 2/10/21 1:22 PM, Roman Bolshakov wrote:
> On Thu, Feb 04, 2021 at 05:39:10PM +0100, Claudio Fontana wrote:
>> for now only TCG is allowed as an accelerator for riscv,
>> so remove the CONFIG_TCG use.
>>
>> Signed-off-by: Claudio Fontana <cfontana@suse.de>
>> Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
>> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
>> ---
>>  target/riscv/cpu.c | 3 +--
>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
>> index 567f6790a9..60d0b43153 100644
>> --- a/target/riscv/cpu.c
>> +++ b/target/riscv/cpu.c
>> @@ -617,10 +617,9 @@ static void riscv_cpu_class_init(ObjectClass *c, void *data)
>>  #endif
>>      cc->gdb_arch_name = riscv_gdb_arch_name;
>>      cc->gdb_get_dynamic_xml = riscv_gdb_get_dynamic_xml;
>> -#ifdef CONFIG_TCG
>>      cc->tcg_ops.initialize = riscv_translate_init;
>>      cc->tlb_fill = riscv_cpu_tlb_fill;
>> -#endif
>> +
>>      device_class_set_props(dc, riscv_cpu_properties);
>>  }
>>  
> 
> I'm not sure if it should be dropped because it might be readded soon
> because of: https://lwn.net/Articles/830078/
> 
> Regards,
> Roman
> 


This #ifdef comes in my view from a "template" use of target/xxx/cpu.c (all targets seem to start with this #ifdef), but its use is not consistent throughout, it's only here.

When KVM is enabled, correct splitting of TCG and KVM will be required, this specific #ifdef is not the solution.

Note that this change is already in master.

Ciao,

Claudio
diff mbox series

Patch

diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index 567f6790a9..60d0b43153 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -617,10 +617,9 @@  static void riscv_cpu_class_init(ObjectClass *c, void *data)
 #endif
     cc->gdb_arch_name = riscv_gdb_arch_name;
     cc->gdb_get_dynamic_xml = riscv_gdb_get_dynamic_xml;
-#ifdef CONFIG_TCG
     cc->tcg_ops.initialize = riscv_translate_init;
     cc->tlb_fill = riscv_cpu_tlb_fill;
-#endif
+
     device_class_set_props(dc, riscv_cpu_properties);
 }