static void vfio_probe_nvidia_bar0_88000_quirk(VFIODevice *vdev, int nr)

{

    PCIDevice *pdev = &vdev->pdev;

    VFIOQuirk *quirk;



    if (!vdev->has_vga || nr != 0 ||

        pci_get_word(pdev->config + PCI_VENDOR_ID) != PCI_VENDOR_ID_NVIDIA) {

        return;

    }



    quirk = g_malloc0(sizeof(*quirk));

    quirk->vdev = vdev;

    quirk->data.flags = quirk->data.read_flags = quirk->data.write_flags = 1;

    quirk->data.address_match = 0x88000;

    quirk->data.address_mask = PCIE_CONFIG_SPACE_SIZE - 1;

    quirk->data.bar = nr;



    memory_region_init_io(&quirk->mem, OBJECT(vdev), &vfio_generic_quirk,

                          quirk, "vfio-nvidia-bar0-88000-quirk",

                          TARGET_PAGE_ALIGN(quirk->data.address_mask + 1));

    memory_region_add_subregion_overlap(&vdev->bars[nr].mem,

                          quirk->data.address_match & TARGET_PAGE_MASK,

                          &quirk->mem, 1);



    QLIST_INSERT_HEAD(&vdev->bars[nr].quirks, quirk, next);



    DPRINTF("Enabled NVIDIA BAR0 0x88000 quirk for device %04x:%02x:%02x.%x\n",

            vdev->host.domain, vdev->host.bus, vdev->host.slot,

            vdev->host.function);

}

static void vfio_probe_nvidia_bar0_88000_quirk(VFIODevice *vdev, int nr)

{

    PCIDevice *pdev = &vdev->pdev;

    VFIOQuirk *quirk;



    if (!vdev->has_vga || nr != 0 ||

        pci_get_word(pdev->config + PCI_VENDOR_ID) != PCI_VENDOR_ID_NVIDIA) {

        return;

    }



    quirk = g_malloc0(sizeof(*quirk));

    quirk->vdev = vdev;

    quirk->data.flags = quirk->data.read_flags = quirk->data.write_flags = 1;

    quirk->data.address_match = 0x88000;

    quirk->data.address_mask = PCIE_CONFIG_SPACE_SIZE - 1;

    quirk->data.bar = nr;



    memory_region_init_io(&quirk->mem, OBJECT(vdev), &vfio_generic_quirk,

                          quirk, "vfio-nvidia-bar0-88000-quirk",

                          TARGET_PAGE_ALIGN(quirk->data.address_mask + 1));

    memory_region_add_subregion_overlap(&vdev->bars[nr].mem,

                          quirk->data.address_match & TARGET_PAGE_MASK,

                          &quirk->mem, 1);



    QLIST_INSERT_HEAD(&vdev->bars[nr].quirks, quirk, next);



    DPRINTF("Enabled NVIDIA BAR0 0x88000 quirk for device %04x:%02x:%02x.%x\n",

            vdev->host.domain, vdev->host.bus, vdev->host.slot,

            vdev->host.function);

}

static void FUNC_0(VFIODevice *VAR_0, int VAR_1)

{

    PCIDevice *pdev = &VAR_0->pdev;

    VFIOQuirk *quirk;



    if (!VAR_0->has_vga || VAR_1 != 0 ||

        pci_get_word(pdev->config + PCI_VENDOR_ID) != PCI_VENDOR_ID_NVIDIA) {

        return;

    }



    quirk = g_malloc0(sizeof(*quirk));

    quirk->VAR_0 = VAR_0;

    quirk->data.flags = quirk->data.read_flags = quirk->data.write_flags = 1;

    quirk->data.address_match = 0x88000;

    quirk->data.address_mask = PCIE_CONFIG_SPACE_SIZE - 1;

    quirk->data.bar = VAR_1;



    memory_region_init_io(&quirk->mem, OBJECT(VAR_0), &vfio_generic_quirk,

                          quirk, "vfio-nvidia-bar0-88000-quirk",

                          TARGET_PAGE_ALIGN(quirk->data.address_mask + 1));

    memory_region_add_subregion_overlap(&VAR_0->bars[VAR_1].mem,

                          quirk->data.address_match & TARGET_PAGE_MASK,

                          &quirk->mem, 1);



    QLIST_INSERT_HEAD(&VAR_0->bars[VAR_1].quirks, quirk, next);



    DPRINTF("Enabled NVIDIA BAR0 0x88000 quirk for device %04x:%02x:%02x.%x\n",

            VAR_0->host.domain, VAR_0->host.bus, VAR_0->host.slot,

            VAR_0->host.function);

}

static void FUNC_0(VFIODevice *VAR_0, int VAR_1)
{ PCIDevice *pdev = &VAR_0->pdev; VFIOQuirk *quirk; if (!VAR_0->has_vga || VAR_1 != 0 ||
pci_get_word(pdev->config + PCI_VENDOR_ID) != PCI_VENDOR_ID_NVIDIA) { return; } quirk = g_malloc0(sizeof(*quirk)); quirk->VAR_0 = VAR_0; quirk->data.flags = quirk->data.read_flags = quirk->data.write_flags = 1; quirk->data.address_match = 0x88000; quirk->data.address_mask = PCIE_CONFIG_SPACE_SIZE - 1; quirk->data.bar = VAR_1; memory_region_init_io(&quirk->mem, OBJECT(VAR_0), &vfio_generic_quirk,
quirk, "vfio-nvidia-bar0-88000-quirk",
TARGET_PAGE_ALIGN(quirk->data.address_mask + 1)); memory_region_add_subregion_overlap(&VAR_0->bars[VAR_1].mem,
quirk->data.address_match & TARGET_PAGE_MASK,
&quirk->mem, 1); QLIST_INSERT_HEAD(&VAR_0->bars[VAR_1].quirks, quirk, next); DPRINTF("Enabled NVIDIA BAR0 0x88000 quirk for device %04x:%02x:%02x.%x\n",
VAR_0->host.domain, VAR_0->host.bus, VAR_0->host.slot,
VAR_0->host.function); }