Commit graph

13212 commits

Author SHA1 Message Date
Madhukar Pappireddy
4ede8c39a2 Merge changes from topic "el3_direct_msg" into integration
* changes:
  docs(spm): document new build option
  feat(fvp): spmd logical partition smc handler
  feat(fvp): add spmd logical partition
  feat(spmd): get logical partitions info
  feat(spmd): add partition info get regs
  refactor(ff-a): move structure definitions
  feat(spmd): el3 direct message API
  feat(spmd): add spmd logical partitions
2023-08-14 17:12:59 +02:00
Joanna Farley
39bcbeac9c Merge "feat(sptool): generate ARM_BL2_SP_LIST_DTS file from sp_layout.json" into integration 2023-08-12 11:45:06 +02:00
Raghu Krishnamurthy
a83aa72fd0 docs(spm): document new build option
Add documentation for the new build option ENABLE_SPMD_LP.

Signed-off-by: Raghu Krishnamurthy <raghu.ncstate@gmail.com>
Change-Id: I808e6c00e3699fc900dc97e889af63cc01cae794
2023-08-11 18:57:55 -07:00
Raghu Krishnamurthy
a1a9a95071 feat(fvp): spmd logical partition smc handler
This patch adds a basic el3 spmd logical partition to the fvp platform
via a platform specific smc handler. One of the use cases for el3
logical partitions is to have the ability to translate sip calls into
ff-a direct requests via the use of spmd logical partitions. The smc
handler creates a direct request based on the incoming smc parameters
and forwards the call as a direct request from the spmd logical
partition to the target secure partition.

Change-Id: If8ba9aab8203924bd00fc1dcdf9cd05a9a04a147
2023-08-11 18:57:50 -07:00
Raghu Krishnamurthy
5cf311f3a4 feat(fvp): add spmd logical partition
This patch changes spmd.mk to include one or more SPMD logical
partitions specific to a platform. It also adds a basic SPMD logical
partition to fvp.

Change-Id: I2075e0458c92813913b28cbf4cfffc1f151e65cf
Signed-off-by: Raghu Krishnamurthy <raghu.ncstate@gmail.com>
2023-08-11 18:56:36 -07:00
Raghu Krishnamurthy
95f7f6d86a feat(spmd): get logical partitions info
This patch enables FF-A secure partitions and the SPMC to query EL3 SPMD
logical partitions that are present in the system via partition get info
regs abi. Note that normal world will not be able to see EL3 SPMD
logical partitions as per the spec.

Signed-off-by: Raghu Krishnamurthy <raghu.ncstate@gmail.com>
Change-Id: I3fca8aed8ae156a559a74521803324c13ae3d55a
2023-08-11 18:56:34 -07:00
Raghu Krishnamurthy
0b850e9e7c feat(spmd): add partition info get regs
This patch adds support for an EL3 SPMD logical partition to discover
secure partitions using the FFA_PARTITION_INFO_GET_REGS abi. It also
adds helper functions for a logical partition to use the information
returned in registers in a meaningful way.

Signed-off-by: Raghu Krishnamurthy <raghu.ncstate@gmail.com>
Change-Id: Id69488e7367e17e2dfa6c8e332be3c8d41f6c773
2023-08-11 18:55:18 -07:00
Raghu Krishnamurthy
5ca1619f86 refactor(ff-a): move structure definitions
Move ffa_partition_info_get definitions from EL3 SPMC private header
files to common header files. The structures are common to FF-A and are
useful for the EL3 SPMD logical partitions.

Signed-off-by: Raghu Krishnamurthy <raghu.ncstate@gmail.com>
Change-Id: I19de3f6cb3351afa873022da1397a475a84e3d8b
2023-08-11 18:55:18 -07:00
Raghu Krishnamurthy
66bdfd6e4e feat(spmd): el3 direct message API
This patch implements an API that is exposed to SPMD logical partitions
that can be used to send direct messages to a secure partition.
It also adds required code in the SPMD smc handler to complete the
direct response appropriately.

Change-Id: I2d0e38415f13ad4fd28f8984d565036b7d3a9e71
Signed-off-by: Raghu Krishnamurthy <raghu.ncstate@gmail.com>
2023-08-11 18:55:11 -07:00
Bipin Ravi
0a54b5cda5 Merge changes from topic "ar/errata_refactor" into integration
* changes:
  refactor(cpus): convert Neoverse Poseidon to use CPU helpers
  refactor(cpus): convert Neoverse Poseidon to framework
