From: Anup Patel <anup@brainfault.org>
To: Alan Kao <alankao@andestech.com>
Cc: Palmer Dabbelt <palmer@sifive.com>,
Anup Patel <Anup.Patel@wdc.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Mike Rapoport <rppt@linux.ibm.com>,
Christoph Hellwig <hch@infradead.org>,
Atish Patra <Atish.Patra@wdc.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Paul Walmsley <paul.walmsley@sifive.com>,
"linux-riscv@lists.infradead.org"
<linux-riscv@lists.infradead.org>
Subject: Re: [PATCH v2] RISC-V: Always compile mm/init.c with cmodel=medany
Date: Mon, 25 Mar 2019 12:29:00 +0530 [thread overview]
Message-ID: <CAAhSdy1wZB-A9Gon5=X21Hnf59hGktggO1f0iERq9eC6Zz-JCQ@mail.gmail.com> (raw)
In-Reply-To: <20190325052550.GA30996@andestech.com>
On Mon, Mar 25, 2019 at 10:56 AM Alan Kao <alankao@andestech.com> wrote:
>
> Hi Anup,
>
> Sorry for being late to the party. I think one more thing should
> move together with setup_vm():
>
> On Mon, Mar 25, 2019 at 03:37:38AM +0000, Anup Patel wrote:
> > 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
> >
> > 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>
> > ---
> > v2: Removed CFLAGS_setup.o from kernel/Makefile and replaced SoBs
> > ---
> > arch/riscv/kernel/Makefile | 2 --
> > arch/riscv/kernel/setup.c | 8 --------
> > arch/riscv/mm/Makefile | 2 ++
> > arch/riscv/mm/init.c | 9 +++++++++
> > 4 files changed, 11 insertions(+), 10 deletions(-)
> >
> > diff --git a/arch/riscv/kernel/Makefile b/arch/riscv/kernel/Makefile
> > index f13f7f276639..8b9780b6bd7f 100644
> > --- a/arch/riscv/kernel/Makefile
> > +++ b/arch/riscv/kernel/Makefile
>
> earlier in this file, there are four lines about ftrace,
>
> 5 ifdef CONFIG_FTRACE
> 6 CFLAGS_REMOVE_ftrace.o = -pg
> 7 CFLAGS_REMOVE_setup.o = -pg
> 8 endif
>
> removing "-pg" flag from setup.o was necessary for ftrace to work, since
> setup_vm() cannot process the trampoline of ftrace properly.
>
> As setup_vm() is being moved to mm/init.c, you may either mark it with a
> "notrace" attribute with its declaration, or adding corresponding CFLAGS_REMOVE*
> to mm/Makefile.
Let's handle it in same way as it was handled for kernel/setup.o
Most of the stuff is already moved to mm/init.c so no need for
"CFLAGS_REMOVE_setup.o = -pg"
I will send-out v3 with above changes and also update patch description
accordingly.
Regards,
Anup
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2019-03-25 6:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-25 3:37 [PATCH v2] RISC-V: Always compile mm/init.c with cmodel=medany Anup Patel
2019-03-25 5:25 ` Alan Kao
2019-03-25 6:48 ` Christoph Hellwig
2019-03-25 7:01 ` Anup Patel
2019-03-26 2:22 ` Palmer Dabbelt
2019-03-26 4:01 ` Anup Patel
2019-03-27 0:10 ` Alistair Francis
2019-03-25 6:59 ` Anup Patel [this message]
2019-03-25 6:12 ` Mike Rapoport
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAAhSdy1wZB-A9Gon5=X21Hnf59hGktggO1f0iERq9eC6Zz-JCQ@mail.gmail.com' \
--to=anup@brainfault.org \
--cc=Anup.Patel@wdc.com \
--cc=Atish.Patra@wdc.com \
--cc=alankao@andestech.com \
--cc=aou@eecs.berkeley.edu \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@sifive.com \
--cc=paul.walmsley@sifive.com \
--cc=rppt@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).