QEMU PCI 设备永远触发

问题描述

我在 QEMU 中编写了一个小型 PCI 设备,使用 https://github.com/qemu/qemu/blob/v2.7.0/hw/misc/edu.c 作为基础,并使用 https://github.com/cirosantilli/linux-kernel-module-cheat/blob/6788a577c394a2fc512d8f3df0806d84dc09f355/kernel_module/pci.c 与之交互。但是,中断似乎大约每 2 秒触发一次。

我将数据写入 PCI 设备以确认中断,我可以在调用之前和之后看到:

    if (!device->irq_status && !device_msi_enabled(device)) {
        printf("Set state from %d ",device->pdev.irq_state);
        pci_set_irq(&device->pdev,0);
        printf("to %d\n",device->pdev.irq_state);
    }

输出

Set state from 0 to 0
Set state from 0 to 0
Set state from 0 to 0
Set state from 0 to 0

我不知道是什么导致中断继续触发 - 是否有我忘记的属性

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)