2023-08-11 21:16:14 +02:00
Arvind Ram Prakash
b98eb2dc1d refactor(cpus): convert Neoverse Poseidon to use CPU helpers
Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
Change-Id: Icf406c05cdb8d62cd0f41a5f19ae5376707e69bd
2023-08-11 14:14:22 -05:00
Arvind Ram Prakash
471e0b8b34 refactor(cpus): convert Neoverse Poseidon to framework
This involves replacing:
 * the reset_func with the standard cpu_reset_func_{start,end} to apply
   errata automatically
 * the <cpu>_errata_report with the errata_report_shim to report errata
   automatically
...and for each erratum:
 * the prologue with the workaround_<type>_start to do the checks and
   framework registration automatically
 * the epilogue with the workaround_<type>_end
 * the checker function with the check_erratum_<type> to make it more
   descriptive

It is important to note that the errata workaround sequences remain
unchanged and preserve their git blame.

Testing was conducted by:

 * Manual comparison of disassembly of converted functions with non-
   converted functions

   aarch64-none-elf-objdump -D <trusted-firmware-a with conversion>/build/fvp/release/bl31/bl31.elf
     vs
   aarch64-none-elf-objdump -D <trusted-firmware-a clean repo>/build/fvp/release/bl31/bl31.elf

 * Build for release with all errata flags enabled and run default tftf
   tests

CROSS_COMPILE=aarch64-none-elf- make PLAT=fvp DEBUG=0 \
CTX_INCLUDE_AARCH32_REGS=0 HW_ASSISTED_COHERENCY=1 USE_COHERENT_MEM=0 \
BL33=./../tf-a-tests/build/fvp/release/tftf.bin \
WORKAROUND_CVE_2022_23960=1 ERRATA_ABI_SUPPORT=1 all fip

 * Build for debug with all errata enabled and step through ArmDS
   at reset to ensure all functions are entered.

Change-Id: I34e27e468d4f971423a03a95a4a52f4af8bd783a
Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
2023-08-11 14:14:22 -05:00
Lauren Wehrmeister
e0af991078 Merge "fix: .gitignore to include memory tools" into integration 2023-08-11 17:45:52 +02:00
Lauren Wehrmeister
50d89e3016 Merge changes from topic "ar/errata_refactor" into integration
* changes:
  refactor(cpus): convert Neoverse V2 to use CPU helpers
  refactor(cpus): convert Neoverse V2 to framework
2023-08-11 17:44:33 +02:00
Bipin Ravi
705832b3a3 Merge changes I2f4961fe,I0039c724,Iaa3076c1,Ic19973a8 into integration
* changes:
  feat(bl32): print entry point before exiting SP_MIN
  fix(bl32): avoid clearing argument registers in RESET_TO_SP_MIN case
  fix(bl32): always include arm_arch_svc in SP_MIN
  fix(services): disable workaround discovery on aarch32 for now
2023-08-11 16:57:09 +02:00
J-Alves
82257de06d fix: .gitignore to include memory tools
Added to .gitignore the following path, as it was
noticed as untracked after a TF-A CI run:
tools/memory/memory/__pycache__/

Signed-off-by: J-Alves <joao.alves@arm.com>
Change-Id: I35ba6f6a33593671c11f8e33c28545ae9bc57b4c
2023-08-11 11:49:53 +01:00
Karl Meakin
20629b3153 feat(sptool): generate ARM_BL2_SP_LIST_DTS file from sp_layout.json
TF-A makefile accepts a device-tree snippet to override hardcoded SP
nodes, via the `ARM_BL2_SP_LIST_DTS` variable. However the SPs declared
in `ARM_BL2_SP_LIST_DTS` must be in the same order as they are in the
FIP image, otherwise hash authentication will fail when loaded by BL2.

This patch generates the `ARM_BL2_SP_LIST_DTS` file from the
`sp_layout.json` file. The SPs in the FIP image are also generated from
`sp_layout.json`, so this ensures that there is only one source of truth
for the SP list, removing the possibility to have the lists disagree
with each other.

Signed-off-by: Karl Meakin <karl.meakin@arm.com>
Change-Id: I7d76715135c596605c6a02aad5196d967dfeb1ce
2023-08-11 11:49:47 +01:00
Moritz Fischer
5039015a9d refactor(cpus): convert Neoverse V2 to use CPU helpers
Convert Neoverse V2 to use CPU helpers, in this case that's
only two spots.

