All of lore.kernel.org
 help / color / mirror / Atom feed
* kexec on APQ8074
@ 2014-09-11  9:46 Noé RUBINSTEIN
  2014-09-11  9:47 ` Noé RUBINSTEIN
  2014-09-12  2:02 ` Wang, Yalin
  0 siblings, 2 replies; 6+ messages in thread
From: Noé RUBINSTEIN @ 2014-09-11  9:46 UTC (permalink / raw)
  To: linux-arm-msm

Hi,

Has anyone successfully used kexec on MSM8974/APQ8074? Or are there some
outstanding issues that have to be fixed before it is possible?

I’m trying to use Linux with kexec as a second stage bootloader on my
APQ8074-based board.  I fail while loading the second kernel, with no error
message whatsoever (no panic, and I do not have access to JTAG to know what is
going on).

The kernel I use is based upon branch jb_mr1_rb1.47 of
git://codeaurora.org/quic/la/kernel/msm (tag M8974AAAAANLYA31050138)
with these commits cherry-picked from mainline for kexec support:

    2456f44 ARM: 7555/1: kexec: fix segment memory addresses check
    c564df4 ARM: 7540/1: kexec: Check segment memory addresses
    4cabd1d ARM: 7539/1: kexec: scan for dtb magic in segments

The commands I run look like this:

    /bin/kexec \
        --debug \
        --load /system/boot/Image \
        --dtb=/system/boot/dtb \
        --append="console=ttyHSL0,115200,n8 maxcpus=1 msm_rtb.filter=0x37 \
                  earlyprintk debug bootmem_debug"
    /bin/kexec -e

This goes well, but the kernel apparently stops working early-on. With
bootmem_debug and printascii-based tracing, I narrowed the freeze down inside
free_all_bootmem -> free_all_bootmem_core -> __free_pages_bootmem ->
__free_pages -> __free_pages_ok -> free_pages_prepare -> kernel_map_pages
-> poison_pages -> memset) when poisoning a page with physical adress
0x33262000.

If I disable HIGHMEM, I get the freeze a little later, in cma_create_area; the
last line that gets printed to the serial is

    [    0.614040] cma_create_area(base 00032400, count 1000)

To me, it looks like I am somehow stepping on some memory that should be left
alone, but I am not really sure where to go from here. I have a boot log
attached which shows the serial output.

Can anyone tell what might be going on?

Thanks in advance,
Noé.

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

* Re: kexec on APQ8074
  2014-09-11  9:46 kexec on APQ8074 Noé RUBINSTEIN
@ 2014-09-11  9:47 ` Noé RUBINSTEIN
  2014-09-12  2:02 ` Wang, Yalin
  1 sibling, 0 replies; 6+ messages in thread
From: Noé RUBINSTEIN @ 2014-09-11  9:47 UTC (permalink / raw)
  To: linux-arm-msm

[-- Attachment #1: Type: text/plain, Size: 2106 bytes --]

...now with attachment.

2014-09-11 11:46 GMT+02:00 Noé RUBINSTEIN <nrubinstein@aldebaran.com>:
> Hi,
>
> Has anyone successfully used kexec on MSM8974/APQ8074? Or are there some
> outstanding issues that have to be fixed before it is possible?
>
> I’m trying to use Linux with kexec as a second stage bootloader on my
> APQ8074-based board.  I fail while loading the second kernel, with no error
> message whatsoever (no panic, and I do not have access to JTAG to know what is
> going on).
>
> The kernel I use is based upon branch jb_mr1_rb1.47 of
> git://codeaurora.org/quic/la/kernel/msm (tag M8974AAAAANLYA31050138)
> with these commits cherry-picked from mainline for kexec support:
>
>     2456f44 ARM: 7555/1: kexec: fix segment memory addresses check
>     c564df4 ARM: 7540/1: kexec: Check segment memory addresses
>     4cabd1d ARM: 7539/1: kexec: scan for dtb magic in segments
>
> The commands I run look like this:
>
>     /bin/kexec \
>         --debug \
>         --load /system/boot/Image \
>         --dtb=/system/boot/dtb \
>         --append="console=ttyHSL0,115200,n8 maxcpus=1 msm_rtb.filter=0x37 \
>                   earlyprintk debug bootmem_debug"
>     /bin/kexec -e
>
> This goes well, but the kernel apparently stops working early-on. With
> bootmem_debug and printascii-based tracing, I narrowed the freeze down inside
> free_all_bootmem -> free_all_bootmem_core -> __free_pages_bootmem ->
> __free_pages -> __free_pages_ok -> free_pages_prepare -> kernel_map_pages
> -> poison_pages -> memset) when poisoning a page with physical adress
> 0x33262000.
>
> If I disable HIGHMEM, I get the freeze a little later, in cma_create_area; the
> last line that gets printed to the serial is
>
>     [    0.614040] cma_create_area(base 00032400, count 1000)
>
> To me, it looks like I am somehow stepping on some memory that should be left
> alone, but I am not really sure where to go from here. I have a boot log
> attached which shows the serial output.
>
> Can anyone tell what might be going on?
>
> Thanks in advance,
> Noé.

