News:

Attention: For security reasons,please choose a user name *different* from your login name.
Also make sure to choose a secure password and change it regularly.

Main Menu

xapp1078 (cpu1 bare metal, cpu0 linux) on TE0720 Linux crash on cpu1 start

Started by bgrissom, August 28, 2015, 06:56:37 PM

Previous topic - Next topic

bgrissom

Hello Trenz folks, I'm trying to get Xilinx xapp1078 (cpu1 bare metal, cpu0 linux) to work on a TE0720 and Linux is experiencing some kernel Oops problems when I start the cpu1 app.

I have followed the xapp instructions very carefully with the exception that I don't run their Vivado .tcl scripts which create a HDF.  Instead I use a HDF based on the Trenz vanilla HDF (http://www.trenz-electronic.de/download/d0/Trenz_Electronic/d1/TE0720-GigaZee/d2/reference_designs/d3/2014.4.html).

The other difference is that since I'm using the Trenz HDF, I'm not adding the "irq_gen" FPGA logic to handle interrupts between the two cores.  Because of this, I disabled everything in the cpu1 app which deals with interrupts.  That means the only thing left in the cpu1 application is "communicating" with Linux by setting a value in a high address accessible between both CPUs:

#define COMM_VAL        (*(volatile unsigned long *)(0xFFFF8000))

  xil_printf("BAG hello world\n");

  unsigned long cnt = 0;
  while(1) {
      cnt++;
      if (cnt > 0xFFFF0000) {
          cnt = 0;
          COMM_VAL+=1;
      }
  }


Everything seems to work, sort of!  For example, I often see my "BAG hello world" via the Linux "softuart" app, which tells me:

1) The cpu1 application is running
2) The communication between the two cores is working

But then I always get a kernel Oops (pasted below).  I even disabled all the SCU timer stuff in cpu1 application (ScuTimerInit(), etc.) and I get the same results.

It really feels to me that the cpu1 application is stomping on Linux memory somewhere.  Linux is running, as the app note says, with mem=768M on the kernel cmdline.

Any ideas?

Here is the Oops message with the SCU timers disabled as well as the xil_printf() statements disabled (I wanted the simplest cpu1 app possible):

