Commit graph

707 commits

Author SHA1 Message Date
Manish Pandey
1cafc96f28 Merge "feat(the): add support for FEAT_THE" into integration 2024-10-16 15:36:33 +02:00
Raghu Krishnamurthy
6a88ec8b30 feat(rmmd): el3 token sign during attestation
Add required SMCs by RMM to push attestation signing requests to EL3
and get responses. EL3 may then choose to push these requests to a HES
as suitable for a platform. This patch also supports the new
RMM_EL3_FEATURES interface, that RMM can use to query for support for
HES based signing. The new interface exposes a feature register with
different bits defining different discoverable features. This new
interface is available starting the 0.4 version of the RMM-EL3
interface, causing the version to bump up. This patch also adds a
platform port for FVP that implements the platform hooks required to
enable the new SMCs, but it does not push to a HES and instead copies a
zeroed buffer in EL3.

Change-Id: I69c110252835122a9533e71bdcce10b5f2a686b2
Signed-off-by: Raghu Krishnamurthy <raghupathyk@nvidia.com>
2024-10-15 08:20:28 -07:00
Jayanth Dodderi Chidanand
6d0433f040 feat(the): add support for FEAT_THE
Arm v8.9 introduces FEAT_THE, adding Translation Hardening Extension
Read-Check-Write mask registers, RCWMASK_EL1 and RCWSMASK_EL1.
Support this, context switching the registers and disabling
traps so lower ELs can access the new registers.

Change the FVP platform to default to handling this as a dynamic option
so the right decision can be made by the code at runtime.

Change-Id: I8775787f523639b39faf61d046ef482f73b2a562
Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
2024-10-13 18:44:54 -05:00
Manish V Badarkhe
40469bf977 fix(build): pass the PLAT option during FIP tool compilation
Due to change [1], the FIP tool was compiled with the default platform
instead of the one specified via the command line, as make_helpers.mk
set the PLAT option to default. This happened because the root Makefile
invoked FIP tool compilation without the PLAT option. The issue has
been fixed by explicitly providing the PLAT option for FIP tool
compilation.

[1]: https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/26597

Change-Id: Icc516f8d44706df03c7e6ee123b58afeda72cea7
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2024-10-03 21:04:46 +01:00
André Przywara
d7890a5f2b Merge "feat(build): add ability to define platform specific defaults" into integration 2024-10-02 19:06:29 +02:00
Chris Kay
d286739716 build: make Poetry optional
The Yocto team has requested that we do not use Poetry from within the
Makefile, as Yocto does not have network access during the build
process.

We want to maintain the current behaviour, so this change makes our use
of Poetry contigent on it being available in the environment.

Additionally, explicitly passing an empty toolchain parameter now allows
a tool to be *disabled* (e.g. passing `POETRY=` will prevent the build
system from trying to use Poetry).

Change-Id: Ibf552a3fee1eaadee767a1b948b559700083b401
Signed-off-by: Chris Kay <chris.kay@arm.com>
2024-09-26 14:23:20 +00:00
Manish V Badarkhe
1297a45d6a Merge changes from topic "dynamic-toolchain" into integration
* changes:
  build: allow multiple toolchain defaults
  build: determine toolchain tools dynamically
2024-09-25 13:53:54 +02:00
Harrison Mutai
2329e22b8b feat(handoff): make tl generation flexible
Make the process of compiling a TL from DT source flexible. Provide a
top level recipe to make it easier for developers to build a transfer
list. Clean up integration of TLC into the build system.

Change-Id: I4466e27a457dfd5bf709dc3a360a2b63bf6030ce
Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
2024-09-19 13:44:23 +00:00
Andrey Skvortsov
1b2fb6adb5 feat(build): add ability to define platform specific defaults
In some cases it maybe needed to override some default settings on a
particular platform. For example, enable ENABLE_LTO on a size
constrained platform.

Change-Id: I556d26f6b81c0f3ceb40b7196180995dde22afd0
Signed-off-by: Andrey Skvortsov <andrej.skvortzov@gmail.com>
2024-09-17 21:44:39 +03:00
Manish V Badarkhe
97a9c7ab9e Merge "fix(checkpatch): detect issues in commit message" into integration 2024-09-12 10:54:45 +02:00
Chris Kay
3789c3c000 build: determine toolchain tools dynamically
Since the introduction of the toolchain detection framework into the
build system, we have done determination and identification of the
toolchain(s) used for the build at the initialization of the build
system.