[-- Attachment #2: boot-log-kexec-no-highmem.txt --]
[-- Type: text/plain, Size: 18264 bytes --]

+ /bin/kexec --debug --load /system/boot/Image --dtb=/system/boot/dtb --append=root= console=ttyHSL0,115200,n8 maxcpus=1 msm_rtb.filter=0x37 ehci-hcd.park=3 systemd.log_level=debug androidboot.hardware=qcom user_debug=31 earlyprintk debug bootmem_debug  initcall_debug ddebug_query="+pflmt"
kernel: 0xb6fb1008 kernel_size: 0xc3730
kexec_load: entry = 0x8000 flags = 0x280000
nr_segments = 2
segment[0].buf   = 0xb6fb1008
segment[0].bufsz = 0xde39ac
segment[0].mem   = 0x8000
segment[0].memsz = 0xde4000
segment[1].buf   = 0xb6f8b008
segment[1].bufsz = 0x255a8
segment[1].mem   = 0x3790000
segment[1].memsz = 0x26000
[    9.371049] kexec used greatest stack depth: 5352 bytes left
+ /bin/kexec --debug -e
[    9.461616] mdss_fb_release: try to close unopened fb 1!
[    9.465895] mdss_fb_release: try to close unopened fb 0!
[    9.472458] Starting new kernel
[    0.000000] Booting Linux on physical CPU 0
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Linux version 3.4.0-g53d64ac-00068-g58f8de0-dirty (no@nrubinstein-de) (gcc version 4.8.2 (crosstool-NG hg+unknown-20140417.133548) ) #67 SMP Wed Sep 10 15:31:14 CEST 2014
[    0.000000] CPU: ARMv7 Processor [512f06f0] revision 0 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
[    0.000000] Machine: Qualcomm MSM 8974 (Flattened Device Tree), model: Qualcomm APQ 8074v2.0-1 DRAGONBOARD
[    0.000000] bootconsole [earlycon0] enabled
[    0.000000] Truncating RAM at 0ff00000-3fffffff to -34ffffff (vmalloc region overlap).
[    0.000000] Ignoring RAM at 40000000-7fffffff (vmalloc region overlap).
[    0.000000] tmc@fc322000 reserved EBI1 size 100000
[    0.000000] qcom,ion-heap@28 reserved EBI1 size 614000
[    0.000000] qcom,mdss_fb_primary reserved EBI1 size 800000
[    0.000000] qcom,cache_dump reserved EBI1 size 600000
[    0.000000] qcom,msm-rtb reserved EBI1 size 100000
[    0.000000] qcom,msm-contig-mem reserved EBI1 size 280000
[    0.000000] Node qcom,msm-mem-hole removed memory a700000-ff00000
[    0.000000] memory pool 3 (start 0x33700000 size 1900000) initialized
[    0.000000] cma: CMA: reserved 16 MiB at 32400000
[    0.000000] cma: Found secure_region, memory base 0, size 252 MiB
[    0.000000] cma: CMA: reserved 252 MiB at 22800000
[    0.000000] cma: Found adsp_region, memory base 0, size 47 MiB
[    0.000000] cma: CMA: reserved 48 MiB at 1f800000
[    0.000000] cma: Found qsecom_region, memory base 0, size 17 MiB
[    0.000000] cma: CMA: reserved 20 MiB at 1e400000
[    0.000000] Memory policy: ECC disabled, Data cache writealloc
[    0.000000] IMEM DT static mapping successful
[    0.000000] bootmem::init_bootmem_core nid=0 start=0 map=3359e end=35000 mapsize=6a00
[    0.000000] bootmem::mark_bootmem_node nid=0 start=0 end=a700 reserve=0 flags=0
[    0.000000] bootmem::__free nid=0 start=0 end=a700
[    0.000000] bootmem::mark_bootmem_node nid=0 start=ff00 end=33700 reserve=0 flags=0
[    0.000000] bootmem::__free nid=0 start=ff00 end=33700
[    0.000000] bootmem::mark_bootmem_node nid=0 start=4 end=8 reserve=1 flags=0
[    0.000000] bootmem::__reserve nid=0 start=4 end=8 flags=0
[    0.000000] bootmem::mark_bootmem_node nid=0 start=8 end=f83 reserve=1 flags=0
[    0.000000] bootmem::__reserve nid=0 start=8 end=f83 flags=0
[    0.000000] bootmem::mark_bootmem_node nid=0 start=3790 end=37b6 reserve=1 flags=0
[    0.000000] bootmem::__reserve nid=0 start=3790 end=37b6 flags=0
[    0.000000] bootmem::mark_bootmem_node nid=0 start=1e400 end=33400 reserve=1 flags=0
[    0.000000] bootmem::__reserve nid=0 start=1e400 end=33400 flags=0
[    0.000000] bootmem::mark_bootmem_node nid=0 start=3359e end=336ff reserve=1 flags=0
[    0.000000] bootmem::__reserve nid=0 start=3359e end=336ff flags=0
[    0.000000] bootmem::mark_bootmem_node nid=0 start=336ff end=33700 reserve=1 flags=0
[    0.000000] bootmem::__reserve nid=0 start=336ff end=33700 flags=0
[    0.000000] On node 0 totalpages: 188160
[    0.000000] bootmem::alloc_bootmem_core nid=0 size=774000 [1908 pages] align=40 goal=457fffff limit=0
[    0.000000] bootmem::__reserve nid=0 start=f83 end=16f7 flags=1
[    0.000000] free_area_init_node: node 0, pgdat c0dbe900, node_mem_map c0f83000
[    0.000000]   Normal zone: 1908 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 186252 pages, LIFO batch:31
[    0.000000] bootmem::alloc_bootmem_core nid=0 size=50 [1 pages] align=40 goal=457fffff limit=0
[    0.000000] bootmem::__reserve nid=0 start=16f7 end=16f8 flags=1
[    0.000000] bootmem::alloc_bootmem_core nid=0 size=6000 [6 pages] align=40 goal=457fffff limit=0
[    0.000000] bootmem::__reserve nid=0 start=16f8 end=16fe flags=1
[    0.000000] bootmem::alloc_bootmem_core nid=0 size=1c [1 pages] align=40 goal=0 limit=ffffffff
[    0.000000] bootmem::__reserve nid=0 start=16fe end=16fe flags=1
[    0.000000] bootmem::alloc_bootmem_core nid=0 size=1c [1 pages] align=40 goal=0 limit=ffffffff
[    0.000000] bootmem::__reserve nid=0 start=16fe end=16fe flags=1
[    0.000000] bootmem::alloc_bootmem_core nid=0 size=3bf64 [60 pages] align=4 goal=0 limit=0
[    0.000000] bootmem::__reserve nid=0 start=16fe end=173a flags=1
[    0.000000] bootmem::alloc_bootmem_core nid=0 size=18 [1 pages] align=4 goal=0 limit=0
[    0.000000] bootmem::__reserve nid=0 start=173a end=173a flags=1
[    0.000000] bootmem::alloc_bootmem_core nid=0 size=18 [1 pages] align=4 goal=0 limit=0
[    0.000000] bootmem::__reserve nid=0 start=173a end=173a flags=1
[    0.000000] bootmem::alloc_bootmem_core nid=0 size=19 [1 pages] align=4 goal=0 limit=0
[    0.000000] bootmem::__reserve nid=0 start=173a end=173a flags=1
[    0.000000] bootmem::alloc_bootmem_core nid=0 size=19 [1 pages] align=4 goal=0 limit=0
[    0.000000] bootmem::__reserve nid=0 start=173a end=173a flags=1
[    0.000000] bootmem::alloc_bootmem_core nid=0 size=19 [1 pages] align=4 goal=0 limit=0
[    0.000000] bootmem::__reserve nid=0 start=173a end=173a flags=1
[    0.000000] bootmem::alloc_bootmem_core nid=0 size=19 [1 pages] align=4 goal=0 limit=0
[    0.000000] bootmem::__reserve nid=0 start=173a end=173a flags=1
[    0.000000] bootmem::alloc_bootmem_core nid=0 size=d4 [1 pages] align=40 goal=0 limit=0
[    0.000000] bootmem::__reserve nid=0 start=173a end=173a flags=1
[    0.000000] bootmem::alloc_bootmem_core nid=0 size=d4 [1 pages] align=40 goal=0 limit=0
[    0.000000] bootmem::__reserve nid=0 start=173a end=173a flags=1
[    0.000000] bootmem::alloc_bootmem_core nid=0 size=1000 [1 pages] align=40 goal=0 limit=0
[    0.000000] bootmem::__reserve nid=0 start=173a end=173b flags=1
[    0.000000] bootmem::alloc_bootmem_core nid=0 size=1000 [1 pages] align=40 goal=0 limit=0
[    0.000000] bootmem::__reserve nid=0 start=173b end=173c flags=1
[    0.000000] bootmem::alloc_bootmem_core nid=0 size=24000 [36 pages] align=1000 goal=0 limit=0
[    0.000000] bootmem::__reserve nid=0 start=173c end=1760 flags=1
[    0.000000] bootmem::mark_bootmem_node nid=0 start=1745 end=1745 reserve=0 flags=0
[    0.000000] bootmem::__free nid=0 start=1745 end=1745
[    0.000000] bootmem::mark_bootmem_node nid=0 start=174e end=174e reserve=0 flags=0
[    0.000000] bootmem::__free nid=0 start=174e end=174e
[    0.000000] bootmem::mark_bootmem_node nid=0 start=1757 end=1757 reserve=0 flags=0
[    0.000000] bootmem::__free nid=0 start=1757 end=1757
[    0.000000] bootmem::mark_bootmem_node nid=0 start=1760 end=1760 reserve=0 flags=0
[    0.000000] bootmem::__free nid=0 start=1760 end=1760
[    0.000000] PERCPU: Embedded 9 pages/cpu @c173c000 s16384 r8192 d12288 u36864
[    0.000000] bootmem::alloc_bootmem_core nid=0 size=4 [1 pages] align=40 goal=0 limit=0
[    0.000000] bootmem::__reserve nid=0 start=1760 end=1761 flags=1
[    0.000000] bootmem::alloc_bootmem_core nid=0 size=4 [1 pages] align=40 goal=0 limit=0
[    0.000000] bootmem::__reserve nid=0 start=1761 end=1761 flags=1
[    0.000000] bootmem::alloc_bootmem_core nid=0 size=10 [1 pages] align=40 goal=0 limit=0
[    0.000000] bootmem::__reserve nid=0 start=1761 end=1761 flags=1
[    0.000000] bootmem::alloc_bootmem_core nid=0 size=10 [1 pages] align=40 goal=0 limit=0
[    0.000000] bootmem::__reserve nid=0 start=1761 end=1761 flags=1
[    0.000000] pcpu-alloc: s16384 r8192 d12288 u36864 alloc=9*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 
[    0.000000] bootmem::alloc_bootmem_core nid=0 size=78 [1 pages] align=40 goal=0 limit=0
[    0.000000] bootmem::__reserve nid=0 start=1761 end=1761 flags=1
[    0.000000] bootmem::alloc_bootmem_core nid=0 size=2c [1 pages] align=40 goal=0 limit=0
[    0.000000] bootmem::__reserve nid=0 start=1761 end=1761 flags=1
[    0.000000] bootmem::alloc_bootmem_core nid=0 size=2c [1 pages] align=40 goal=0 limit=0
[    0.000000] bootmem::__reserve nid=0 start=1761 end=1761 flags=1
[    0.000000] bootmem::mark_bootmem_node nid=0 start=173a end=173a reserve=0 flags=0
[    0.000000] bootmem::__free nid=0 start=173a end=173a
[    0.000000] bootmem::mark_bootmem_node nid=0 start=173b end=173b reserve=0 flags=0
[    0.000000] bootmem::__free nid=0 start=173b end=173b
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 186252
[    0.000000] Kernel command line: root= console=ttyHSL0,115200,n8 maxcpus=1 msm_rtb.filter=0x37 ehci-hcd.park=3 systemd.log_level=debug androidboot.hardware=qcom user_debug=31 earlyprintk debug bootmem_debug  initcall_debug ddebug_query="+pflmt"
[    0.000000] bootmem::alloc_bootmem_core nid=0 size=4000 [4 pages] align=40 goal=0 limit=0
[    0.000000] bootmem::__reserve nid=0 start=1761 end=1765 flags=1
[    0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] bootmem::alloc_bootmem_core nid=0 size=80000 [128 pages] align=40 goal=0 limit=0
[    0.000000] bootmem::__reserve nid=0 start=1765 end=17e5 flags=1
[    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[    0.000000] bootmem::alloc_bootmem_core nid=0 size=40000 [64 pages] align=40 goal=0 limit=0
[    0.000000] bootmem::__reserve nid=0 start=17e5 end=1825 flags=1
[    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] bootmem::mark_bootmem_node nid=0 start=10fd end=11ba reserve=0 flags=0
[    0.000000] bootmem::__free nid=0 start=10fd end=11ba
[    0.000000] bootmem::free_all_bootmem_core nid=0 start=0 end=35000
[    0.000000] bootmem::free_all_bootmem_core nid=0 released=1761b
[    0.000000] Memory: 167MB 568MB = 735MB total
[    0.000000] Memory: 383084k/383084k available, 395156k reserved, 0K highmem
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
[    0.000000]     vmalloc : 0xf0000000 - 0xff000000   ( 240 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xef800000   ( 760 MB)
[    0.000000]     modules : 0xbf000000 - 0xc0000000   (  16 MB)
[    0.000000]       .text : 0xc0008000 - 0xc0b53e18   (11568 kB)
[    0.000000]       .init : 0xc0c00000 - 0xc0d04000   (1040 kB)
[    0.000000]       .data : 0xc0d04000 - 0xc0deb988   ( 927 kB)
[    0.000000]        .bss : 0xc0deb9ac - 0xc0f82310   (1627 kB)
[    0.000000] SLUB: Genslabs=11, HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] Hierarchical RCU implementation.
[    0.000000]  RCU dyntick-idle grace-period acceleration is enabled.
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] kmemleak: Kernel memory leak detector disabled
[    0.000000] sched_clock: 32 bits at 19MHz, resolution 52ns, wraps every 223696ms
[    0.000000] Switching to timer-based delay loop
[    0.000000] Console: colour dummy device 80x30
[    0.009122] Calibrating delay loop (skipped), value calculated using timer frequency.. 38.40 BogoMIPS (lpj=192000)
[    0.019532] pid_max: default: 32768 minimum: 301
[    0.024378] Mount-cache hash table entries: 512
[    0.048255] Initializing cgroup subsys debug
[    0.051575] Initializing cgroup subsys cpuacct
[    0.056077] Initializing cgroup subsys freezer
[    0.060608] CPU: Testing write buffer coherency: ok
[    0.065863] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.073262] calling  init_hw_perf_events+0x0/0x42c @ 1
[    0.077441] hw perfevents: enabled with ARMv7 Krait PMU driver, 5 counters available
[    0.086695] initcall init_hw_perf_events+0x0/0x42c returned 0 after 9765 usecs
[    0.092955] calling  init_static_idmap+0x0/0x164 @ 1
[    0.098067] Setting up static identity map for 0x726498 - 0x726520
[    0.104241] initcall init_static_idmap+0x0/0x164 returned 0 after 0 usecs
[    0.111108] calling  init_hotplug+0x0/0x5c @ 1
[    0.115614] initcall init_hotplug+0x0/0x5c returned 0 after 0 usecs
[    0.121958] calling  xpu_err_fatal_init+0x0/0x6c @ 1
[    0.127035] Configuring XPU violations to be fatal errors
[    0.132516] initcall xpu_err_fatal_init+0x0/0x6c returned 0 after 9765 usecs
[    0.139571] calling  init_memory_dump+0x0/0x104 @ 1
[    0.144527] MSM Memory Dump table set up
[    0.148512] initcall init_memory_dump+0x0/0x104 returned 0 after 0 usecs
[    0.155292] calling  msm_restart_init+0x0/0x64 @ 1
[    0.160145] initcall msm_restart_init+0x0/0x64 returned 0 after 0 usecs
[    0.166836] calling  spawn_ksoftirqd+0x0/0x54 @ 1
[    0.171743] initcall spawn_ksoftirqd+0x0/0x54 returned 0 after 0 usecs
[    0.178209] calling  init_workqueues+0x0/0x3c8 @ 1
[    0.183358] initcall init_workqueues+0x0/0x3c8 returned 0 after 0 usecs
[    0.189754] calling  __might_sleep_init+0x0/0x20 @ 1
[    0.194779] initcall __might_sleep_init+0x0/0x20 returned 0 after 0 usecs
[    0.201645] calling  migration_init+0x0/0x74 @ 1
[    0.206328] initcall migration_init+0x0/0x74 returned 0 after 0 usecs
[    0.212843] calling  cpu_stop_init+0x0/0xd8 @ 1
[    0.217486] initcall cpu_stop_init+0x0/0xd8 returned 0 after 0 usecs
[    0.223867] calling  rcu_scheduler_really_started+0x0/0x18 @ 1
[    0.229761] initcall rcu_scheduler_really_started+0x0/0x18 returned 0 after 0 usecs
[    0.237495] calling  relay_init+0x0/0x18 @ 1
[    0.241829] initcall relay_init+0x0/0x18 returned 0 after 0 usecs
[    0.247998] calling  tracer_alloc_buffers+0x0/0x190 @ 1
[    0.253327] initcall tracer_alloc_buffers+0x0/0x190 returned 0 after 0 usecs
[    0.260412] calling  init_trace_printk+0x0/0xc @ 1
[    0.265265] initcall init_trace_printk+0x0/0xc returned 0 after 0 usecs
[    0.272006] smp_init();
[    0.274465] Brought up 1 CPUs
[    0.277503] SMP: Total of 1 processors activated (38.40 BogoMIPS).
[    0.283760] sched_init_smp();
[    0.286863] do_basic_setup();
[    0.289828] cpuset_init_smp();
[    0.292953] usermodehelper_init();
[    0.296489] shmem_init();
[    0.299195] driver_init();
[    0.302050] devtmpfs: initialized
[    0.305415] init_irq_proc();
[    0.312556] do_ctors();
[    0.314039] usermodehelper_enable();
[    0.317687] do_initcalls();
[    0.320770] calling  init_watchdog+0x0/0xc @ 1
[    0.325091] initcall init_watchdog+0x0/0xc returned 0 after 0 usecs
[    0.331415] calling  ipc_ns_init+0x0/0x18 @ 1
[    0.335831] initcall ipc_ns_init+0x0/0x18 returned 0 after 0 usecs
[    0.342088] calling  init_mmap_min_addr+0x0/0x20 @ 1
[    0.347115] initcall init_mmap_min_addr+0x0/0x20 returned 0 after 0 usecs
[    0.353983] calling  init_cpufreq_transition_notifier_list+0x0/0x24 @ 1
[    0.360663] initcall init_cpufreq_transition_notifier_list+0x0/0x24 returned 0 after 0 usecs
[    0.369172] calling  net_ns_init+0x0/0xf0 @ 1
[    0.373664] initcall net_ns_init+0x0/0xf0 returned 0 after 0 usecs
[    0.380012] calling  ptrace_break_init+0x0/0x2c @ 1
[    0.384790] initcall ptrace_break_init+0x0/0x2c returned 0 after 0 usecs
[    0.391567] calling  v6_userpage_init+0x0/0x8 @ 1
[    0.396333] initcall v6_userpage_init+0x0/0x8 returned 0 after 0 usecs
[    0.402939] calling  msm_pm_setup_saved_state+0x0/0x1b0 @ 1
[    0.408654] initcall msm_pm_setup_saved_state+0x0/0x1b0 returned 0 after 0 usecs
[    0.416048] calling  msm_rq_stats_early_init+0x0/0x18 @ 1
[    0.421508] initcall msm_rq_stats_early_init+0x0/0x18 returned 0 after 0 usecs
[    0.428807] calling  cpu_hotplug_pm_sync_init+0x0/0x18 @ 1
[    0.434355] initcall cpu_hotplug_pm_sync_init+0x0/0x18 returned 0 after 0 usecs
[    0.441741] calling  alloc_frozen_cpus+0x0/0x8 @ 1
[    0.446594] initcall alloc_frozen_cpus+0x0/0x8 returned 0 after 0 usecs
[    0.453286] calling  ksysfs_init+0x0/0xa0 @ 1
[    0.457724] initcall ksysfs_init+0x0/0xa0 returned 0 after 0 usecs
[    0.463962] calling  pm_init+0x0/0xb8 @ 1
[    0.468061] initcall pm_init+0x0/0xb8 returned 0 after 0 usecs
[    0.473937] calling  init_jiffies_clocksource+0x0/0xc @ 1
[    0.479417] initcall init_jiffies_clocksource+0x0/0xc returned 0 after 0 usecs
[    0.486701] calling  cpu_pm_init+0x0/0x18 @ 1
[    0.491136] initcall cpu_pm_init+0x0/0x18 returned 0 after 0 usecs
[    0.497375] calling  init_zero_pfn+0x0/0x40 @ 1
[    0.501985] initcall init_zero_pfn+0x0/0x40 returned 0 after 0 usecs
[    0.508399] calling  fsnotify_init+0x0/0x24 @ 1
[    0.513014] initcall fsnotify_init+0x0/0x24 returned 0 after 0 usecs
[    0.519423] calling  filelock_init+0x0/0x3c @ 1
[    0.524036] initcall filelock_init+0x0/0x3c returned 0 after 0 usecs
[    0.530448] calling  init_misc_binfmt+0x0/0x30 @ 1
[    0.535320] initcall init_misc_binfmt+0x0/0x30 returned 0 after 0 usecs
[    0.541993] calling  init_script_binfmt+0x0/0x1c @ 1
[    0.547037] initcall init_script_binfmt+0x0/0x1c returned 0 after 0 usecs
[    0.553885] calling  init_elf_binfmt+0x0/0x1c @ 1
[    0.558668] initcall init_elf_binfmt+0x0/0x1c returned 0 after 0 usecs
[    0.565257] calling  debugfs_init+0x0/0x64 @ 1
[    0.569787] initcall debugfs_init+0x0/0x64 returned 0 after 0 usecs
[    0.576108] calling  random32_init+0x0/0xd8 @ 1
[    0.580718] initcall random32_init+0x0/0xd8 returned 0 after 0 usecs
[    0.587132] calling  regulator_init+0x0/0x7c @ 1
[    0.591997] dummy: 
[    0.594050] initcall regulator_init+0x0/0x7c returned 0 after 0 usecs
[    0.600501] calling  cma_init_reserved_areas+0x0/0x324 @ 1
[    0.606063] base=32400 count=1000
[    0.609439] cma = cma_create_area(base, count);
[    0.614040] cma_create_area(base 00032400, count 1000)

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

