From 090d83b0173b0525db4873570473ee0920671247 Mon Sep 17 00:00:00 2001 From: Henning Schild Date: Tue, 27 Jan 2015 15:05:34 +0100 Subject: [PATCH] tools: config create: add assertions in DMAR parser Assert for some of the comments from the VT-d manual, might help to detect invalid ACPI tables. Signed-off-by: Henning Schild Signed-off-by: Jan Kiszka --- tools/jailhouse-config-create | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/jailhouse-config-create b/tools/jailhouse-config-create index ad4b0b4..4df0518 100755 --- a/tools/jailhouse-config-create +++ b/tools/jailhouse-config-create @@ -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) = \ -- 2.39.2