This incurs a large cost to the build every time - for every toolchain
that has been requested by the current makefile, we try to identify each
tool in the list of known tool classes, even if that tool doesn't
actually see any use.

For the clean and check-like targets we worked around this by disabling
most of the toolchains if we detect these targets, but this is
inflexible and not very reliable, and it still means that when building
normal targets we are incurring that cost for all tools whether they are
used or not.

This change instead modifies the toolchain detection framework to only
initialize a tool for a given toolchain when it is first used. This does
mean that we can no longer warn about an incorrectly-configured
toolchain at the beginning of build system invocation, but it has the
advantage of substantially reducing build time and the complexity of
*using* the framework (at the cost of an increase in complexity in the
framework itself).

Change-Id: I7f3d06b2eb58c1b26a846791a13b0037f32c8013
Signed-off-by: Chris Kay <chris.kay@arm.com>
2024-09-10 09:47:06 +00:00
Chris Kay
73f7b7ddbe fix(cot-dt2c): fix various breakages
This change fixes several breakages that were introduced in some build
configurations by the introduction of the cot-dt2c tool.

Some Python environments cannot be managed directly via `pip`, and
invocations of `make`, including `make distclean`, would cause errors
along the lines of:

    error: externally-managed-environment

    × This environment is externally managed
    ╰─> To install Python packages system-wide, try apt install
        python3-xyz, where xyz is the package you are trying to
        install.

This change has been resolved by ensuring that calls to the cot-dt2c
tool from the build system happen exclusively through Poetry, which
automatically sets up a virtual environment that *can* be modified.

Some environments saw the following error when building platforms where
the cot-dt2c tool was used:

    make: *** No rule to make target '<..>/debug/bl2_cot.c', needed
    by '<..>/debug/bl2/bl2_cot.o'.  Stop.

Additionally, environments with a more recent version of Python saw the
following error:

      File "<...>/lib/python3.12/site-packages/cot_dt2c/cot_parser.py",
      line 637, in img_to_c
        if ifdef:
           ^^^^^
    NameError: name 'ifdef' is not defined

Both of these errors have now been resolved by modifications to the
build system and the cot-dt2c tool to enable preprocessing of the device
tree source file before it is processed by the tool.

As a consequence of this change, the `pydevicetree` library is no longer
vendored into the repository tree, and we instead pull it in via a
dependency in Poetry.

This change also resolves several MyPy warnings and errors related to
missing type hints.

Change-Id: I72b2d01caca3fcb789d3fe2549f318a9c92d77d1
Signed-off-by: Chris Kay <chris.kay@arm.com>
2024-08-28 09:56:59 +00:00
Madhukar Pappireddy
59bdcc58c3 feat(el3-spmc): support simd context management upon world switch
This patch performs necessary simd context management operations for
context switch from NWd to SWD and vice versa.

Change-Id: Ife01fffc4e2a7f3deb9b6273424161c225fdbbfb
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
2024-08-19 11:11:14 -05:00
Madhukar Pappireddy
3524d0742e feat(simd): add rules to rationalize simd ctxt mgmt
Illegal combinations of build flags associated with SIMD context
management are flagged by the build system.

Change-Id: I3192af3889e1e864c7875778616e167ba6894195
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
2024-08-19 11:11:06 -05:00
Madhukar Pappireddy
308ebfa188 feat(simd): introduce simd context helper APIs
This patch adds the common API to save and restore FP and SVE. When SVE
is enabled we save and restore SVE which automatically covers FP. If FP
is enabled while SVE is not, then we save and restore FP only.

The patch uses simd_ctx_t to save and restore both FP and SVE which
means developers need not use fp or sve routines directly. Once all the
calls to fpregs_context_* are replaced with simd_ctx_*, we can remove
fp_regs_t data structure and macros (taken care in a following patch).

simd_ctx_t is currently allocated in section of its own. This will go
into  BSS section by default but platform will have option of relocating
it to a different section by overriding in plat.ld.S.

Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
Signed-off-by: Okash Khawaja <okash@google.com>
Change-Id: I090f8b8fa3862e527b6c40385249adc69256bf24
2024-08-19 11:10:10 -05:00
Madhukar Pappireddy
42422622f9 feat(simd): add sve state to simd ctxt struct
This patch extends the simd data structure to hold the SVE state. A new
build flag CTX_INCLUDE_SVE_REGS is introduced in this patch to enable
SVE context management.

