[Linux-Xtensa] booting linux in ISS with LX3 core

Piet Delaney pdelaney at tensilica.com
Thu Jul 8 03:04:33 PDT 2010


Lam Yat Seng wrote:

Hi Steven:

> Hi Piet, Marc,
>  
> My name is Steven I am a colleague of Low working also on the kernel 
> porting.  Thanks for the previous reply below and we are now trying 
> directly with the DINI board.\

I mentioned your working with the DINI board to our of our hardware
superstars and he thought we might be able to work closer with you if we had
RTL for the ethernet NIC.


> As for Piet's previous reply below:
>  
> "I'll fire off a DC_B_233L. BUILDROOT for it and try that next. Since 
> your using xt-gdb on printk() I take it your already familiar with the 
> tricks of placing breakpoints in V3 MMU code (Documented in 
> linux//Documentation/xtensa/gdbmacros)."
>  
> There seems to be useful macros there for debugging the MMU V3, but what 
> I saw are a few .gdb and xt-gdbinit file attached, what are the 
> instructions to load and invoke these macros with xt-gdb?  (sorry for 
> the silly question as I am also not too familiar with gdb here except 
> for the basic ones..)

I use the .xt-gdbinit macro to load the breakpoints after the
MMU has been re-mapped. I also use the .xt-gdbinit macro to
load the .gdb files in that directory.

I've been tweaking .xt-gdbinit macro, even today while debugging.
There are a number of things that get tricky, like making sure
you set breakpoints after the MMU has re-mapped and setting breakpoints
in vectors.S after the have been setup. New additions include enabling
verify after loading the image.

You might try just doing this process by hand the first time. If you
single step (stepi) from the beginning you will end up in the code that
re-mapped the MMU. I wrote this so you can even single step thru this
code while it's re-mapping, thus being sure never to lose control. At the
end of the remapping the code will return bootstrap.S at reset: which
is where I have a breakpoint as I recall to set the breakpoints in the
kernel.

As a 1st step just try single stepping from the starting point in
bootstrap.S that should immediately take you to _SetupMMU which includes
arch/xtensa/include/asm/initialize_mmu.h. I wrote this so code so you can
continue single stepping thru it. The symbols of the code are defined to
both the originally mapped addresses as well as the new linux-style mapped
addresses. So as you switch mapping the code will appear in the ddd/xt-gdb
window to step as if nothing significant happen. At the end of this #included
code you end up back in bootstrap.S at reset: which is a point where it's
safe to set the kernel breakpoints.

I'll try to give it a spin again in the near future and make sure nothing
has broken. When I last use the V3_MMU it was working great for both
uni-processor and SMP bit-streams and kernels.

Hope that helps and you don't mind my Cc: the linux-xtensa mailing list
as we started this discussion. I think this kinda of material could be
valuable to others in the future.

A few more pointers. Debugging the kernel can be a bit tedious, especially the
machine specific stuff. I find it more comfortable to configure the
kernel for debugging, compiling it -O0, so that the stack back-traces
are complete and variables (locals, formals, and globals) are simply
what gdb says they are. If you start xt-gdb with ddd you can see the
value of all variables my simply placing the cursor on top the the
variable in the code. I usually start xt-gdb with ddd like this:

	exec ddd -debugger xt-gdb -n

We have tried to make it easy for new comers by making the
back-traces pass thru exceptions and even the registers at the
time of the exception being displayed by gdb correctly. Attached
in 'HugeStack' is an example backtrace that I crash in this evening
while preparing code to go upstream. As you can see it's crossing
exceptions quite a few times. You just click on on the ddd "up" and
'down' buttons and ddd takes you to the code and you just mouse over
the code and it pops up the variable values. Just as easy as debugging
a normal user space C program in computers 101.

There's a bug or something in ddd which makes it best to start
xt-gdb with the -n option and doing the "source .xt-gdbinit" by
hand when ddd opens up the command window. If you forget the -n
option xt-gdb will automatically source the .xt-gdbinit file.
The problem is that if you change the .xt-gdbinit file and start
ddd again it continues to use the previous versions. I suppose it's
considered to be the default sessions and can likely be disabled
somehow.
	
Good luck and keep us posted on your progress. When your starting
a new area of work is usually better to ask a lot of questions
until you get familiar with the environment.

Here a bit more on gdb macros. In the .xt-gdbinit example
you have you will see:

140 if $debug_reset
141     break *&_ResetVector
142     set var $_ResetVector = $bpnum
143
144 #   NOTE: you can't enable this breakpoint while
145 #         single stepping in the MMU-V3 remapping
146 #         code and mapped to 0x46000000.
147 #
148     break reset
149     set var $reset = $bpnum
150     commands $reset

Here $debug_reset is enabling putting a breakpoint in to
set the breakpoints at reset. The variable $reset is the
breakpoint number of the breakpoint at 'reset'. When it hits
the breakpoint it executes the gdb commands starting at 'commands'
up to the matching 'end'. Today I just tried placing the commands
in a separate gdb definition and just invoking 'set_breakpoints'
macro in the command. Ex:
	
	commands $reset
	    set_breakpoints
	end

I've attached it, but keep in mind I'm still messing with
it and it not setting breakpoints right yet; it's just
an example of using the 'commands' gdb cmd to run
the 'set_breakpoints' user-defined function upon
hitting a breakpoint at 'reset:' after the MMU
has been re-mapped.

-piet

>  
> Thanks in advance,
> steven
>  
>  
>  
>  
> -----Original Message-----
> From: Piet Delaney [mailto:pdelaney at tensilica.com]
> Sent: Saturday, June 26, 2010 11:37 AM
> To: Low Swee Leong @ Low Kwang Hao
> Cc: Marc Gauthier; Piet Delaney; linux-xtensa at linux-xtensa.org; Piet 
> Delaney; Lam Yat Seng
> Subject: Re: [Linux-Xtensa] booting linux in ISS with LX3 core
>  
> Low Swee Leong @ Low Kwang Hao wrote:
>  
> Hi Low Swee:
>  
>  > In our core configuration , we have the following :
>  >
>  > 
>  >
>  > Memory Protection/MMU       MMU with TLBs and autorefill
>  >
>  >   Entries/Way (Inst)     4
>  >
>  >   Entries/Way (Data)   4
>  >
>  >   System RAM start address / size     0x0 / 128M
>  >
>  >   System ROM start address / size     0xfe000000 / 32M
>  >
>  > 
>  >
>  > I would assume MMU is being configured in our core ?
>  
> I suppose your using the new V3 MMU as said LX2 worked fine
> but your having problems with vprintk() in with an ISS simulation.
>  
>  >
>  > 
>  >
>  > We are currently using
>  >
>  >  DN9000K10PCIE8T from dini group
>  
> We have a DN9002K10PCU, sexy board, but we haven't tried running linux 
> on it.
>  
>  
>  
>  >
>  > I have tried to use the kernel source from
>  > 
> http://git.linux-xtensa.org/cgi-bin/git.cgi?p=kernel/xtensa-2.6.29-smp.git;a=summary,
>  >
>  > Use the configuration as attached , and build the kernel and run in ISS,
>  > it  has pass through set_cpu_possible but seems to get stuck at vprintk.
>  
> I tried running my HiFi-2 config which I had a buildroot for and tried it
> with ISS and got well past the first kernel printk() calls.
>  
> Clearly say xt-gdb 'next' over line 563:
>  
>   557 asmlinkage int printk(const char *fmt, ...)
>   558 {
>   559         va_list args;
>   560         int r;
>   561
>   562         va_start(args, fmt);
>   563         r = vprintk(fmt, args);
>   564         va_end(args);
>   565
>   566         return r;
>   567 }
>  
> setup_arch() took a while but succeeded.
> In fact I got up to network initialization and filesystem initialization:
> -------------------------------------------------------------------------------------
> (gdb) next
> net_namespace: 520 bytes
> ^CNET: Registered protocol family 16
> bio: create slab <bio-0> at 0
> NET: Registered protocol family 2
> IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
> TCP established hash table entries: 4096 (order: 3, 32768 bytes)
> TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
> TCP: Hash tables configured (established 4096 bind 4096)
> TCP reno registered
> NET: Registered protocol family 1
> SIMDISK: major: 240
> Can't open x: 2
> Can't open x: 2
> msgmni has been set to 248
> io scheduler noop registered (default)
> Reading in symbols for fs/sysfs/dir.c...done.
>  
> Program received signal SIGINT, Interrupt.
> 0xd00bf96f in sysfs_link_sibling (sd=0xd78ab2a0) at fs/sysfs/dir.c:54
> (gdb) bt
> Reading in symbols for lib/kobject.c...done.
> Reading in symbols for drivers/base/core.c...done.
> Reading in symbols for drivers/char/pty.c...done.
> #0  0xd00bf96f in sysfs_link_sibling (sd=0xd78ab2a0) at fs/sysfs/dir.c:54
> #1  0xd00c00c0 in __sysfs_add_one (acxt=0xd781b8dc, sd=0xd78ab2a0) at 
> fs/sysfs/dir.c:431
> #2  0xd00c0135 in sysfs_add_one (acxt=0xd781b8dc, sd=0xd78ab2a0) at 
> fs/sysfs/dir.c:460
> #3  0xd00c04d2 in create_dir (kobj=0xd78aaf44, parent_sd=0xd7811450, 
> name=0xd78a5450 "ttyp1", p_sd=0xd781b938) at fs/sysfs/dir.c:656
> #4  0xd00c0586 in sysfs_create_dir (kobj=0xd78aaf44) at fs/sysfs/dir.c:689
> #5  0xd00fe30a in create_dir (kobj=0xd78aaf44) at lib/kobject.c:51
> #6  0xd00fe6ce in kobject_add_internal (kobj=0xd78aaf44) at 
> lib/kobject.c:187
> #7  0xd00fe890 in kobject_add_varg (kobj=0xd78aaf44, parent=0xd782b008, 
> fmt=0xd01ed0d8 "%s", vargs={__va_stk = 0xd781ba90, __va_reg = 
> 0xd781ba60, __va_ndx = 0xc}) at lib/kobject.c:307
> #8  0xd00fe905 in kobject_add (kobj=0xd78aaf44, parent=0xd782b008, 
> fmt=0xd01ed0d8 "%s") at lib/kobject.c:352
> #9  0xd0126ee6 in device_add (dev=0xd78aaf00) at drivers/base/core.c:885
> #10 0xd0127119 in device_register (dev=0xd78aaf00) at 
> drivers/base/core.c:991
> #11 0xd0127530 in device_create_vargs (class=0xd7810500, parent=0x0, 
> devt=0x300001, drvdata=0x0, fmt=0xd781bc04 "ttyp1", args={__va_stk = 
> 0xd781bbe0, __va_reg = 0xd781bbc0, __va_ndx = 0x14}) at
> drivers/base/core.c:1352
> #12 0xd01275c9 in device_create (class=0xd7810500, parent=0x0, 
> devt=0x300001, drvdata=0x0, fmt=0xd781bc04 "ttyp1") at 
> drivers/base/core.c:1393
> #13 0xd010fa48 in tty_register_device (driver=0xd78429c0, index=0x1, 
> device=0x0) at drivers/char/tty_io.c:2850
> #14 0xd010fd56 in tty_register_driver (driver=0xd78429c0) at 
> drivers/char/tty_io.c:2995
> #15 0xd0262189 in legacy_pty_init () at drivers/char/pty.c:419
> #16 0xd026241e in pty_init () at drivers/char/pty.c:762
> #17 0xd00012b2 in do_one_initcall (fn=0xd0262418 <pty_init>) at 
> init/main.c:709
> #18 0xd025ab30 in do_initcalls () at init/main.c:749
> #19 0xd025ab66 in do_basic_setup () at init/main.c:769
> #20 0xd025abf1 in kernel_init (unused=0x0) at init/main.c:861
> #21 0xd0002acd in kernel_thread () at arch/xtensa/kernel/entry.S:2136
> Backtrace stopped: previous frame inner to this frame (corrupt stack?)
> (gdb) c
> Software Watchdog Timer: 0.07 initialized. soft_noboot=0 soft_margin=60 
> sec (nowayout= 1)
> TCP cubic registered
> NET: Registered protocol family 17
> RPC: Registered udp transport module.
> RPC: Registered tcp transport module.
> ISS serial driver 0.1
> IP-Config: No network devices available.
> Looking up port of RPC 100003/2 on 192.168.168.1
> rpcbind: server 192.168.168.1 not responding, timed out
> Root-NFS: Unable to get nfsd port number from server, using default
> Looking up port of RPC 100005/1 on 192.168.168.1
> rpcbind: server 192.168.168.1 not responding, timed out
> Root-NFS: Unable to get mountd port number from server, using default
> Root-NFS: Server returned error -5 while mounting 
> /opt/montavista/pro/devkit/xtensa/linux_be/target
> VFS: Unable to mount root fs via NFS, trying floppy.
> List of all partitions:
> No filesystem could mount root, tried:
> Kernel panic - not syncing: VFS: Unable to mount root fs on 
> unknown-block(2,0)
> ( ISS simcall ) *WARNING* Unexpected request code -1
>  
> Program received signal SIGTRAP, Trace/breakpoint trap.
> 0xd00083e3 in iss_panic_event (this=0xd0243798, event=0x0, 
> ptr=0xd026d018) at arch/xtensa/platforms/iss/setup.c:100
> (gdb)
> ----------------------------------------------------------------------------------------------------
>  
>  
> Mark:
>  
> You mentioned tricks/adjustments:
> ------------------------------------------------------------------------------
>  > We don't run on ISS as regularly, however it should work.  You have to
>  > follow the extra instructions in that wiki for configuring the kernel
>  > for use with ISS, including using the iss_defconfig instead of other
>  > default kernel configs, as well as other adjustments.  Presumably you've
>  > done all this?
> -----------------------------------------------------------------------------
> Is this what you were referring to:
> ...............................................................................
> in addition to setting up the initramfs filesystem, do the following. 
> Under Bus Options, deselect PCI support. Under Platform Options, 
> deselect Default bootloader kernel arguments.
> ....................................................................................................................................................................................
> I got thru PCI the hard way, and will try deselect Default bootloader 
> kernel arguments next time.
>  
> BTW, how do we get to the internet with ISS? Would be nice to document 
> up to mounting NFS root file-system and all.
> Perhaps eventually documenting how to run SMP linux in simulation with 
> XTSC so kernel.org guys can maintain it.
>  
>  
>  
> Low Swee: (continued):
>  
> So I assume the problem is likely specific to your config or the new V3 
> MMU code,
> which I've heavily tested on the LX200 FPGA board but it's never been 
> tried with ISS AFAIK.
>  
> I've just build xtensa-tools for a V3 MMU version of DC_B_232L, calling 
> it DC_B_233L. (Marc: is the 'B' kosher? 'C' better?)
>  
> I'll fire off a DC_B_233L. BUILDROOT for it and try that next. Since 
> your using xt-gdb on printk()
> I take it your already familiar with the tricks of placing breakpoints 
> in V3 MMU code
> (Documented in linux//Documentation/xtensa/gdbmacros).
>  
> -piet
>  
>  
>  >
>  > 
>  >
>  > Please advice ..
>  >
>  > 
>  >
>  > Thanks lot .
>  >
>  > 
>  >
>  > 
>  >
>  > (xt-gdb) bt
>  >
>  > #0  0xd0103390 in printk ()
>  >
>  > #1  0xd015c3d4 in start_kernel ()
>  >
>  > #2  0xd015c004 in _startup () at
>  > /home/sllow/Download/git/linux/arch/xtensa/kernel/head.S:289
>  >
>  > (xt-gdb) stepi
>  >
>  > 0xd0103393 in printk ()
>  >
>  > (xt-gdb)
>  >
>  > 0xd0103396 in printk ()
>  >
>  > (xt-gdb)
>  >
>  > 0xd0103399 in printk ()
>  >
>  > (xt-gdb)
>  >
>  > 0xd010339b in printk ()
>  >
>  > (xt-gdb)
>  >
>  > 0xd010339e in printk ()
>  >
>  > (xt-gdb)
>  >
>  > 0xd01033a0 in printk ()
>  >
>  > (xt-gdb)
>  >
>  > 0xd01033a2 in printk ()
>  >
>  > (xt-gdb)
>  >
>  > 0xd01033a4 in printk ()
>  >
>  > (xt-gdb)
>  >
>  > 0xd01033a6 in printk ()
>  >
>  > (xt-gdb)
>  >
>  > 0xd01033a8 in printk ()
>  >
>  > (xt-gdb)
>  >
>  > 0xd01033aa in printk ()
>  >
>  > (xt-gdb)
>  >
>  > 0xd01033ac in printk ()
>  >
>  > (xt-gdb)
>  >
>  > 0xd01033ae in printk ()
>  >
>  > (xt-gdb)
>  >
>  > 0xd01033b1 in printk ()
>  >
>  > (xt-gdb)
>  >
>  > 0xd000bd54 in vprintk ()
>  >
>  > (xt-gdb) stepi
>  >
>  > 0xd000bd57 in vprintk ()
>  >
>  > (xt-gdb)
>  >
>  > 0xd000bd5a in vprintk ()
>  >
>  > (xt-gdb)
>  >
>  > 0xd000bd5d in vprintk ()
>  >
>  > (xt-gdb)
>  >
>  > 0xd000bd5f in vprintk ()
>  >
>  > (xt-gdb)
>  >
>  > 0xd000bd62 in vprintk ()
>  >
>  > (xt-gdb)
>  >
>  > 0xd000bd65 in vprintk ()
>  >
>  > (xt-gdb)
>  >
>  > 0xd000bd67 in vprintk ()
>  >
>  > (xt-gdb)
>  >
>  > 0xd000bd6a in vprintk ()
>  >
>  > (xt-gdb)
>  >
>  > 0xd000bd6d in vprintk ()
>  >
>  > (xt-gdb)
>  >
>  > 0xd000bd70 in vprintk ()
>  >
>  > (xt-gdb)
>  >
>  > 0xd000bd73 in vprintk ()
>  >
>  > (xt-gdb)
>  >
>  > 0xd000bd76 in vprintk ()
>  >
>  > (xt-gdb)
>  >
>  > 0xd000bd78 in vprintk ()
>  >
>  > (xt-gdb)
>  >
>  > 0xd000bdc5 in vprintk ()
>  >
>  > (xt-gdb)
>  >
>  > 0xd000bdc8 in vprintk ()
>  >
>  > (xt-gdb)
>  >
>  > 0xd000bdcb in vprintk ()
>  >
>  > (xt-gdb)
>  >
>  > 0xd000bdcd in vprintk ()
>  >
>  > (xt-gdb)
>  >
>  > 0xd000bdcf in vprintk ()
>  >
>  > (xt-gdb)
>  >
>  > 0xd000bdd2 in vprintk ()
>  >
>  > (xt-gdb)
>  >
>  > 0xd000bdd4 in vprintk ()
>  >
>  > (xt-gdb)
>  >
>  > 0xd000bdd7 in vprintk ()
>  >
>  > (xt-gdb)
>  >
>  > 0xd000bdda in vprintk ()
>  >
>  > (xt-gdb)
>  >
>  > 0xd000bddc in vprintk ()
>  >
>  > (xt-gdb)
>  >
>  > 0xd000bddf in vprintk ()
>  >
>  > (xt-gdb)
>  >
>  > 0xd000bde1 in vprintk ()
>  >
>  > (xt-gdb)
>  >
>  > 0xd000be0f in vprintk ()
>  >
>  > (xt-gdb)
>  >
>  > 
>  >
>  > 
>  >
>  > 
>  >
>  > *From:* Marc Gauthier [mailto:marc at tensilica.com]
>  > *Sent:* Thursday, 24 June, 2010 11:55 PM
>  > *To:* Low Swee Leong @ Low Kwang Hao; Piet Delaney
>  > *Cc:* linux-xtensa at linux-xtensa.org; Piet Delaney
>  > *Subject:* RE: [Linux-Xtensa] booting linux in ISS with LX3 core
>  >
>  > 
>  >
>  > Hi Low Swee,
>  >
>  > 
>  >
>  > I think the latest overlay installer will work with either overlay. 
>  > Though we are moving to the one in src/xtensa-config-overlay.tar.gz as
>  > the standard one.  One issue is that open source tools progress
>  > independently of Xtensa Tools releases.  If you've successfully
>  > installed the overlay, that means the overlay installer recognized the
>  > overlay you gave it, so you should be okay.
>  >
>  > 
>  >
>  > We run the kernel regularly on the LX60 and LX200 boards.  Which FPGA
>  > board are you using?  Does your custom LX3 core have an MMU?
>  >
>  > 
>  >
>  > We don't run on ISS as regularly, however it should work.  You have to
>  > follow the extra instructions in that wiki for configuring the kernel
>  > for use with ISS, including using the iss_defconfig instead of other
>  > default kernel configs, as well as other adjustments.  Presumably you've
>  > done all this?
>  >
>  > 
>  >
>  > Since you're running in xt-gdb, you could Ctrl-C after a while and see
>  > what the (simulated) processor is doing.  Is it in the idle loop?  You
>  > might have to use "symbol vmlinux" to switch to the actual image's
>  > kernel symbols, to see that.
>  >
>  > 
>  >
>  > HTH,
>  >
>  > -Marc
>  >
>  > 
>  >
>  > 
>  >
>  >     
>  >
>  >     
> ------------------------------------------------------------------------
>  >
>  >     *From:* linux-xtensa-bounces at linux-xtensa.org
>  >     [mailto:linux-xtensa-bounces at linux-xtensa.org] *On Behalf Of *Low
>  >     Swee Leong @ Low Kwang Hao
>  >     *Sent:* Thursday, June 24, 2010 06:15
>  >     *To:* Piet Delaney
>  >     *Cc:* linux-xtensa at linux-xtensa.org; Piet Delaney
>  >     *Subject:* RE: [Linux-Xtensa] booting linux in ISS with LX3 core
>  >
>  >     Thanks, i will try that ,
>  >
>  >     
>  >
>  >     I have tried it on FPGA board , but it has the same result , so i
>  >     have used ISS to do the testing .
>  >
>  >     I have tested the linux build in LX2 before and it works well.
>  >
>  >     
>  >
>  >     
>  >
>  >     1 question i have is that there seems to have 2  overlay file in the
>  >     core
>  >
>  >     ./MAC_core5_lx3/xtensa-elf/src/linux/misc/linux-overlay.tar.gz
>  >
>  >     ./MAC_core5_lx3/src/xtensa-config-overlay.tar.gz
>  >
>  >     
>  >
>  >     In the OSKIT  guide it stated
>  >
>  >     
>  >
>  >     
>  >
>  >     Building a Linux environment for a specific Tensilica processor
>  >     configuration requires the Xtensa Linux Overlay.
>  >
>  >     This overlay is a compressed tar file located
>  >     in<xtensa_root>/xtensa-elf/src/linux/misc/linux-overlay.tar.gz ,
>  >     where <xtensa_root> is the location of the configured Tensilica core
>  >     package
>  >
>  >     
>  >
>  >     
>  >
>  >     But in the Build root instruction, seems to indicate that i need to
>  >     use xtensa-config-overlay
>  >
>  >     
>  >
>  >     
>  >
>  >     ./buildroot/target/xtensa/xt-buildroot-overlay-install -t
>  >     blinkcore-config-overlay.tar.gz   -b ./buildroot -k ./linux -c
>  >     superzip -l "ChipCorp SuperZIP Blink Accelerator Core"
>  >
>  >     
>  >
>  >     
>  >
>  >     May i know which is the correct one to use ?
>  >
>  >     
>  >
>  >     Thanks
>  >
>  >     
>  >
>  >     *From:* Piet Delaney [mailto:piet.delaney at gmail.com]
>  >     *Sent:* Thursday, 24 June, 2010 6:47 PM
>  >     *To:* Low Swee Leong @ Low Kwang Hao
>  >     *Cc:* linux-xtensa at linux-xtensa.org; piet.delaney at Tensilica.com
>  >     *Subject:* Re: [Linux-Xtensa] booting linux in ISS with LX3 core
>  >
>  >     
>  >
>  >     Low Swee Leong @ Low Kwang Hao wrote:
>  >
>  >     Hi
>  >
>  >     
>  >
>  >     Our company are currently using a custom LX3 core , i have download
>  >     the image from linux-xtensa-20080711.tar.gz
>  >
>  >     And follow the instruction in
>  >
>  >     http://wiki.linux-xtensa.org/index.php/Buildroot_Build_Instructions
>  >
>  >     Morning Low:
>  >
>  >     Most folks are using the 2.6.29-SMP git repo:
>  >
>  >           
>  >     
> http://git.linux-xtensa.org/cgi-bin/git.cgi?p=kernel/xtensa-2.6.29-smp.git;a=summary
>  >
>  >     I haven't tried running it with ISS as we mostly use a FPGA or an
>  >     LX2 chip.
>  >     I'll try running the 2.6.29-SMP code with ISS as soon as possible
>  >     and make
>  >     sure it's not broken.
>  >
>  >     -piet
>  >
>  >
>  >     
>  >
>  >     but when i try to run in ISS, it just stuck , as shown below , am i
>  >     missing something ? anyone can shed some light on how to
>  >     troubleshoot this issue ?
>  >
>  >     
>  >
>  >     Thanks
>  >
>  >     
>  >
>  >     [sllow at localhost tmpX]$ xt-gdb Image.elf
>  >
>  >     GNU gdb 6.8 Xtensa Tools 8.0.0
>  >
>  >     Copyright (C) 2008 Free Software Foundation, Inc.
>  >
>  >     License GPLv3+: GNU GPL version 3 or later
>  >     <http://gnu.org/licenses/gpl.html>
>  >
>  >     This is free software: you are free to change and redistribute it.
>  >
>  >     There is NO WARRANTY, to the extent permitted by law.  Type "show
>  >     copying"
>  >
>  >     and "show warranty" for details.
>  >
>  >     This GDB was configured as "--host=i686-pc-linux-gnu
>  >     --target=xtensa-elf"...
>  >
>  >     (xt-gdb) run
>  >
>  >     Starting program: /mnt/hgfs/tmpX/Image.elf
>  >
>  >     Starting the ISS simulator.
>  >
>  >     Switching to remote protocol
>  >
>  >     Remote debugging using localhost:63087
>  >
>  >     
>  >
>  >     
>  >
>  >     
>  >
>  >     
>  >
>  >     
>  >
>  >
>  >     
>  >
>  >
>  >     Disclaimer added by *CodeTwo Exchange Rules 2007*
>  >     www.codetwo.com <http://www.codetwo.com> <http://www.codetwo.com>
>  >
>  >     
>  >
>  >     ------------------------------------------------------------------
>  >     -
>  >     -
>  >     DISCLAIMER:
>  >
>  >     This e-mail (including any attachments) is for the addressee(s)
>  >     only and may contain confidential information. If you are not the
>  >     intended recipient, please note that any dealing, review,
>  >     distribution, printing, copying or use of this e-mail is strictly
>  >     prohibited. If you have received this email in error, please notify
>  >     the sender immediately and delete the original message.
>  >     MIMOS Berhad is a research and development institution under
>  >     the purview of the Malaysian Ministry of Science, Technology and
>  >     Innovation. Opinions, conclusions and other information in this e-
>  >     mail that do not relate to the official business of MIMOS Berhad
>  >     and/or its subsidiaries shall be understood as neither given nor
>  >     endorsed by MIMOS Berhad and/or its subsidiaries and neither
>  >     MIMOS Berhad nor its subsidiaries accepts responsibility for the
>  >     same. All liability arising from or in connection with computer
>  >     viruses and/or corrupted e-mails is excluded to the fullest extent
>  >     permitted by law.
>  >
>  >     
>  >
>  >     
>  >
>  >     
>  >
>  >
>  >
>  >     
> ------------------------------------------------------------------------
>  >
>  >
>  >     
>  >
>  >     
>  >
>  >     
>  >
>  >     _______________________________________________
>  >
>  >     linux-xtensa mailing list
>  >
>  >     linux-xtensa at linux-xtensa.org <mailto:linux-xtensa at linux-xtensa.org>
>  >
>  >     http://lists.linux-xtensa.org/mailman/listinfo/linux-xtensa
>  >
>  >      
>  >
>  >     
>  >
>  >     ------------------------------------------------------------------
>  >     -
>  >     -
>  >     DISCLAIMER:
>  >
>  >     This e-mail (including any attachments) is for the addressee(s)
>  >     only and may contain confidential information. If you are not the
>  >     intended recipient, please note that any dealing, review,
>  >     distribution, printing, copying or use of this e-mail is strictly
>  >     prohibited. If you have received this email in error, please notify
>  >     the sender immediately and delete the original message.
>  >     MIMOS Berhad is a research and development institution under
>  >     the purview of the Malaysian Ministry of Science, Technology and
>  >     Innovation. Opinions, conclusions and other information in this e-
>  >     mail that do not relate to the official business of MIMOS Berhad
>  >     and/or its subsidiaries shall be understood as neither given nor
>  >     endorsed by MIMOS Berhad and/or its subsidiaries and neither
>  >     MIMOS Berhad nor its subsidiaries accepts responsibility for the
>  >     same. All liability arising from or in connection with computer
>  >     viruses and/or corrupted e-mails is excluded to the fullest extent
>  >     permitted by law.
>  >
>  >
>  > ------------------------------------------------------------------
>  > -
>  > -
>  > DISCLAIMER:
>  >
>  > This e-mail (including any attachments) is for the addressee(s)
>  > only and may contain confidential information. If you are not the
>  > intended recipient, please note that any dealing, review,
>  > distribution, printing, copying or use of this e-mail is strictly
>  > prohibited. If you have received this email in error, please notify
>  > the sender immediately and delete the original message.
>  > MIMOS Berhad is a research and development institution under
>  > the purview of the Malaysian Ministry of Science, Technology and
>  > Innovation. Opinions, conclusions and other information in this e-
>  > mail that do not relate to the official business of MIMOS Berhad
>  > and/or its subsidiaries shall be understood as neither given nor
>  > endorsed by MIMOS Berhad and/or its subsidiaries and neither
>  > MIMOS Berhad nor its subsidiaries accepts responsibility for the
>  > same. All liability arising from or in connection with computer
>  > viruses and/or corrupted e-mails is excluded to the fullest extent
>  > permitted by law.
>  >
>  >
>  
>  
> -----------------------------------------------
> A strategic agency under MOSTI
> www.mimos.my <http://www.mimos.my>
> -----------------------------------------------
>  
> 
> ------------------------------------------------------------------
> -
> -
> DISCLAIMER:
> 
> This e-mail (including any attachments) is for the addressee(s)
> only and may contain confidential information. If you are not the
> intended recipient, please note that any dealing, review,
> distribution, printing, copying or use of this e-mail is strictly
> prohibited. If you have received this email in error, please notify
> the sender immediately and delete the original message.
> MIMOS Berhad is a research and development institution under
> the purview of the Malaysian Ministry of Science, Technology and
> Innovation. Opinions, conclusions and other information in this e-
> mail that do not relate to the official business of MIMOS Berhad
> and/or its subsidiaries shall be understood as neither given nor
> endorsed by MIMOS Berhad and/or its subsidiaries and neither
> MIMOS Berhad nor its subsidiaries accepts responsibility for the
> same. All liability arising from or in connection with computer
> viruses and/or corrupted e-mails is excluded to the fullest extent
> permitted by law.
> 
> 

-------------- next part --------------
Unaligned memory access to 3fa7c725 in 'gethostid01' (pid = 1860, pc = 0x20036c0e)
BUG: spinlock wrong owner on CPU#0, /-1653284005
 lock: d0340db0, .magic: dead4ead, .owner: pause03/2175, .owner_cpu: 0

Stack: d3ff8410 d3ff8000 d3ff8410 d3ff8050 d3ff8410 00000005 d0340db0 d02e9cf8 
       d3ff8050 d3ff8434 d3ff8450 00000004 d3ff8450 00000004 00000052 00060301 
       901ad3ea d3ff8490 d0340db0 d02e9cf8 d3ff8000 00000000 d3e89e28 d3f82c60 
Call Trace:
 [<d01ad14b>] spin_bug+0xb3/0xb8
 [<d01ad3ea>] do_raw_spin_unlock+0x66/0x98
 [<d02c3b89>] _raw_spin_unlock+0x11/0x14
 [<d000562c>] timer_interrupt+0x90/0xc4
 [<d004e3f2>] handle_IRQ_event+0x42/0x17c
 [<d00508e2>] handle_percpu_irq+0x32/0x60
 [<d00028a0>] do_IRQ+0x98/0xb8
 [<d000573c>] do_interrupt+0x44/0x58
 [<d0001fdc>] _kernel_exception+0x10e/0x127
 [<d004e3d1>] handle_IRQ_event+0x21/0x17c
 [<d0050539>] handle_level_irq+0xdd/0x158
 [<d00028a0>] do_IRQ+0x98/0xb8
 [<d000573c>] do_interrupt+0x44/0x58
 [<d0001fdc>] _kernel_exception+0x10e/0x127
 [<d02c3bc4>] _raw_spin_unlock_irq+0x14/0x18
 [<d01e636c>] ethoc_start_xmit+0x460/0x470
 [<d0207a72>] dev_hard_start_xmit+0x176/0x2e8
 [<d0220111>] sch_direct_xmit+0xf1/0x314
 [<d0208354>] dev_queue_xmit+0x408/0x70c
 [<d0235c65>] ip_finish_output+0x351/0x3a8
 [<d0236178>] ip_output+0x70/0x78
 [<d0235576>] ip_local_out+0x32/0x3c
 [<d02366ad>] ip_queue_xmit+0x52d/0x58c
 [<d0257c48>] tcp_transmit_skb+0x7ec/0x83c
 [<d025c59c>] tcp_send_ack+0x174/0x178
 [<d02542f4>] __tcp_ack_snd_check+0x98/0xa8
 [<d0255118>] tcp_rcv_established+0x6b4/0x880
 [<d0260772>] tcp_v4_do_rcv+0x3e/0x184
 [<d02610e4>] tcp_v4_rcv+0x82c/0xbfc
 [<d02318a0>] ip_local_deliver_finish+0x174/0x20c
 [<d0231971>] ip_local_deliver+0x39/0x44
 [<d0231e69>] ip_rcv_finish+0x4ed/0x50c
 [<d0232339>] ip_rcv+0x4b1/0x4ec
 [<d02090f0>] netif_receive_skb+0x4e4/0x508
 [<d01e4620>] ethoc_rx+0x230/0x3a0
 [<d01e4ffd>] ethoc_poll+0x29/0xa4
 [<d020a0e4>] net_rx_action+0xd4/0x244
 [<d001ad65>] __do_softirq+0xc5/0x1a4
 [<d001ae74>] do_softirq+0x30/0x3c
 [<d001aba0>] local_bh_enable+0xe8/0xfc
 [<d020864a>] dev_queue_xmit+0x6fe/0x70c
 [<d0235c65>] ip_finish_output+0x351/0x3a8
 [<d0236178>] ip_output+0x70/0x78
 [<d0235576>] ip_local_out+0x32/0x3c
 [<d02393d5>] ip_push_pending_frames+0x5d9/0x658
 [<d0269641>] udp_push_pending_frames+0x3dd/0x4a4
 [<d0269e4c>] udp_sendmsg+0x744/0x88c
 [<d0274dbd>] inet_sendmsg+0x3d/0x48
 [<d01ef7f8>] sock_sendmsg+0xc0/0xe8
 [<d01ef86d>] kernel_sendmsg+0x4d/0x6c
 [<d02977e4>] xs_send_kvec+0x80/0xa4
 [<d02979b6>] xs_sendpages+0xda/0x1bc
 [<d0297db8>] xs_udp_send_request+0xa8/0x1f0
 [<d0296584>] xprt_transmit+0x120/0x300
 [<d0293a37>] call_transmit+0xeb/0x138
 [<d029d481>] __rpc_execute+0x121/0x3a8
 [<d029d770>] rpc_execute+0x68/0x6c
 [<d0292b71>] rpc_run_task+0x79/0x84
 [<d0127e44>] nfs_read_rpcsetup+0x310/0x35c
 [<d01283e8>] nfs_pagein_one+0x174/0x190
 [<d012559d>] nfs_pageio_doio+0x51/0x98
 [<d01255f3>] nfs_pageio_add_request+0xf/0x34
 [<d0128fc8>] readpage_async_filler+0x248/0x2e0
 [<d00633be>] read_cache_pages+0x62/0xa0
 [<d012925e>] nfs_readpages+0x1fe/0x2dc
 [<d0063422>] read_pages+0x26/0xa0
 [<d00636d0>] __do_page_cache_readahead+0x234/0x280
 [<d006383c>] ra_submit+0x20/0x2c
 [<d0056658>] do_sync_mmap_readahead+0xf0/0xf4
 [<d00568a8>] filemap_fault+0x1cc/0x490
 [<d007d6a0>] __do_fault+0x6c/0x958
 [<d007dfcc>] do_linear_fault+0x40/0x48
 [<d007e2ad>] handle_mm_fault+0x245/0x3f8
 [<d00070b2>] do_page_fault+0x152/0x41c
 [<d0001fdc>] _kernel_exception+0x10e/0x127
 [<d02beea0>] memset+0x24/0x78
 [<d00ed656>] padzero+0x66/0xa8
 [<d00eef25>] load_elf_binary+0x931/0xd50
 [<d00a4e94>] search_binary_handler+0xe4/0x39c
 [<d00a5341>] do_execve+0x1f5/0x340
 [<d000346d>] xtensa_execve+0x51/0x6c
 [<d0002712>] system_call+0x3e/0x4c
 [<d0001e28>] _user_exception+0x102/0x123

-------------- next part --------------
#
# Example .xt-gdbinit file:
#	Sets a breakpoint in the reset vector to setup
#	kernel breakpoints once the primary V3 MMU has
#	remapped to our normal virtaul mappings.
#
#	Includes general purpose macros for dumping the
#	the state of the PTEs, TLB, task list and switching
#	the context to a particular task for backtrace.
#
#	Tuneed for used with xt-gdb driven with ddd with
#	kernel compiled without optimization.
#
#					    -piet
#
set editing on
set radix 0x0a
set print pretty
set print array
set print union
set pagination off
set can-use-hw-watchpoints 0
set print elements 64
set var $sa_tcp_breakpoints = 0
set var $set_exception_breakpoints = 0
set var $mess_with_context_asid = 0
set var $debug_boot_secondary_processors = 0
set var $debug_stress_test = 1
set var $debug_cpu_init = 0
set var $debug_irq_init = 0
set var $debug_irqs_disabled = 0
set var $debug_irq_handler = 0
set var $debug_uart = 0
set var $debug_sound = 0
set var $debug_modules = 1
set var $debug_all_sound = 0
set var $debug_migration = 0
set var $debug_vm_page_mapcount = 0
set var $debug_vm_page_mapcount_writers = 0
set var $monitor_trace_supported = 1
set var $monitor_trace_enabled = 0
set var $monitor_verify_supported = 1
set var $monitor_verify_enabled = 1
set var $debug_clear_lazy_smp_coprocessor_flushing_enabled = 0
set var $load_image = 1
set var $reset_processors = 1

# NOTE: A Breakpoint at init_arch causes 2nd CPU to get stuck;
#       which is a handy way to come up with just 1 CPU
set var $debug_init_arch = 0

# $debug_reset needed for placing breakpoints with V3 MMU
set var $debug_reset = 1		

set var $debug_out_of_memory = 0
set var $debug_kernel_start = 0
set var $debug_platform_init = 0
set var $debug_platform_setup = 0
set var $debug_free_area_init_node = 0
set var $debug_unmap_region = 0
set var $debug_slab = 0
set var $debug_open_eth = 0
set var $debug_exceptions = 1
set var $mx = 0
set logging on
set logging file kgdb.log
set logging overwrite on
# show logging
# set debug remote 10
set debug remote 0
# set backtrace limit 50

# set debug remote 1
# set remotebaud 115200
# set remotebaud 19200


# target remote udp:192.168.110.61:6443 MY_GATE
# target remote /dev/ttyS0
# target remote gums:20000 0

# reset

delete

if $mx
#	add-symbol-file vmlinux 0xd0000000
	add-symbol-file vmlinux 0
	file arch/xtensa/boot/Image.elf
#	target remote gums:20000 0xd0000012
#	target remote gums:20001 0xd0000012
#	target remote gums:20002 0xd0000012
#	target remote gums:20000 &spill_location_0
	target remote localhost:20000 &spill_location_0
#	target remote localhost:20001 &spill_location_1
#	target remote localhost:20002 &spill_location_2
#	target remote gums:20001 &spill_location_1
#	target remote gums:20002 &spill_location_2
#
# 2nd Board
#	target remote localhost:20010 0
#	target remote localhost:20000 0
else
	add-symbol-file vmlinux 0	
	file arch/xtensa/boot/Image.elf
	target remote localhost:20000  &spill_location_0
end

if $reset_processors
    echo "Resetting Processors\n"
    reset
end

#	timebomb
#	set $sar = 0x30
#	set $sr176 = 0x0f3d2483

if $load_image
    if $monitor_trace_supported
      echo "Monitor trace off\n"
      monitor trace off
    end
    
    if $monitor_verify_supported
      echo "monitor verify all off\n"
      monitor verify all off
    end
    
    echo "load: Started\n"
    load
    echo "load: Completed\n"
    
    if $monitor_trace_supported
      if $monitor_trace_enabled
        echo "Monitor trace on\n"
        monitor trace on
      end
    end
    
    if $monitor_verify_supported
      if $monitor_verify_enabled
        echo "Monitor verify all on\n"
        monitor verify all on
      end
    end
    set var $load_image = 0
end

if $debug_reset
    break *&_ResetVector
    set var $_ResetVector = $bpnum

#   NOTE: you can't enable this breakpoint while
#         single stepping in the MMU-V3 remapping
#	  code and mapped to 0x46000000.
#
    break reset
    set var $reset = $bpnum
    commands $reset
	echo "Set Breakpoints?\n"
	set_breakpoints
    end
end

define set_breakpoints
	if $mx
	    if $debug_boot_secondary_processors == 0
		set boot_secondary_processors = 0
	    end
	end

	if $debug_clear_lazy_smp_coprocessor_flushing_enabled
	    set lazy_smp_coprocessor_flushing_enabled = 1
	end

# 	break _image_start
#	break *&_startup
#	break emit_log_char
#	break printk
#	break init_mmu
#	break init_IRQ
	if $debug_irq_handler
		break *&__set_irq_handler
		break do_interrupt
		break handle_level_irq
	end

	if $mx
	   if  $debug_irq_init
		break xtensa_mx_irq_mask
		break xtensa_mx_irq_unmask
		break xtensa_mx_irq_ack
		break xtensa_mx_irq_retrigger
		break secondary_irq_init
	   end	
#	   break wakeup_secondary_cpu
		
#	   break send_ipi_message
#	   break recv_ipi_messages
#	   break secondary_irq_enable
	else
	    if $debug_irq_init
		break xtensa_irq_mask
		break xtensa_irq_unmask
		break xtensa_irq_ack
		break xtensa_irq_retrigger
	    end
	end
	
	if $debug_free_area_init_node
	    break free_area_init_node
	    set var $free_area_init_node = $bpnum
	    commands $free_area_init_node
	       	continue
	    end
	end
	
#	break free_area_init_nodes
	
	#
	# These functions don't have an entry instruction,
	# avoid placing break at entry + 4.
	#
#	break  *&__platform_idle
#	set var $__platform_idle = $bpnum
#	disable $__platform_idle
	
	break  *&_UserExceptionVector
	set var $_UserExceptionVector = $bpnum
	if $debug_exceptions == 0
		disable $_UserExceptionVector
	end

	break  *&_KernelExceptionVector
	set var $_KernelExceptionVector = $bpnum
	if $debug_exceptions == 0
		disable $_KernelExceptionVector
	end

	break  *&_DoubleExceptionVector
	set var $_DoubleExceptionVector = $bpnum
	set var $_DoubleExceptionVector_count = 0
	if $debug_exceptions == 0
		disable $_DoubleExceptionVector
	end
	if 1
#	    Can't use the "commands" command among a breakpoint's commands.	
	    commands $_DoubleExceptionVector
		set $_DoubleExceptionVector_exccause = $exccause
		set $_DoubleExceptionVector_count = $_DoubleExceptionVector_count + 1
		set $PS_UM_BIT = 5
		set $PS_UM_MASK = 1 << $PS_UM_BIT
		set $UM = $ps & $PS_UM_MASK
		
		if $_DoubleExceptionVector_count == 0
		    disable $_DoubleExceptionVector
		end
	    end
	end

	break  *&_DoubleExceptionVector_WindowUnderflow
	set var $_DoubleExceptionVector_WindowUnderflow = $bpnum
	if $debug_exceptions == 0
		disable $_DoubleExceptionVector_WindowUnderflow
	end

	if $debug_exceptions != 0
		break  *&_DoubleExceptionVector_WindowOverflow
		set var $_DoubleExceptionVector_WindowUnderflow = $bpnum
		if $debug_exceptions == 0
			disable $_DoubleExceptionVector_WindowOverflow
		end
	end
	
	break  *&_DebugInterruptVector
	set var $_DebugInterruptVector = $bpnum
	if $debug_exceptions == 0
		disable $_DebugInterruptVector
	end

	if 0
		break  *&_Level2InterruptVector
		set var $_Level2InterruptVector = $bpnum
		if $debug_exceptions == 0
			disable $_Level2InterruptVector
		end
		
		break  *&_Level3InterruptVector
		set var $_Level3InterruptVector = $bpnum
		if $debug_exceptions == 0
			disable $_Level3InterruptVector
		end
	end
	break  *&_WindowOverflow4
	set var $_WindowOverflow4 = $bpnum
	if $debug_exceptions == 0
		disable $_WindowOverflow4
	end

	break  *&_WindowUnderflow4
	set var $_WindowUnderflow4 = $bpnum
	if $debug_exceptions == 0
		disable $_WindowUnderflow4
	end
	
	break  *&_WindowOverflow8
	set var $_WindowOverflow8 = $bpnum
	if $debug_exceptions == 0
		disable $_WindowOverflow8
	end

	break  *&_WindowUnderflow8
	set var $_WindowUnderflow8 = $bpnum
	if $debug_exceptions == 0
		disable $_WindowUnderflow8
	end

	break  *&_WindowOverflow12
	set var $_WindowOverflow12 = $bpnum
	if $debug_exceptions == 0
		disable $_WindowOverflow12
	end

	break  *&_WindowUnderflow12
	set var $_WindowUnderflow12 = $bpnum
	if $debug_exceptions == 0
		disable $_WindowUnderflow12
	end
	
	#
	# Catch Double Exceptions that will hang
	# can only be placed after init_arch() 
	# has been called.
	#
	break  *&_DoubleExceptionVector_Hang
	set var $_DoubleExceptionVector_Hang = $bpnum
	set var $_DoubleExceptionVector_Hang_count = 0
	disable $_DoubleExceptionVector_Hang

	
	break  *&fast_unaligned
	set var $fast_unaligned = $bpnum
	set var $fast_unaligned_count = 0
	disable $fast_unaligned

	if $debug_init_arch
	    break init_arch
	    set $init_arch = $bpnum
	    if 0
#	      Can't use the "commands" command among a breakpoint's commands.
	      commands $init_arch
		disable $init_arch
	        echo "init_arch(): Enabling Breakpoints at Exception Vectors\n"
	        enable $_DoubleExceptionVector_Hang
	        echo skip enable $fast_unaligned
	        if $mess_with_context_asid != 0
	        	echo "config_ignore_mm_context_asid:"
	        	print config_ignore_mm_context_asid
	        	set $dbreaka0 =  &config_ignore_mm_context_asid
	        	set $dbreakc0 = 0x8000003c
	        end	
	       	continue
	      end
	    end
	 end
	
	if $debug_kernel_start != 0
	    break start_kernel
	    set $start_kernel = $bpnum
	    disable $start_kernel	
	    commands $start_kernel
	    	echo "config_ignore_mm_context_asid:"
	    	print config_ignore_mm_context_asid
	    	continue
	    end
	end
	
	if $debug_platform_setup != 0
	    if $debug_platform_init
	        break platform_init
	        set $platform_init = $bpnum
	      
		if 0 
	            commands $platform_init
	                continue
	            end
	        end
	    end
	end

	if $debug_platform_setup != 0
		break platform_setup
		set $platform_setup = $bpnum
		if 0
	    		commands $platform_setup
	        	disable $platform_setup	
	        	continue
	    	end
	    end
	end
	
	if $debug_unmap_region
	    break unmap_region
	    set $unmap_region = $bpnum
	    if 0
	        commands $unmap_region
	            disable  $unmap_region
	            if (config_ignore_mm_context_asid == 1)
	        	continue
	            end	
	        end	
	    end
	end
	
	 if $debug_irqs_disabled
	    break irqs_disabled
	    set $irqs_disabled = $bpnum
	    if 0
	        commands $irqs_disabled
	            disable $irqs_disabled
	            if (config_ignore_mm_context_asid == 1)	
	        	continue
	            end	
	        end	
	    end
	end
	
	if $debug_out_of_memory
	    break out_of_memory
	    set $out_of_memory = $bpnum
	    if 0
	        commands $out_of_memory
	    	    continue
	        end
	    end
	    
	    break oom_kill_process
	    set $oom_kill_process = $bpnum
	    if 0
	        commands $oom_kill_process
	    	    if (config_ignore_mm_context_asid == 1)
	    		continue
	    	    end
	    	end
	    end
	end
	
	if $debug_slab
		break slab_bp
		set $slab_bp = $bpnum
	end
	
#	break bp 
	break die 
	break panic
	break xtensa_breakpoint
#	break show_regs
#	break handle_pte_fault
#	break bad_page_fault
	break bad_page_fault_bp
#	break swapon
#
#	You likely don't want to have a breakpoint
#	here with multiple cpu's. The other CPUs will
#	think it's a SIGTRAP and leave things weird.
#
	if $debug_stress_test == 0
		break dump_stack
		break do_unaligned_user
		break die 
	end
	break do_debug
	break do_illegal_instruction
	break do_multihit
	break do_unhandled
	# break dtlb_probe
#	break get_current_bp
	
	if $debug_cpu_init != 0
		break cpu_up
		break _cpu_up
		break __cpu_up
		break cpu_online
		break smp_init
		break smp_init_cpus
		break get_core_count
		break smp_prepare_cpus
		break secondary_start_kernel
	end

	if $debug_open_eth != 0
                break oeth_probe
                break oeth_open
                break oeth_start_xmit
                break oeth_init
                break oeth_interrupt
                ip_local_deliver_finish
                ip_local_deliver
                ip_rcv_finish
                ip_rcv
	end

	if $debug_modules != 0
		break load_module
		set var $load_module = $bpnum
		commands $load_module
			break sys_init_module
			break apply_relocate_add
			break do_one_initcall
		end
		set apply_relocate_add_enabled = 1
	end

#	break print_oops_end_marker
#	break show_stack

#	break  *&fast_second_level_miss_double_kernel
#	break  *&_DoubleExceptionVector_WindowOverflow

	# break update_mmu_cache
	# break copy_pte_range
	# break zap_pte_range
	# break remap_pte_range
	# break change_pte_range
	# break move_ptes
	# break ic_dynamic
	
	# break parse_early_param
	
	# Delete this breakpoint at reset now
	# that breakpoints have been set.

    #
    # Bring in gdb macros after re-mapping MMU
    # so they can access config constants.
    #	
    source ps.gdb
    source showtlb.gdb
    source showcache.gdb
    source show_mem_pte.gdb

    if ($debug_uart != 0)
    	break uart_get_baud_rate	
    	break time_init	
    	break uart_parse_options	
    	break uart_set_options	
    	break __platform_calibrate_ccount
    end	

    if ($debug_all_sound != 0) 
	#
	# HiFI-2 Driver at sound/oss/sound_lx200.c
	# No Interrupt handler.
	#
	break aic23_write_reg
	break aic23_config_dac
	break aic23_set_vol
	break aic23_get_vol
	break aic23_set_freq
	break slx200_fifo_logic
	break slx200_audio_mute
	break slx200_fifo_write
	break slx200_set_sample_rate
	break slx200_set_volume
	break slx200_set_channels
	break slx200_audio_ioctl
	break slx200_audio_write
	break slx200_audio_open
	break slx200_audio_release
	break slx200_init
    end

    if ($debug_sound != 0)
	break slx200_fifo_write
    end

    if ($debug_migration) 
	break load_balance
        break *&fast_coprocessor
    end

    if ($debug_vm_page_mapcount)
	break reset_page_mapcount
	break page_mapcount
	break page_dup_rmap
#	break get_page_bootmem
#	break put_page_bootmem
	break page_add_anon_rmap
	break page_add_new_anon_rmap
	break page_add_file_rmap
	break page_dup_rmap
	break page_remove_rmap
#	break free_map_bootmem
    end

    if ($debug_vm_page_mapcount_writers)
	break reset_page_mapcount
	break page_dup_rmap
#	break get_page_bootmem
#	break put_page_bootmem
	break page_add_anon_rmap
	break page_add_new_anon_rmap
	break page_add_file_rmap
	break page_dup_rmap
	break page_remove_rmap
    end
end

document set_breakpoints
	Sets breakpoints after MMU has been mapped.
end

info breakpoints

echo "$mess_with_context_asid:"
print $mess_with_context_asid
if $mess_with_context_asid != 0
	echo "set config_ignore_mm_context_asid = 1;\n"
	set config_ignore_mm_context_asid = 1
	print config_ignore_mm_context_asid
end

display/i $pc
#target sim --timer
set output-radix 16

define exit 
	quit
	end

define regs 
	info registers pc a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15
	end

define cregs
	info registers ccount ccompare0 ccompare1
	end

define iregs
	info registers interrupt intenable icount icountlvl psintlvl
	end

define lregs
	info registers lbeg lend lcount
	end

define restart
	set *(volatile unsigned *)0xfd020010 = 0xdead
	end

define i8regs 
	info registers i80 i81 i82 i83 i84 i85 i86 i87 i88 i89 i810 i811 i812 i813 i814 i815
	end

define i16regs 
	info registers i160 i161 i162 i163 i164 i165 i166 i167 i168 i169 i1610 i1611 i1612 i1613 i1614 i1615
	end

define i32regs 
	info registers i320 i321 i322 i323 i324 i325 i326 i327 i328 i329 i3210 i3211 i3212 i3213 i3214 i3215
	end

define extraregs 
	info registers s8 s16 s32 result
	end

define memfree
	graph display contig_page_data

	print contig_page_data.node_zones[0].name
	print contig_page_data.node_zones[0].present_pages

	print contig_page_data.node_zones[1].name
	print contig_page_data.node_zones[1].present_pages

	print contig_page_data.node_zones[2].name
	print contig_page_data.node_zones[2].present_pages
end

echo ".xt-gdbinit: Done\n"


More information about the linux-xtensa mailing list