* RE: kexec on APQ8074
  2014-09-11  9:46 kexec on APQ8074 Noé RUBINSTEIN
  2014-09-11  9:47 ` Noé RUBINSTEIN
@ 2014-09-12  2:02 ` Wang, Yalin
  2014-09-12 16:05   ` Noé RUBINSTEIN
  1 sibling, 1 reply; 6+ messages in thread
From: Wang, Yalin @ 2014-09-12  2:02 UTC (permalink / raw)
  To: 'Noé RUBINSTEIN', linux-arm-msm

Hi

What's your @memory parameters in your dtb file?
And what's your PHYSICAL_OFFSET of your kexec kernel ?

Thanks

-----Original Message-----
From: linux-arm-msm-owner@vger.kernel.org [mailto:linux-arm-msm-owner@vger.kernel.org] On Behalf Of Noé RUBINSTEIN
Sent: Thursday, September 11, 2014 5:46 PM
To: linux-arm-msm@vger.kernel.org
Subject: kexec on APQ8074

Hi,

Has anyone successfully used kexec on MSM8974/APQ8074? Or are there some outstanding issues that have to be fixed before it is possible?

I’m trying to use Linux with kexec as a second stage bootloader on my APQ8074-based board.  I fail while loading the second kernel, with no error message whatsoever (no panic, and I do not have access to JTAG to know what is going on).

The kernel I use is based upon branch jb_mr1_rb1.47 of git://codeaurora.org/quic/la/kernel/msm (tag M8974AAAAANLYA31050138) with these commits cherry-picked from mainline for kexec support:

    2456f44 ARM: 7555/1: kexec: fix segment memory addresses check
    c564df4 ARM: 7540/1: kexec: Check segment memory addresses
    4cabd1d ARM: 7539/1: kexec: scan for dtb magic in segments

The commands I run look like this:

    /bin/kexec \
        --debug \
        --load /system/boot/Image \
        --dtb=/system/boot/dtb \
        --append="console=ttyHSL0,115200,n8 maxcpus=1 msm_rtb.filter=0x37 \
                  earlyprintk debug bootmem_debug"
    /bin/kexec -e

This goes well, but the kernel apparently stops working early-on. With bootmem_debug and printascii-based tracing, I narrowed the freeze down inside free_all_bootmem -> free_all_bootmem_core -> __free_pages_bootmem -> __free_pages -> __free_pages_ok -> free_pages_prepare -> kernel_map_pages
-> poison_pages -> memset) when poisoning a page with physical adress
0x33262000.

If I disable HIGHMEM, I get the freeze a little later, in cma_create_area; the last line that gets printed to the serial is

    [    0.614040] cma_create_area(base 00032400, count 1000)

To me, it looks like I am somehow stepping on some memory that should be left alone, but I am not really sure where to go from here. I have a boot log attached which shows the serial output.

Can anyone tell what might be going on?

Thanks in advance,
Noé.
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: kexec on APQ8074
  2014-09-12  2:02 ` Wang, Yalin
