RISC-V: Always compile mm/init.c with cmodel=medany and notrace
authorAnup Patel <Anup.Patel@wdc.com>
Tue, 26 Mar 2019 08:03:47 +0000 (08:03 +0000)
committerPalmer Dabbelt <palmer@sifive.com>
Wed, 27 Mar 2019 01:25:06 +0000 (18:25 -0700)
commit387181dcdb6c1ee254efab4744846a7a53d4c4cb
tree30e2aa91c25ce3dc05ee9b4f790a65e46941c050
parentdbee9c9c45846f003ec2f819710c2f4835630a6a
RISC-V: Always compile mm/init.c with cmodel=medany and notrace

The Linux RISC-V 32bit kernel is broken after we moved setup_vm() from
kernel/setup.c to mm/init.c because Linux RISC-V 32bit kernel by default
uses cmodel=medlow which results in a non-position-independent setup_vm().

This patch fixes Linux RISC-V 32bit kernel booting by:
1. Forcing cmodel=medany for mm/init.c
2. Moving remaing MM-related stuff va_pa_offset, pfn_base and
   empty_zero_page from kernel/setup.c to mm/init.c

Further, the setup_vm() cannot handle GCC instrumentation for FTRACE so
we disable it for mm/init.c by not using "-pg" compiler flag.

Fixes: 6f1e9e946f0b ("RISC-V: Move setup_vm() to mm/init.c")
Suggested-by: Christoph Hellwig <hch@lst.de>
Suggested-by: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Mike Rapoport <rppt@linux.ibm.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
arch/riscv/kernel/Makefile
arch/riscv/kernel/setup.c
arch/riscv/mm/Makefile
arch/riscv/mm/init.c