On 3/1/21 8:49 AM, Claudio Fontana wrote:
Signed-off-by: Claudio Fontana<cfont...@suse.de>
---
  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/.

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~

Reply via email to