OSDN Git Service

target/riscv/tcg: introduce tcg_cpu_instance_init()
authorDaniel Henrique Barboza <dbarboza@ventanamicro.com>
Mon, 25 Sep 2023 17:57:05 +0000 (14:57 -0300)
committerAlistair Francis <alistair.francis@wdc.com>
Thu, 12 Oct 2023 02:24:07 +0000 (12:24 +1000)
commitfce8bb5d088c655be18b1642e716489df608a0c4
tree3fe687446ffd9d84a62825a9a4ce6e5ef3b56855
parentf51d03b01fac6cf2757d02efe1cc2679b1d133ac
target/riscv/tcg: introduce tcg_cpu_instance_init()

tcg_cpu_instance_init() will be the 'cpu_instance_init' impl for the TCG
accelerator. It'll be called from within riscv_cpu_post_init(), via
accel_cpu_instance_init(), similar to what happens with KVM. In fact, to
preserve behavior, the implementation will be similar to what
riscv_cpu_post_init() already does.

In this patch we'll move riscv_cpu_add_user_properties() and
riscv_init_max_cpu_extensions() and all their dependencies to tcg-cpu.c.
All multi-extension properties code was moved. The 'multi_ext_user_opts'
hash table was also moved to tcg-cpu.c since it's a TCG only structure,
meaning that we won't have to worry about initializing a TCG hash table
when running a KVM CPU anymore.

riscv_cpu_add_user_properties() will remain in cpu.c for now due to how
much code it requires to be moved at the same time. We'll do that in the
next patch.

Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20230925175709.35696-16-dbarboza@ventanamicro.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
target/riscv/cpu.c
target/riscv/cpu.h
target/riscv/tcg/tcg-cpu.c