diff options
author | Antonio Nino Diaz <antonio.ninodiaz@arm.com> | 2017-11-17 16:58:33 +0000 |
---|---|---|
committer | Sandrine Bailleux <sandrine.bailleux@arm.com> | 2017-11-23 10:48:52 +0000 |
commit | 82dd66df3e2e23cc2e7e227cb90ff94cffccf9f1 (patch) | |
tree | 1ee18be6a93458b511875553a9d88cb52ffc2b67 /tests/runtime_services | |
parent | a4090b5754a7f448db8cca4274946fd18e9c9c13 (diff) |
Ensure that PSTATE is updated right after a change
It is needed to add a isb after modifying PSTATE.{D,A,I,F} so that the
effects are seen immediately. For example, this is useful to make sure
that pending interrupt are handled as soon as the interrupts are
enabled.
Some definitions in `include/lib/aarch64/arch_helpers.h` have been moved
inside the file so that isb() is defined before it is used.
This commit makes it unnecesary to have a isb() after any of the
functions modified by this file, so all isb() after them have been
removed across the whole codebase.
The fact that the old version of the functions needed a isb() made it
easy to introduce bugs, as it was easy to forget about the isb(). There
are some cases in the codebase as well, that are now fixed.
Change-Id: If9f9335f8889f2e23900307eb6a6236143577e10
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Diffstat (limited to 'tests/runtime_services')
3 files changed, 0 insertions, 6 deletions
diff --git a/tests/runtime_services/standard_service/psci/api_tests/cpu_suspend/test_suspend.c b/tests/runtime_services/standard_service/psci/api_tests/cpu_suspend/test_suspend.c index f16eee3..aa05f11 100644 --- a/tests/runtime_services/standard_service/psci/api_tests/cpu_suspend/test_suspend.c +++ b/tests/runtime_services/standard_service/psci/api_tests/cpu_suspend/test_suspend.c @@ -101,7 +101,6 @@ static test_result_t suspend_non_lead_cpu(void) /* Preserve DAIF flags*/ flags = read_daif(); disable_irq(); - isb(); rc = tftf_program_timer(PLAT_SUSPEND_ENTRY_TIME); if (rc != 0) { @@ -218,7 +217,6 @@ static test_result_t test_psci_suspend(unsigned int aff_level, /* Preserve DAIF flags*/ flags = read_daif(); disable_irq(); - isb(); /* * Program the timer, this will serve as the diff --git a/tests/runtime_services/standard_service/psci/api_tests/system_suspend/test_psci_system_suspend.c b/tests/runtime_services/standard_service/psci/api_tests/system_suspend/test_psci_system_suspend.c index 312a9d1..0f1149b 100644 --- a/tests/runtime_services/standard_service/psci/api_tests/system_suspend/test_psci_system_suspend.c +++ b/tests/runtime_services/standard_service/psci/api_tests/system_suspend/test_psci_system_suspend.c @@ -512,7 +512,6 @@ test_result_t test_psci_sys_susp_pending_irq(void) tftf_irq_enable(sgi_id, GIC_HIGHEST_NS_PRIORITY); disable_irq(); - isb(); /* Send the SGI to the lead CPU */ tftf_send_sgi(sgi_id, core_pos); @@ -522,7 +521,6 @@ test_result_t test_psci_sys_susp_pending_irq(void) /* Un-mask the interrupt */ enable_irq(); - isb(); /* * If the wake-up timer has fired, then the pending interrupt did diff --git a/tests/runtime_services/standard_service/psci/api_tests/validate_power_state/test_validate_power_state.c b/tests/runtime_services/standard_service/psci/api_tests/validate_power_state/test_validate_power_state.c index 25febde..a86abf1 100644 --- a/tests/runtime_services/standard_service/psci/api_tests/validate_power_state/test_validate_power_state.c +++ b/tests/runtime_services/standard_service/psci/api_tests/validate_power_state/test_validate_power_state.c @@ -441,7 +441,6 @@ static test_result_t test_execute_test_function(void) * CPU to wake-up from suspend. */ disable_irq(); - isb(); /* Configure an SGI to wake-up from suspend */ tftf_send_sgi(IRQ_NS_SGI_0, core_pos); @@ -449,7 +448,6 @@ static test_result_t test_execute_test_function(void) ret = (*psci_validate_test_function)(); enable_irq(); - isb(); while (!sgi_received[core_pos]) ; |