From: Anup Patel <anup@brainfault.org>
To: Mike Rapoport <rppt@linux.ibm.com>
Cc: Damien Le Moal <Damien.LeMoal@wdc.com>,
Anup Patel <anup.patel@wdc.com>,
Palmer Dabbelt <palmer@sifive.com>,
Christoph Hellwig <hch@infradead.org>,
Atish Patra <atish.patra@wdc.com>,
linux-riscv@lists.infradead.org
Subject: Re: 32bit kernel is broken for Linux-5.1-rc1 due to GCC cmodel=medlow
Date: Fri, 22 Mar 2019 17:59:07 +0530 [thread overview]
Message-ID: <CAAhSdy3UoX9gS=9YN6m0=qA2g-m=bw-Y-N-5CAFQZcnKA04C5g@mail.gmail.com> (raw)
In-Reply-To: <20190322104209.GB24367@rapoport-lnx>
On Fri, Mar 22, 2019 at 4:12 PM Mike Rapoport <rppt@linux.ibm.com> wrote:
>
> Hi,
>
> On Fri, Mar 22, 2019 at 11:46:24AM +0530, Anup Patel wrote:
> > Hi Palmer,
> >
> > The 32bit kernel booting is broken for Linux-5.1-rc1 due to GCC cmodel=medlow
> > affecting setup_vm() movement from kernel/setup.c to mm/init.c.
> >
> > There is no issue with 64bit kernel booting.
> >
> > The "[PATCH v2 2/5] RISC-V: Make setup_vm() independent of GCC code model"
> > fixes this issue.
> >
> > https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1959102.html
> >
> > If possible please include above patch as Linux-5.1-rc1 fix.
>
> I'm not convinced that it's the best solution. Multiple __load_pa() and
> __load_va() conversions make code unreadable.
We have many __load_pa() and __load_va() in setup_vm() here because
this patch only get's things working for 32bit RISC-V kernel.
If you look at PATCH3 of my series then you will see that use of __load_pa()
and __load_va() is simplified a lot and is easily readable. This was possible
by rewriting the initial page table setup code.
> Is there any reason swapper_pg_dir cannot be setup after 'relocate'? It'll
> save a lot of churn for the current fix and for the addition of 4K mappings
>
> I've drafted a patch that separates trampoline_pd_dir and swapper_pg_dir
> setup, if it works, the __load_pa() and __load_va() conversions can be
> applied only to the trampoline initialization. I don't have riscv hardware,
> so it's compile tested only.
I had similar views as yours but I found that trampoling_pg_dir is totally
redundant and since it is part of __init section it will break runtime hart
hotplug in future. All mapping in trampoling_pg_dir are already covered
by swapper_pg_dir. The PATCH4 in my v2 series removes trampoline_pg_dir.
We just need to map vmlinux_start to vmlinux_end and DTB in setup_vm()
that's all. Complete memory is only mapped in setup_vm_final().
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-22 12:29 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-22 6:16 32bit kernel is broken for Linux-5.1-rc1 due to GCC cmodel=medlow Anup Patel
2019-03-22 10:42 ` Mike Rapoport
2019-03-22 12:29 ` Anup Patel [this message]
2019-03-22 13:26 ` Christoph Hellwig
2019-03-22 13:38 ` Anup Patel
2019-03-22 13:25 ` Christoph Hellwig
2019-03-22 13:37 ` Anup Patel
2019-03-22 13:40 ` Christoph Hellwig
2019-03-22 13:45 ` Anup Patel
2019-03-23 17:21 ` Christoph Hellwig
2019-03-24 1:42 ` Anup Patel
2019-03-24 1:56 ` Gary Guo
2019-03-24 3:04 ` Anup Patel
2019-03-24 3:10 ` Anup Patel
2019-03-24 6:05 ` Mike Rapoport
2019-03-24 9:41 ` Anup Patel
2019-03-24 8:37 ` Christoph Hellwig
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='CAAhSdy3UoX9gS=9YN6m0=qA2g-m=bw-Y-N-5CAFQZcnKA04C5g@mail.gmail.com' \
--to=anup@brainfault.org \
--cc=Damien.LeMoal@wdc.com \
--cc=anup.patel@wdc.com \
--cc=atish.patra@wdc.com \
--cc=hch@infradead.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@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).