hw/riscv: Treat kernel_start_addr as vaddr
PATCH 1/1 hw/riscv: Treat kernel_start_addr as vaddr
Changes kernel_start_addr from target_ulong to vaddr. Logically, the argument represents the virtual address at which to load the kernel image, which as a fallback gets treated as a hwaddr if elf/uimage loading fails.
(Note: callers of riscv_load_kernel() currently pass in a hwaddr as kernel_start_addr, so I'm not 100% if hwaddr or vaddr is right here. Please correct me if I'm wrong.)
--- include/hw/riscv/boot.h | 2 +- hw/riscv/boot.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
include/hw/riscv/boot.h +1 -1
@@ -57,7 +57,7 @@ hwaddr riscv_load_firmware(const char *firmware_filename, symbol_fn_t sym_cb);void riscv_load_kernel (MachineState *machine,RISCVBootInfo *info, -target_ulong kernel_start_addr, +vaddr kernel_start_addr,bool load_initrd,symbol_fn_t sym_cb); uint64_t riscv_compute_fdt_addr(hwaddr dram_base, hwaddr dram_size,
hw/riscv/boot.c +1 -1
@@ -228,7 +228,7 @@ static void riscv_load_initrd(MachineState *machine, RISCVBootInfo *info)void riscv_load_kernel (MachineState *machine,RISCVBootInfo *info, -target_ulong kernel_start_addr, +vaddr kernel_start_addr,bool load_initrd,symbol_fn_t sym_cb) {
Signature · 1 line
2.51.0
Quoted 7 lines · Anton Johansson
Changes
kernel_start_addrfromtarget_ulongto vaddr. Logically, the argument represents the virtual address at which to load the kernel image, which as a fallback gets treated as a hwaddr if elf/uimage loading fails.(Note: callers of
riscv_load_kernel()currently pass in a hwaddr askernel_start_addr, so I'm not 100% if hwaddr or vaddr is right here. Please correct me if I'm wrong.)
IMHO they need to be updated, i.e.:
-- >8 --
hw/riscv/microchip_pfsoc.c +2 -1
@@ -521,7 +521,8 @@ static void microchip_icicle_kit_machine_init(MachineState *machine)uint64_t mem_low_size, mem_high_size;hwaddr firmware_load_addr;const char *firmware_name; -hwaddr firmware_end_addr, kernel_start_addr; +hwaddr firmware_end_addr; +vaddr kernel_start_addr;uint64_t kernel_entry;uint64_t fdt_load_addr;DriveInfo *dinfo =drive_get (IF_SD ,0 ,0 );
---
Quoted 7 lines
Suggested-by Philippe Mathieu-Daudé <[email protected]>Signed-off-by Anton Johansson <[email protected]>--- include/hw/riscv/boot.h | 2 +- hw/riscv/boot.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)