Commit graph

15927 commits

Author SHA1 Message Date
Karl Li
f5a6aa02a9 feat(mt8196): enable APU on mt8196
Enable APU on MT8196

Change-Id: Ic746571ba3ecf9db512e26ee2f89683f2d656239
Signed-off-by: Karl Li <karl.li@mediatek.com>
2024-12-19 09:56:25 +08:00
Karl Li
2d134d28f5 feat(mt8196): add APU SMMU hardware semaphore operations
Add APU SMMU hardware semaphore operations to make APU SMMU
able to sync the power status.

Change-Id: I1926cab990fba54a2ea694ac6d9e87135dfb19cf
Signed-off-by: Karl Li <karl.li@mediatek.com>
2024-12-19 09:56:04 +08:00
Karl Li
7ed4d67c63 feat(mt8196): add smpu protection for APU secure memory
1. Add smpu protection for APU secure memory.
2. Move emi mpu protection for mt8188 to platform folder

Since the smpu driver has not upstream, we currently leave the interface
and do nothing until smpu driver is ready.

Change-Id: Id70162e90a7deb64befe90f09a841a0903535482
Signed-off-by: Karl Li <karl.li@mediatek.com>
2024-12-19 09:56:04 +08:00
Karl Li
f31932b430 feat(mt8196): add APU RCX DevAPC setting
APU RCX is a sub-domain in apusys, connecting several APU components.
The APU RCX DevAPC control lives in APU and can only be set after
APU is powered on.
The APUSYS kernel driver will trigger RCX DevAPC init by smc call.

Change-Id: I3a9b014ea1be7ee80fd6861ad088f1dec5410872
Signed-off-by: Karl Li <karl.li@mediatek.com>
2024-12-19 09:56:04 +08:00
Karl Li
5e5c57d52b feat(mt8196): add APU kernel control operations
Add APU kernel control operations to provide the bootup init functions.

1. Add software workaround for certain operations on mt8196.
2. Add APU logger operations.
3. Add function to clear mbox spare register, which is used in APU
   booting process.
4. Add function to setup CE binary to make sure the CE binary version
   is align with the APU firmware.

Change-Id: Ic99adba1409c020c72179ea135e0d4291fc3f384
Signed-off-by: Karl Li <karl.li@mediatek.com>
2024-12-19 09:56:04 +08:00
Karl Li
3ee4b2def6 feat(mt8196): add APU power on/off functions
1. Add APU power on/off functions
2. Refine the APU power on/off interface for mt8188
3. Add dcm setup function to support mt8196

Change-Id: Ie1caca40f89de71caac037fabe7e7455ff2a1872
Signed-off-by: Karl Li <karl.li@mediatek.com>
2024-12-19 09:56:04 +08:00
Karl Li
e534d4f633 feat(mt8196): add APUMMU setting
APUMMU is the MMU in APU, which is responsible for inner address
mapping. The APU kernel driver will setup the APUMMU by SMC call.

Change-Id: Iad7532883e42c288aeb0d23ab419f4dc6d8630f2
Signed-off-by: Karl Li <karl.li@mediatek.com>
2024-12-19 09:56:04 +08:00
Karl Li
83f836c962 feat(mt8196): enable apusys mailbox mpu protection
Enable mt8196 apusys mailbox mpu protection and
move the mt8188 setting to platform folder

Change-Id: I76b68318bb88e56b12cdacd9e2b998699ca6b48e
Signed-off-by: Karl Li <karl.li@mediatek.com>
2024-12-19 09:56:04 +08:00
Karl Li
9059a375ee feat(mt8196): enable apusys security control
Remap the request from domain 5, 7, 14 to domain 6 and setup security
sideband

Change-Id: I06d377f4bcc542bf22e0a04ffb45cf52b7528a75
Signed-off-by: Karl Li <karl.li@mediatek.com>
2024-12-19 09:55:23 +08:00
Karl Li
31a0b87756 feat(mt8196): add APUSYS AO DevAPC setting
Apusys AO DevAPC is a set of control registers inside APU, controlling
the access permission of APU AO (Always On) domain.

This patch add the mt8196 APU AO DevAPC setting to setup the protection.

Change-Id: I975a92795031cd1813442302890e29b671ef16f1
Signed-off-by: Karl Li <karl.li@mediatek.com>
2024-12-19 09:55:23 +08:00
Karl Li
0781f7804a feat(mt8196): add APU power-on init flow
Add the APU (AI processing unit) power init flow to prepare the hardware
setting before using APU power functions.

Change-Id: I595b1d5100a4f083263de6527f920e5168700b7a
Signed-off-by: Karl Li <karl.li@mediatek.com>
2024-12-19 09:55:23 +08:00
Manish V Badarkhe
fded3a4858 Merge changes from topic "hm/heap-info" into integration
* changes:
  fix(handoff): remove XFERLIST_TB_FW_CONFIG
  feat(arm): migrate heap info to fw handoff
  feat(mbedtls): introduce crypto lib heap info struct
  feat(handoff): add Mbed-TLS heap info entry tag
  refactor(arm): refactor secure TL initialization
  fix(handoff): fix message formatting of hex values
  feat(handoff): add func to check and init a tl
  fix(arm): resolve dangling comments around macros
2024-12-18 17:56:44 +01:00
Bipin Ravi
08bbe24533 Merge changes from topic "sm/fix_erratum" into integration
* changes:
  fix(cpus): workaround for CVE-2024-5660 for Cortex-X925
  fix(cpus): workaround for CVE-2024-5660 for Cortex-X2
  fix(cpus): workaround for CVE-2024-5660 for Cortex-A77
  fix(cpus): workaround for CVE-2024-5660 for Neoverse-V1
  fix(cpus): workaround for CVE-2024-5660 for Cortex-A78_AE
  fix(cpus): workaround for CVE-2024-5660 for Cortex-A78C
  fix(cpus): workaround for CVE-2024-5660 for Cortex-A78
  fix(cpus): workaround for CVE-2024-5660 for Cortex-X1
  fix(cpus): workaround for CVE-2024-5660 for Neoverse-N2
  fix(cpus): workaround for CVE-2024-5660 for Cortex-A710
  fix(cpus): workaround for CVE-2024-5660 for Neoverse-V2
  fix(cpus): workaround for CVE-2024-5660 for Cortex-X3
  fix(cpus): workaround for CVE-2024-5660 for Neoverse-V3
  fix(cpus): workaround for CVE-2024-5660 for Cortex-X4
2024-12-18 16:43:50 +01:00
Harrison Mutai
18be2dbe00 fix(handoff): remove XFERLIST_TB_FW_CONFIG
Remove XFERLIST_TB_FW_CONFIG as the corresponding patch to add it to the
specification [1] has been abandoned and there are no plans for it to be
merged, with the information it contains being moved to a transfer list
instead.

[1] https://github.com/FirmwareHandoff/firmware_handoff/pull/37

Change-Id: If4a21d56b87bafc2f4894beefd73ac51e36e6571
Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
2024-12-18 14:48:26 +00:00
Harrison Mutai
ada4e59d16 feat(arm): migrate heap info to fw handoff
Mbed-TLS requires platforms to allocate it a heap for it's own internal
usage. This heap is typically between shared by BL1 and BL2 to conserve
memory.The base address and size of the heap are conveyed from BL1 to
BL2 through the config TB_FW_CONFIG.

This slightly awkward approach necessitates declaring a placeholder node
in the DTS. At runtime, this node is populated with the actual values of
the heap information. Instead, since this is dynamic information, and
simple to represent through C structures, transmit it to later stages
using the firmware handoff framework.

With this migration, remove references to TB_FW_CONFIG when firmware
handoff is enabled, as it is no longer needed. The setup code now relies
solely on TL structures to configure the TB firmware

Change-Id: Iff00dc742924a055b8bd304f15eec03ce3c6d1ef
Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
2024-12-18 14:48:24 +00:00
Harrison Mutai
24da55eef7 feat(mbedtls): introduce crypto lib heap info struct
Add a struct to store information about the memory location of the heap,
intended for use with cryptographic libraries such as Mbed-TLS.

Change-Id: I42e6bbdbd3a353e01d70fb09b77edeef9498fd98
Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
2024-12-18 14:48:24 +00:00
Harrison Mutai
0e932b8563 feat(handoff): add Mbed-TLS heap info entry tag
Update library to support XFERLIST_MBEDTLS_HEAP_INFO (tag = 0x105).
This is an Arm-specific TE type that enables the location and size
of the stack-based memory region used by Mbed-TLS as a heap to be
passed via a transfer list.

[1] https://firmwarehandoff.github.io/firmware_handoff/main/transfer_list.html#mbed-tls-heap-information-xferlist-mbedtls-heap-info