Necessary precautions are taken such as ensuring the field offsets are
not changed and necessary padding is added for alignment reasons.

Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
Signed-off-by: Okash Khawaja <okash@google.com>
Change-Id: I54f5222c7d8c68638105003f68caa511d347cd60
2024-08-19 11:10:10 -05:00
Yann Gautier
1a72174860 fix(checkpatch): detect issues in commit message
The current implementation of make checkpatch does not detect issues
when Signed-off-by line is missing. The solution is to concatenate
the output of both git log and git diff before executing checkpatch
script.

Change-Id: Ic2d6f8bc10316d73b72a73a1807aa36cdec6900d
Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
2024-08-09 11:55:00 +02:00
Xialin Liu
0e0fab0ca2 feat(arm): makefile invoke CoT dt2c
Change the makefile to call the cot-dt2c tool
during the build for Arm platform

Change-Id: Idb7c02cca6b9ddd87f575a42c88e7b2660b896e0
Signed-off-by: Xialin Liu <Xialin.Liu@ARM.com>
2024-08-07 08:46:30 +01:00
Chris Kay
fd74ca0d6b build: fix missing $$(@D)/ from sp_gen.mk
This target can currently fail as the `$(BUILD_PLAT)` target no longer exists, as it is now `$(BUILD_PLAT)/` (with an explicit trailing slash).

Change-Id: I9172b2f51f6e02e6369f62468ea63a64ec0f6dd1
Signed-off-by: Chris Kay <chris.kay@arm.com>
2024-07-30 17:26:10 +02:00
Manish Pandey
0195bac19b Merge "build: consolidate directory creation rules" into integration 2024-07-29 15:54:46 +02:00
Chris Kay
f4dd18c270 build: consolidate directory creation rules
This commit streamlines directory creation by introducing a single
pattern rule to automatically make directories for which there is a
dependency.

We currently use several macros to generate rules to create directories
upon dependence, which is a significant amount of code and a lot of
redundancy. The rule introduced by this change represents a catch-all:
any rule dependency on a path ending in a forward slash is automatically
created.

Now, rules can rely on an unordered dependency (`|`) on `$$(@D)/` which,
when secondary expansion is enabled, expands to the directory of the
target being built, e.g.:

    build/main.o: main.c | $$(@D)/ # automatically creates `build/`

Change-Id: I7e554efa2ac850e779bb302fd9c7fbb239886c9f
Signed-off-by: Chris Kay <chris.kay@arm.com>
2024-07-22 09:41:30 +00:00
Arvind Ram Prakash
33e6aaacf1 feat(fgt2): add support for FEAT_FGT2
This patch disables trapping to EL3 when the FEAT_FGT2
specific trap registers are accessed by setting the
SCR_EL3.FGTEn2 bit

Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
Change-Id: I6d2b614affb9067b2bc3d7bf0ae7d169d031592a
2024-07-18 13:49:43 -05:00
Arvind Ram Prakash
83271d5a5a feat(debugv8p9): add support for FEAT_Debugv8p9
This patch enables FEAT_Debugv8p9 and prevents EL1/0 from
trapping to EL3 when accessing MDSELR_EL1 register by
setting the MDCR_EL3.EBWE bit.

Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
Change-Id: I3613af1dd8cb8c0d3c33dc959f170846c0b9695a
2024-07-18 13:49:43 -05:00
Chris Kay
7c4e1eea61 build: unify verbosity handling
This change introduces a few helper variables for dealing with verbose
and silent build modes: `silent`, `verbose`, `q` and `s`.

The `silent` and `verbose` variables are boolean values determining
whether the build system has been configured to run silently or
verbosely respectively (i.e. with `--silent` or `V=1`).

These two modes cannot be used together - if `silent` is truthy then
`verbose` is always falsy. As such:

    make --silent V=1

... results in a silent build.

In addition to these boolean variables, we also introduce two new
variables - `s` and `q` - for use in rule recipes to conditionally
suppress the output of commands.

When building silently, `s` expands to a value which disables the
command that follows, and `q` expands to a value which supppresses
echoing of the command:

    $(s)echo 'This command is neither echoed nor executed'
    $(q)echo 'This command is executed but not echoed'

When building verbosely, `s` expands to a value which disables the
command that follows, and `q` expands to nothing:

    $(s)echo 'This command is neither echoed nor executed'
    $(q)echo 'This command is executed and echoed'

