linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* RE: [ARMv8] kernel entry point
       [not found]   ` <VI1PR0401MB2496C34266F4220813AFA05EF1310@VI1PR0401MB2496.eurprd04.prod.outlook.com>
@ 2019-05-10 13:24     ` Pankaj Bansal
  2019-05-10 13:40       ` Mark Rutland
  0 siblings, 1 reply; 4+ messages in thread
From: Pankaj Bansal @ 2019-05-10 13:24 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Ard Biesheuvel
  Cc: Wasim Khan, Varun Sethi, linux-arm-kernel

+ Ard,
Hi Ard,

Can you please check below mail? We are not able to boot linux loading Image at 16MB offset (0x81000000) from DDR start address (0x80000000)
I have tested with both u-boot as well as atf.

This issue is occurring with latest kernel (5.1) Image.
If I revert kernel code to commit a7f8de168ace ("arm64: allow kernel Image to be loaded anywhere in physical memory "), then this issue doesn't occur.

Do you know why the support of "loading kernel Image anywhere in memory" has been removed in latest kernel ?

Regards,
Pankaj Bansal

> -----Original Message-----
> From: Pankaj Bansal
> Sent: Tuesday, 7 May, 2019 04:03 PM
> To: 'Catalin Marinas' <catalin.marinas@arm.com>; 'Will Deacon'
> <will.deacon@arm.com>
> Cc: 'linux-arm-kernel@lists.infradead.org' <linux-arm-
> kernel@lists.infradead.org>; Varun Sethi <V.Sethi@nxp.com>
> Subject: [ARMv8] kernel entry point
> 
> Hi Catalin/Will et. Al,
> 
> I am s/w engineer from NXP India Pvt. Ltd.
> I am facing an issue while booting linux on our ARMv8 based platform.
> In our platform DDR address starts from 0x80000000.
> If I load kernel image @ address 0x80080000 and then try to boot linux image
> from this address, then linux is booting fine.
> BUT if I load kernel image @ address 0x81000000 and then try to boot linux
> image from this address, then linux is not booting.
> I have tried to boot linux using u-boot as well as arm trusted firmware.
> Linux is not booting with either of these if the linux load address is 0x81000000.
> 
> I get no kernel logs like "[    0.000000] Booting Linux on physical CPU 0x0"
> 
> The linux version that I am using is 4.14.53 Can you please help me in debugging
> this issue?
> 
> Regards,
> Pankaj Bansal

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ARMv8] kernel entry point
  2019-05-10 13:24     ` [ARMv8] kernel entry point Pankaj Bansal
@ 2019-05-10 13:40       ` Mark Rutland
  2019-05-10 14:36         ` Pankaj Bansal
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Rutland @ 2019-05-10 13:40 UTC (permalink / raw)
  To: Pankaj Bansal
  Cc: Ard Biesheuvel, Catalin Marinas, Will Deacon, Wasim Khan,
	Varun Sethi, linux-arm-kernel

Hi Pankaj,

