|
|
|
#
|
|
|
|
# Copyright (c) 2013-2018, ARM Limited and Contributors. All rights reserved.
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
#
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Include SPM Makefile
|
|
|
|
################################################################################
|
|
|
|
ifeq (${ENABLE_SPM},1)
|
|
|
|
ifeq (${SPM_DEPRECATED},1)
|
|
|
|
ifeq (${EL3_EXCEPTION_HANDLING},0)
|
|
|
|
$(error EL3_EXCEPTION_HANDLING must be 1 for SPM support)
|
|
|
|
endif
|
|
|
|
$(info Including deprecated SPM makefile)
|
|
|
|
include services/std_svc/spm_deprecated/spm.mk
|
|
|
|
else
|
|
|
|
$(info Including SPM makefile)
|
|
|
|
include services/std_svc/spm/spm.mk
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
include lib/psci/psci_lib.mk
|
|
|
|
|
|
|
|
BL31_SOURCES += bl31/bl31_main.c \
|
|
|
|
bl31/interrupt_mgmt.c \
|
|
|
|
bl31/aarch64/bl31_entrypoint.S \
|
|
|
|
bl31/aarch64/crash_reporting.S \
|
|
|
|
bl31/aarch64/ea_delegate.S \
|
|
|
|
bl31/aarch64/runtime_exceptions.S \
|
|
|
|
bl31/bl31_context_mgmt.c \
|
|
|
|
common/runtime_svc.c \
|
|
|
|
lib/aarch64/setjmp.S \
|
|
|
|
lib/cpus/aarch64/dsu_helpers.S \
|
|
|
|
plat/common/aarch64/platform_mp_stack.S \
|
|
|
|
services/arm_arch_svc/arm_arch_svc_setup.c \
|
|
|
|
services/std_svc/std_svc_setup.c \
|
|
|
|
${PSCI_LIB_SOURCES} \
|
|
|
|
${SPM_SOURCES}
|
|
|
|
|
|
|
|
|
|
|
|
ifeq (${ENABLE_PMF}, 1)
|
|
|
|
BL31_SOURCES += lib/pmf/pmf_main.c
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq (${EL3_EXCEPTION_HANDLING},1)
|
|
|
|
BL31_SOURCES += bl31/ehf.c
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq (${SDEI_SUPPORT},1)
|
|
|
|
ifeq (${EL3_EXCEPTION_HANDLING},0)
|
|
|
|
$(error EL3_EXCEPTION_HANDLING must be 1 for SDEI support)
|
|
|
|
endif
|
SDEI: Make dispatches synchronous
SDEI event dispatches currently only sets up the Non-secure context
before returning to the caller. The actual dispatch only happens upon
exiting EL3 next time.
However, for various error handling scenarios, it's beneficial to have
the dispatch happen synchronously. I.e. when receiving SDEI interrupt,
or for a successful sdei_dispatch_event() call, the event handler is
executed; and upon the event completion, dispatcher execution resumes
after the point of dispatch. The jump primitives introduced in the
earlier patch facilitates this feature.
With this patch:
- SDEI interrupts and calls to sdei_dispatch_event prepares the NS
context for event dispatch, then sets a jump point, and immediately
exits EL3. This results in the client handler executing in
Non-secure.
- When the SDEI client completes the dispatched event, the SDEI
dispatcher does a longjmp to the jump pointer created earlier. For
the caller of the sdei_dispatch_event() in particular, this would
appear as if call returned successfully.
The dynamic workaround for CVE_2018_3639 is slightly shifted around as
part of related minor refactoring. It doesn't affect the workaround
functionality.
Documentation updated.
NOTE: This breaks the semantics of the explicit dispatch API, and any
exiting usages should be carefully reviewed.
Change-Id: Ib9c876d27ea2af7fb22de49832e55a0da83da3f9
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
7 years ago
|
|
|
BL31_SOURCES += services/std_svc/sdei/sdei_dispatch.S \
|
|
|
|
services/std_svc/sdei/sdei_event.c \
|
|
|
|
services/std_svc/sdei/sdei_intr_mgmt.c \
|
|
|
|
services/std_svc/sdei/sdei_main.c \
|
|
|
|
services/std_svc/sdei/sdei_state.c
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq (${ENABLE_SPE_FOR_LOWER_ELS},1)
|
|
|
|
BL31_SOURCES += lib/extensions/spe/spe.c
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq (${ENABLE_AMU},1)
|
|
|
|
BL31_SOURCES += lib/extensions/amu/aarch64/amu.c \
|
|
|
|
lib/extensions/amu/aarch64/amu_helpers.S
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq (${ENABLE_SVE_FOR_NS},1)
|
|
|
|
BL31_SOURCES += lib/extensions/sve/sve.c
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq (${ENABLE_MPAM_FOR_LOWER_ELS},1)
|
|
|
|
BL31_SOURCES += lib/extensions/mpam/mpam.c
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq (${WORKAROUND_CVE_2017_5715},1)
|
|
|
|
BL31_SOURCES += lib/cpus/aarch64/wa_cve_2017_5715_bpiall.S \
|
|
|
|
lib/cpus/aarch64/wa_cve_2017_5715_mmu.S
|
|
|
|
endif
|
|
|
|
|
|
|
|
BL31_LINKERFILE := bl31/bl31.ld.S
|
|
|
|
|
|
|
|
# Flag used to indicate if Crash reporting via console should be included
|
|
|
|
# in BL31. This defaults to being present in DEBUG builds only
|
|
|
|
ifndef CRASH_REPORTING
|
|
|
|
CRASH_REPORTING := $(DEBUG)
|
|
|
|
endif
|
|
|
|
|
|
|
|
$(eval $(call assert_boolean,CRASH_REPORTING))
|
|
|
|
$(eval $(call assert_boolean,EL3_EXCEPTION_HANDLING))
|
|
|
|
$(eval $(call assert_boolean,SDEI_SUPPORT))
|
|
|
|
|
|
|
|
$(eval $(call add_define,CRASH_REPORTING))
|
|
|
|
$(eval $(call add_define,EL3_EXCEPTION_HANDLING))
|
|
|
|
$(eval $(call add_define,SDEI_SUPPORT))
|