In all other cases, both `s` and `q` expand to a value which suppresses
echoing of the command that follows:

    $(s)echo 'This command is executed but not echoed'
    $(q)echo 'This command is executed but not echoed'

The `s` variable is predominantly useful for `echo` commands, where you
always want to suppress echoing of the command itself, whilst `q` is
more useful for all other commands.

Change-Id: I8d8ff6ed714d3cb401946c52955887ed7dca602b
Signed-off-by: Chris Kay <chris.kay@arm.com>
2024-06-14 15:54:48 +00:00
Soby Mathew
261edb6a0f Merge changes I710d1780,Ia9a59bde into integration
* changes:
  feat(gpt): configure memory size protected by bitlock
  feat(gpt): add support for large GPT mappings
2024-05-28 12:26:37 +02:00
Manish V Badarkhe
669e2b159a docs(changelog): changelog for v2.11 release
Generated this change-log using below command:
npm run release -- --skip.commit --skip.tag --release-as 2.11.0

Change-Id: I34c7b342549781057da1b18116500f110bc3f5ad
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
Signed-off-by: Juan Pablo Conde <JuanPablo.Conde@arm.com>
2024-05-22 19:19:54 -05:00
AlexeiFedorov
d766084fc4 feat(gpt): configure memory size protected by bitlock
This patch adds support in GPT library for configuration
of the memory block size protected by one bit of 'bitlock'
structure. Build option 'RME_GPT_BITLOCK_BLOCK' defines the
number of 512MB blocks covered by each bit. This numeric
parameter must be a power of 2 and can take the values from
0 to 512. Setting this value to 0 chooses a single spinlock
for all GPT L1 table entries. The default value is set to 1
which corresponds to 512MB per bit.

Change-Id: I710d178072894a3ef40daebea701f74d19e8a3d7
Signed-off-by: AlexeiFedorov <Alexei.Fedorov@arm.com>
2024-05-22 11:41:00 +01:00
Chris Kay
291e718229 build: skip toolchain detection for some targets
Most developers run the `clean`, `checkpatch` and other similar targets
without specifying any other additional build options. When combined
with a flow where the developer passes `CROSS_COMPILE` or `CC`
explicitly, and where the default-configured tools are not on the PATH,
these targets will warn about unrecognized toolchain tools.

This change is a workaround for this whereby the toolchain makefile is
not expanded unless a target *not* named `*clean`, `check*` `doc` or
`*tool` has been specified.

Change-Id: I2f2a275964b65253df07c2207043217b14f615fe
Signed-off-by: Chris Kay <chris.kay@arm.com>
2024-05-14 15:41:15 +00:00
AlexeiFedorov
ec0088bbab feat(gpt): add support for large GPT mappings
This patch adds support for large GPT mappings using
Contiguous descriptors. The maximum size of supported
contiguous block in MB is defined in RME_GPT_MAX_BLOCK
build parameter and takes values 0, 2, 32 and 512 and
by default set to 2 in make_helpers/defaults.mk.
Setting RME_GPT_MAX_BLOCK value to 0 disables use of
Contiguous descriptors.
Function gpt_tlbi_by_pa_ll() and its declaration
are removed from lib/aarch64/misc_helpers.S and
include/arch/aarch64/arch_helpers.h, because the
GPT library now uses tlbirpalos_xxx() functions.

Change-Id: Ia9a59bde1741c5666b4ca1de9324e6dfd6f734eb
Signed-off-by: AlexeiFedorov <Alexei.Fedorov@arm.com>
2024-05-14 10:36:42 +02:00
Manish Pandey
b38b37ba06 Merge changes from topic "ar/pmuSaveRestore" into integration
* changes:
  feat(tc): add save/restore DSU PMU register support
  feat(dsu): save/restore DSU PMU register
  feat(plat): add platform API that gets cluster ID
2024-05-10 11:46:42 +02:00
Arvind Ram Prakash
f99a69c386 feat(dsu): save/restore DSU PMU register
Adds driver support to preserve DSU PMU register values over a DSU
power cycle. This driver needs to be enabled by the platforms that
support DSU and also need it's PMU registers to be preserved

