qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 4/6] i386: acpi: add IVHD device entry for IOAPI


From: Brijesh Singh
Subject: Re: [Qemu-devel] [PATCH 4/6] i386: acpi: add IVHD device entry for IOAPIC
Date: Wed, 12 Sep 2018 14:24:52 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1



On 09/12/2018 11:35 AM, Igor Mammedov wrote:
...

+ /*
+     * When interrupt remapping is enabled, Linux IOMMU driver also checks
+     * for special IVHD device (type IO-APIC), which is typically presented
+     * as PCI device 14:00.0.
Probably it shouldn't be a 'typically' device from somewhere but rather address
fetched from corresponding device model QEMU implements.


IOAPIC is not presented as a true PCI device to guest OS. When IOMMU is
enabled a pseudo address space to added under root PCI bus. PCI 14:0.0
presents to this pseudo device.


+     */
+    if (s->intr_enabled) {
+        build_append_int_noprefix(table_data, 0x0100a00000000048, 8);
                                                  ^^ this is incomprehensible,
where does this magic number comes from and how was it calculated?


In order to provide interrupt remap support, a special IVHD device need
to be added,  the magic number uses the format defined in Table 95 (IVHD
device entry type codes).

0x01 00a0 00 00 0000 48

Byte 0: 0x48 (special device)
Byte 1 & 2: must be zero
Byte 3: 0 (dte setting)
Byte 4: 0 (handle)
Byte 5 & 6: IOAPIC devfn (14:0.0)
Byte 7: 0x1 (IOAPIC) - See Table 97 in spec


+    }
+
      build_header(linker, table_data, (void *)(table_data->data + iommu_start),
                   "IVRS", table_data->len - iommu_start, 1, NULL, NULL);
  }




reply via email to

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