]> rtime.felk.cvut.cz Git - jailhouse.git/commitdiff
tools: config-create: include PM timer in root cell config
authorHenning Schild <henning.schild@siemens.com>
Mon, 7 Jul 2014 15:48:51 +0000 (17:48 +0200)
committerJan Kiszka <jan.kiszka@siemens.com>
Mon, 7 Jul 2014 16:02:25 +0000 (18:02 +0200)
Add the PM timer to configurations created with jailhouse config create.

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

index ce196079d2e272b370d77acbfda9d79a92c5d608..fc594ba2baf86fc1a7e40c3332cf101e161eccab 100755 (executable)
@@ -324,6 +324,18 @@ def parse_dmar():
 
     return ioapic_id, regions
 
+
+def parse_ioports():
+    pm_timer_base = None
+    f, e = input_open('/proc/ioports', True, False, 'r')
+    for line in f:
+        if line.endswith('ACPI PM_TMR\n'):
+            pm_timer_base = int(line.split('-')[0], 16)
+            break
+    f.close()
+    return pm_timer_base
+
+
 pcidevices = parse_pcidevices()
 
 product = [input_readline('/sys/class/dmi/id/sys_vendor',
@@ -362,6 +374,8 @@ regions.append(inmatereg)
 
 cpucount = count_cpus()
 
+pm_timer_base = parse_ioports()
+
 f = open(options.file, 'w')
 
 if options.generate_collector:
@@ -379,4 +393,5 @@ else:
                         product=product,
                         pcidevices=pcidevices,
                         cpucount=cpucount,
-                        ioapic_id=ioapic_id))
+                        ioapic_id=ioapic_id,
+                        pm_timer_base=pm_timer_base))
index 5a8b9a4fcf6584028f80787589f1b862a05e8446..f6e57e9b27ab40432f625b9b36a3a4ade71ac378 100644 (file)
@@ -35,6 +35,9 @@ struct {
                        .phys_start = ${hex(confmem[0])},
                        .size = ${hex(confmem[1])},
                },
+               .platform_info.x86 = {
+                       .pm_timer_address = ${hex(pm_timer_base)},
+               },
                .root_cell = {
                        .name = "${product[1]}",
                        .cpu_set_size = sizeof(config.cpus),