Change-Id: I1d27b6b2d5a13101b7680b8a19e833354655cd30
Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
2024-12-18 14:48:24 +00:00
Harrison Mutai
d570571994 refactor(arm): refactor secure TL initialization
The initialization logic for the secure transfer list is currently
scattered and duplicated across platform setup code. This not only leads
to inefficiency but also complicates access to transfer lists from other
parts of the code without invoking setup functions. For instance,
arm_bl2_setup_next_ep_info acts as a thin wrapper in arm_bl2_setup.c to
provide access to the secure transfer list.

To streamline the interface, all setup code has been consolidated into a
central location.

Change-Id: I99d2a567ff39df88baa57e7e08607fccb8af189c
Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
2024-12-18 14:48:23 +00:00
Harrison Mutai
24e1ae2f0e fix(handoff): fix message formatting of hex values
Our implementation of printf does not support flag format specifiers.
Our previous format specification as a result was causing the integer
values to be omitted. This change updates the formatting to ensure
accurate and complete error messages are displayed.

Change-Id: I80cfb5fd7ff26e44cfad4e06803d9e0912488136
Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
2024-12-18 14:48:23 +00:00
Harrison Mutai
f1d9459335 feat(handoff): add func to check and init a tl
Add a function to check whether a transfer list has been initialized
at the input address. If not, initialize a transfer list at the
specified location with the given size. This is to help ensure that we
don't accidently overwrite a transfer list that's been passed from a
previous stage.

Change-Id: Ic5906626df09d3801435488e258490765e8f81eb
Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
2024-12-18 14:48:21 +00:00
Harrison Mutai
523c78704f fix(arm): resolve dangling comments around macros
Fix dangling comments around define guards, addressing leftovers from
fe94a21a6 ("fix(arm): move HW_CONFIG relocation into BL31") which
implicitly removed constraints on using HW_CONFIG with RESET_TO_BL2.

Change-Id: I19d61812fed6fa4b668875e5bf4eafd1a8a660f6
Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
2024-12-18 14:48:21 +00:00
Manish V Badarkhe
8f3e82acf7 Merge "fix(tc): define status to fix SPM tests" into integration 2024-12-18 10:09:37 +01:00
Icen.Zeyada
8d4d190915 fix(tc): define status to fix SPM tests
The failure was caused by missing a variable definition, `status`
in the RSE initialisation patch.

Change-Id: I937a39e20fae39f3a6d14fe66af578c166545301
Signed-off-by: Icen.Zeyada <Icen.Zeyada2@arm.com>
2024-12-18 08:42:32 +00:00
Sona Mathew
ebc090fbf4 fix(cpus): workaround for CVE-2024-5660 for Cortex-X925
Implements mitigation for CVE-2024-5660 that affects Cortex-X925
revisions r0p0, r0p1.
The workaround is to disable the hardware page aggregation at
EL3 by setting CPUECTLR_EL1[46] = 1'b1.

Public Documentation:
https://developer.arm.com/Arm%20Security%20Center/Arm%20CPU%20Vulnerability%20CVE-2024-5660

Change-Id: I9d5a07ca6b89b27d8876f4349eff2af26c962d8a
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2024-12-17 10:28:09 -06:00
Sona Mathew
5b58142c46 fix(cpus): workaround for CVE-2024-5660 for Cortex-X2
Implements mitigation for CVE-2024-5660 that affects Cortex-X2
revisions r0p0, r1p0, r2p0, r2p1.
The workaround is to disable the hardware page aggregation at
EL3 by setting CPUECTLR_EL1[46] = 1'b1

Public Documentation:
https://developer.arm.com/Arm%20Security%20Center/Arm%20CPU%20Vulnerability%20CVE-2024-5660

Change-Id: If28804e154617a39d7d52c40b3a00a14a39df929
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2024-12-17 10:28:09 -06:00
Sona Mathew
aed3e8b59a fix(cpus): workaround for CVE-2024-5660 for Cortex-A77
Implements mitigation for CVE-2024-5660 that affects Cortex-A77
revisions r0p0, r1p0, r1p1.
The workaround is to disable the hardware page aggregation at
EL3 by setting CPUECTLR_EL1[46] = 1'b1.

Public Documentation:
https://developer.arm.com/Arm%20Security%20Center/Arm%20CPU%20Vulnerability%20CVE-2024-5660

