Skip to content

Commit

Permalink
tools: cell-linux: Use minimal decompression space for ARM64
Browse files Browse the repository at this point in the history
Factor out a default decompression factor for ARM because ARM64 does not
perform any compression so far, thus has a factor of 1 only. This allows
for more compact non-root Linux cell layout during load.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
  • Loading branch information
jan-kiszka committed Jan 20, 2018
1 parent 0def9fe commit 83034d7
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions tools/jailhouse-cell-linux
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,10 @@ class ARMCommon:
if args.initrd:
ramdisk_size = page_align(os.fstat(args.initrd.fileno()).st_size)
# leave sufficient space between the kernel and the initrd
image_size += kernel_size * 4
kernel_size *= 5
decompression_factor = self.default_decompression_factor()
decompression_space = decompression_factor * kernel_size
kernel_size += decompression_space
image_size += decompression_space

if not args.dtb:
print('No device tree specified', file=sys.stderr)
Expand Down Expand Up @@ -425,6 +427,10 @@ class ARM(ARMCommon):
def get_kernel_offset(kernel):
return 0

@staticmethod
def default_decompression_factor():
return 4


class ARM64(ARMCommon):
name = 'arm64'
Expand All @@ -442,6 +448,10 @@ class ARM64(ARMCommon):
(text_offset,) = struct.unpack_from('<Q', kernel.read(8))
return text_offset

@staticmethod
def default_decompression_factor():
return 1


def resolve_arch(defined_arch=None):
arch_classes = {'x86': X86, 'arm': ARM, 'arm64': ARM64, None: None}
Expand Down

0 comments on commit 83034d7

Please sign in to comment.