On Fri, May 10, 2019 at 01:24:55PM +0000, Pankaj Bansal wrote:
> + Ard,
> Hi Ard,
> 
> Can you please check below mail? We are not able to boot linux loading
> Image at 16MB offset (0x81000000) from DDR start address (0x80000000)
> I have tested with both u-boot as well as atf.
> 
> This issue is occurring with latest kernel (5.1) Image.  If I revert
> kernel code to commit a7f8de168ace ("arm64: allow kernel Image to be
> loaded anywhere in physical memory "), then this issue doesn't occur.

That commit allows the 2MiB base to be arbitrary, but the text_offset
must still be taken into account. That's all documented in:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/arm64/booting.txt?h=v5.1#n125

.. where we say:

| The Image must be placed text_offset bytes from a 2MB aligned base
| address anywhere in usable system RAM and called there. The region
| between the 2 MB aligned base address and the start of the image has no
| special significance to the kernel, and may be used for other purposes.
| At least image_size bytes from the start of the image must be free for
| use by the kernel.

... and where text_offset is defined in the Image header:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/arm64/booting.txt?h=v5.1#n73

On a contemporary defconfig kernel, text_offset is 0x80000, so
0x81000000 is not a valid address to load the kernel at.

I suspect that things will work if you load your kernel at 0x81080000.

I would strongly recommend you use a bootloader that parses the kernel
Image header, and respects text_offset automatically.

Thanks,
Mark.

> 
> Do you know why the support of "loading kernel Image anywhere in
> memory" has been removed in latest kernel ?
> 
> Regards,
> Pankaj Bansal
> 
> > -----Original Message-----
> > From: Pankaj Bansal
> > Sent: Tuesday, 7 May, 2019 04:03 PM
> > To: 'Catalin Marinas' <catalin.marinas@arm.com>; 'Will Deacon'
> > <will.deacon@arm.com>
> > Cc: 'linux-arm-kernel@lists.infradead.org' <linux-arm-
> > kernel@lists.infradead.org>; Varun Sethi <V.Sethi@nxp.com>
> > Subject: [ARMv8] kernel entry point
> > 
> > Hi Catalin/Will et. Al,
> > 
> > I am s/w engineer from NXP India Pvt. Ltd.
> > I am facing an issue while booting linux on our ARMv8 based platform.
> > In our platform DDR address starts from 0x80000000.
> > If I load kernel image @ address 0x80080000 and then try to boot linux image
> > from this address, then linux is booting fine.
> > BUT if I load kernel image @ address 0x81000000 and then try to boot linux
> > image from this address, then linux is not booting.
> > I have tried to boot linux using u-boot as well as arm trusted firmware.
> > Linux is not booting with either of these if the linux load address is 0x81000000.
> > 
> > I get no kernel logs like "[    0.000000] Booting Linux on physical CPU 0x0"
> > 
> > The linux version that I am using is 4.14.53 Can you please help me in debugging
> > this issue?
> > 
> > Regards,
> > Pankaj Bansal
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [ARMv8] kernel entry point
  2019-05-10 13:40       ` Mark Rutland
@ 2019-05-10 14:36         ` Pankaj Bansal
  2019-05-10 14:48           ` Mark Rutland
  0 siblings, 1 reply; 4+ messages in thread
From: Pankaj Bansal @ 2019-05-10 14:36 UTC (permalink / raw)
  To: Mark Rutland
  Cc: Ard Biesheuvel, Catalin Marinas, Will Deacon, Wasim Khan,
	Varun Sethi, linux-arm-kernel

Hi Mark,

> -----Original Message-----
> From: Mark Rutland <mark.rutland@arm.com>
> Sent: Friday, 10 May, 2019 07:11 PM
> To: Pankaj Bansal <pankaj.bansal@nxp.com>
> Cc: Catalin Marinas <catalin.marinas@arm.com>; Will Deacon
> <will.deacon@arm.com>; Ard Biesheuvel <ard.biesheuvel@linaro.org>; Wasim
> Khan <wasim.khan@nxp.com>; Varun Sethi <V.Sethi@nxp.com>; linux-arm-
> kernel@lists.infradead.org
> Subject: Re: [ARMv8] kernel entry point
> 
> Hi Pankaj,
> 
> On Fri, May 10, 2019 at 01:24:55PM +0000, Pankaj Bansal wrote:
> > + Ard,
> > Hi Ard,
> >
> > Can you please check below mail? We are not able to boot linux loading
> > Image at 16MB offset (0x81000000) from DDR start address (0x80000000)
> > I have tested with both u-boot as well as atf.
> >
> > This issue is occurring with latest kernel (5.1) Image.  If I revert
> > kernel code to commit a7f8de168ace ("arm64: allow kernel Image to be
> > loaded anywhere in physical memory "), then this issue doesn't occur.
> 
> That commit allows the 2MiB base to be arbitrary, but the text_offset must still
> be taken into account. That's all documented in:
> 
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.kernel
> .org%2Fpub%2Fscm%2Flinux%2Fkernel%2Fgit%2Ftorvalds%2Flinux.git%2Ftree%
> 2FDocumentation%2Farm64%2Fbooting.txt%3Fh%3Dv5.1%23n125&amp;data=
> 02%7C01%7Cpankaj.bansal%40nxp.com%7C045f77d8202040db896108d6d54d1
> 5f2%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C636930924443311
> 148&amp;sdata=nOHlA67bfSc21hS0kTnHGJ%2BqxSa2KvAGnRPq7%2FEQgmg%3
> D&amp;reserved=0
> 
> .. where we say:
> 
> | The Image must be placed text_offset bytes from a 2MB aligned base
> | address anywhere in usable system RAM and called there. The region
> | between the 2 MB aligned base address and the start of the image has
> | no special significance to the kernel, and may be used for other purposes.
> | At least image_size bytes from the start of the image must be free for
> | use by the kernel.
> 
> ... and where text_offset is defined in the Image header:
> 
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.kernel
> .org%2Fpub%2Fscm%2Flinux%2Fkernel%2Fgit%2Ftorvalds%2Flinux.git%2Ftree%
> 2FDocumentation%2Farm64%2Fbooting.txt%3Fh%3Dv5.1%23n73&amp;data=0
> 2%7C01%7Cpankaj.bansal%40nxp.com%7C045f77d8202040db896108d6d54d15
> f2%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C6369309244433111
> 48&amp;sdata=Zw2JQ176V6cFXz%2BFcS1uJuYkCZUISjHI%2Bb3HNnkf30k%3D&a
> mp;reserved=0
> 
> On a contemporary defconfig kernel, text_offset is 0x80000, so
> 0x81000000 is not a valid address to load the kernel at.
> 
> I suspect that things will work if you load your kernel at 0x81080000.

Thank you for this tip. It worked.

> 
> I would strongly recommend you use a bootloader that parses the kernel Image
> header, and respects text_offset automatically.

I am using u-boot. I don't know if uboot takes into account text_offset in kernel Image header.
I don't think it's there, otherwise uboot would have given an error to respect the load address requirements.
I will ask uboot maintainer if such checks (load address = 2MB aligned + text_offset) can be added in uboot.
Thanks again for your help.

> 
> Thanks,
> Mark.
> 
> >
> > Do you know why the support of "loading kernel Image anywhere in
> > memory" has been removed in latest kernel ?
> >
> > Regards,
> > Pankaj Bansal
> >
> > > -----Original Message-----
> > > From: Pankaj Bansal
> > > Sent: Tuesday, 7 May, 2019 04:03 PM
> > > To: 'Catalin Marinas' <catalin.marinas@arm.com>; 'Will Deacon'
> > > <will.deacon@arm.com>
> > > Cc: 'linux-arm-kernel@lists.infradead.org' <linux-arm-
> > > kernel@lists.infradead.org>; Varun Sethi <V.Sethi@nxp.com>
> > > Subject: [ARMv8] kernel entry point
> > >
> > > Hi Catalin/Will et. Al,
> > >
> > > I am s/w engineer from NXP India Pvt. Ltd.
> > > I am facing an issue while booting linux on our ARMv8 based platform.
> > > In our platform DDR address starts from 0x80000000.
> > > If I load kernel image @ address 0x80080000 and then try to boot
> > > linux image from this address, then linux is booting fine.
> > > BUT if I load kernel image @ address 0x81000000 and then try to boot
> > > linux image from this address, then linux is not booting.
> > > I have tried to boot linux using u-boot as well as arm trusted firmware.
> > > Linux is not booting with either of these if the linux load address is
> 0x81000000.
> > >
> > > I get no kernel logs like "[    0.000000] Booting Linux on physical CPU 0x0"
> > >
> > > The linux version that I am using is 4.14.53 Can you please help me
> > > in debugging this issue?
> > >
> > > Regards,
> > > Pankaj Bansal
> >
> > _______________________________________________
> > linux-arm-kernel mailing list
> > linux-arm-kernel@lists.infradead.org
> > https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists
> > .infradead.org%2Fmailman%2Flistinfo%2Flinux-arm-
> kernel&amp;data=02%7C0
> >
> 1%7Cpankaj.bansal%40nxp.com%7C045f77d8202040db896108d6d54d15f2%7C
> 686ea
> >
> 1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C636930924443311148&amp;sda
> ta=Ykm
> > rBwDOYYLdrOtWFDeBxY2on3xwBP%2F8O1seKm9aiio%3D&amp;reserved=0

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ARMv8] kernel entry point
  2019-05-10 14:36         ` Pankaj Bansal
@ 2019-05-10 14:48           ` Mark Rutland
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Rutland @ 2019-05-10 14:48 UTC (permalink / raw)
  To: Pankaj Bansal
  Cc: Ard Biesheuvel, Catalin Marinas, Will Deacon, Wasim Khan,
	Varun Sethi, linux-arm-kernel

On Fri, May 10, 2019 at 02:36:37PM +0000, Pankaj Bansal wrote:
> Hi Mark,
> 
> > -----Original Message-----
> > From: Mark Rutland <mark.rutland@arm.com>
> > Sent: Friday, 10 May, 2019 07:11 PM
> > To: Pankaj Bansal <pankaj.bansal@nxp.com>
> > Cc: Catalin Marinas <catalin.marinas@arm.com>; Will Deacon
> > <will.deacon@arm.com>; Ard Biesheuvel <ard.biesheuvel@linaro.org>; Wasim
> > Khan <wasim.khan@nxp.com>; Varun Sethi <V.Sethi@nxp.com>; linux-arm-
> > kernel@lists.infradead.org
> > Subject: Re: [ARMv8] kernel entry point

> > I would strongly recommend you use a bootloader that parses the
> > kernel Image header, and respects text_offset automatically.
> 
> I am using u-boot. I don't know if uboot takes into account
> text_offset in kernel Image header.  I don't think it's there,
> otherwise uboot would have given an error to respect the load address
> requirements.

I believe that u-boot's "booti" (boot Image) command respects
text_offset.

Thanks,
Mark.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-05-10 14:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <VI1PR0401MB2496E0C9DF38720B251C5D32F1310@VI1PR0401MB2496.eurprd04.prod.outlook.com>
     [not found] ` <VI1PR0401MB24965B8DFAC68CFA27CFEBB4F1310@VI1PR0401MB2496.eurprd04.prod.outlook.com>
     [not found]   ` <VI1PR0401MB2496C34266F4220813AFA05EF1310@VI1PR0401MB2496.eurprd04.prod.outlook.com>
2019-05-10 13:24     ` [ARMv8] kernel entry point Pankaj Bansal
2019-05-10 13:40       ` Mark Rutland
2019-05-10 14:36         ` Pankaj Bansal
2019-05-10 14:48           ` Mark Rutland

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).