@ 2014-09-12 16:05   ` Noé RUBINSTEIN
  2014-09-13  0:14     ` 回复: " Wang, Yalin
  0 siblings, 1 reply; 6+ messages in thread
From: Noé RUBINSTEIN @ 2014-09-12 16:05 UTC (permalink / raw)
  To: Wang, Yalin; +Cc: linux-arm-msm

2014-09-12 4:02 GMT+02:00 Wang, Yalin <Yalin.Wang@sonymobile.com>:
> What's your @memory parameters in your dtb file?
> And what's your PHYSICAL_OFFSET of your kexec kernel ?

TEXT_OFFSET is 0x8000;

Here's the content of the memory node:

        memory {
                #address-cells = <0x1>;
                #size-cells = <0x1>;
                device_type = "memory";
                reg = <0x0 0x40000000 0x40000000 0x40000000>;

                secure_region {
                        linux,contiguous-region;
                        reg = <0x0 0xfc00000>;
                        label = "secure_mem";
                        linux,phandle = <0x1b>;
                        phandle = <0x1b>;
                };

                adsp_region {
                        linux,contiguous-region;
                        reg = <0x0 0x2f00000>;
                        label = "adsp_mem";
                        linux,phandle = <0x1c>;
                        phandle = <0x1c>;
                };

                qsecom_region {
                        linux,contiguous-region;
                        reg = <0x0 0x1100000>;
                        label = "qseecom_mem";
                        linux,phandle = <0x1d>;
                        phandle = <0x1d>;
                };
        };

