|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v3 05/12] xen/riscv: add kernel loading support
On 10.04.2026 17:54, Oleksii Kurochko wrote:
> +/* Check if the image is a 64-bit Image */
> +static int __init kernel_image64_probe(struct kernel_info *info,
> + paddr_t addr, paddr_t size)
> +{
> + /* riscv/boot-image-header.rst */
Is this meant to refer to Linux'es
Documentation/arch/riscv/boot-image-header.rst?
This needs making unambiguous.
Jan
> + struct {
> + uint32_t code0; /* Executable code */
> + uint32_t code1; /* Executable code */
> + uint64_t text_offset; /* Image load offset, little endian */
> + uint64_t image_size; /* Effective Image size, little endian */
> + uint64_t flags; /* kernel flags, little endian */
> + uint32_t version; /* Version of this header */
> + uint32_t res1; /* Reserved */
> + uint64_t res2; /* Reserved */
> + uint64_t magic; /* Deprecated: Magic number, little endian,
> "RISCV" */
> + uint32_t magic2; /* Magic number 2, little endian, "RSC\x05"
> */
> + uint32_t res3; /* Reserved for PE COFF offset */
> + } image;
> + uint64_t effective_size;
> +
> + if ( size < sizeof(image) )
> + return -EINVAL;
> +
> + copy_from_paddr(&image, addr, sizeof(image));
> +
> + /* Magic v1 is deprecated and may be removed. Only use v2 */
> + if ( le32_to_cpu(image.magic2) != IMAGE64_MAGIC_V2 )
> + return -EINVAL;
> +
> + effective_size = le64_to_cpu(image.image_size);
> +
> + if ( effective_size && size > effective_size )
> + return -EINVAL;
> +
> + info->image.kernel_addr = addr;
> + /* Actual size in the binary file */
> + info->image.len = size;
> + /* Total memory the kernel occupies at runtime */
> + info->image.image_size = effective_size;
> + info->image.text_offset = le64_to_cpu(image.text_offset);
> + info->image.start = 0;
> +
> + info->load = kernel_image_load;
> +
> + return 0;
> +}
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |