[Sound-open-firmware] [EXT] Re: Stack alignment issues with XCC?

Paul Olaru paul.olaru at nxp.com
Wed Nov 20 15:10:01 CET 2019


Didn't test the emulator (I still have trouble with that).

If other interrupts caused problems wouldn't I be able to see more logs
than the one related to registering the DMA interrupt?

Also (see my draft/hack PR, #2111) if I force-align the stack within the
irq_steer handler I don't get any panics further on. Although it may
very well be possible that the compiler doesn't vectorize any instruction
in any of the functions directly or indirectly called from such an interrupt
(there is nothing to vectorize?) and thus the stack may still be misaligned
but in those cases it doesn't matter.

-----Original Message-----
From: Liam Girdwood <liam.r.girdwood at linux.intel.com> 
Sent: Wednesday, November 20, 2019 1:09 PM
To: Paul Olaru <paul.olaru at nxp.com>; sound-open-firmware at alsa-project.org
Subject: [EXT] Re: [Sound-open-firmware] Stack alignment issues with XCC?

Caution: EXT Email

On Tue, 2019-11-19 at 15:33 +0000, Paul Olaru wrote:
> Hello, I'm trying to begin doing all my builds with XCC for testing
> and, besides one issue where I need to
> manually insert stack alignment code in the IRQ handling function for
> the DMA domain it seems to work.
> Also, if I align the stack within my IRQ_STEER handler it remains
> aligned for the domain handler just fine.
>
> My question is, why within irq_handler (see
> src/drivers/imx/interrupt.c, function begins around line 275)
> the stack is not aligned? Did you also encounter this issue on other
> platforms? And is there any good
> solution other than that bit of inline assembly that just force-
> aligns the stack pointer when entering the
> cascaded IRQ handler?
>

Never encountered this on Intel platforms. It could be another issue
that shows up when handling an IRQ ?

Does the emulator shed any light on this ?

> Without this code I seem to get panics with an alignment exception,
> the address pointing within an
> Interrupt stack and epc0 not being correct (I think I need to
> investigate that as well but that's a
> low-priority issue).

Could be corruption somewhere else ? I guess the timer IRQs and SW IRQs
work fine without the alignment ?

Liam
>
> Compiler version for reference (in case there is a known issue I'm
> not aware of):
>
> xt-xcc -v
> xt-xcc version 11.0.4
> Thread model: single
> _______________________________________________
> Sound-open-firmware mailing list
> Sound-open-firmware at alsa-project.org
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.alsa-project.org%2Fmailman%2Flistinfo%2Fsound-open-firmware&data=02%7C01%7Cpaul.olaru%40nxp.com%7Ca924d436a54b426986d208d76daa085f%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637098449357704788&sdata=JA00H1rkM6iHxs2jqm5gP1CfjGTLMklCj7XBuQAl%2B%2BY%3D&reserved=0



More information about the Sound-open-firmware mailing list