From: Scott Wood <scottwood@freescale.com>
To: Kevin Hao <haokexin@gmail.com>
Cc: linuxppc <linuxppc-dev@lists.ozlabs.org>
Subject: Re: [v3, 3/7] powerpc: enable the relocatable support for the fsl booke 32bit kernel
Date: Fri, 3 Jan 2014 18:49:09 -0600 [thread overview]
Message-ID: <1388796549.11795.100.camel@snotra.buserror.net> (raw)
In-Reply-To: <20131220074339.GA23977@pek-khao-d1.corp.ad.wrs.com>
On Fri, 2013-12-20 at 15:43 +0800, Kevin Hao wrote:
> On Wed, Dec 18, 2013 at 05:48:25PM -0600, Scott Wood wrote:
> > On Wed, Aug 07, 2013 at 09:18:31AM +0800, Kevin Hao wrote:
> > > This is based on the codes in the head_44x.S. The difference is that
> > > the init tlb size we used is 64M. With this patch we can only load the
> > > kernel at address between memstart_addr ~ memstart_addr + 64M. We will
> > > fix this restriction in the following patches.
> >
> > Which following patch fixes the restriction? With all seven patches
> > applied, I was still only successful booting within 64M of memstart_addr.
>
> There is bug in this patch series when booting above the 64M. It seems
> that I missed to test this previously. Sorry for that. With the following
> change I can boot the kernel at 0x5000000.
I tried v4 and it still doesn't work for me over 64M (without increasing
the start of memory). I pulled the following out of the log buffer when
booting at 0x5000000 (after cleaning up the binary goo -- is that
something new?):
Unable to handle kernel paging request for data at address 0xbffe4008
Faulting instruction address: 0xc16ee934
Oops: Kernel access of bad area, sig: 11 [#1]
SMP NR_CPUS=8
Modules linked in:
CPU: 0 PID: 0 Comm: swapper Not tainted 3.13.0-rc1-00065-g422752a #12
task: c18f2340 ti: c192c000 task.ti: c192c000
NIP: c16ee934 LR: c16d1860 CTR: c100e96c
REGS: c192dee0 TRAP: 0300 Not tainted (3.13.0-rc1-00065-g422752a)
MSR: 00021002 <CE,ME> CR: 42044022 XER: 20000000
DEAR: bffe4008 ESR: 00000000
GPR00: c16d1860 c192df90 c18f2340 c16eec58 00000000 00000000 05000000 00000000
GPR08: 00000000 bffe4000 00000000 bc000000 00000000 0570ad40 ffffffff 7ffb0aec
GPR16: 00000000 00000000 7fe4dd70 00000000 7fe4ddb0 00000000 c192c000 00000007
GPR24: 00000000 c1940000 c16eec58 00000000 ffffffff 03fe4000 00000000 c18f0000
NIP [c16ee934] of_scan_flat_dt+0x28/0x148
LR [c16d1860] early_get_first_memblock_info+0x38/0x84
Call Trace:
[c192dfc0] [c16d1860] early_get_first_memblock_info+0x38/0x84
[c192dfd0] [c16d4888] relocate_init+0x98/0x160
[c192dff0] [c100045c] set_ivor+0x144/0x190
Instruction dump:
7c0803a6 4e800020 9421ffd0 7c0802a6 bee1000c 3f20c194 8139a45c 7c7a1b78
90010034 7c9b2378 3b80ffff 3ae00007 <83e90008> 3b00fff8 7fe9fa14 48000008
---[ end trace 41ed10ed80b8d831 ]---
Kernel panic - not syncing: Attempted to kill the idle task!
> diff --git a/arch/powerpc/mm/fsl_booke_mmu.c b/arch/powerpc/mm/fsl_booke_mmu.c
> index 048d716ae706..ce0c7d7db6c3 100644
> --- a/arch/powerpc/mm/fsl_booke_mmu.c
> +++ b/arch/powerpc/mm/fsl_booke_mmu.c
> @@ -171,11 +171,10 @@ unsigned long calc_cam_sz(unsigned long ram, unsigned long virt,
> return 1UL << camsize;
> }
>
> -unsigned long map_mem_in_cams(unsigned long ram, int max_cam_idx)
> +static unsigned long map_mem_in_cams_addr(phys_addr_t phys, unsigned long virt,
> + unsigned long ram, int max_cam_idx)
> {
> int i;
> - unsigned long virt = PAGE_OFFSET;
> - phys_addr_t phys = memstart_addr;
> unsigned long amount_mapped = 0;
>
> /* Calculate CAM values */
> @@ -195,6 +194,14 @@ unsigned long map_mem_in_cams(unsigned long ram, int max_cam_idx)
> return amount_mapped;
> }
>
> +unsigned long map_mem_in_cams(unsigned long ram, int max_cam_idx)
> +{
> + unsigned long virt = PAGE_OFFSET;
> + phys_addr_t phys = memstart_addr;
> +
> + return map_mem_in_cams_addr(phys, virt, ram, max_cam_idx);
> +}
> +
> #ifdef CONFIG_PPC32
>
> #if defined(CONFIG_LOWMEM_CAM_NUM_BOOL) && (CONFIG_LOWMEM_CAM_NUM >= NUM_TLBCAMS)
> @@ -289,7 +296,11 @@ notrace void __init relocate_init(u64 dt_ptr, phys_addr_t start)
> is_second_reloc = 1;
> n = switch_to_as1();
> /* map a 64M area for the second relocation */
> - map_mem_in_cams(0x4000000UL, CONFIG_LOWMEM_CAM_NUM);
> + if (memstart_addr > start)
> + map_mem_in_cams(0x4000000, CONFIG_LOWMEM_CAM_NUM);
> + else
> + map_mem_in_cams_addr(start, PAGE_OFFSET - offset,
> + 0x4000000, CONFIG_LOWMEM_CAM_NUM);
> restore_to_as0(n, offset, __va(dt_ptr));
> /* We should never reach here */
> panic("Relocation error");
>
I'm having a hard time following the logic here. What is PAGE_OFFSET -
offset supposed to be? Why would we map anything belowe PAGE_OFFSET?
-Scott
next prev parent reply other threads:[~2014-01-04 0:49 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-07 1:18 [PATCH v3 0/7] powerpc: enable the relocatable support for fsl booke 32bit kernel Kevin Hao
2013-08-07 1:18 ` [PATCH v3 1/7] powerpc/fsl_booke: protect the access to MAS7 Kevin Hao
2013-08-07 1:18 ` [PATCH v3 2/7] powerpc/fsl_booke: introduce get_phys_addr function Kevin Hao
2013-08-07 1:18 ` [PATCH v3 3/7] powerpc: enable the relocatable support for the fsl booke 32bit kernel Kevin Hao
2013-12-18 23:48 ` [v3, " Scott Wood
2013-12-20 7:43 ` Kevin Hao
2014-01-04 0:49 ` Scott Wood [this message]
2014-01-04 6:34 ` Kevin Hao
2014-01-07 23:46 ` Scott Wood
2014-01-08 2:42 ` Kevin Hao
2014-01-08 21:46 ` Scott Wood
2014-01-09 0:02 ` Scott Wood
2014-01-09 1:39 ` Kevin Hao
2013-08-07 1:18 ` [PATCH v3 4/7] powerpc/fsl_booke: set the tlb entry for the kernel address in AS1 Kevin Hao
2013-08-07 1:18 ` [PATCH v3 5/7] powerpc: introduce early_get_first_memblock_info Kevin Hao
2013-08-07 1:18 ` [PATCH v3 6/7] powerpc/fsl_booke: make sure PAGE_OFFSET map to memstart_addr for relocatable kernel Kevin Hao
2013-08-07 1:18 ` [PATCH v3 7/7] powerpc/fsl_booke: enable the relocatable for the kdump kernel Kevin Hao
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=1388796549.11795.100.camel@snotra.buserror.net \
--to=scottwood@freescale.com \
--cc=haokexin@gmail.com \
--cc=linuxppc-dev@lists.ozlabs.org \
/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).