Change-Id: I7fc68a3d7d99ee369379aa5cd114fffc763fc0d2
Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
2024-05-09 10:20:32 -05:00
Manish V Badarkhe
91dcf7d176 build: remove experimental mark for PSA FWU support
The PSA FWU support is significantly matured in terms of
its design, threat model documentation, and implementation
as well as its adherence to the latest PSA FWU specifications.
Consequently, the experimental mark for this feature has been
removed.

Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
Change-Id: Ia6611e0c71485413b0da885f41ac59c93038e480
2024-05-09 14:42:18 +02:00
Manish V Badarkhe
82222db809 build: mark DICE_PROTECTION_ENVIRONMENT as an experimental feature
The DICE_PROTECTION_ENVIRONMENT support has been marked as experimental
since it has not incorporated into the threat model.

Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
Change-Id: Ic1ea4d59fd8a3fde7ce0404488a56e9d11bc1b85
2024-05-09 14:42:06 +02:00
Manish Pandey
a97e1f9747 Merge changes from topic "early_console" into integration
* changes:
  feat(stm32mp2): use early traces
  feat(st-bsec): use early traces
  refactor(st): replace STM32MP_EARLY_CONSOLE with EARLY_CONSOLE
  feat(console): introduce EARLY_CONSOLE
  feat(bl32): create an sp_min_setup function
2024-05-08 23:12:11 +02:00
Chris Kay
758ccb802d build: remove MAKE_BUILD_STRINGS function
This function causes the build message to be generated and compiled in
two different ways, with one way done inside `build_macros.mk` and the
other done inside `windows.mk`, mostly because it's done by generating
the C file on the command line.

We can instead replace this whole build message generation sequence with
a simple standard C compilation command and a normal C file.

Change-Id: I8bc136380c9585ddeec9a11154ee39ef70526f81
Signed-off-by: Chris Kay <chris.kay@arm.com>
2024-04-29 12:47:01 +00:00
Yann Gautier
ae770fedf4 feat(console): introduce EARLY_CONSOLE
This is a generic porting of what was done on ST platforms with flag
STM32MP_EARLY_CONSOLE. It creates the flag and the prototype for
plat_setup_early_console(). This function depends on platform
implementation. This function call is added at the beginning of each BL
image early setup function.
The patch also introduce an extra log macro: EARLY_ERROR. This can
replace ERROR macro in code that will only be executed before the
default console is enabled, and will do nothing when the EARLY_CONSOLE
is not enabled. This can then save some space in memory.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I77bf0a0c4289b4c7df94e4bfb783a938e05bf023
2024-04-24 15:44:28 +02:00
Soby Mathew
9bbc989f83 Merge "feat(rme): build TF-A with ENABLE_RME for Armv9.2" into integration 2024-04-12 16:25:25 +02:00
Govindraj Raja
c282384dbb refactor(mte): remove mte, mte_perm
Currently both FEAT_MTE and FEAT_MTE_PERM aren't used for enabling
of any feature bits in EL3. So remove both FEAT handling.

All mte regs that are currently context saved/restored are needed
only when FEAT_MTE2 is enabled, so move to usage of FEAT_MTE2 and
remove FEAT_MTE usage.

BREAKING CHANGE: Any platform or downstream code trying to use
SCR_EL3.ATA bit(26) will see failures as this is now moved to be
used only with FEAT_MTE2 with
commit@ef0d0e5478a3f19cbe70a378b9b184036db38fe2

Change-Id: Id01e154156571f7792135639e17dc5c8d0e17cf8
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
2024-03-26 14:30:58 -05:00
AlexeiFedorov
7d5fc98f54 feat(rme): build TF-A with ENABLE_RME for Armv9.2
FEAT_RME is OPTIONAL in an Armv9.2 implementation,
so set ARM_ARCH_MAJOR := 9 and ARM_ARCH_MINOR := 2
when TF-A is built with 'ENABLE_RME = 1'.

Change-Id: Ibcdb23bd057983eb846eed0b0da8c4d72ed696ae
Signed-off-by: AlexeiFedorov <Alexei.Fedorov@arm.com>
2024-03-13 14:47:38 +01:00
Tamas Ban
e7f1181f8a feat(tc): add DPE backend to the measured boot framework
The client platform relies on the DICE attestation
scheme. RSS provides the DICE Protection Environment
(DPE) service. TF-A measured boot framework supports
multiple backends. A given platform always enables
the corresponding backend which is required by the
attestation scheme.

Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Change-Id: Idc3360d0d7216e4859e99b5db3d377407e0aeee5
2024-03-06 16:55:08 +01:00
Chris Kay
fa402f38b2 build: allow platform makefiles to configure ENABLE_LTO
This change introduces a lazily-evaluated condition on `ENABLE_LTO` to
the `LTO_CFLAGS` variable as opposed to evaluating the condition
eagerly.