Change-Id: Ic71b163883ea624e9f2f77deb8b30c69612938b9
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2024-12-17 10:28:09 -06:00
Sona Mathew
85709f6619 fix(cpus): workaround for CVE-2024-5660 for Neoverse-V1
Implements mitigation for CVE-2024-5660 that affects Neoverse-V1
revisions r0p0, r1p0, r1p1, r1p2.
The workaround is to disable the hardware page aggregation at
EL3 by setting CPUECTLR_EL1[46] = 1'b1.

Public Documentation:
https://developer.arm.com/Arm%20Security%20Center/Arm%20CPU%20Vulnerability%20CVE-2024-5660

Change-Id: Ia59452ea38c66b291790956d7f2880bfcd56d45f
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2024-12-17 10:28:09 -06:00
Sona Mathew
902dc0e01f fix(cpus): workaround for CVE-2024-5660 for Cortex-A78_AE
Implements mitigation for CVE-2024-5660 that affects Cortex-A78_AE
revisions r0p0, r0p1, r0p2, r0p3.
The workaround is to disable the hardware page aggregation at
EL3 by setting CPUECTLR_EL1[46] = 1'b1.

Public Documentation:
https://developer.arm.com/Arm%20Security%20Center/Arm%20CPU%20Vulnerability%20CVE-2024-5660

Change-Id: I33ac653fcb45f687fe9ace1c76a3eb2000459751
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2024-12-17 10:28:09 -06:00
Sona Mathew
46a4cadb9d fix(cpus): workaround for CVE-2024-5660 for Cortex-A78C
Implements mitigation for CVE-2024-5660 that affects Cortex-A78C
revisions r0p0, r0p1, r0p2.
The workaround is to disable the hardware page aggregation at
EL3 by setting CPUECTLR_EL1[46] = 1'b1.

Public Documentation:
https://developer.arm.com/Arm%20Security%20Center/Arm%20CPU%20Vulnerability%20CVE-2024-5660

Change-Id: Ieb8d7b122320d16bf8987a43dc683ca41227beb5
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2024-12-17 10:28:09 -06:00
Sona Mathew
c818bf1d60 fix(cpus): workaround for CVE-2024-5660 for Cortex-A78
Implements mitigation for CVE-2024-5660 that affects Cortex-A78
revisions r0p0, r1p0, r1p1, r1p2.
The workaround is to disable the hardware page aggregation at
EL3 by setting CPUECTLR_EL1[46] = 1'b1.

Public Documentation:
https://developer.arm.com/Arm%20Security%20Center/Arm%20CPU%20Vulnerability%20CVE-2024-5660

Change-Id: I4e40388bef814481943b2459fe35dd7267c625a2
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2024-12-17 10:28:09 -06:00
Sona Mathew
26293a7463 fix(cpus): workaround for CVE-2024-5660 for Cortex-X1
Implements mitigation for CVE-2024-5660 that affects Cortex-X1
revisions r0p0, r1p0, r1p1, r1p2.
The workaround is to disable the hardware page aggregation at
EL3 by setting CPUECTLR_EL1[46] = 1'b1.

Public Documentation:
https://developer.arm.com/Arm%20Security%20Center/Arm%20CPU%20Vulnerability%20CVE-2024-5660

Change-Id: I3124db3980f2786412369a010ca6abbbbaa3b601
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2024-12-17 10:28:09 -06:00
Sona Mathew
26e0ff9d5e fix(cpus): workaround for CVE-2024-5660 for Neoverse-N2
Implements mitigation for CVE-2024-5660 that affects Neoverse-N2
revisions r0p0, r0p1, r0p2, r0p3.
The workaround is to disable the hardware page aggregation at
EL3 by setting CPUECTLR_EL1[46] = 1'b1.
This patch implements the erratum mitigation for Neoverse-N2.

Public Documentation:
https://developer.arm.com/Arm%20Security%20Center/Arm%20CPU%20Vulnerability%20CVE-2024-5660

Change-Id: I2b9dea78771cc159586a03ff563c0ec79591ea64
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2024-12-17 10:28:09 -06:00
Sona Mathew
0d7b503f8a fix(cpus): workaround for CVE-2024-5660 for Cortex-A710
Implements mitigation for CVE-2024-5660 that affects Cortex-A710
revisions r0p0, r1p0, r2p0, r2p1.
The workaround is to disable the hardware page aggregation at
EL3 by setting CPUECTLR_EL1[46] = 1'b1.

