[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-arm] [Qemu-devel] [PATCH 04/19] nvic: Add cached vectpending_p
From: |
Richard Henderson |
Subject: |
Re: [Qemu-arm] [Qemu-devel] [PATCH 04/19] nvic: Add cached vectpending_prio state |
Date: |
Wed, 13 Sep 2017 16:25:26 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 |
On 09/12/2017 11:13 AM, Peter Maydell wrote:
> Instead of looking up the pending priority
> in nvic_pending_prio(), cache it in a new state struct
> field. The calculation of the pending priority given
> the interrupt number is more complicated in v8M with
> the security extension, so the caching will be worthwhile.
>
> This changes nvic_pending_prio() from returning a full
> (group + subpriority) priority value to returning a group
> priority. This doesn't require changes to its callsites
> because we use it only in comparisons of the form
> execution_prio > nvic_pending_prio()
> and execution priority is always a group priority, so
> a test (exec prio > full prio) is true if and only if
> (execprio > group_prio).
>
> (Architecturally the expected comparison is with the
> group priority for this sort of "would we preempt" test;
> we were only doing a test with a full priority as an
> optimisation to avoid the mask, which is possible
> precisely because the two comparisons always give the
> same answer.)
>
> Signed-off-by: Peter Maydell <address@hidden>
> ---
> include/hw/intc/armv7m_nvic.h | 2 ++
> hw/intc/armv7m_nvic.c | 23 +++++++++++++----------
> hw/intc/trace-events | 2 +-
> 3 files changed, 16 insertions(+), 11 deletions(-)
Reviewed-by: Richard Henderson <address@hidden>
r~
- [Qemu-arm] [PATCH 00/19] ARMv8M: support security extn in the NVIC, Peter Maydell, 2017/09/12
- [Qemu-arm] [PATCH 02/19] nvic: Add banked exception states, Peter Maydell, 2017/09/12
- [Qemu-arm] [PATCH 03/19] nvic: Add cached vectpending_is_s_banked state, Peter Maydell, 2017/09/12
- [Qemu-arm] [PATCH 04/19] nvic: Add cached vectpending_prio state, Peter Maydell, 2017/09/12
- Re: [Qemu-arm] [Qemu-devel] [PATCH 04/19] nvic: Add cached vectpending_prio state,
Richard Henderson <=
- [Qemu-arm] [PATCH 06/19] nvic: Make ICSR.RETTOBASE handle banked exceptions, Peter Maydell, 2017/09/12
- [Qemu-arm] [PATCH 05/19] nvic: Implement AIRCR changes for v8M, Peter Maydell, 2017/09/12
- [Qemu-arm] [PATCH 07/19] nvic: Implement NVIC_ITNS<n> registers, Peter Maydell, 2017/09/12
- [Qemu-arm] [PATCH 12/19] nvic: In escalation to HardFault, support HF not being priority -1, Peter Maydell, 2017/09/12
- [Qemu-arm] [PATCH 10/19] nvic: Make SHPR registers banked, Peter Maydell, 2017/09/12