summary refs log tree commit diff stats
path: root/results/classifier/zero-shot/118/none/1898883
blob: 08e578de5560f7939d555492e6dbac8c63495ed5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
mistranslation: 0.535
device: 0.512
permissions: 0.488
kernel: 0.471
performance: 0.456
virtual: 0.443
semantic: 0.441
peripherals: 0.430
vnc: 0.407
ppc: 0.386
network: 0.379
PID: 0.372
i386: 0.366
hypervisor: 0.353
VMM: 0.346
architecture: 0.346
graphic: 0.335
user-level: 0.333
arm: 0.326
socket: 0.315
files: 0.314
register: 0.298
assembly: 0.289
TCG: 0.283
KVM: 0.276
x86: 0.274
debug: 0.263
boot: 0.248
risc-v: 0.240

qemu-system-riscv64 failed to load binary kernel into memory

QEMU Version: 5.1.0
Compiled in Ubuntu 20.04 for riscv64, following the guide https://risc-v-getting-started-guide.readthedocs.io/en/latest/linux-qemu.html.

In qemu-system-riscv64, code at 0x80000000 will be executed by virtual CPU.
For example, using `qemu-system-riscv64 -nographic -machine virt -bios none -kernel vmlinux -S -s`, my homebrew kernel(ELF file) will load at 0x80000000. If I strip the kernel using `riscv64-linux-gnu-objcopy -O binary vmlinux Image`, qemu-system-riscv64 will not load the binary machine code into the riscv64 load address, but `-bios Image` will.

In `qemu-system-aarch64` compiled by Ubuntu team, I can use `qemu-system-aarch64 -M raspi3 -kernel Image_aarch64 -S -s` to load a specific machine code binary into 0x80000. And the elf kernel can be loaded to that address, too.

On Wed, Oct 7, 2020 at 10:37 PM Azuk 443 <email address hidden> wrote:
>
> Public bug reported:
>
> QEMU Version: 5.1.0
> Compiled in Ubuntu 20.04 for riscv64, following the guide https://risc-v-getting-started-guide.readthedocs.io/en/latest/linux-qemu.html.
>
> In qemu-system-riscv64, code at 0x80000000 will be executed by virtual CPU.
> For example, using `qemu-system-riscv64 -nographic -machine virt -bios none -kernel vmlinux -S -s`, my homebrew kernel(ELF file) will load at 0x80000000. If I strip the kernel using `riscv64-linux-gnu-objcopy -O binary vmlinux Image`, qemu-system-riscv64 will not load the binary machine code into the riscv64 load address, but `-bios Image` will.

This is not a bug. As you said, please use `-bios Image` for your
special purpose.

>
> In `qemu-system-aarch64` compiled by Ubuntu team, I can use `qemu-
> system-aarch64 -M raspi3 -kernel Image_aarch64 -S -s` to load a specific
> machine code binary into 0x80000. And the elf kernel can be loaded to
> that address, too.
>
> ** Affects: qemu
>      Importance: Undecided
>          Status: New
>

Regards,
Bin


As per Bin Meng, closing as not-a-bug.

Just an update on this.

You can use -bios to load your image, which will load it to address 0x80000000.

In QEMU 5.1 `-bios none -kernel Image` will load the Image to 0x80020000/0x80040000 depending on XLEN.

QEMU 5.2 will now correctly load the above mentioned Image to address 0x80000000 if you don't load a firmware (`-bios none`).