1. Nov 15, 2019
    • Anup Patel's avatar
      firmware: Add preferred boot HART field in struct fw_dynamic_info · 7a13beb2
      Anup Patel authored
      
      
      It has been reported that link address range of previous booting stage
      (such as U-Boot SPL) can overlap the link address rage of FW_DYNAMIC.
      
      This means self-relocation in FW_DYNAMIC can potentially corrupt
      previous booting stage if any of the secondary HART enter FW_DYNAMIC
      before primary HART.
      
      To tackle this, we add preferred boot HART field (i.e boot_hart) in
      struct fw_dyanmic_info. We use this field to force secondary HARTs
      into relocation wait loop till preferred/primary boot HART enters
      FW_DYNAMIC completes self-relocation. If preferred boot HART is not
      available then we fall back to relocation lottery approach.
      
      Signed-off-by: default avatarAnup Patel <anup.patel@wdc.com>
      Reviewed-by: default avatarAtish Patra <atish.patra@wdc.com>
      7a13beb2
  2. Nov 06, 2019
  3. Nov 05, 2019
  4. Oct 28, 2019
  5. Oct 09, 2019
  6. Oct 03, 2019
  7. Oct 02, 2019
  8. Sep 30, 2019
  9. Sep 28, 2019
  10. Sep 25, 2019
    • Bin Meng's avatar
      docs: platform: Update descriptions for qemu/sifive_u support · 88537582
      Bin Meng authored
      
      
      With QEMU v4.2 release that has improved the emulation fidelity
      of 'sifive_u' machine, OpenSBI v0.4 / U-Boot v2019.10-rc1 / Linux
      kernel v5.3-rc2 images built for the SiFive HiFive Unleashed board
      can be used out of the box without any special hack.
      
      Update our documents to mention 'qemu/sifive_u' platform should
      only be used with QEMU v4.1 or before, and it will be dropped
      sometime in the future release.
      
      Going forward, 'sifive/fu540' platform can be used on both real
      hardware and QEMU v4.2+ 'sifive_u' machine.
      
      Signed-off-by: default avatarBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: default avatarAnup Patel <anup.patel@wdc.com>
      88537582
  11. Sep 10, 2019
  12. Sep 05, 2019
  13. Aug 31, 2019
  14. Aug 23, 2019
  15. Aug 19, 2019
  16. Aug 16, 2019
    • Atish Patra's avatar
      platform: Remove the ipi_sync method from all platforms. · 75229705
      Atish Patra authored
      
      
      OpenSBI manages outstanding TLB flush requests by queueing
      them in a fifo synchronously. An ipi sync which uses an
      atomic operation on MMIO address is no longer required.
      
      Remove the ipi sync method from platform header and all usage.
      
      Signed-off-by: default avatarAtish Patra <atish.patra@wdc.com>
      Reviewed-by: default avatarAnup Patel <anup.patel@wdc.com>
      75229705
    • Atish Patra's avatar
      lib: Fix race conditions in tlb fifo access. · 897a97a6
      Atish Patra authored
      
      
      Linux kernel expects tlb flush SBI call to be completely synchronous i.e.
      the SBI call should only return once corresponding *fence* instruction is
      executed.
      
      OpenSBI manages the outstanding TLB flush requests by keeping them in a
      per hart based fifo. However, there are few corner cases that may lead to
      race conditions while updating the fifo.
      
      Currently, the caller hart waits for IPI acknowledgement via clint
      address which is not a very good method as synchronization on MMIO may not
      be supported in every platform. Moreover, the waiter doesn't have any way of
      identifying if the IPI is received for specific tlb flush request or any
      other IPI. This may lead to unpredictable behavior in supervisor/user space.
      
      Fix this by waiting on individual fifo entries rather than MMIO address.
      Currently, a relaxed loop is being used because wfi again involves MMIO write
      which would be slower compared to relaxed loop. To avoid deadlock, fifo
      is processed every time a hart loops for fifo enqueue or fifo sync to consume
      the tlb flush requests sent by other harts.
      
      Signed-off-by: default avatarAnup Patel <anup.patel@wdc.com>
      Signed-off-by: default avatarAtish Patra <atish.patra@wdc.com>
      897a97a6
    • Atish Patra's avatar
      f6e13e0d
  17. Aug 13, 2019
    • Anup Patel's avatar
      lib: Handle traps when doing unpriv load/store in get_insn() · a88e424f
      Anup Patel authored
      
      
      We can get a page/access trap when doing unpriv load/store in
      get_insn() function because on a SMP system Linux swapper running
      on HART A can unmap pages from page table used by HART B.
      
      To tackle this we extend get_insn() implementation so that if
      we get trap in get_insn() then we redirect it to S-mode as fetch
      page/access fault.
      
      Signed-off-by: default avatarAnup Patel <anup.patel@wdc.com>
      a88e424f