Unverified Commit b39d2896 authored by davidcunado-arm's avatar davidcunado-arm Committed by GitHub
Browse files

Merge pull request #1283 from jeenu-arm/sdei-fixes

SDEI fixes
parents ba91a001 f2928f5b
...@@ -2022,9 +2022,9 @@ This macro must be defined to the EL3 exception priority level associated with ...@@ -2022,9 +2022,9 @@ This macro must be defined to the EL3 exception priority level associated with
Critical SDEI events on the platform. This must have a lower value (therefore of Critical SDEI events on the platform. This must have a lower value (therefore of
higher priority) than ``PLAT_SDEI_NORMAL_PRI``. higher priority) than ``PLAT_SDEI_NORMAL_PRI``.
It's recommended that SDEI exception priorities in general are assigned the **Note**: SDEI exception priorities must be the lowest among Secure priorities.
lowest among Secure priorities. Among the SDEI exceptions, Critical SDEI Among the SDEI exceptions, Critical SDEI priority must be higher than Normal
priority must be higher than Normal SDEI priority. SDEI priority.
Functions Functions
......... .........
......
/* /*
* Copyright (c) 2017, ARM Limited and Contributors. All rights reserved. * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved.
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
...@@ -556,7 +556,7 @@ int sdei_event_complete(int resume, uint64_t pc) ...@@ -556,7 +556,7 @@ int sdei_event_complete(int resume, uint64_t pc)
unsigned int client_el = sdei_client_el(); unsigned int client_el = sdei_client_el();
/* Return error if called without an active event */ /* Return error if called without an active event */
disp_ctx = pop_dispatch(); disp_ctx = get_outstanding_dispatch();
if (!disp_ctx) if (!disp_ctx)
return SDEI_EDENY; return SDEI_EDENY;
...@@ -566,15 +566,8 @@ int sdei_event_complete(int resume, uint64_t pc) ...@@ -566,15 +566,8 @@ int sdei_event_complete(int resume, uint64_t pc)
map = disp_ctx->map; map = disp_ctx->map;
assert(map); assert(map);
se = get_event_entry(map); se = get_event_entry(map);
SDEI_LOG("EOI:%lx, %d spsr:%lx elr:%lx\n", read_mpidr_el1(),
map->ev_num, read_spsr_el3(), read_elr_el3());
if (is_event_shared(map))
sdei_map_lock(map);
act = resume ? DO_COMPLETE_RESUME : DO_COMPLETE; act = resume ? DO_COMPLETE_RESUME : DO_COMPLETE;
if (!can_sdei_state_trans(se, act)) { if (!can_sdei_state_trans(se, act)) {
if (is_event_shared(map)) if (is_event_shared(map))
...@@ -582,6 +575,15 @@ int sdei_event_complete(int resume, uint64_t pc) ...@@ -582,6 +575,15 @@ int sdei_event_complete(int resume, uint64_t pc)
return SDEI_EDENY; return SDEI_EDENY;
} }
/* Having done sanity checks, pop dispatch */
pop_dispatch();
SDEI_LOG("EOI:%lx, %d spsr:%lx elr:%lx\n", read_mpidr_el1(),
map->ev_num, read_spsr_el3(), read_elr_el3());
if (is_event_shared(map))
sdei_map_lock(map);
/* /*
* Restore Non-secure to how it was originally interrupted. Once done, * Restore Non-secure to how it was originally interrupted. Once done,
* it's up-to-date with the saved copy. * it's up-to-date with the saved copy.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment