# parsing of DMAR ACPI Table
# see Intel VT-d Spec chapter 8
def parse_dmar():
- f = input_open('/sys/firmware/acpi/tables/DMAR', 'rb')
+ f = input_open('/sys/firmware/acpi/tables/DMAR', 'rb', True)
+ if get_cpu_vendor() == 'AuthenticAMD':
+ print('WARNING: AMD IOMMU support is not implemented yet')
+ return [], 0, []
signature = f.read(4)
if signature != b'DMAR':
if options.generate_collector:
print('ERROR: You have to be root to work on "/"!', file=sys.stderr)
sys.exit(1)
+def get_cpu_vendor():
+ with input_open('/proc/cpuinfo', 'r') as f:
+ for line in f:
+ if not line.strip():
+ continue
+ key, value = line.split(':')
+ if key.strip() == 'vendor_id':
+ return value.strip()
+
+
(pcidevices, pcicaps) = parse_pcidevices()
product = [input_readline('/sys/class/dmi/id/sys_vendor',
.mmconfig_base = ${hex(mmconfig.base)},
.mmconfig_end_bus = ${hex(mmconfig.end_bus)},
.pm_timer_address = ${hex(pm_timer_base)},
+ % if dmar_units:
.dmar_unit_base = {
% for d in dmar_units:
${hex(d)},
% endfor
},
+ % endif
},
.root_cell = {
.name = "RootCell",