1. 29 Jan, 2020 1 commit
  2. 27 Jan, 2020 2 commits
    • Raghu Krishnamurthy's avatar
      T589: Fix insufficient ordering guarantees in bakery lock · c0018913
      Raghu Krishnamurthy authored
      
      
      bakery_lock_get() uses DMB LD after lock acquisition and
      bakery_lock_release() uses DMB ST before releasing the lock. This is
      insufficient in both cases. With just DMB LD, stores in the critical
      section can be reordered before the DMB LD which could mean writes in
      the critical section completing before the lock has been acquired
      successfully. Similarly, with just DMB ST, a load in the critical section
      could be reordered after the the DMB ST. DMB is the least expensive
      barrier that can provide the required ordering.
      Signed-off-by: default avatarRaghu Krishnamurthy <raghu.ncstate@icloud.com>
      Change-Id: Ieb74cbf5b76b09e1789331b71f37f7c660221b0e
      c0018913
    • Manish Pandey's avatar
      Neovers N1: added support to update presence of External LLC · f2d6b4ee
      Manish Pandey authored
      
      
      CPUECTLR_EL1.EXTLLC bit indicates the presense of internal or external
      last level cache(LLC) in the system, the reset value is internal LLC.
      
      To cater for the platforms(like N1SDP) which has external LLC present
      introduce a new build option 'NEOVERSE_N1_EXTERNAL_LLC' which can be
      enabled by platform port.
      Signed-off-by: default avatarManish Pandey <manish.pandey2@arm.com>
      Change-Id: Ibf475fcd6fd44401897a71600f4eafe989921363
      f2d6b4ee
  3. 23 Jan, 2020 2 commits
  4. 22 Jan, 2020 4 commits
  5. 20 Jan, 2020 1 commit
  6. 10 Jan, 2020 1 commit
    • Deepika Bhavnani's avatar
      Unify type of "cpu_idx" across PSCI module. · 5b33ad17
      Deepika Bhavnani authored
      
      
      NOTE for platform integrators:
         API `plat_psci_stat_get_residency()` third argument
         `last_cpu_idx` is changed from "signed int" to the
         "unsigned int" type.
      
      Issue / Trouble points
      1. cpu_idx is used as mix of `unsigned int` and `signed int` in code
      with typecasting at some places leading to coverity issues.
      
      2. Underlying platform API's return cpu_idx as `unsigned int`
      and comparison is performed with platform specific defines
      `PLAFORM_xxx` which is not consistent
      
      Misra Rule 10.4:
      The value of a complex expression of integer type may only be cast to
      a type that is narrower and of the same signedness as the underlying
      type of the expression.
      
      Based on above points, cpu_idx is kept as `unsigned int` to match
      the API's and low-level functions and platform defines are updated
      where ever required
      Signed-off-by: default avatarDeepika Bhavnani <deepika.bhavnani@arm.com>
      Change-Id: Ib26fd16e420c35527204b126b9b91e8babcc3a5c
      5b33ad17
  7. 02 Jan, 2020 1 commit
  8. 23 Dec, 2019 1 commit
  9. 20 Dec, 2019 1 commit
    • Paul Beesley's avatar
      spm: Remove SPM Alpha 1 prototype and support files · 538b0020
      Paul Beesley authored
      
      
      The Secure Partition Manager (SPM) prototype implementation is
      being removed. This is preparatory work for putting in place a
      dispatcher component that, in turn, enables partition managers
      at S-EL2 / S-EL1.
      
      This patch removes:
      
      - The core service files (std_svc/spm)
      - The Resource Descriptor headers (include/services)
      - SPRT protocol support and service definitions
      - SPCI protocol support and service definitions
      
      Change-Id: Iaade6f6422eaf9a71187b1e2a4dffd7fb8766426
      Signed-off-by: default avatarPaul Beesley <paul.beesley@arm.com>
      Signed-off-by: default avatarArtsem Artsemenka <artsem.artsemenka@arm.com>
      538b0020
  10. 18 Dec, 2019 2 commits
  11. 17 Dec, 2019 2 commits
  12. 11 Dec, 2019 1 commit
  13. 06 Dec, 2019 2 commits
  14. 26 Nov, 2019 1 commit
    • Pankaj Gupta's avatar
      adding support to enable different personality of the same soc. · ab4df50c
      Pankaj Gupta authored
      
      
      Same SoC has different personality by creating different number of:
      - cores
      - clusters.
      
      As a result, the platform specific power domain tree will be created
      after identify the personality of the SoC.
      Hence, platform specific power domain tree may not be same for all the
      personality of the soc.
      
      Thus, psci library code will deduce the 'plat_core_count', while
      populating the power domain tree topology and return the number of
      cores.
      
      PLATFORM_CORE_COUNT will still be valid for a SoC, such that
      psci_plat_core_count <= PLATFORM_CORE_COUNT.
      
      PLATFORM_CORE_COUNT will continued to be defined by platform to create
      the data structures.
      Signed-off-by: default avatarPankaj Gupta <pankaj.gupta@nxp.com>
      Change-Id: I1f5c47647631cae2dcdad540d64cf09757db7185
      ab4df50c
  15. 12 Nov, 2019 1 commit
    • Deepika Bhavnani's avatar
      Coding guideline suggest not to use unsigned long · 9afe8cdc
      Deepika Bhavnani authored
      
      
      `unsigned long` should be replaced to
      1. `unsigned int` or `unsigned long long` - If fixed,
      based on the architecture AArch32 or AArch64
      2. `u_register_t` - If it is supposed to be 32-bit
      wide in AArch32 and 64-bit wide in AArch64.
      
      Translation descriptors are always 32-bit wide, here
      `uint32_t` is used to describe the `exact size` of
      translation descriptors instead of `unsigned int` which
      guarantees minimum 32-bits
      Signed-off-by: default avatarDeepika Bhavnani <deepika.bhavnani@arm.com>
      Change-Id: I6a2af2e8b3c71170e2634044e0b887f07a41677e
      9afe8cdc
  16. 24 Oct, 2019 1 commit
  17. 20 Oct, 2019 1 commit
    • Simon South's avatar
      Disable stack protection explicitly · 7af195e2
      Simon South authored
      
      
      Explicitly disable stack protection via the "-fno-stack-protector"
      compiler option when the ENABLE_STACK_PROTECTOR build option is
      set to "none" (the default).
      
      This allows the build to complete without link errors on systems where
      stack protection is enabled by default in the compiler.
      
      Change-Id: I0a676aa672815235894fb2cd05fa2b196fabb972
      Signed-off-by: default avatarSimon South <simon@simonsouth.net>
      7af195e2
  18. 18 Oct, 2019 1 commit
    • Artsem Artsemenka's avatar
      xlat_table_v2: Fix enable WARMBOOT_ENABLE_DCACHE_EARLY config · 0e7a0540
      Artsem Artsemenka authored
      
      
      The WARMBOOT_ENABLE_DCACHE_EARLY allows caches to be turned on early during
      the boot. But the xlat_change_mem_attributes_ctx() API did not do the required
      cache maintenance after the mmap tables are modified if
      WARMBOOT_ENABLE_DCACHE_EARLY is enabled. This meant that when the caches are turned
      off during power down, the tables in memory are accessed as part of cache
      maintenance for power down, and the tables are not correct at this point which
      results in a data abort.
      This patch removes the optimization within xlat_change_mem_attributes_ctx()
      when WARMBOOT_ENABLE_DCACHE_EARLY is enabled.
      Signed-off-by: default avatarArtsem Artsemenka <artsem.artsemenka@arm.com>
      Change-Id: I82de3decba87dd13e9856b5f3620a1c8571c8d87
      0e7a0540
  19. 04 Oct, 2019 2 commits
    • laurenw-arm's avatar
      Neoverse N1 Errata Workaround 1542419 · 80942622
      laurenw-arm authored
      
      
      Coherent I-cache is causing a prefetch violation where when the core
      executes an instruction that has recently been modified, the core might
      fetch a stale instruction which violates the ordering of instruction
      fetches.
      
      The workaround includes an instruction sequence to implementation
      defined registers to trap all EL0 IC IVAU instructions to EL3 and a trap
      handler to execute a TLB inner-shareable invalidation to an arbitrary
      address followed by a DSB.
      Signed-off-by: default avatarLauren Wehrmeister <lauren.wehrmeister@arm.com>
      Change-Id: Ic3b7cbb11cf2eaf9005523ef5578a372593ae4d6
      80942622
    • Soby Mathew's avatar
      Fix the CAS spinlock implementation · c97cba4e
      Soby Mathew authored
      
      
      Make the spinlock implementation use ARMv8.1-LSE CAS instruction based
      on a platform build option. The CAS-based implementation used to be
      unconditionally selected for all ARM8.1+ platforms.
      
      The previous CAS spinlock implementation had a bug wherein the spin_unlock()
      implementation had an `sev` after `stlr` which is not sufficient. A dsb is
      needed to ensure that the stlr completes prior to the sev. Having a dsb is
      heavyweight and a better solution would be to use load exclusive semantics
      to monitor the lock and wake up from wfe when a store happens to the lock.
      The patch implements the same.
      
      Change-Id: I5283ce4a889376e4cc01d1b9d09afa8229a2e522
      Signed-off-by: default avatarSoby Mathew <soby.mathew@arm.com>
      Signed-off-by: default avatarOlivier Deprez <olivier.deprez@arm.com>
      c97cba4e
  20. 03 Oct, 2019 2 commits
  21. 02 Oct, 2019 1 commit
  22. 30 Sep, 2019 1 commit
  23. 26 Sep, 2019 2 commits
    • Alexei Fedorov's avatar
      AArch32: Disable Secure Cycle Counter · c3e8b0be
      Alexei Fedorov authored
      
      
      This patch changes implementation for disabling Secure Cycle
      Counter. For ARMv8.5 the counter gets disabled by setting
      SDCR.SCCD bit on CPU cold/warm boot. For the earlier
      architectures PMCR register is saved/restored on secure
      world entry/exit from/to Non-secure state, and cycle counting
      gets disabled by setting PMCR.DP bit.
      In 'include\aarch32\arch.h' header file new
      ARMv8.5-PMU related definitions were added.
      
      Change-Id: Ia8845db2ebe8de940d66dff479225a5b879316f8
      Signed-off-by: default avatarAlexei Fedorov <Alexei.Fedorov@arm.com>
      c3e8b0be
    • Madhukar Pappireddy's avatar
      Adding new optional PSCI hook pwr_domain_on_finish_late · 10107707
      Madhukar Pappireddy authored
      
      
      This PSCI hook is similar to pwr_domain_on_finish but is
      guaranteed to be invoked with the respective core and cluster are
      participating in coherency. This will be necessary to safely invoke
      the new GICv3 API which modifies shared GIC data structures concurrently.
      
      Change-Id: I8e54f05c9d4ef5712184c9c18ba45ac97a29eb7a
      Signed-off-by: default avatarMadhukar Pappireddy <madhukar.pappireddy@arm.com>
      10107707
  24. 20 Sep, 2019 1 commit
    • Justin Chadwell's avatar
      Fix MTE support from causing unused variable warnings · 019b03a3
      Justin Chadwell authored
      
      
      assert() calls are removed in release builds, and if that assert call is
      the only use of a variable, an unused variable warning will be triggered
      in a release build. This patch fixes this problem when
      CTX_INCLUDE_MTE_REGS by not using an intermediate variable to store the
      results of get_armv8_5_mte_support().
      
      Change-Id: I529e10ec0b2c8650d2c3ab52c4f0cecc0b3a670e
      Signed-off-by: default avatarJustin Chadwell <justin.chadwell@arm.com>
      019b03a3
  25. 13 Sep, 2019 2 commits
    • Deepika Bhavnani's avatar
      SCTLR and ACTLR are 32-bit for AArch32 and 64-bit for AArch64 · eeb5a7b5
      Deepika Bhavnani authored
      
      
      AArch64 System register SCTLR_EL1[31:0] is architecturally mapped
      to AArch32 System register SCTLR[31:0]
      AArch64 System register ACTLR_EL1[31:0] is architecturally mapped
      to AArch32 System register ACTLR[31:0].
      
      `u_register_t` should be used when it's important to store the
      contents of a register in its native size
      Signed-off-by: default avatarDeepika Bhavnani <deepika.bhavnani@arm.com>
      Change-Id: I0055422f8cc0454405e011f53c1c4ddcaceb5779
      eeb5a7b5
    • Alexei Fedorov's avatar
      Refactor ARMv8.3 Pointer Authentication support code · ed108b56
      Alexei Fedorov authored
      
      
      This patch provides the following features and makes modifications
      listed below:
      - Individual APIAKey key generation for each CPU.
      - New key generation on every BL31 warm boot and TSP CPU On event.
      - Per-CPU storage of APIAKey added in percpu_data[]
        of cpu_data structure.
      - `plat_init_apiakey()` function replaced with `plat_init_apkey()`
        which returns 128-bit value and uses Generic timer physical counter
        value to increase the randomness of the generated key.
        The new function can be used for generation of all ARMv8.3-PAuth keys
      - ARMv8.3-PAuth specific code placed in `lib\extensions\pauth`.
      - New `pauth_init_enable_el1()` and `pauth_init_enable_el3()` functions
        generate, program and enable APIAKey_EL1 for EL1 and EL3 respectively;
        pauth_disable_el1()` and `pauth_disable_el3()` functions disable
        PAuth for EL1 and EL3 respectively;
        `pauth_load_bl31_apiakey()` loads saved per-CPU APIAKey_EL1 from
        cpu-data structure.
      - Combined `save_gp_pauth_registers()` function replaces calls to
        `save_gp_registers()` and `pauth_context_save()`;
        `restore_gp_pauth_registers()` replaces `pauth_context_restore()`
        and `restore_gp_registers()` calls.
      - `restore_gp_registers_eret()` function removed with corresponding
        code placed in `el3_exit()`.
      - Fixed the issue when `pauth_t pauth_ctx` structure allocated space
        for 12 uint64_t PAuth registers instead of 10 by removal of macro
        CTX_PACGAKEY_END from `include/lib/el3_runtime/aarch64/context.h`
        and assigning its value to CTX_PAUTH_REGS_END.
      - Use of MODE_SP_ELX and MODE_SP_EL0 macro definitions
        in `msr	spsel`  instruction instead of hard-coded values.
      - Changes in documentation related to ARMv8.3-PAuth and ARMv8.5-BTI.
      
      Change-Id: Id18b81cc46f52a783a7e6a09b9f149b6ce803211
      Signed-off-by: default avatarAlexei Fedorov <Alexei.Fedorov@arm.com>
      ed108b56
  26. 12 Sep, 2019 1 commit
  27. 11 Sep, 2019 2 commits