lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 22 Sep 2013 07:16:38 -0500
From:	Grant Likely <grant.likely@...aro.org>
To:	Rob Herring <robherring2@...il.com>
Cc:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
	Rob Herring <rob.herring@...xeda.com>,
	Catalin Marinas <catalin.marinas@....com>,
	Will Deacon <will.deacon@....com>,
	James Hogan <james.hogan@...tec.com>,
	Michal Simek <monstr@...str.eu>,
	Jonas Bonn <jonas@...thpole.se>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>,
	"H. Peter Anvin" <hpa@...or.com>,
	"x86@...nel.org" <x86@...nel.org>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>,
	"microblaze-uclinux@...e.uq.edu.au" 
	<microblaze-uclinux@...e.uq.edu.au>, linux@...ts.openrisc.net
Subject: Re: [PATCH 18/28] of: create default early_init_dt_add_memory_arch

On Wed, 18 Sep 2013 10:09:40 -0500, Rob Herring <robherring2@...il.com> wrote:
> On Tue, Sep 17, 2013 at 10:33 PM, Grant Likely <grant.likely@...aro.org> wrote:
> > On Mon, 16 Sep 2013 18:09:14 -0500, Rob Herring <robherring2@...il.com> wrote:
> >> From: Rob Herring <rob.herring@...xeda.com>
> >>
> >> Create a weak version of early_init_dt_add_memory_arch which uses
> >> memblock or is an empty function when memblock is not enabled. This
> >> will unify all architectures except ones with custom memory bank
> >> structs.
> >
> > Two comments below, but otherwise:
> >
> > Acked-by: Grant Likely <grant.likely@...aro.org>
> >
> >> diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
> >> index 0714dd4..a9dce7a 100644
> >> --- a/drivers/of/fdt.c
> >> +++ b/drivers/of/fdt.c
> >> @@ -688,6 +688,17 @@ u64 __init dt_mem_next_cell(int s, __be32 **cellp)
> >>       return of_read_number(p, s);
> >>  }
> >>
> >> +void __init __weak early_init_dt_add_memory_arch(u64 base, u64 size)
> >> +{
> >> +#ifdef CONFIG_HAVE_MEMBLOCK
> >> +     base &= PAGE_MASK;
> >> +     size &= PAGE_MASK;
> >> +     memblock_add(base, size);
> >> +#else
> >> +     pr_err("%s: ignoring memory (%llx, %llx)\n", __func__, base, size);
> >> +#endif
> >> +}
> >> +
> >
> > Can you do it this way instead:
> >
> > #ifdef CONFIG_HAVE_MEMBLOCK
> > void __init __weak early_init_dt_add_memory_arch(u64 base, u64 size)
> > {
> >         base &= PAGE_MASK;
> >         size &= PAGE_MASK;
> >         memblock_add(base, size);
> > }
> > #endif
> >
> > If the platform doesn't provide an early_init_dt_add_memory_arch()
> > function and it doesn't have a memblock implementation, then the build
> > should outright fail. I don't see a scenario where we would want to
> > successfully build the kernel without a working add memory function.
> 
> metag and x86 both have empty functions. I guess they get memory from
> a different boot interface.

I would put the exceptions into arch/x86 and arch/metag then. The
default answer should be that early_init_dt_add_memory_arch() works, and
the build will fail if they aren't implemented. If it really is valid to
have an empty implementation, then the architecture should have to do
something special to get that.

g.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