|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v4 2/2] xen/arm: support gzip compressed kernels
Hi Stefano,
On 03/09/15 18:54, Stefano Stabellini wrote:
> Free the memory used for the compressed kernel and update the relative
> mod->start and mod->size parameters with the uncompressed ones.
>
> Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
> CC: julien.grall@xxxxxxxxxx
> CC: ian.campbell@xxxxxxxxxx
With the 2 comments coding style changes, see below:
Reviewed-by: Julien Grall <julien.grall@xxxxxxxxxx>
[...]
> +static __init int kernel_decompress(struct kernel_info *info,
> + paddr_t *addr, paddr_t *size)
> +{
[...]
> + end = output + (1 << (kernel_order_out + PAGE_SHIFT));
> + /* Need to free pages after output_size here because they won't be
> + * freed by discard_initial_modules */
Multi-line comment on Xen should be:
/*
* Need ...
* freed ...
*/
> + output += (output_size + PAGE_SIZE - 1) & PAGE_MASK;
> + for ( ; output < end; output += PAGE_SIZE )
> + free_domheap_page(virt_to_page(output));
> +
> + return 0;
> +}
> +
> #ifdef CONFIG_ARM_64
> /*
> * Check if the image is a 64-bit Image.
> @@ -463,6 +520,20 @@ int kernel_probe(struct kernel_info *info)
> printk("Loading ramdisk from boot module @ %"PRIpaddr"\n",
> info->initrd_bootmodule->start);
>
> + /* if it is a gzip'ed image, 32bit or 64bit, uncompress it */
> + rc = kernel_decompress(info, &start, &size);
> + if (rc < 0 && rc != -EINVAL)
> + return rc;
> + else if (!rc)
> + {
> + /* Free the original kernel, update the pointers to the
> + * decompressed kernel */
Ditto
> + dt_unreserved_regions(mod->start, mod->start + mod->size,
> + init_domheap_pages, 0);
> + mod->start = start;
> + mod->size = size;
> + }
> +
> #ifdef CONFIG_ARM_64
> rc = kernel_zimage64_probe(info, start, size);
> if (rc < 0)
Regards,
--
Julien Grall
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |