linux/arch/arm
Russell King - ARM Linux a4841e39f7 ARM: introduce handle_IRQ() not to dump exception stack
On Mon, Jul 11, 2011 at 3:52 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:

...

> The __exception annotation on a function causes this to happen:
>
> [<c002406c>] (asm_do_IRQ+0x6c/0x8c) from [<c0024b84>]
> (__irq_svc+0x44/0xcc)
> Exception stack(0xc3897c78 to 0xc3897cc0)
> 7c60:                                                       4022d320 4022e000
> 7c80: 08000075 00001000 c32273c0 c03ce1c0 c2b49b78 4022d000 c2b420b4 00000001
> 7ca0: 00000000 c3897cfc 00000000 c3897cc0 c00afc54 c002edd8 00000013 ffffffff
>
> Where that stack dump represents the pt_regs for the exception which
> happened.  Any function found in while unwinding will cause this to
> be printed.
>
> If you insert a C function between the IRQ assembly and asm_do_IRQ,
> the
> dump you get from asm_do_IRQ will be the stack for your function,
> not
> the pt_regs.  That makes the feature useless.
>

When __irq_svc - or any of the other exception handling assembly code -
calls the C code, the stack pointer will be pointing at the pt_regs
structure.

All the entry points into C code from the exception handling code are
marked with __exception or __exception_irq_enter to indicate that they
are one of the functions which has pt_regs above them.

Normally, when you've entered asm_do_IRQ() you will have this stack
layout (higher address towards top):

       pt_regs
       asm_do_IRQ frame

If you insert a C function between the exception assembly code and
asm_do_IRQ, you end up with this stack layout instead:

       pt_regs
       your function frame
       asm_do_IRQ frame

This means when we unwind, we'll get to asm_do_IRQ, and rather than
dumping out the pt_regs, we'll dump out your functions stack frame
instead, because that's what is above the asm_do_IRQ stack frame
rather than the expected pt_regs structure.

