]> Git Repo - qemu.git/commit
riscv: Ensure the kernel start address is correctly cast
authorAlistair Francis <[email protected]>
Thu, 24 Jan 2019 17:37:47 +0000 (17:37 +0000)
committerPalmer Dabbelt <[email protected]>
Mon, 11 Feb 2019 23:56:22 +0000 (15:56 -0800)
commit40e46e516d90c2dfe8e8de3741c1c65f1b526502
treee2138826726c02c175fbc110d63f5653bb5902a2
parentff9f31d9a0d45da83f34207b7ccace850cfc465b
riscv: Ensure the kernel start address is correctly cast

Cast the kernel start address to the target bit length.

This ensures that we calculate the initrd offset to a valid address for
the architecture.

Steps to reproduce the original problem (reported by Alex):
  Build U-Boot for the virt machine for riscv32. Then run it with

    $ qemu-system-riscv32 -M virt -kernel u-boot -nographic -initrd <a file>

  You can find the initrd address with

    U-Boot# fdt addr $fdtcontroladdr
    U-Boot# fdt ls /chosen

  Then take a peek at that address:

    U-Boot# md.b <addr>

  and you will see that there is nothing there without this patch. The
  reason is that the binary was loaded to a negative address.

Signed-off-by: Alistair Francis <[email protected]>
Suggested-by: Alexander Graf <[email protected]>
Reported-by: Alexander Graf <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Palmer Dabbelt <[email protected]>
hw/riscv/sifive_e.c
hw/riscv/sifive_u.c
hw/riscv/spike.c
hw/riscv/virt.c
This page took 0.024543 seconds and 4 git commands to generate.