qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC v2 06/24] target/arm: split off cpu-sysemu.c


From: Richard Henderson
Subject: Re: [RFC v2 06/24] target/arm: split off cpu-sysemu.c
Date: Mon, 1 Mar 2021 22:17:44 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1

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

[Prev in Thread] Current Thread [Next in Thread]