Thanks a lot,
Noé

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

* 回复: kexec on APQ8074
  2014-09-12 16:05   ` Noé RUBINSTEIN
@ 2014-09-13  0:14     ` Wang, Yalin
  2014-09-16  7:48       ` Noé RUBINSTEIN
  0 siblings, 1 reply; 6+ messages in thread
From: Wang, Yalin @ 2014-09-13  0:14 UTC (permalink / raw)
  To: Noé RUBINSTEIN; +Cc: linux-arm-msm

Do you pass a initrd to kexec kernel?
i don't see it.

- 发送自我的Sony Xperia™智能手机

---- Noé RUBINSTEIN编写 ----


2014-09-12 4:02 GMT+02:00 Wang, Yalin <Yalin.Wang@sonymobile.com>:
> What's your @memory parameters in your dtb file?
> And what's your PHYSICAL_OFFSET of your kexec kernel ?

TEXT_OFFSET is 0x8000;

Here's the content of the memory node:

        memory {
                #address-cells = <0x1>;
                #size-cells = <0x1>;
                device_type = "memory";
                reg = <0x0 0x40000000 0x40000000 0x40000000>;

                secure_region {
                        linux,contiguous-region;
                        reg = <0x0 0xfc00000>;
                        label = "secure_mem";
                        linux,phandle = <0x1b>;
                        phandle = <0x1b>;
                };

                adsp_region {
                        linux,contiguous-region;
                        reg = <0x0 0x2f00000>;
                        label = "adsp_mem";
                        linux,phandle = <0x1c>;
                        phandle = <0x1c>;
                };

                qsecom_region {
                        linux,contiguous-region;
                        reg = <0x0 0x1100000>;
                        label = "qseecom_mem";
                        linux,phandle = <0x1d>;
                        phandle = <0x1d>;
                };
        };

Thanks a lot,
Noé

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

* Re: kexec on APQ8074
  2014-09-13  0:14     ` 回复: " Wang, Yalin