Change-Id: Icd250f92974e8a50c459038de7644a2e68007589
Signed-off-by: Moritz Fischer <moritzf@google.com>
Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
2023-08-10 15:49:53 -05:00
Moritz Fischer
31a3da83f8 refactor(cpus): convert Neoverse V2 to framework
For V2, this involves replacing:
  - The reset_func with the standard cpu_reset_func_{start,end}
    to apply errata automatically
  - The <cpu>_errata_report with the errata_report_shim to
    report errata automatically

And for each erratum:
  - The prologue with the workaround_<type>_start to do the checks and
    framework registration automatically at reset or runtime
  - The epilogue with the workaround_<type>_end
  - The checker function with the check_erratum_<type> to check whether
    the erratum applies on the revision of the CPU.

It is important to note that the errata workaround sequences remain
unchanged and preserve their git blame.

Testing was conducted by:

 * Manual comparison of disassembly of converted functions with non-
   converted functions

   aarch64-none-elf-objdump -D <trusted-firmware-a with conversion>/build/fvp/release/bl31/bl31.elf
     vs
   aarch64-none-elf-objdump -D <trusted-firmware-a clean repo>/build/fvp/release/bl31/bl31.elf

 * Build for release with all errata flags enabled and run default tftf
   tests

   CROSS_COMPILE=aarch64-none-elf- make PLAT=fvp  CTX_INCLUDE_AARCH32_REGS=0 \
   HW_ASSISTED_COHERENCY=1 USE_COHERENT_MEM=0 \
   BL33=./../tf-a-tests/build/fvp/debug/tftf.bin \
   ERRATA_V2_2801372 WORKAROUND_CVE_2022_23960=1 ERRATA_ABI_SUPPORT=1 all fip

 * Build for debug with all errata enabled and step through ArmDS
   at reset to ensure all functions are entered.

Change-Id: Ic968844d6aabea3867189d747769ced8faa87e56
Signed-off-by: Moritz Fischer <moritzf@google.com>
Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
2023-08-10 15:49:53 -05:00
Bipin Ravi
74e3959ea3 Merge "fix(cpus): assert invalid cpu_ops obtained" into integration 2023-08-10 22:37:22 +02:00
Manish V Badarkhe
6d71a9b820 Merge "docs: add instructions for PDF generation of docs" into integration 2023-08-10 17:46:50 +02:00
Thaddeus Serna
3f721c6edd fix(cpus): assert invalid cpu_ops obtained
Not including the proper CPU file can halt execution at the
reset_handler since the cpu_ops obtained will be invalid and therefore
the cpu reset function will be invalid too, unless SUPPORT_UNKNOWN_MPID
is enabled.

This patch adds an assert to check for the validity of the obtained
cpu_ops object and will display an error if the object is invalid.

Change-Id: I0e1661745e4a692aab5e910e110c2de0caf64f46
Signed-off-by: Thaddeus Serna <Thaddeus.Gonzalez-Serna@arm.com>
2023-08-10 16:38:42 +02:00
Joanna Farley
38d1679db2 Merge changes from topic "xlnx_security_flag_change" into integration
* changes:
  fix(versal-net): make pmc ipi channel as secure
  fix(versal): make pmc ipi channel as secure
  fix(versal-net): add redundant call to avoid glitches
  fix(versal-net): change flag to increase security
2023-08-10 16:08:15 +02:00
Bipin Ravi
87bf01b29e Merge "fix(cpus): flush L2 cache for Cortex-A7/12/15/17" into integration 2023-08-10 15:59:28 +02:00
Elizabeth Ho
5ac3fdcdfb docs: add instructions for PDF generation of docs
This patch details the required packages and terminal commands for
building the documentation in PDF format locally.

Change-Id: Ic5f416b73e46d5f362fe9eb909200b95eda19e6a
Signed-off-by: Elizabeth Ho <elizabeth.ho@arm.com>
2023-08-10 10:42:14 +01:00
Stephan Gerhold
c5c160cddd fix(cpus): flush L2 cache for Cortex-A7/12/15/17
Similar to Cortex-A53, the AArch32-only Cortex-A7/12/15/17 have an
(optional) integrated L2 cache that might need to be flushed if the
whole cluster is powered down. However, unlike Cortex-A53 there is
currently no L2 cache flush in the cluster_pwr_dwn implementation for
some reason. This causes problems if there is unwritten data left in
the L2 cache during a cluster power off.

Fix this by adding the L2 cache flush similar to cortex_a53.S.

