On 30.09.19 21:13, Andrej Utz wrote:
> Signed-off-by: Andrej Utz <[email protected]>
> Signed-off-by: Ralf Ramsauer <[email protected]>
> ---
> tools/jailhouse-config-create | 10 +++++-----
> tools/root-cell-config.c.tmpl | 4 ++--
> 2 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/tools/jailhouse-config-create b/tools/jailhouse-config-create
> index 55601a6d..cfa7fbad 100755
> --- a/tools/jailhouse-config-create
> +++ b/tools/jailhouse-config-create
> @@ -269,7 +269,7 @@ product = [input_readline('/sys/class/dmi/id/sys_vendor',
> inmatemem = kmg_multiply_str(options.mem_inmates)
> hvmem = [0, kmg_multiply_str(options.mem_hv)]
>
> -(regions, dmar_regions) = sysfs_parser.parse_iomem(pcidevices)
> +mem_regions, dmar_regions = sysfs_parser.parse_iomem(pcidevices)
For the sake of consistency: Let's leave the brackets. There is
apparently no semantical difference, but it is easier to spot that we
are unpacking a tuple here when its in brackets. I know we have some
cases remaining where it is missing, but those seem to be mostly in
tools/jailhouse-hardware-check.
> ourmem = parse_kernel_cmdline()
> total = hvmem[1] + inmatemem
>
> @@ -283,11 +283,11 @@ if vendor == 'GenuineIntel':
> dmar_regions)
> else:
> (iommu_units, extra_memregs) = sysfs_parser.parse_ivrs(pcidevices,
> ioapics)
> -regions += extra_memregs
> +mem_regions += extra_memregs
>
> # kernel does not have memmap region, pick one
> if ourmem is None:
> - ourmem = alloc_mem(regions, total)
> + ourmem = alloc_mem(mem_regions, total)
> elif (total > ourmem[1]):
> raise RuntimeError('Your memmap reservation is too small you need >="' +
> hex(total) + '". Hint: your kernel cmd line needs '
> @@ -298,7 +298,7 @@ hvmem[0] = ourmem[0]
> inmatereg = sysfs_parser.MemRegion(ourmem[0] + hvmem[1],
> ourmem[0] + hvmem[1] + inmatemem - 1,
> 'JAILHOUSE Inmate Memory')
> -regions.append(inmatereg)
> +mem_regions.append(inmatereg)
>
> cpucount = count_cpus()
>
> @@ -311,7 +311,7 @@ f = open(options.file, 'w')
> tmpl = Template(filename=os.path.join(options.template_dir,
> 'root-cell-config.c.tmpl'))
> kwargs = {
> - 'regions': regions,
> + 'mem_regions': mem_regions,
> 'ourmem': ourmem,
> 'argstr': ' '.join(sys.argv),
> 'hvmem': hvmem,
> diff --git a/tools/root-cell-config.c.tmpl b/tools/root-cell-config.c.tmpl
> index f9805dcd..b6522ce1 100644
> --- a/tools/root-cell-config.c.tmpl
> +++ b/tools/root-cell-config.c.tmpl
> @@ -45,7 +45,7 @@
> struct {
> struct jailhouse_system header;
> __u64 cpus[${int((cpucount + 63) / 64)}];
> - struct jailhouse_memory mem_regions[${len(regions)}];
> + struct jailhouse_memory mem_regions[${len(mem_regions)}];
> struct jailhouse_irqchip irqchips[${len(irqchips)}];
> struct jailhouse_pio pio_regions[6];
> struct jailhouse_pci_device pci_devices[${len(pcidevices)}];
> @@ -126,7 +126,7 @@ struct {
> },
>
> .mem_regions = {
> - % for r in regions:
> + % for r in mem_regions:
> /* ${str(r)} */
> % for c in r.comments:
> /* ${c} */
>
Jan
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
--
You received this message because you are subscribed to the Google Groups
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jailhouse-dev/52f5e61e-3ff4-cf6d-c5b5-1f2fb90c8ec4%40siemens.com.