@ 2014-09-16  7:48       ` Noé RUBINSTEIN
  0 siblings, 0 replies; 6+ messages in thread
From: Noé RUBINSTEIN @ 2014-09-16  7:48 UTC (permalink / raw)
  To: Wang, Yalin; +Cc: linux-arm-msm

2014-09-13 2:14 GMT+02:00 Wang, Yalin <Yalin.Wang@sonymobile.com>:
> Do you pass a initrd to kexec kernel?

I don't; it crashes much earlier.

I also tried booting with an initrd passed to the kexec kernel just to
make sure, and it does not change much.

On the other hand, adding memblock=debug to the kernel command line
made me notice that the device tree is not loaded at the same address
on the cold boot (where it is at 0x1e00000) and on the kexec boot (on
which it seems to be loaded at 0x379a000), so this might be something.

Thanks,
Noé.

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

end of thread, other threads:[~2014-09-16  7:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-11  9:46 kexec on APQ8074 Noé RUBINSTEIN
2014-09-11  9:47 ` Noé RUBINSTEIN
2014-09-12  2:02 ` Wang, Yalin
2014-09-12 16:05   ` Noé RUBINSTEIN
2014-09-13  0:14     ` 回复: " Wang, Yalin
2014-09-16  7:48       ` Noé RUBINSTEIN

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.