The fix is to introduce handle_IRQ() for no exception stack dump, so
it can be called with MULTI_IRQ_HANDLER is selected and a C function
is between the assembly code and the actual IRQ handling code.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
2011-07-12 19:42:40 +08:00
..
boot ARM: 6961/1: zImage: Add build-time check for correctly-sized proc_type entries 2011-06-21 11:33:20 +01:00
common Merge branch 'for-rmk' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung into devel-stable 2011-05-25 21:47:48 +01:00
configs rtc: fix build warnings in defconfigs 2011-06-15 20:04:02 -07:00
include/asm ARM: introduce handle_IRQ() not to dump exception stack 2011-07-12 19:42:40 +08:00
kernel ARM: introduce handle_IRQ() not to dump exception stack 2011-07-12 19:42:40 +08:00
lib ARM: 6945/1: Add unwinding support for division functions 2011-05-27 22:56:53 +01:00
mach-at91 AT91: Change nand buswidth logic to match hardware default configuration 2011-07-04 23:22:25 +02:00
mach-bcmring ARM: bcmring: convert to use sp804 clockevents 2011-05-23 18:04:54 +01:00
mach-clps711x
mach-cns3xxx
mach-davinci davinci: make PCM platform devices static 2011-06-08 14:41:37 +05:30
mach-dove ARM: dove: Consolidate mpp code with platform mpp. 2011-05-16 15:49:31 -04:00
mach-ebsa110
mach-ep93xx ep93xx: set DMA masks for the ep93xx_eth 2011-06-11 16:25:15 -07:00
mach-exynos4 Merge branch 'tty-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6 2011-06-28 11:14:55 -07:00
mach-footbridge ARM: footbridge: fix clock event support 2011-06-11 00:46:17 +01:00
mach-gemini Merge git://git.infradead.org/mtd-2.6 2011-05-27 20:06:53 -07:00
mach-h720x ARM: 6962/1: mach-h720x: fix build error 2011-06-17 11:25:03 +01:00
mach-imx ARM: imx: move mx3 support to mach-imx 2011-05-19 13:11:38 +02:00
mach-integrator Merge branches 'consolidate-clksrc', 'consolidate-flash', 'consolidate-generic', 'consolidate-smp', 'consolidate-stmp' and 'consolidate-zones' into consolidate 2011-05-23 18:05:10 +01:00
mach-iop13xx
mach-iop32x ARM: zImage: remove the static qualifier from global data variables 2011-05-07 00:08:02 -04:00
mach-iop33x ARM: zImage: remove the static qualifier from global data variables 2011-05-07 00:08:02 -04:00
mach-ixp4xx Merge git://git.infradead.org/mtd-2.6 2011-05-27 20:06:53 -07:00
mach-ixp23xx
mach-ixp2000
mach-kirkwood ARM: orion: Refactor the MPP code common in the orion platform 2011-05-16 15:25:54 -04:00
mach-ks8695
mach-l7200/include/mach
mach-loki ARM: orion: Consolidate ethernet platform data 2011-05-16 15:06:01 -04:00
mach-lpc32xx clocksource: convert ARM 32-bit up counting clocksources 2011-05-23 18:04:51 +01:00
mach-mmp Merge branch 'zImage_fixes' of git://git.linaro.org/people/nico/linux into devel-stable 2011-05-07 08:34:02 +01:00
mach-msm msm: timer: Fix DGT rate on 8960 and 8660 2011-06-20 16:30:07 -07:00
mach-mv78xx0 ARM: orion: Refactor the MPP code common in the orion platform 2011-05-16 15:25:54 -04:00
mach-mx5 ARM: mxc: don't allow to compile together i.MX51 and i.MX53 2011-05-19 13:11:30 +02:00
mach-mxs arm: mxs: include asm/processor.h for cpu_relax() 2011-06-06 09:50:04 +02:00
mach-netx ARM: 6827/1: mach-netx: delete hardcoded periphid 2011-05-26 10:33:34 +01:00
mach-nomadik gpio: move Nomadik GPIO driver to drivers/gpio 2011-05-26 17:30:03 -06:00
mach-nuc93x ARM: zImage: remove the static qualifier from global data variables 2011-05-07 00:08:02 -04:00
mach-omap1 OMAP1: PM: register notifiers with generic clock ops even when !PM_RUNTIME 2011-06-14 05:53:18 -07:00
mach-omap2 Merge branch 'fixes-v3.0-rc3' into devel-fixes 2011-06-14 05:53:42 -07:00
mach-orion5x ARM: orion5x: Refactor mpp code to use common orion platform mpp. 2011-05-16 15:42:59 -04:00
mach-pnx4008
mach-pxa gpio: include linux/gpio.h where needed 2011-06-16 08:40:44 -06:00
mach-realview Merge branches 'consolidate-clksrc', 'consolidate-flash', 'consolidate-generic', 'consolidate-smp', 'consolidate-stmp' and 'consolidate-zones' into consolidate 2011-05-23 18:05:10 +01:00
mach-rpc ARM: zImage: remove the static qualifier from global data variables 2011-05-07 00:08:02 -04:00
mach-s3c24a0/include/mach
mach-s3c64xx Merge branch 'for-rmk' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung into devel-stable 2011-05-25 21:47:48 +01:00
mach-s3c2400
mach-s3c2410 ARM: S3C2410: remove the now empty mach-s3c2410/irq.c 2011-06-03 18:36:53 -07:00
mach-s3c2412
mach-s3c2416 Merge branch 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6 2011-05-23 12:33:02 -07:00
mach-s3c2440
mach-s3c2443
mach-s5p64x0 ARM: zImage: remove the static qualifier from global data variables 2011-05-07 00:08:02 -04:00
mach-s5pc100 gpio: Move the s5pc100 GPIO to drivers/gpio 2011-05-26 17:33:41 -06:00
mach-s5pv210 ARM: S5PV210: Fix possible null pointer dereference 2011-06-01 15:06:35 -07:00
mach-sa1100 Merge branches 'consolidate-clksrc', 'consolidate-flash', 'consolidate-generic', 'consolidate-smp', 'consolidate-stmp' and 'consolidate-zones' into consolidate 2011-05-23 18:05:10 +01:00
mach-shark ARM: use ARM_DMA_ZONE_SIZE to adjust the zone sizes 2011-05-12 08:36:53 +01:00
mach-shmobile ARM: mach-shmobile: make a struct in board-ap4evb.c static 2011-06-30 14:37:06 +09:00
mach-spear3xx ARM: 6931/1: SPEAr3xx: Rework KConfig to allow all boards to be compiled in 2011-05-20 22:34:25 +01:00
mach-spear6xx ARM: 6934/1: SPEAr6xx: Rework Kconfig for single image solution 2011-05-20 22:34:25 +01:00
mach-tcc8k clocksource: convert ARM 32-bit up counting clocksources 2011-05-23 18:04:51 +01:00
mach-tegra ARM: Tegra: Harmony: Fix conflicting GPIO numbering 2011-06-04 15:51:52 -07:00
mach-u300 ARM: 6949/2: mach-u300: fix compilaton warning in IO accessors 2011-06-09 10:15:06 +01:00
mach-ux500 Merge branch 'tty-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6 2011-06-28 11:14:55 -07:00
mach-versatile Merge branches 'consolidate-clksrc', 'consolidate-flash', 'consolidate-generic', 'consolidate-smp', 'consolidate-stmp' and 'consolidate-zones' into consolidate 2011-05-23 18:05:10 +01:00
mach-vexpress ARM: 6946/1: vexpress: move v2m clock init to init_early 2011-06-06 10:56:09 +01:00
mach-vt8500
mach-w90x900 Merge branch 'devel-stable' into for-linus 2011-05-23 19:28:04 +01:00
mm ARM: pm: ensure ARMv7 CPUs save and restore the TLS register 2011-06-24 08:47:09 +01:00
nwfpe
oprofile
plat-iop ARM: 6969/1: plat-iop: fix build error 2011-06-21 11:33:21 +01:00
plat-mxc ARM: mx51/sdma: Check the chip revision in run-time 2011-06-06 09:50:04 +02:00
plat-nomadik gpio/nomadik: fix sleepmode for elder Nomadik 2011-06-09 15:03:38 -06:00
plat-omap Merge branch 'fixes-v3.0-rc3' into devel-fixes 2011-06-14 05:53:42 -07:00
plat-orion Merge branch 'devel-stable' into for-linus 2011-05-23 19:28:04 +01:00
plat-pxa
plat-s3c24xx ARM: S3C24XX: Move s3c24xx_irq_syscore_ops to plat-s3c24xx/irq.c 2011-06-03 18:36:52 -07:00
plat-s5p ARM: SAMSUNG: Remove unused onenand plat functions 2011-06-03 16:45:02 -07:00
plat-samsung Merge branch 'tty-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6 2011-06-28 11:14:55 -07:00
plat-spear Merge branches 'consolidate', 'ep93xx', 'fixes', 'misc', 'mmci', 'remove' and 'spear' into for-linus 2011-05-23 19:27:40 +01:00
plat-tcc
plat-versatile ARM: consolidate SMP cross call implementation 2011-05-23 16:53:17 +01:00
tools ARM: Update mach-types 2011-05-14 21:36:55 +01:00
vfp
Kconfig Merge branches 'devel', 'devel-stable' and 'fixes' into for-linus 2011-05-27 22:59:57 +01:00
Kconfig-nommu
Kconfig.debug lib: consolidate DEBUG_STACK_USAGE option 2011-05-25 08:39:54 -07:00
Makefile Merge branch 'for-rmk' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung into devel-stable 2011-05-25 21:47:48 +01:00