[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/7] target/arm: Split "get pending exception in
From: |
Richard Henderson |
Subject: |
Re: [Qemu-devel] [PATCH 2/7] target/arm: Split "get pending exception info" from "acknowledge it" |
Date: |
Sat, 3 Feb 2018 13:06:04 -0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 |
On 01/30/2018 07:02 AM, Peter Maydell wrote:
> Currently armv7m_nvic_acknowledge_irq() does three things:
> * make the current highest priority pending interrupt active
> * return a bool indicating whether that interrupt is targeting
> Secure or NonSecure state
> * implicitly tell the caller which is the highest priority
> pending interrupt by setting env->v7m.exception
>
> We need to split these jobs, because v7m_exception_taken()
> needs to know whether the pending interrupt targets Secure so
> it can choose to stack callee-saves registers or not, but it
> must not make the interrupt active until after it has done
> that stacking, in case the stacking causes a derived exception.
> Similarly, it needs to know the number of the pending interrupt
> so it can read the correct vector table entry before the
> interrupt is made active, because vector table reads might
> also cause a derived exception.
>
> Create a new armv7m_nvic_get_pending_irq_info() function which simply
> returns information about the highest priority pending interrupt, and
> use it to rearrange the v7m_exception_taken() code so we don't
> acknowledge the exception until we've done all the things which could
> possibly cause a derived exception.
>
> Signed-off-by: Peter Maydell <address@hidden>
> ---
> target/arm/cpu.h | 19 ++++++++++++++++---
> hw/intc/armv7m_nvic.c | 30 +++++++++++++++++++++++-------
> target/arm/helper.c | 16 ++++++++++++----
> hw/intc/trace-events | 3 ++-
> 4 files changed, 53 insertions(+), 15 deletions(-)
Reviewed-by: Richard Henderson <address@hidden>
r~
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Qemu-devel] [PATCH 2/7] target/arm: Split "get pending exception info" from "acknowledge it",
Richard Henderson <=