Re: [PATCH 1/4] powerpc/prom: avoid endian conversions for linux, memory-limit node

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2017-08-04 at 11:37 +1000, Benjamin Herrenschmidt wrote:
> On Thu, 2017-08-03 at 14:54 +0530, Hari Bathini wrote:
> > As linux,memory-limit node is set and also later used by the kernel,
> > avoid endian conversions for this property.
> > 
> > Fixes: 493adffcb43f ("powerpc: Make prom_init.c endian safe")
> > Cc: stable@xxxxxxxxxxxxxxx # 3.12+
> > Cc: Anton Blanchard <anton@xxxxxxxxxx>
> > Cc: Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>
> > Signed-off-by: Hari Bathini <hbathini@xxxxxxxxxxxxxxxxxx>
> > ---
> >  arch/powerpc/kernel/prom_init.c |    3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> > 
> > diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
> > index 613f79f..723df83 100644
> > --- a/arch/powerpc/kernel/prom_init.c
> > +++ b/arch/powerpc/kernel/prom_init.c
> > @@ -3180,9 +3180,8 @@ unsigned long __init prom_init(unsigned long r3, unsigned long r4,
> >  	 * Fill in some infos for use by the kernel later on
> >  	 */
> >  	if (prom_memory_limit) {
> > -		__be64 val = cpu_to_be64(prom_memory_limit);
> >  		prom_setprop(prom.chosen, "/chosen", "linux,memory-limit",
> > -			     &val, sizeof(val));
> > +			     &prom_memory_limit, sizeof(prom_memory_limit));
> >  	}
> >  #ifdef CONFIG_PPC64
> >  	if (prom_iommu_off)
> 
> NACK. The device-tree is big endian by convention

Also that probably breaks kexec.

Cheers,
Ben.




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]