Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
  1. Jun 12, 2023
  2. Jun 05, 2023
  3. Jun 02, 2023
  4. Jun 01, 2023
  5. May 31, 2023
    • Lauren Wehrmeister's avatar
      Merge changes from topic "bk/errata_refactor" into integration · 0cfa06b2
      Lauren Wehrmeister authored
      * changes:
        feat(cpus): wrappers to propagate AArch32 errata info
        feat(cpus): add a way to automatically report errata
        feat(cpus): add a concise way to implement AArch64 errata
        refactor(cpus): convert print_errata_status to C
        refactor(cpus): rename errata_report.h to errata.h
        refactor(cpus): move cpu_ops field defines to a header
      0cfa06b2
    • Jimmy Brisson's avatar
      fix(measured-boot): don't strip last non-0 char · b85bcb8e
      Jimmy Brisson authored
      
      With the current implementation of stripping the last null
      byte from a string, there was no way to get the TF-M measured
      boot test suite to pass. It would expect the size of the string
      passed into extend measurement to be unaffected by the call.
      
      This fix should allow passing a string with the null char
      pre-stripped, allowing the tests to exclude the null char in
      their test data and not have the length decremented.
      
      Further, This patch adds an early exit if either the version
      or sw_type is larger than its buffer. Without this check,
      it may be possible to pass a length one more than the maximum,
      and if the last element is a null, the length will be truncated
      to fit. This is instead suppsed to return an error.
      
      Signed-off-by: default avatarJimmy Brisson <jimmy.brisson@arm.com>
      Change-Id: I98e1bb53345574d4645513009883c6e7b6612531
      b85bcb8e
    • Olivier Deprez's avatar
  6. May 30, 2023
    • Madhukar Pappireddy's avatar
    • Boyan Karatotev's avatar
      feat(cpus): wrappers to propagate AArch32 errata info · 34c51f32
      Boyan Karatotev authored
      
      AArch32 is not being ported to the errata framework. However, the
      runtime errata list is needed at runtime for the upcoming errata ABI.
      Add wrappers to populate this information and make it accessible in the
      same way as AArch64.
      
      Signed-off-by: default avatarBoyan Karatotev <boyan.karatotev@arm.com>
      Change-Id: I084720f34d6ed4e00e94b09babd3c90a5393298a
      34c51f32
    • Boyan Karatotev's avatar
      feat(cpus): add a way to automatically report errata · 4f748cc4
      Boyan Karatotev authored
      
      Using the errata framework per-cpu data structure, errata can all be
      reported automatically through a single standard errata reporter which
      can replace the cpu-specific ones.
      
      This reporter can also enforce the ordering requirement of errata.
      
      Signed-off-by: default avatarBoyan Karatotev <boyan.karatotev@arm.com>
      Change-Id: I7d2d5ac5bcb9d21aed0d560d7d23919a323ffdab
      4f748cc4
    • Boyan Karatotev's avatar
      feat(cpus): add a concise way to implement AArch64 errata · 3f4c1e1e
      Boyan Karatotev authored
      
      Errata implementation involves adding a lot of boilerplate to random
      places with just conventions on how to do them. Copy pasting is the
      usual method for doing this. The result is an error-prone and verbose
      patch that is a nightmare to get through review.
      
      Errata workarounds have a very large degree of similarity - most of them
      involve setting a bit at reset. As such most of the boilerplate is not
      strictly necessary. To solve this, add a collection of assembly macros
      to wrap errata implementations such that only the actual mitigations
      need to be written. A new erratum mitigation looks something like:
      
        workaround_reset_start cortex_a77, ERRATUM(1925769), ERRATA_A77_1925769
          sysreg_bit_set CORTEX_A77_CPUECTLR_EL1, CORTEX_A77_CPUECTLR_EL1_BIT_8
        workaround_reset_end cortex_a77, ERRATUM(1925769)
      
        check_erratum_ls cortex_a77, ERRATUM(1925769), CPU_REV(1, 1)
      
      Note, that the long comment on every mitigation is missing. This is on
      purpose, as this new format includes all of its contents into an easily
      readable format.
      
      The workaround wrappers add an erratum entry (24 bytes) to a per-cpu
      data structure which can then be read by a standard reset function to
      apply all errata automatically. This has the added benefit of collecting
      all errata TF-A knows about in a central way, which was previously
      missing. This can then be used at runtime with the errata ABI.
      
      If an erratum doesn't fit this standard definition (eg. the
      CVE_2022_23960), it can progressively be unwrapped to the old
      convention. The only differences are that the naming format is slightly
      more verbose and a call to add_erratum_entry is needed to inform the
      framework about the errata.
      
      Finally, the internal workaround names change a tiny bit, especially
      CVEs.
      
      Signed-off-by: default avatarBoyan Karatotev <boyan.karatotev@arm.com>
      Change-Id: Iac644f85dcf85b8279b25e83baf1e7d08b253b16
      3f4c1e1e
    • Boyan Karatotev's avatar
      refactor(cpus): convert print_errata_status to C · dd9fae1c
      Boyan Karatotev authored
      
      The function is called in a fully initialised C environment and calls
      into other C functions. The Aarch differences are minimal and are hidden
      by the pre-existing headers. Converting it results into cleaner code
      that is the same across both Aarch64 and Aarch32.
      
      To avoid having to do very ugly pointer arithmetic, define a C struct
      for the cpu_ops for both Aarch64 and Aarch32.
      
      Signed-off-by: default avatarBoyan Karatotev <boyan.karatotev@arm.com>
      Change-Id: Idc07c4064e03143c88a4a0e2d10ceda70ba19a50
      dd9fae1c
    • Boyan Karatotev's avatar
      refactor(cpus): rename errata_report.h to errata.h · 6bb96fa6
      Boyan Karatotev authored
      
      The ERRATA_XXX macros, used in cpu_helpers.S, are necessary for the
      check_errata_xxx family of functions. The CPU_REV should be used in the
      cpu files but for whatever reason the values have been hard-coded so far
      (at the cost of readability). It's evident this file is not strictly for
      status reporting.
      
      The new purpose of this file is to make it a one-stop-shop for all
      things errata.
      
      Signed-off-by: default avatarBoyan Karatotev <boyan.karatotev@arm.com>
      Change-Id: I1ce22dd36df5aa0bcfc5f2772251f91af8703dfb
      6bb96fa6
    • Boyan Karatotev's avatar
      refactor(cpus): move cpu_ops field defines to a header · 007433d8
      Boyan Karatotev authored
      
      The cpu_macros.S file is loaded with lots of definitions for the cpu_ops
      structure. However, since they are defined as .equ directives they are
      inaccessible for C code. Convert them to #defines, put them into order,
      refactor them for readability, and extract them to a separate file to
      make this possible.
      
      This has the benefit of removing some Aarch differences and a lot of
      duplicate code.
      
      Signed-off-by: default avatarBoyan Karatotev <boyan.karatotev@arm.com>
      Change-Id: I72861794b6c9131285a9297d5918822ed718b228
      007433d8
  7. May 26, 2023
  8. May 25, 2023
  9. May 24, 2023