[PATCH v2 2/2] ARM: move device tree mapping out of linear region
Nicolas Pitre
nico at fluxnic.net
Wed Oct 7 12:38:50 EDT 2020
On Wed, 7 Oct 2020, Ard Biesheuvel wrote:
> On Wed, 7 Oct 2020 at 17:28, Nicolas Pitre <nico at fluxnic.net> wrote:
> >
> > On Wed, 7 Oct 2020, Ard Biesheuvel wrote:
> >
> > > @@ -947,7 +949,7 @@ static void __init create_mapping(struct map_desc *md)
> > > return;
> > > }
> > >
> > > - if ((md->type == MT_DEVICE || md->type == MT_ROM) &&
> > > + if (md->type == MT_DEVICE &&
> > > md->virtual >= PAGE_OFFSET && md->virtual < FIXADDR_START &&
> > > (md->virtual < VMALLOC_START || md->virtual >= VMALLOC_END)) {
> > > pr_warn("BUG: mapping for 0x%08llx at 0x%08lx out of vmalloc space\n",
> >
> > Hmmm... I wonder why MT_ROM was there in the first place.
> >
> > Digging into the history of this particular test (which has seen many
> > slight variations over the years and could probably be simplified
> > further nowdays) I finally found where that MT_ROM condition was
> > introduced:
> >
> > https://git.kernel.org/pub/scm/linux/kernel/git/history/history.git/commit/?id=457450ab3b94
> >
> > Oh well...
> >
>
> I didn't dig quite that far, but I did notice that the test predates
> get Git era.
I was just wondering who added that useless condition given that the
only MT_ROM usage before your patch was for the XIP mapping of the
kernel which is always located in the module area i.e. below
PAGE_OFFSET.
Nicolas
More information about the linux-arm-kernel
mailing list