@@ -223,10 +223,6 @@ static void kvm_apic_realize(DeviceState *dev, Error **errp)
memory_region_init_io(&s->io_memory, OBJECT(s), &kvm_apic_io_ops, s,
"kvm-apic-msi", APIC_SPACE_SIZE);
-
- if (kvm_has_gsi_routing()) {
- msi_nonbroken = true;
- }
}
static void kvm_apic_unrealize(DeviceState *dev, Error **errp)
@@ -44,7 +44,6 @@ static void xen_apic_realize(DeviceState *dev, Error **errp)
s->vapic_control = 0;
memory_region_init_io(&s->io_memory, OBJECT(s), &xen_apic_io_ops, s,
"xen-apic-msi", APIC_SPACE_SIZE);
- msi_nonbroken = true;
}
static void xen_apic_set_base(APICCommonState *s, uint64_t val)
@@ -890,8 +890,6 @@ static void apic_realize(DeviceState *dev, Error **errp)
s->timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, apic_timer, s);
local_apics[s->id] = s;
-
- msi_nonbroken = true;
}
static void apic_unrealize(DeviceState *dev, Error **errp)
@@ -151,7 +151,6 @@ static void gicv2m_realize(DeviceState *dev, Error **errp)
sysbus_init_irq(SYS_BUS_DEVICE(dev), &s->spi[i]);
}
- msi_nonbroken = true;
kvm_gsi_direct_mapping = true;
kvm_msi_via_irqfd_allowed = kvm_irqfds_enabled();
}
@@ -106,8 +106,6 @@ void gicv3_its_init_mmio(GICv3ITSState *s, const MemoryRegionOps *ops)
memory_region_add_subregion(&s->iomem_main, ITS_CONTROL_SIZE,
&s->iomem_its_translation);
sysbus_init_mmio(sbd, &s->iomem_main);
-
- msi_nonbroken = true;
}
static void gicv3_its_common_reset(DeviceState *dev)
@@ -1377,7 +1377,6 @@ static void fsl_common_init(OpenPICState *opp)
opp->irq_msi = 224;
- msi_nonbroken = true;
for (i = 0; i < opp->fsl->max_ext; i++) {
opp->src[i].level = false;
}
@@ -242,7 +242,6 @@ static void kvm_openpic_realize(DeviceState *dev, Error **errp)
memory_listener_register(&opp->mem_listener, &address_space_memory);
/* indicate pic capabilities */
- msi_nonbroken = true;
kvm_kernel_irqchip = true;
kvm_async_interrupts_allowed = true;
@@ -35,22 +35,6 @@
#define PCI_MSI_VECTORS_MAX 32
-/*
- * Flag for interrupt controllers to declare broken MSI/MSI-X support.
- * values: false - broken; true - non-broken.
- *
- * Setting this flag to false will remove MSI/MSI-X capability from all devices.
- *
- * It is preferable for controllers to set this to true (non-broken) even if
- * they do not actually support MSI/MSI-X: guests normally probe the controller
- * type and do not attempt to enable MSI/MSI-X with interrupt controllers not
- * supporting such, so removing the capability is not required, and
- * it seems cleaner to have a given device look the same for all boards.
- *
- * TODO: some existing controllers violate the above rule. Identify and fix them.
- */
-bool msi_nonbroken;
-
/* If we get rid of cap allocator, we won't need this. */
static inline uint8_t msi_cap_sizeof(uint16_t flags)
{
@@ -191,11 +175,6 @@ int msi_init(struct PCIDevice *dev, uint8_t offset,
uint8_t cap_size;
int config_offset;
- if (!msi_nonbroken) {
- error_setg(errp, "MSI is not supported by interrupt controller");
- return -ENOTSUP;
- }
-
MSI_DEV_PRINTF(dev,
"init offset: 0x%"PRIx8" vector: %"PRId8
" 64bit %d mask %d\n",
@@ -269,12 +269,6 @@ int msix_init(struct PCIDevice *dev, unsigned short nentries,
unsigned table_size, pba_size;
uint8_t *config;
- /* Nothing to do if MSI is not supported by interrupt controller */
- if (!msi_nonbroken) {
- error_setg(errp, "MSI-X is not supported by interrupt controller");
- return -ENOTSUP;
- }
-
if (nentries < 1 || nentries > PCI_MSIX_FLAGS_QSIZE + 1) {
error_setg(errp, "The number of MSI-X vectors is invalid");
return -EINVAL;
@@ -835,9 +835,7 @@ static void spapr_dt_rtas(sPAPRMachineState *spapr, void *fdt)
_FDT(fdt_setprop_cell(fdt, rtas, "rtas-event-scan-rate",
RTAS_EVENT_SCAN_RATE));
- if (msi_nonbroken) {
- _FDT(fdt_setprop(fdt, rtas, "ibm,change-msix-capable", NULL, 0));
- }
+ _FDT(fdt_setprop(fdt, rtas, "ibm,change-msix-capable", NULL, 0));
/*
* According to PAPR, rtas ibm,os-term does not guarantee a return
@@ -2056,8 +2054,6 @@ static void ppc_spapr_init(MachineState *machine)
long load_limit, fw_size;
char *filename;
- msi_nonbroken = true;
-
QLIST_INIT(&spapr->phbs);
QTAILQ_INIT(&spapr->pending_dimm_unplugs);
@@ -2251,13 +2251,11 @@ void spapr_pci_rtas_init(void)
rtas_ibm_read_pci_config);
spapr_rtas_register(RTAS_IBM_WRITE_PCI_CONFIG, "ibm,write-pci-config",
rtas_ibm_write_pci_config);
- if (msi_nonbroken) {
- spapr_rtas_register(RTAS_IBM_QUERY_INTERRUPT_SOURCE_NUMBER,
- "ibm,query-interrupt-source-number",
- rtas_ibm_query_interrupt_source_number);
- spapr_rtas_register(RTAS_IBM_CHANGE_MSI, "ibm,change-msi",
- rtas_ibm_change_msi);
- }
+ spapr_rtas_register(RTAS_IBM_QUERY_INTERRUPT_SOURCE_NUMBER,
+ "ibm,query-interrupt-source-number",
+ rtas_ibm_query_interrupt_source_number);
+ spapr_rtas_register(RTAS_IBM_CHANGE_MSI, "ibm,change-msi",
+ rtas_ibm_change_msi);
spapr_rtas_register(RTAS_IBM_SET_EEH_OPTION,
"ibm,set-eeh-option",
@@ -876,7 +876,6 @@ static void s390_pcihost_class_init(ObjectClass *klass, void *data)
k->init = s390_pcihost_init;
hc->plug = s390_pcihost_hot_plug;
hc->unplug = s390_pcihost_hot_unplug;
- msi_nonbroken = true;
}
static const TypeInfo s390_pcihost_info = {
@@ -29,8 +29,6 @@ struct MSIMessage {
uint32_t data;
};
-extern bool msi_nonbroken;
-
void msi_set_message(PCIDevice *dev, MSIMessage msg);
MSIMessage msi_get_message(PCIDevice *dev, unsigned int vector);
bool msi_enabled(const PCIDevice *dev);
It was used before to know whether specific board has correct emulation support on MSI, and originally we set this to true when the board is not buggy with MSI. That's not really what we should do. For broken emulated boards, we should either blacklist it (using something like msi_broken, when really needed), or better, fix all the bugs that lead to the broken. No matter what, it would not be a good idea to do it in the reversed order (correctly emulated boards setup msi_nonbroken), then we will never know which board is really broken. For now, let's remove msi_nonbroken once and for all. Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Peter Xu <peterx@redhat.com> --- hw/i386/kvm/apic.c | 4 ---- hw/i386/xen/xen_apic.c | 1 - hw/intc/apic.c | 2 -- hw/intc/arm_gicv2m.c | 1 - hw/intc/arm_gicv3_its_common.c | 2 -- hw/intc/openpic.c | 1 - hw/intc/openpic_kvm.c | 1 - hw/pci/msi.c | 21 --------------------- hw/pci/msix.c | 6 ------ hw/ppc/spapr.c | 6 +----- hw/ppc/spapr_pci.c | 12 +++++------- hw/s390x/s390-pci-bus.c | 1 - include/hw/pci/msi.h | 2 -- 13 files changed, 6 insertions(+), 54 deletions(-)