root@trenz_2015:~# peek 0xffff8000
0x00000000
root@trenz_2015:~# poke 0xfffffff0 0x30000000; peek 0xffff8000;
Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM
Modules linked in: ipv6
CPU: 0 PID: 21 Comm: kworker/0:1 Not tainted 3.17.0-xilinx #17
Workqueue: events flush_to_ldisc
task: 674eca00 ti: 6750a000 task.ti: 6750a000
PC is at 0x40aa85e8
LR is at finish_task_switch+0x58/0x100
pc : [<40aa85e8>]    lr : [<40038b88>]    psr: 60000113
sp : 6750be80  ip : 00000000  fp : 00000002
r10: 674f8000  r9 : ffffffff  r8 : 40036268
r7 : 00000000  r6 : ffffffff  r5 : 400096cc  r4 : 4006552c
r3 : ffffffff  r2 : 00000002  r1 : 00000000  r0 : ffffffff
Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 18c5387d  Table: 277fc04a  DAC: 00000015
Process kworker/0:1 (pid: 21, stack limit = 0x6750a240)
Stack: (0x6750be80 to 0x6750c000)
be80: 00000000 6644b200 00000001 4021494c 40a6c000 00000001 6640bc80 6640bc81
bea0: 6640bc81 ffffffff 70947014 00000001 00000000 6644b280 70947000 4003b960
bec0: 00000000 6640bc00 6768f580 67685c04 679a0700 67685c14 6762cf40 67685c00
bee0: 00000000 40214970 00000001 6640bc80 6640bd80 40217590 6749f500 67685c04
bf00: 6799d640 679a0700 00000000 00000000 00000000 40031918 6749f500 6749f500
bf20: 6799d640 6749f518 40a6e100 6799d654 00000001 00000000 00000000 40032090
bf40: 00000000 674de8c0 00000000 6749f500 40031e20 00000000 00000000 00000000
bf60: 00000000 40035740 ffffffff 00000000 ffffffff 6749f500 00000000 00000000
bf80: 6750bf80 6750bf80 00000000 00000000 6750bf90 6750bf90 6750bfac 674de8c0
bfa0: 40035664 00000000 00000000 4000ddb8 00000000 00000000 00000000 00000000
bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
bfe0: 00000000 00000000 00000000 00000000 00000013 00000000 ffffffff 00000000
Code: 00000000 00000000 00000000 13de4352 (f8f00600)
---[ end trace ee6c30b041c6945d ]---
BUG: Bad page map in process poke  pte:00a3c75f pmd:277b5831
page:679cc780 count:1 mapcount:-1 mapping:66483b59 index:0x12e
page flags: 0x80068(uptodate|lru|active|swapbacked)
page dumped because: bad pte
addr:000a7000 vm_flags:00100873 anon_vma:66483a40 mapping:67040dac index:97
vma->vm_ops->fault: shmem_fault+0x0/0x19c
vma->vm_file->f_op->mmap: sock_mmap+0x0/0x1c
CPU: 0 PID: 865 Comm: poke Tainted: G      D        3.17.0-xilinx #17
[<40014848>] (unwind_backtrace) from [<40010e54>] (show_stack+0x10/0x14)
[<40010e54>] (show_stack) from [<4045f118>] (dump_stack+0x90/0xd4)
[<4045f118>] (dump_stack) from [<4009c244>] (print_bad_pte+0x160/0x194)
[<4009c244>] (print_bad_pte) from [<4009d3e0>] (unmap_single_vma+0x3ec/0x5bc)
[<4009d3e0>] (unmap_single_vma) from [<4009e544>] (unmap_vmas+0x44/0x54)
[<4009e544>] (unmap_vmas) from [<400a2c68>] (exit_mmap+0xc4/0x1c8)
[<400a2c68>] (exit_mmap) from [<4001ed48>] (mmput+0x40/0xe4)
[<4001ed48>] (mmput) from [<40021d14>] (do_exit+0x2f0/0x7e0)
[<40021d14>] (do_exit) from [<40022f80>] (do_group_exit+0x84/0xa4)
[<40022f80>] (do_group_exit) from [<40022fb0>] (__wake_up_parent+0x0/0x18)
Internal error: Oops - BUG: 0 [#2] PREEMPT SMP ARM
Modules linked in: ipv6
CPU: 0 PID: 865 Comm: poke Tainted: G    B D        3.17.0-xilinx #17
task: 67510600 ti: 674f8000 task.ti: 674f8000
PC is at 0x40ab09d0
LR is at call_timer_fn.isra.26+0x20/0x30
pc : [<40ab09d0>]    lr : [<40057d30>]    psr: 20000113
sp : 674f9d50  ip : 00000000  fp : 00200200
r10: 00000000  r9 : 40aaf08c  r8 : 40a6e100
r7 : 40aaf08c  r6 : 674f9d70  r5 : 00000100  r4 : 674f8000
r3 : 40aaf08c  r2 : 674f9d50  r1 : 40aaf08c  r0 : 40aaf08c
Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: 18c5387d  Table: 277fc04a  DAC: 00000015
Process poke (pid: 865, stack limit = 0x674f8240)
Stack: (0x674f9d50 to 0x674fa000)
9d40:                                     674f8000 40aaee80 40aaf07c 40058448
9d60: 40aaf0a0 00000000 00000000 40aaf69c 40aaf07c 6799cbf4 ffffffff 00000202
9d80: 674f8020 674f8000 40a6e080 00000100 40a6e084 40aa8c80 674f8000 40023488
9da0: 61420171 67406640 00000001 40000001 0000000a 00400104 ffffa39d 00000002
9dc0: 401decdc 674f8028 40a69cfc 40a6df40 674f9e44 66404978 00000001 6768f3f8
9de0: 00000000 4002376c 0000001d 4000e628 f8f00100 674f9e10 40a75120 40008560
9e00: 4009d094 20000013 ffffffff 40011840 674f9ee0 674f8018 000001b6 6768f580
9e20: 674f9ee0 36dd5000 00000000 00000001 66404978 00000001 6768f3f8 00000000
9e40: 00000000 674f9e58 4009e544 4009d094 20000013 ffffffff 6643c030 ffffffff
9e60: 36dd6000 00000000 677e8db4 677e8db8 6768f3f8 00000000 674f8000 674f9e94
9e80: 4009e544 4009d000 00000013 ffffffff 00000000 66404978 ffffffff 674f9ee0
9ea0: 00000000 00000000 00000001 6768f3f8 00000000 4009e544 00000000 677ce8c8
9ec0: 677ce8c8 6768f3c0 675109f0 674f8008 674f9f58 400a2c68 00000001 40aa87d8
9ee0: 6768f3c0 00000001 00000000 00000000 ffffffff 36e8fb10 674f9fb0 00000109
9f00: 00000400 6754c000 00000000 400084c0 00000003 6768f3c0 00000000 675109f0
9f20: 674f8008 674f9f58 6768f3c0 00000000 675109f0 4001ed48 00000000 67510600
9f40: 6768f3c0 40021d14 674f8000 00000001 00000000 400943d0 00000001 000fffff
9f60: 674f9f6c 67646280 00000000 674f8000 000000f8 4000dea4 674f8000 00000000
9f80: 00000000 40022f80 00000000 00000001 00000000 36f2874c 000000f8 40022fb0
9fa0: 00000000 4000dd20 00000001 00000000 00000000 36f786d0 00000008 00000000
9fc0: 00000001 00000000 36f2874c 000000f8 00000000 00000000 36f7c000 00000000
9fe0: 0009a55c 3eaa4cc0 0009a578 36e8fb30 60000010 00000000 00000000 00000000
[<40057d30>] (call_timer_fn.isra.26) from [<40058448>] (run_timer_softirq+0x1ec/0x21c)
[<40058448>] (run_timer_softirq) from [<40023488>] (__do_softirq+0xe8/0x1d8)
[<40023488>] (__do_softirq) from [<4002376c>] (irq_exit+0x58/0xac)
[<4002376c>] (irq_exit) from [<4000e628>] (handle_IRQ+0x6c/0x90)
[<4000e628>] (handle_IRQ) from [<40008560>] (gic_handle_irq+0x3c/0x60)
[<40008560>] (gic_handle_irq) from [<40011840>] (__irq_svc+0x40/0x74)
Exception stack(0x674f9e10 to 0x674f9e58)
9e00:                                     674f9ee0 674f8018 000001b6 6768f580
9e20: 674f9ee0 36dd5000 00000000 00000001 66404978 00000001 6768f3f8 00000000
9e40: 00000000 674f9e58 4009e544 4009d094 20000013 ffffffff
[<40011840>] (__irq_svc) from [<4009d094>] (unmap_single_vma+0xa0/0x5bc)
[<4009d094>] (unmap_single_vma) from [<4009e544>] (unmap_vmas+0x44/0x54)
[<4009e544>] (unmap_vmas) from [<400a2c68>] (exit_mmap+0xc4/0x1c8)
[<400a2c68>] (exit_mmap) from [<4001ed48>] (mmput+0x40/0xe4)
[<4001ed48>] (mmput) from [<40021d14>] (do_exit+0x2f0/0x7e0)
[<40021d14>] (do_exit) from [<40022f80>] (do_group_exit+0x84/0xa4)
[<40022f80>] (do_group_exit) from [<40022fb0>] (__wake_up_parent+0x0/0x18)
Code: 00000b5e 00000000 40aa1600 4037318c (ffffffff)
---[ end trace ee6c30b041c6945e ]---
Kernel panic - not syncing: Fatal exception in interrupt
---[ end Kernel panic - not syncing: Fatal exception in interrupt



bgrissom

I played with the cpu1 app, doing less and less, until I got down to just a main() { while(1) {} return 0; }     So basically nothing!  And the problem still occurs.  This tells me that resources are not segregated properly between the cores...

Antti Lukats

Hi

I am failing to see how this problem could be related to TE0720.

ASFAIK linux on TE0720 uses both cores without issues, hence it should also be possible to-do asymmetrical designs.

I do not have a good advice at the moment.