Change-Id: Icd087bef9acff11e03edcaa0d26dd8b8e30796b7
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
2023-08-10 09:28:52 +02:00
Manish V Badarkhe
2360d18bb5 Merge "docs: remove blank pages from PDF documentation" into integration 2023-08-09 15:18:05 +02:00
Manish V Badarkhe
27bb509d7b Merge "fix: use rsvg-convert as the conversion backend" into integration 2023-08-09 15:18:02 +02:00
Bipin Ravi
1fd03dd62b Merge "fix(cpus): revert erroneous use of override_vector_table macro in Cortex-A73" into integration 2023-08-08 22:33:45 +02:00
Bipin Ravi
a3919ed0ab Merge "fix(fvp): extract core id from mpidr for pwrc operations" into integration 2023-08-08 21:27:23 +02:00
Manish V Badarkhe
72e8f2456a Merge "chore: update to use Arm word across TF-A" into integration 2023-08-08 17:26:48 +02:00
Bipin Ravi
995eaa63a8 Merge changes from topic "hm/errata-a710" into integration
* changes:
  refactor(cpus): convert the Cortex-A710 to use cpu helpers
  refactor(cpus): convert Cortex-A710 to use the errata framework
  refactor(cpus): reorder Cortex-A710 errata by ascending order
  feat(cpus): make revision procedure call optional
2023-08-08 17:04:56 +02:00
Govindraj Raja
4c700c1563 chore: update to use Arm word across TF-A
Align entire TF-A to use Arm in copyright header.

Change-Id: Ief9992169efdab61d0da6bd8c5180de7a4bc2244
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
2023-08-08 15:12:30 +01:00
Manish V Badarkhe
c399679cdc Merge "feat(stm32mp1): add FWU with boot from NOR-SPI" into integration 2023-08-08 15:46:02 +02:00
Manish V Badarkhe
1142b38f1d Merge changes I2c4e826f,I388e8dcd,I6fd20225 into integration
* changes:
  chore(ethos-n): use non blocking soft reset on npu
  docs(ethos-n): update build-options.rst
  refactor(ethos-n): move build flags to ethosn_npu.mk
2023-08-08 13:04:53 +02:00
Jay Buddhabhatti
2c65b79e25 fix(versal-net): make pmc ipi channel as secure
Make PMC IPI channel for Versal NET as secure so that NS
systems cannot directly access or modify secure systems.

Signed-off-by: Jay Buddhabhatti <jay.buddhabhatti@amd.com>
Change-Id: I75ba8796859dcb35644f3e144d7dc5926755ef78
2023-08-08 12:52:23 +02:00
Jay Buddhabhatti
96eaafa3f8 fix(versal): make pmc ipi channel as secure
Make PMC IPI channel for Versal as secure so that NS systems
cannot directly access or modify secure systems.

Signed-off-by: Jay Buddhabhatti <jay.buddhabhatti@amd.com>
Change-Id: I22148653fa2d27941cb3031ac790892cee0d1796
2023-08-08 12:52:16 +02:00
Jay Buddhabhatti
cebb7cc110 fix(versal-net): add redundant call to avoid glitches
Add redundant macro call to increase security by making
code glitch immune as security operations might be
called with the IPI command.

Signed-off-by: Jay Buddhabhatti <jay.buddhabhatti@amd.com>
Change-Id: I84d84cca258b7cd981f62816c51032341e19095c
2023-08-08 12:52:05 +02:00
Jay Buddhabhatti
e8efb65afb fix(versal-net): change flag to increase security
Currently security flag is set to SECURE by default and
is changed to NON_SECURE if NS system is detected. In this
case NS system may access secure system if condition check
gets skipped due to glitches.

So, initialize security_flag to NON_SECURE_FLAG and switch
to SECURE_FLAG if the TrustZone bit is detected to be
in more secure state.

Signed-off-by: Jay Buddhabhatti <jay.buddhabhatti@amd.com>
Change-Id: I7af54465bd8744ba97a58c02607631ee23619d47
2023-08-08 12:51:17 +02:00
Zingo Andersen
273cf25cf8 chore(ethos-n): use non blocking soft reset on npu
Signed-off-by: Zingo Andersen <zingo.andersen@arm.com>
Change-Id: I2c4e826f4bbbcd7c9170d5df2f8088f82ac2da7c
2023-08-08 08:41:07 +02:00
Sona Mathew
9a0c81257f fix(cpus): revert erroneous use of override_vector_table macro in Cortex-A73
override_vector_table does adr, followed by an msr ops.
Accidentally was used here for for adr and mrs op.

