1. 02 Aug, 2021 1 commit
  2. 28 Jun, 2021 1 commit
    • Max Shvetsov's avatar
      feat(sve): enable SVE for the secure world · 0c5e7d1c
      Max Shvetsov authored
      
      
      Enables SVE support for the secure world via ENABLE_SVE_FOR_SWD.
      ENABLE_SVE_FOR_SWD defaults to 0 and has to be explicitly set by the
      platform. SVE is configured during initial setup and then uses EL3
      context save/restore routine to switch between SVE configurations for
      different contexts.
      Reset value of CPTR_EL3 changed to be most restrictive by default.
      Signed-off-by: default avatarMax Shvetsov <maksims.svecovs@arm.com>
      Change-Id: I889fbbc2e435435d66779b73a2d90d1188bf4116
      0c5e7d1c
  3. 25 May, 2021 1 commit
  4. 24 Mar, 2021 1 commit
    • Pankaj Gupta's avatar
      tbbr-tools: enable override TRUSTED_KEY_CERT · 6c74c997
      Pankaj Gupta authored
      
      
      Platforms, which requires additional images to be
      verified using TBBR; such that their key certificate
      is tied to TRUSTED_KEY_CERT.
      
      For such platforms, if make commands runs twice:
       - Once with targets as bl2 & fip.bin, and
       - Again to build the target as the additional image.
      
      then, if path to the TRUSTED_KEY_CERT varies in the
      makefile with make-target of the additional image, then
      there would be two location where "trusted_key.crt" will
      be created.
      
      This patch helps overriding the TRUSTED_KEY_CERT from any .mk
      in the platform's makefile structure.
      Signed-off-by: default avatarPankaj Gupta <pankaj.gupta@nxp.com>
      Change-Id: I775a2c409035504b21b0bbe5a4f9046898163eed
      6c74c997
  5. 25 Feb, 2021 1 commit
  6. 05 Feb, 2021 1 commit
  7. 08 Jan, 2021 1 commit
    • Pali Rohár's avatar
      Makefile: Fix ${FIP_NAME} to be rebuilt only when needed · 4727fd13
      Pali Rohár authored
      
      
      Currently ${FIP_DEPS} as prerequisite for ${BUILD_PLAT}/${FIP_NAME}
      contains .PHONY targets check_$(1) and therefore ${BUILD_PLAT}/${FIP_NAME}
      is always rebuilt even when other file target prerequisites are not
      changed.
      
      These changes fix above issue and ${BUILD_PLAT}/${FIP_NAME} target is
      rebuilt only when its prerequisites are changed.
      
      There are 3 changes:
      
      Content of check_$(1) target is moved into check_$(1)_cmd variable so it
      can be easily reused.
      
      .PHONY check_$(1) targets are not put into ${FIP_DEPS} and ${FWU_FIP_DEPS}
      dependencies anymore and required checks which are in ${CHECK_FIP_CMD} and
      ${CHECK_FWU_FIP_CMD} variables are executed as part of targets
      ${BUILD_PLAT}/${FIP_NAME} and ${BUILD_PLAT}/${FWU_FIP_NAME} itself.
      
      To ensure that ${BUILD_PLAT}/${FIP_NAME} and ${BUILD_PLAT}/${FWU_FIP_NAME}
      are rebuilt even when additional dependency file image added by
      TOOL_ADD_IMG is changed, this file image (if exists) is added as file
      dependency to ${FIP_DEPS} and ${FWU_FIP_DEPS}. If it does not exist then
      FORCE target is added to ensure that FIP/FWU_FIP is rebuilt. Command
      ${CHECK_FIP_CMD}/${CHECK_FWU_FIP_CMD} will then thrown an error message if
      the file is required but not present.
      
      So this change ensures that if BL33 image is updated then final FIP image
      is updated too. And if BL33 image is not specified or does not exist and is
      required to be present then check_$(1)_cmd call from ${CHECK_FIP_CMD} would
      ensure that error message is thrown during build.
      Signed-off-by: default avatarPali Rohár <pali@kernel.org>
      Change-Id: I635cf82e2b667ff57e2af83500d4aca71d235e3e
      4727fd13
  8. 11 Dec, 2020 1 commit
    • Javier Almansa Sobrino's avatar
      Add support for FEAT_MTPMU for Armv8.6 · 0063dd17
      Javier Almansa Sobrino authored
      
      
      If FEAT_PMUv3 is implemented and PMEVTYPER<n>(_EL0).MT bit is implemented
      as well, it is possible to control whether PMU counters take into account
      events happening on other threads.
      
      If FEAT_MTPMU is implemented, EL3 (or EL2) can override the MT bit
      leaving it to effective state of 0 regardless of any write to it.
      
      This patch introduces the DISABLE_MTPMU flag, which allows to diable
      multithread event count from EL3 (or EL2). The flag is disabled
      by default so the behavior is consistent with those architectures
      that do not implement FEAT_MTPMU.
      Signed-off-by: default avatarJavier Almansa Sobrino <javier.almansasobrino@arm.com>
      Change-Id: Iee3a8470ae8ba13316af1bd40c8d4aa86e0cb85e
      0063dd17
  9. 10 Dec, 2020 1 commit
  10. 09 Nov, 2020 1 commit
  11. 20 Oct, 2020 1 commit
  12. 12 Oct, 2020 1 commit
    • Alexei Fedorov's avatar
      TF-A: Add HASH_ALG default value to defaults.mk · ae3cf1ff
      Alexei Fedorov authored
      
      
      This patch adds default value of 'sha256' for HASH_ALG
      build flag to 'make_helpers\defaults.mk', according to
      'docs\getting_started\build-options.rst'.
      This fixes Measured Boot driver error when TF-A uses
      default HASH_ALG value and TPM_HASH_ALG is set to
      sha384 or sha512.
      
      Change-Id: Id0aa34b54807de0adaf88e5f7d7032577c22f365
      Signed-off-by: default avatarAlexei Fedorov <Alexei.Fedorov@arm.com>
      ae3cf1ff
  13. 14 Sep, 2020 2 commits
  14. 10 Sep, 2020 1 commit
  15. 17 Aug, 2020 1 commit
  16. 12 Aug, 2020 1 commit
    • Manish Pandey's avatar
      cert_create: add Platform owned secure partitions support · 23d5f03a
      Manish Pandey authored
      
      
      Add support to generate a certificate named "plat-sp-cert" for Secure
      Partitions(SP) owned by Platform.
      Earlier a single certificate file "sip-sp-cert" was generated which
      contained hash of all 8 SPs, with this change SPs are divided into
      two categories viz "SiP owned" and "Plat owned" containing 4 SPs each.
      
      Platform RoT key pair is used for signing.
      Signed-off-by: default avatarManish Pandey <manish.pandey2@arm.com>
      Change-Id: I5bd493cfce4cf3fc14b87c8ed1045f633d0c92b6
      23d5f03a
  17. 30 Jul, 2020 1 commit
    • Manish V Badarkhe's avatar
      Makefile, doc: Make OPENSSL_DIR variable as build option for tools · 582e4e7b
      Manish V Badarkhe authored
      
      
      Openssl directory path is hardcoded to '/usr' in the makefile
      of certificate generation and firmware encryption tool using
      'OPENSSL_DIR' variable.
      
      Hence changes are done to make 'OPENSSL_DIR' variable as
      a build option so that user can provide openssl directory
      path while building the certificate generation and firmware
      encryption tool.
      
      Also, updated the document for this newly created build option
      
      Change-Id: Ib1538370d2c59263417f5db3746d1087ee1c1339
      Signed-off-by: default avatarManish V Badarkhe <Manish.Badarkhe@arm.com>
      582e4e7b
  18. 09 Jul, 2020 1 commit
  19. 12 Jun, 2020 1 commit
  20. 09 Jun, 2020 1 commit
  21. 08 Jun, 2020 1 commit
    • Manish Pandey's avatar
      cert_create: add SiP owned secure partitions support · 0792dd7d
      Manish Pandey authored
      
      
      Add support to generate certificate "sip-sp-cert" for Secure
      Partitions(SP) owned by Silicon provider(SiP).
      To avoid deviation from TBBR specification the support is only added for
      dualroot CoT and not for TBBR CoT.
      
      A single certificate file is generated containing hash of individual
      packages. Maximum 8 secure partitions are supported.
      
      Following new options added to cert_tool:
       --sip-sp-cert --> SiP owned Secure Partition Content Certificate
       --sp-pkg1 --> Secure Partition Package1 file
       --sp-pkg2
       .....
       --sp-pkg8
      
      Trusted world key pair is used for signing.
      
      Going forward, this feature can be extended for Platfrom owned
      Partitions, if required.
      Signed-off-by: default avatarManish Pandey <manish.pandey2@arm.com>
      Change-Id: Ia6dfbc1447cfb41b1fcbd12cf2bf7b88f409bd8d
      0792dd7d
  22. 15 May, 2020 1 commit
  23. 14 May, 2020 1 commit
    • Manish V Badarkhe's avatar
      Implement workaround for AT speculative behaviour · 45aecff0
      Manish V Badarkhe authored
      During context switching from higher EL (EL2 or higher)
      to lower EL can cause incorrect translation in TLB due to
      speculative execution of AT instruction using out-of-context
      translation regime.
      
      Workaround is implemented as below during EL's (EL1 or EL2)
      "context_restore" operation:
      1. Disable page table walk using SCTLR.M and TCR.EPD0 & EPD1
         bits for EL1 or EL2 (stage1 and stage2 disabled)
      2. Save all system registers except TCR and SCTLR (for EL1 and EL2)
      3. Do memory barrier operation (isb) to ensure all
         system register writes are done.
      4. Restore TCR and SCTLR registers (for EL1 and EL2)
      
      Errata details are available for various CPUs as below:
      Cortex-A76: 1165522
      Cortex-A72: 1319367
      Cortex-A57: 1319537
      Cortex-A55: 1530923
      Cortex-A53: 1530924
      
      More details can be found in mail-chain:
      https://lists.trustedfirmware.org/pipermail/tf-a/2020-April/000445.html
      
      
      
      Currently, Workaround is implemented as build option which is default
      disabled.
      Signed-off-by: default avatarManish V Badarkhe <Manish.Badarkhe@arm.com>
      Change-Id: If8545e61f782cb0c2dda7ffbaf50681c825bd2f0
      45aecff0
  24. 01 Apr, 2020 1 commit
    • Manish V Badarkhe's avatar
      Enable MTE support · 7ff088d1
      Manish V Badarkhe authored
      
      
      Enable MTE support by adding memory tag option in Makefile
      This option is available only when ARMv8.5-MemTag is implemented
      
      MTE options are added in latest clang and armclang compiler which
      support below options:
      for clang <version 11.0.0>
      1. -march=arm8.5-a+memtag
      2. -fsanitize=memtag
      
      for armclang <version 6.12>
      1. -march=arm8.5-a+memtag
      2. -mmemtag-stack
      
      Set the option SUPPORT_STACK_MEMTAG=yes to enable memory stack tagging.
      Signed-off-by: default avatarManish V Badarkhe <Manish.Badarkhe@arm.com>
      Change-Id: I4e0bbde4e9769ce03ead6f550158e22f32c1c413
      7ff088d1
  25. 31 Mar, 2020 1 commit
  26. 16 Mar, 2020 1 commit
    • Louis Mayencourt's avatar
      fconf: Clean Arm IO · a6de824f
      Louis Mayencourt authored
      
      
      Merge the previously introduced arm_fconf_io_storage into arm_io_storage. This
      removes the duplicate io_policies and functions definition.
      
      This patch:
      - replace arm_io_storage.c with the content of arm_fconf_io_storage.c
      - rename the USE_FCONF_BASED_IO option into ARM_IO_IN_DTB.
      - use the ARM_IO_IN_DTB option to compile out io_policies moved in dtb.
      - propagate DEFINES when parsing dts.
      - use ARM_IO_IN_DTB to include or not uuid nodes in fw_config dtb.
      - set the ARM_IO_IN_DTB to 0 by default for fvp. This ensure that the behavior
        of fvp stays the same as it was before the introduction of fconf.
      
      Change-Id: Ia774a96d1d3a2bccad29f7ce2e2b4c21b26c080e
      Signed-off-by: default avatarLouis Mayencourt <louis.mayencourt@arm.com>
      a6de824f
  27. 06 Mar, 2020 2 commits
    • Sumit Garg's avatar
      Makefile: Add support to optionally encrypt BL31 and BL32 · c6ba9b45
      Sumit Garg authored
      
      
      Following build flags have been added to support optional firmware
      encryption:
      
      - FW_ENC_STATUS: Top level firmware's encryption numeric flag, values:
          0: Encryption is done with Secret Symmetric Key (SSK) which is
             common for a class of devices.
          1: Encryption is done with Binding Secret Symmetric Key (BSSK) which
             is unique per device.
      
      - ENC_KEY: A 32-byte (256-bit) symmetric key in hex string format. It
          could be SSK or BSSK depending on FW_ENC_STATUS flag.
      
      - ENC_NONCE: A 12-byte (96-bit) encryption nonce or Initialization Vector
          (IV) in hex string format.
      
      - ENCRYPT_BL31: Binary flag to enable encryption of BL31 firmware.
      
      - ENCRYPT_BL32: Binary flag to enable encryption of Secure BL32 payload.
      
      Similar flags can be added to encrypt other firmwares as well depending
      on use-cases.
      Signed-off-by: default avatarSumit Garg <sumit.garg@linaro.org>
      Change-Id: I94374d6830ad5908df557f63823e58383d8ad670
      c6ba9b45
    • Sumit Garg's avatar
      drivers: crypto: Add authenticated decryption framework · 7cda17bb
      Sumit Garg authored
      
      
      Add framework for autheticated decryption of data. Currently this
      patch optionally imports mbedtls library as a backend if build option
      "DECRYPTION_SUPPORT = aes_gcm" is set to perform authenticated decryption
      using AES-GCM algorithm.
      Signed-off-by: default avatarSumit Garg <sumit.garg@linaro.org>
      Change-Id: I2966f0e79033151012bf4ffc66f484cd949e7271
      7cda17bb
  28. 03 Mar, 2020 1 commit
  29. 02 Mar, 2020 1 commit
  30. 27 Feb, 2020 1 commit
  31. 24 Feb, 2020 2 commits
    • Petre-Ionut Tudor's avatar
      Read-only xlat tables for BL31 memory · 60e8f3cf
      Petre-Ionut Tudor authored
      
      
      This patch introduces a build flag which allows the xlat tables
      to be mapped in a read-only region within BL31 memory. It makes it
      much harder for someone who has acquired the ability to write to
      arbitrary secure memory addresses to gain control of the
      translation tables.
      
      The memory attributes of the descriptors describing the tables
      themselves are changed to read-only secure data. This change
      happens at the end of BL31 runtime setup. Until this point, the
      tables have read-write permissions. This gives a window of
      opportunity for changes to be made to the tables with the MMU on
      (e.g. reclaiming init code). No changes can be made to the tables
      with the MMU turned on from this point onwards. This change is also
      enabled for sp_min and tspd.
      
      To make all this possible, the base table was moved to .rodata. The
      penalty we pay is that now .rodata must be aligned to the size of
      the base table (512B alignment). Still, this is better than putting
      the base table with the higher level tables in the xlat_table
      section, as that would cost us a full 4KB page.
      
      Changing the tables from read-write to read-only cannot be done with
      the MMU on, as the break-before-make sequence would invalidate the
      descriptor which resolves the level 3 page table where that very
      descriptor is located. This would make the translation required for
      writing the changes impossible, generating an MMU fault.
      
      The caches are also flushed.
      Signed-off-by: default avatarPetre-Ionut Tudor <petre-ionut.tudor@arm.com>
      Change-Id: Ibe5de307e6dc94c67d6186139ac3973516430466
      60e8f3cf
    • Sandrine Bailleux's avatar
      Build system: Changes to drive cert_create for dualroot CoT · 53b985a0
      Sandrine Bailleux authored
      
      
      The build system needs to drive the cert_create tool in a slightly
      different manner when using the dualroot chain of trust.
      
       - It needs to pass it the platform root of trust key file.
      
       - It must not try to generate the Non-Trusted Firmware Key Certificate,
         which is not part of the dualroot CoT.
      
      Change-Id: Ibcc821c5735765523730f861ae8230208f41302b
      Signed-off-by: default avatarSandrine Bailleux <sandrine.bailleux@arm.com>
      53b985a0
  32. 18 Feb, 2020 1 commit
  33. 07 Feb, 2020 1 commit
    • Louis Mayencourt's avatar
      fconf: Move platform io policies into fconf · 0a6e7e3b
      Louis Mayencourt authored
      
      
      Use the firmware configuration framework to store the io_policies
      information inside the configuration device tree instead of the static
      structure in the code base.
      
      The io_policies required by BL1 can't be inside the dtb, as this one is
      loaded by BL1, and only available at BL2.
      
      This change currently only applies to FVP platform.
      
      Change-Id: Ic9c1ac3931a4a136aa36f7f58f66d3764c1bfca1
      Signed-off-by: default avatarLouis Mayencourt <louis.mayencourt@arm.com>
      0a6e7e3b
  34. 29 Jan, 2020 1 commit
  35. 28 Jan, 2020 1 commit
  36. 24 Jan, 2020 1 commit
    • Masahiro Yamada's avatar
      Build: support per-BL LDFLAGS · d986bae4
      Masahiro Yamada authored
      
      
      make_helpers/build_macros.mk supports per-BL CFLAGS. For example,
      you can pass compiler flags only to BL31 by using BL31_CFLAGS.
      
      This commit adds per-BL LDFLAGS support, which is useful as well.
      
      My main motivation of this addition is to use it for ENABLE_PIE.
      When ENABLE_PIE is enabled, some linker flags are added to TF_LDFLAGS,
      which affects all the TF images. It will make more sense to pass the
      relevant options only to BL images that support it.
      
      Change-Id: I203acaab0091db5ae0ea6e66460ee7dc8d9c4d75
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      d986bae4
  37. 14 Jan, 2020 1 commit
    • Balint Dobszay's avatar
      Replace dts includes with C preprocessor syntax · 2d51b55e
      Balint Dobszay authored
      
      
      Using the /include/ syntax, the include was evaluated by dtc, only after running
      the preprocessor, therefore the .dtsi files were not preprocessed. This patch
      adds the #include syntax instead. Evaluating this and preprocessing the files
      now happens in a single step, done by the C preprocessor.
      
      Change-Id: I6d0104b6274316fc736e84973502a4d6c2c9d6e0
      Signed-off-by: default avatarBalint Dobszay <balint.dobszay@arm.com>
      2d51b55e