On 3/2/21 7:17 AM, Richard Henderson wrote:
> On 3/1/21 8:49 AM, Claudio Fontana wrote:
>> Signed-off-by: Claudio Fontana<[email protected]>
>> ---
>> target/arm/internals.h | 8 ++-
>> target/arm/cpu-sysemu.c | 105 ++++++++++++++++++++++++++++++++++++++++
>> target/arm/cpu.c | 83 -------------------------------
>> target/arm/meson.build | 1 +
>> 4 files changed, 113 insertions(+), 84 deletions(-)
>> create mode 100644 target/arm/cpu-sysemu.c
>
> It'd be nice to rearrange this into tcg/ and kvm/.
Yes.
This would be the objective of the next series,
basically the objective of this series is to make the kvm-only build succeed
after moving helpers to tcg/ and picking stuff we need from helper.c .
configure --enable-kvm --disable-tcg
The objective of the next one would be to properly place the code in kvm-only
and tcg-only sections,
and then add the classes that specialize the cpu, just like for i386.
But I can continue this series as a whole if preferrable.
>
> I think we could do with some macros like
>
> #ifndef CONFIG_KVM
> #define KVM_ERROR QEMU_ERROR("kvm is disabled")
> #endif
> #ifndef CONFIG_TCG
> #define TCG_ERROR QEMU_ERROR("tcg is disabled")
> #endif
>
> Not sure where to put these, but certainly not arm specific.
>
> Then,
>
> void arm_cpu_tcg_set_irq(void *opaque, int irq, int level)
> TCG_ERROR;
> void arm_cpu_kvm_set_irq(void *opaque, int irq, int level)
> KVM_ERROR;
>
> if (kvm_enabled()) {
> qdev_init_gpio_in(DEVICE(cpu), arm_cpu_kvm_set_irq, 4);
> } else if (tcg_enabled()) {
> qdev_init_gpio_in(DEVICE(cpu), arm_cpu_tcg_set_irq, 4);
> } else {
> g_assert_not_reached();
> }
>
> So arm_cpu_kvm_set_irq can go in kvm/ and needs no ifdef.
>
> I'll let folks interested in xen and hvf figure our what needs doing with the
> above.
>
>
> r~
>
Thanks,
Claudio