Skip to content

Commit

Permalink
tools: config-create: include PM timer in root cell config
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
henning-schild authored and jan-kiszka committed Jul 7, 2014
1 parent 82ee792 commit 24fdf99
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
17 changes: 16 additions & 1 deletion tools/jailhouse-config-create
Expand Up @@ -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',
Expand Down Expand Up @@ -362,6 +374,8 @@ regions.append(inmatereg)

cpucount = count_cpus()

pm_timer_base = parse_ioports()

f = open(options.file, 'w')

if options.generate_collector:
Expand All @@ -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))
3 changes: 3 additions & 0 deletions tools/root-cell-config.c.tmpl
Expand Up @@ -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),
Expand Down

0 comments on commit 24fdf99

Please sign in to comment.