foss-for-synopsys-dwc-arc-processors / linux

Helpful resources for users & developers of Linux kernel for ARC
22 stars 13 forks source link

[arc64] link 64-bit kernel at high address #55

Closed vineetgarc closed 2 years ago

vineetgarc commented 2 years ago

So far for debugging/bringup needs we've been linking 64-bit kernel in same address map as 32-bit kernel. Now time is ripe to switch to a 64-bit kernel, linked at high address such as 0xFFFF_0000_0000.

Code: https://github.com/foss-for-synopsys-dwc-arc-processors/linux/tree/arc64-high-link-wip

config CONFIG_LINUX_LINK_BASE=0xFFFF00000000 CONFIG_LINUX_RAM_BASE=0xFFFF00000000

This currently links with gcc10, but then fails to boot on nSIM fairly early.

vmlinux-210811-arc64-highaddr-gcc10.gz

VVIsaev commented 2 years ago

Just for update here: Current arc64 gcc11 is able to link the kernel, but we fail at sched_clock because of https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/issues/412#issuecomment-899575428

VVIsaev commented 2 years ago

First version of changes are pushed to https://github.com/foss-for-synopsys-dwc-arc-processors/linux/tree/arc64-high-link-wip .

It can be booted on latest HW and in qemu from https://github.com/foss-for-synopsys-dwc-arc-processors/qemu/tree/arc64-high-addr.

TBD: earlycon is disabled for now, we need to have some early_ioremap in order to use earlycon.

I didn't commit it to arc64 because we need tools support (for example qemu) in order to load vmlinux to correct address.

VVIsaev commented 2 years ago

Done in https://github.com/foss-for-synopsys-dwc-arc-processors/linux/commit/171d0c0dfbf5942947124899d4a1cf23bb2d18aa

Full-featured (earlycon/SMP/loader) after : https://github.com/foss-for-synopsys-dwc-arc-processors/linux/commit/0a5f612bd870caba984c02679f5ae39b6445670d