On 01/30/2018 07:02 AM, Peter Maydell wrote: > In the v8M architecture, if the process of taking an exception > results in a further exception this is called a derived exception > (for example, an MPU exception when writing the exception frame to > memory). If the derived exception happens while pushing the initial > stack frame, we must ignore any subsequent possible exception > pushing the callee-saves registers. > > In preparation for making the stack writes check for exceptions, > add a return value from v7m_push_stack() and a new parameter to > v7m_exception_taken(), so that the former can tell the latter that > it needs to ignore failures to write to the stack. We also plumb > the argument through to v7m_push_callee_stack(), which is where > the code to ignore the failures will be. > > (Note that the v8M ARM pseudocode structures this slightly differently: > derived exceptions cause the attempt to process the original > exception to be abandoned; then at the top level it calls > DerivedLateArrival to prioritize the derived exception and call > TakeException from there. We choose to let the NVIC do the prioritization > and continue forward with a call to TakeException which will then > take either the original or the derived exception. The effect is > the same, but this structure works better for QEMU because we don't > have a convenient top level place to do the abandon-and-retry logic.) > > Signed-off-by: Peter Maydell <[email protected]> > --- > target/arm/helper.c | 35 +++++++++++++++++++++++------------ > 1 file changed, 23 insertions(+), 12 deletions(-)
Reviewed-by: Richard Henderson <[email protected]> r~
