]> rtime.felk.cvut.cz Git - jailhouse.git/commitdiff
tools: config create: add assertions in DMAR parser
authorHenning Schild <henning.schild@siemens.com>
Tue, 27 Jan 2015 14:05:34 +0000 (15:05 +0100)
committerJan Kiszka <jan.kiszka@siemens.com>
Sun, 1 Feb 2015 11:47:10 +0000 (12:47 +0100)
Assert for some of the comments from the VT-d manual, might help to
detect invalid ACPI tables.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
tools/jailhouse-config-create

index ad4b0b42dc73e16248c3d8345cddfc8d8dc53358..4df0518438693f46e40c2ad2cca104c81714349c 100755 (executable)
@@ -646,12 +646,14 @@ def parse_dmar(pcidevices, ioapics):
                     parse_dmar_devscope(f)
                 # PCI Endpoint Device
                 if scope_type == 1:
+                    assert not (flags & 1)
                     for d in pcidevices:
                         if d.bus == bus and d.dev == dev and d.fn == fn:
                             d.iommu = len(units) - 1
                             break
                 # PCI Sub-hierarchy
                 elif scope_type == 2:
+                    assert not (flags & 1)
                     for d in pcidevices:
                         if d.bus == bus and d.dev == dev and d.fn == fn:
                             (secondbus, subordinate) = \