Public Documentation:
https://developer.arm.com/Arm%20Security%20Center/Arm%20CPU%20Vulnerability%20CVE-2024-5660

Change-Id: I10feea238600dcceaac7bb75a59db7913ca65cf1
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2024-12-17 10:28:09 -06:00
Sona Mathew
878464f02a fix(cpus): workaround for CVE-2024-5660 for Neoverse-V2
Implements mitigation for CVE-2024-5660 that affects Neoverse-V2
revisions r0p0, r0p1, r0p2.
The workaround is to disable the hardware page aggregation at
EL3 by setting CPUECTLR_EL1[46] = 1'b1.

Public Documentation:
https://developer.arm.com/Arm%20Security%20Center/Arm%20CPU%20Vulnerability%20CVE-2024-5660

Change-Id: If66687add52d16f68ce54fe5433dd3b3f067ee04
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2024-12-17 10:27:57 -06:00
Sona Mathew
b0d441bdad fix(cpus): workaround for CVE-2024-5660 for Cortex-X3
Implements mitigation for CVE-2024-5660 that affects Cortex-X3
revisions r0p0, r1p0, r1p1, r1p2.
The workaround is to disable the hardware page aggregation at
EL3 by setting CPUECTLR_EL1[46] = 1'b1.

Public Documentation:
https://developer.arm.com/Arm%20Security%20Center/Arm%20CPU%20Vulnerability%20CVE-2024-5660

Change-Id: Ibe90313948102ece3469f2cfe3faccc7f4beeabe
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2024-12-17 10:24:36 -06:00
Sona Mathew
ad3da01990 fix(cpus): workaround for CVE-2024-5660 for Neoverse-V3
Implements mitigation for CVE-2024-5660 that affects Neoverse-V3
revisions r0p0, r0p1.
The workaround is to disable the hardware page aggregation at
EL3 by setting CPUECTLR_EL1[46] = 1'b1.

Public Documentation:
https://developer.arm.com/Arm%20Security%20Center/Arm%20CPU%20Vulnerability%20CVE-2024-5660

Change-Id: I9ed2590bf1215bf6a692f01dfd351e469ff072f8
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2024-12-17 10:24:36 -06:00
Sona Mathew
af65cbb954 fix(cpus): workaround for CVE-2024-5660 for Cortex-X4
Implements mitigation for CVE-2024-5660 that affects Cortex-X4
revisions r0p0, r0p1, r0p2.
The workaround is to disable the hardware page aggregation at
EL3 by setting CPUECTLR_EL1[46] = 1'b1.

Public Documentation:
https://developer.arm.com/Arm%20Security%20Center/Arm%20CPU%20Vulnerability%20CVE-2024-5660

Change-Id: I378cb4978919cced03e7febc2ad431c572eac72d
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2024-12-17 10:24:33 -06:00
Boyan Karatotev
f8d2a0e5ca fix(pubsub): make sure LTO doesn't garbage collect the handlers
We never directly reference the event handlers so they look like fair
game to be garbage collected when building with LTO.

Tell the compiler that we definitely need them and to leave them alone.

Change-Id: Iac672ce85e20328d25acbc3f5e544ad157eebf48
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
2024-12-17 13:27:18 +00:00
Boyan Karatotev
50009f6117 fix(css): turn the redistributor off on PSCI CPU_OFF
When GICR_WAKER.ProcessorSleep == 1 (i.e. after gicv3_cpuif_disable())
the GIC will assert the WakeRequest signal to try and wake the core up
instead of delivering an interrupt. This is useful when a core is in
some kind of suspend state.

However, when the core is properly off (CPU_OFF), it shouldn't get woken
up in any way other than a CPU_ON call. In the general case interrupts
would be routed away so this doesn't matter. But in case they aren't, we
want the core to stay off.

So turn the redistributor off on CPU_OFF calls. This will prevent the
WakeRequest from being sent.

Change-Id: I7f20591d1c83a4a9639281ef86caa79d6669b536
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
2024-12-17 13:26:45 +00:00
Boyan Karatotev
ee0c5b8cd8 chore: drop -fno-builtin
It is implied by -ffreestanding

