From 4f5604c41d4a4d41964dfacaa87b08178abcc838 Mon Sep 17 00:00:00 2001 From: Alistair Francis Date: Fri, 15 Mar 2019 20:05:36 +0000 Subject: riscv: plic: Set msi_nonbroken as true Set msi_nonbroken as true for the PLIC. According to the comment located here: https://git.qemu.org/?p=qemu.git;a=blob;f=hw/pci/msi.c;h=47d2b0f33c664533b8dbd5cb17faa8e6a01afe1f;hb=HEAD#l38 the msi_nonbroken variable should be set to true even if they don't support MSI. In this case that is what we are doing as we don't support MSI. Signed-off-by: Alistair Francis Reported-by: Andrea Bolognani Reported-by: David Abdurachmanov Message-Id: <256afbb2da005dc62c159b0f4a4fc0d95c050660.1552679970.git.alistair.francis@wdc.com> Signed-off-by: Paolo Bonzini --- hw/riscv/sifive_plic.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'hw/riscv') diff --git a/hw/riscv/sifive_plic.c b/hw/riscv/sifive_plic.c index d12ec3f..4b0537c 100644 --- a/hw/riscv/sifive_plic.c +++ b/hw/riscv/sifive_plic.c @@ -22,6 +22,7 @@ #include "qemu/log.h" #include "qemu/error-report.h" #include "hw/sysbus.h" +#include "hw/pci/msi.h" #include "target/riscv/cpu.h" #include "hw/riscv/sifive_plic.h" @@ -443,6 +444,8 @@ static void sifive_plic_realize(DeviceState *dev, Error **errp) plic->enable = g_new0(uint32_t, plic->bitfield_words * plic->num_addrs); sysbus_init_mmio(SYS_BUS_DEVICE(dev), &plic->mmio); qdev_init_gpio_in(dev, sifive_plic_irq_request, plic->num_sources); + + msi_nonbroken = true; } static void sifive_plic_class_init(ObjectClass *klass, void *data) -- cgit v1.1 From ca9b7e29de3e79d6fe21bfc21297770a98d54e58 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 14 Mar 2019 14:13:34 +0100 Subject: kconfig: add CONFIG_MSI_NONBROKEN Not all interrupt controllers have a working implementation of message-signalled interrupts; in some cases, the guest may expect MSI to work but it won't due to the buggy or lacking emulation. In QEMU this is represented by the "msi_nonbroken" variable. This patch adds a new configuration symbol enabled whenever the binary contains an interrupt controller that will set "msi_nonbroken". We can then use it to remove devices that cannot be possibly added to the machine, because they require MSI. Signed-off-by: Paolo Bonzini --- hw/riscv/Kconfig | 1 + 1 file changed, 1 insertion(+) (limited to 'hw/riscv') diff --git a/hw/riscv/Kconfig b/hw/riscv/Kconfig index 8c7fc1f..8674211 100644 --- a/hw/riscv/Kconfig +++ b/hw/riscv/Kconfig @@ -6,6 +6,7 @@ config HART config SIFIVE bool + select MSI_NONBROKEN config SIFIVE_E bool -- cgit v1.1