linux-mips
[Top] [All Lists]

Re: wrong SP restored after DBE exception

To: Ralf Baechle <ralf@linux-mips.org>
Subject: Re: wrong SP restored after DBE exception
From: "Maciej W. Rozycki" <macro@linux-mips.org>
Date: Thu, 28 Sep 2006 14:56:29 +0100 (BST)
Cc: Dave Johnson <djohnson+linux-mips@sw.starentnetworks.com>, linux-mips@linux-mips.org
In-reply-to: <20060928130925.GA3394@linux-mips.org>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <17690.54995.407882.581783@zeus.sw.starentnetworks.com> <20060928130925.GA3394@linux-mips.org>
Sender: linux-mips-bounce@linux-mips.org
On Thu, 28 Sep 2006, Ralf Baechle wrote:

> If we take a DBE exception in this code we're in trouble and I've seen
> systems delivering DBEs highly asynchronously.  Afar the Broadcom SOCs
> fall into that class.
> 
> So the interesting part is if we take a data bus exception between
> the stack pointer adjustment and and before EXL is cleared.  We're taking
> a nested exception so c0_epc and c0_cause.bd will not be updated.  So
> when the bus error handler will save the $sp value it saw on entry but
> will return to the EPC of the first exception, that is only one stack
> frame will be popped.  Whops ...

 It looks like a design issue -- further asynchronous bus error exceptions 
should be blocked till one currenly being handled has been acked.  In fact 
if they are asynchronous, then it really makes no sense to use the 
exception and a general interrupt should be used instead -- the whole 
point of using an exception here is the ability to stop a data corrupting 
transaction, as unlike an interropt, an exception can be precise.

  Maciej

<Prev in Thread] Current Thread [Next in Thread>