Change-Id: Ia7b0f78fd4020aceea246d10ac3d869e743e7a9f
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
2024-12-17 13:26:12 +00:00
Manish Pandey
0863511b68 Merge "fix(psa): increase psa-mbedtls heap size for rsa" into integration 2024-12-17 14:12:10 +01:00
André Przywara
7b070314e3 Merge "fix(cm): fix context management SYSREG128 write macros" into integration 2024-12-17 11:39:12 +01:00
Yann Gautier
95977c2e4d Merge changes from topic "gerrit-master-v3" into integration
* changes:
  feat(qemu-sbsa): add support for RME on SBSA machine
  feat(qemu-sbsa): configure RMM manifest based on system RAM
  feat(qemu-sbsa): configure GPT based on system RAM
  feat(qemu-sbsa): adjust DT memory start address when supporting RME
  feat(qemu-sbsa): relocate DT after the RMM when RME is enabled
  feat(qemu-sbsa): dissociate QEMU NS start address and NS_DRAM0_BASE
  feat(qemu-sbsa): increase maximum FIP size
  refactor(qemu-sbsa): move all DT related functions to sbsa_platform.c
  refactor(qemu-sbsa): create accessor functions for platform info
  refactor(qemu-sbsa): rename function sip_svc_init() to something more meaningful
  refactor(qemu-sbsa): move DT related structures to their own header
  refactor(qemu-sbsa): rename struct dynamic_platform_info
  refactor(qemu): make L0GPT size configurable
  refactor(qemu): move GPT setup to BL31
  fix(qemu-sbsa): fix compilation error when accessing DT functions
2024-12-17 10:05:55 +01:00
Olivier Deprez
6f0a71cc19 Merge "feat(mt8196): enable DP and eDP for mt8196" into integration 2024-12-17 08:43:50 +01:00
Manish Pandey
fcdab0dc45 Merge "fix(encrypt-fw): put build_msg under LOG_LEVEL flag" into integration 2024-12-16 21:09:11 +01:00
Igor Podgainõi
6595f4cb39 fix(cm): fix context management SYSREG128 write macros
This patch fixes a bug which was introduced in commit
3065513 related to improper saving of EL1 context in the
context management library code when using 128-bit
system registers.

Bug explanation:
The function el1_sysregs_context_save still used the normal
macros that read all the system registers related to the EL1
context, which then involved casting them to uint64_t and
eventually writing them to a memory structure. This means that
the context management library was saving EL1-related SYSREG128
registers with the upper 64 bits zeroed out.

Alternative macros had previously been introduced for the EL2
context in the aforementioned commit, but not for EL1.

Some refactoring has also been done as part of this patch:
- Re-added "common" back to write_el2_ctx_common_sysreg128
- Added dummy SYSREG128 macros for cases when some features
  are disabled
- Removed some newlines

Change-Id: I15aa2190794ac099a493e5f430220b1c81e1b558
Signed-off-by: Igor Podgainõi <igor.podgainoi@arm.com>
2024-12-16 18:14:51 +01:00
Manish Pandey
885503f4f3 Merge "fix(docs): put INIT_UNUSED_NS_EL2 docs back" into integration 2024-12-16 16:56:42 +01:00
Manish Pandey
bfaded4061 Merge "feat(stm32mp2): add FWU support" into integration 2024-12-16 16:47:02 +01:00
Manish Pandey
9e6ab88eca Merge changes I7854e1ae,I214e4b2b,I000573e5 into integration
* changes:
  feat(stm32mp2): add a runtime service for STGEN configuration
  feat(stm32mp2): add common SMC runtime services
  feat(stm32mp1): rework SVC services
2024-12-16 16:46:14 +01:00
Boyan Karatotev
73d98e3759 fix(trbe): add a tsb before context switching
Just like for SPE, we need to synchronize TRBE samples before we change
the context to ensure everything goes where it was intended to. If that
is not done, the in-flight entries might use any piece of now incorrect
context as there are no implicit ordering requirements.

Prior to root context, the buffer drain hooks would have done that. But
now that must happen much earlier. So add a tsb to prepare_el3_entry as
well.

Annoyingly, the barrier can be reordered relative to other instructions
by default (rule RCKVWP). So add an isb after the psb/tsb to assure that
they are ordered, at least as far as context is concerned.

Then, drop the buffer draining hooks. Everything they need to do is
already done by now. There's a notable difference in that there are no
dsb-s now. Since EL3 does not access the buffers or the feature
specific context, we don't need to wait for them to finish.

Finally, drop a stray isb in the context saving macro. It is now
absorbed into root context, but was missed.

Change-Id: I30797a40ac7f91d0bb71ad271a1597e85092ccd5
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
2024-12-16 15:14:30 +00:00