riscvarchive / riscv-linux

RISC-V Linux Port
606 stars 210 forks source link

Infinite loop in relocate #92

Closed francescodg closed 7 years ago

francescodg commented 7 years ago

We are running the kernel on FPGA with Rocket Chip core. When relocate returns with ra as a virtual address, it raises a trap that eventually ends in this loop:

    /* Set trap vector to spin forever to help debug */
    la a0, .Lsecondary_park
    csrw stvec, a0

Is this the intended behaviour? Does it mean that address translation is not performed correctly?

palmer-dabbelt commented 7 years ago

That trap loop is there to help catch bugs in early boot, so something's broken. If this still manifests with the latest freedom and freedom-u-sdk, then feel free to re-open the issue.