Signed-off-by: Sona Mathew <SonaRebecca.Mathew@arm.com>
Change-Id: I2d3fda12acd097acabbde9b7dcc376d08419e223
2023-08-07 18:22:21 -05:00
Harrison Mutai
7b1e8c1c39 refactor(cpus): convert the Cortex-A710 to use cpu helpers
Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
Change-Id: I5e928f139c2e9fa91c78947cf6a8bff546f7be05
2023-08-07 19:36:56 +01:00
Harrison Mutai
d16a90d422 refactor(cpus): convert Cortex-A710 to use the errata framework
This involves replacing:
 * the reset_func with the standard cpu_reset_func_{start,end} to apply
   errata automatically
 * the <cpu>_errata_report with the errata_report_shim to report errata
   automatically
...and for each erratum:
 * the prologue with the workaround_<type>_start to do the checks and
   framework registration automatically
 * the epilogue with the workaround_<type>_end
 * the checker function with the check_erratum_<type> to make it more
   descriptive

It is important to note that the errata workaround and checking
sequences remain unchanged and preserve their git blame. Testing was
conducted by:

 * Building for release with all errata flags enabled and running script
   in change 19136 to compare output of objdump for each errata.
 * Manual comparison of disassembly of converted functions with non-
   converted functions
 * Build for debug with all errata enabled and step through ArmDS
   at reset to ensure all functions are entered.

Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
Change-Id: I417539ab292f13a4f0949625d2fef6b7792fbd35
2023-08-07 19:36:56 +01:00
Harrison Mutai
d25136daea refactor(cpus): reorder Cortex-A710 errata by ascending order
Errata report order is enforced to be in ascending order. To achieve
this with the errata framework this has to be done at the definition
level.

Change-Id: I4a6ed55d48e91ec914b7a591c6d30da5ce5d915d
Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
2023-08-07 19:36:56 +01:00
Harrison Mutai
4d22b0e5ba feat(cpus): make revision procedure call optional
For runtime errata, we should avoid generating calls to
`cpu_get_rev_var` unless its necessary. Make the path that generates
this call parameterized, and cache the result in a temporary register to
allow future calls that go down the alternate path to retrieve the cache
CPU revision.

Change-Id: I9882ede76568fbd9a7ccd4caa74eff0c66a7b20e
Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
2023-08-07 19:36:56 +01:00
Rajasekaran Kalidoss
ffdf5ea47a docs(ethos-n): update build-options.rst
Move documentation related to Arm(R) Ethos(TM)-N NPU driver from
docs/plat/arm/arm-build-options.rst to
docs/getting_started/build-options.rst.

Signed-off-by: Rajasekaran Kalidoss <rajasekaran.kalidoss@arm.com>
Change-Id: I388e8dcd3950b11bc3305f5e6396ee2e49c04493
2023-08-07 19:13:58 +02:00
Rajasekaran Kalidoss
352366ede4 refactor(ethos-n): move build flags to ethosn_npu.mk
The build flags to enable the Arm(R) Ethos(TM)-N NPU driver are in arm
platform specific make files i.e. plat/arm/common/arm_common.mk. These
flags are renamed and moved to ethosn_npu.mk. Other source and make
files are changed to reflect the changes in these flags.

Signed-off-by: Rajasekaran Kalidoss <rajasekaran.kalidoss@arm.com>
Change-Id: I6fd20225343c574cb5ac1f0f32ff2fc28ef37ea6
2023-08-07 19:13:45 +02:00
Lauren Wehrmeister
29ae73e3fb Merge changes from topic "mb/mb-signer-id" into integration
* changes:
  feat(qemu): add dummy plat_mboot_measure_key() function
  docs(rss): update RSS doc for signer-ID
  feat(imx): add dummy 'plat_mboot_measure_key' function
  feat(tc): implement platform function to measure and publish Public Key
  feat(auth): measure and publicise the Public Key
  feat(fvp): implement platform function to measure and publish Public Key
  feat(fvp): add public key-OID information in RSS metadata structure
  feat(auth): add explicit entries for key OIDs
  feat(rss): set the signer-ID in the RSS metadata
  feat(auth): create a zero-OID for Subject Public Key
  docs: add details about plat_mboot_measure_key function
  feat(measured-boot): introduce platform function to measure and publish Public Key
2023-08-07 16:53:35 +02:00
Madhukar Pappireddy
70bc74441b fix(fvp): extract core id from mpidr for pwrc operations
The ID field populated for every FVP PWRC register interface must be
computed from the affinity level values from MPIDR.

Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
Change-Id: If1474fd25704911f8f717dafb419a0734b99a4ec
2023-08-07 09:15:57 -05:00
Manish V Badarkhe
96eb2dc4e3 Merge "chore(xilinx): reorder headers in assembly files" into integration 2023-08-07 15:15:05 +02:00