This concludes a recent request on the mailing list:

    https://lists.trustedfirmware.org/archives/list/tf-a@lists.trustedfirmware.org/thread/EU3XR4VB3RP2NQB372QPZ4VRP57ANNLC/

Change-Id: Ie1f73352eb51fb2ceb2385232336312216ef87fc
Signed-off-by: Chris Kay <chris.kay@arm.com>
2024-03-05 16:30:02 +01:00
Bipin Ravi
9a79c9e431 Merge changes from topic "fix-lto-build-all" into integration
* changes:
  build(fpga): correctly handle gcc as linker for LTO
  fix(build): enforce single partition for LTO build
  fix(rockchip): add support for building with LTO enabled
2024-03-04 20:22:42 +01:00
Sughosh Ganu
11d05a7729 feat(fwu): add a config flag for including image info in the FWU metadata
The version 2 of the FWU metadata structure is designed such that the
information on the updatable images can be omitted from the metadata
structure. Add a configuration flag, PSA_FWU_METADATA_FW_STORE_DESC,
which is used to select whether the metadata structure has this
information included or not. It's value is set to 1 by default.

Change-Id: I4463a20c94d2c745ddb0b2cc8932c12d418fbd42
Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
2024-03-01 14:19:56 +05:30
Andrey Skvortsov
31f80efeef fix(build): enforce single partition for LTO build
For example, build for PLAT=fvp SPD=spmd fails with a following error
when LTO is enabled using GCC 13.2.1:

  aarch64-none-elf/bin/ld: /tmp/ccrG0Z8D.ltrans0.ltrans.o: in function `spmd_smc_forward':
  arm-trusted-firmware/services/std_svc/spmd/spmd_main.c:749:(.text+0xbe50): undefined reference to `rdist_ctx'
  aarch64-none-elf/bin/ld: arm-trusted-firmware/services/std_svc/spmd/spmd_main.c:749:(.text+0xbe58): undefined reference to `dist_ctx'
  collect2: error: ld returned 1 exit status

Access to rdist_ctx and dist_ctx is defined using inline assembler
like
 __asm__ volatile ("ldr %0, =rdist_ctx" : "=r" (v) : "X" (rdist_ctx));

Access assembler function definitions moved to a different ltrans then
actual variables. Partitioner doesn't take into account defined and
used symbols in inline assembler. Depending on compiler partitioner
decision the same code builds for some platforms successfully.

This is a known gcc problem
1. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57703
2. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46820

TF-A source code isn't that big and enforcing single partitioning will
not affect build performance, but will fix problems with 'undefined
references' related to inline assembler.

Change-Id: I72955ab0318f72b588d3a246824f99a48a92d8ef
Signed-off-by: Andrey Skvortsov <andrej.skvortzov@gmail.com>
2024-02-24 00:42:50 +03:00
Arunachalam Ganapathy
0686a01b0c feat(arm): add trusty_sp_fw_config build option
Also increase add PLAT_ARM_SP_MAX_SIZE to override the default
ARM_SP_MAX_SIZE to support Trusty image and move OPTEE_SP_FW_CONFIG
documentation to build-internals.rst as it's not externally set-able.

Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
Change-Id: Ief90ae9113d32265ee2200f35f3e517b7b9a4bea
2024-02-23 16:11:47 +00:00
Mark Dykes
ef68521971 Merge "build: use toolchain identifiers in conditions" into integration 2024-02-20 16:06:52 +01:00
Mark Dykes
60dd8069bf Merge "build: use new toolchain variables for tools" into integration 2024-02-20 16:06:35 +01:00
Mark Dykes
084c9d3c0d Merge "build: refactor toolchain detection" into integration 2024-02-20 16:04:53 +01:00
Govindraj Raja
8e3978899a feat(mte): add mte2 feat
Add support for feat mte2. tfsr_el2 is available only with mte2,
however currently its context_save/restore is done with mte rather than
mte2, so introduce 'is_feat_mte2_supported' to check mte2.

Change-Id: I108d9989a8f5b4d1d2f3b9865a914056fa566cf2
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
2024-02-12 08:20:01 -06:00
Yann Gautier
c25d1ccf1e fix(build): move comment for VERSION_PATCH
Having a comment at the end of VERSION_PATCH definition line prevent
the release script to work properly. Move it on the previous line.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I4008ccbccd512edf33f67c645b38937ad1af9777
2024-02-08 18:40:27 +01:00