1. Feb 15, 2022
  2. Feb 04, 2022
  3. Jan 22, 2022
  4. Jan 11, 2022
  5. Dec 24, 2021
  6. Dec 23, 2021
  7. Dec 22, 2021
  8. Dec 16, 2021
  9. Dec 11, 2021
  10. Dec 03, 2021
    • Vincent Chen's avatar
      lib: pmu: support the event ID encoded by a bitmap. · 2428987c
      Vincent Chen authored
      
      
      RISC-V privilege specification does not specify how to encode the event ID.
      Therefore, each platform is allowed to customize its own encoding rule.
      The common encoding methods are as follow, directly assigning a number to an
      event, or every bit in the mphmevent CSR controls one specified event or
      mixes the above two methods.
      
      To enable OpenSBI to support the above three encoding methods simultaneously,
      this patch repurpose the dt property "riscv,raw-event-to-mhpmcounters". The
      "riscv,raw-event-to-mhpmcounters" will describes the one or multiple raw
      events that could be counted by a set of counters. But, the column number
      of "riscv,raw-event-to-mhpmcounters" is extended from 2 to 3. The 1st column
      (64bit) is the ID of the raw events. The 2nd column (64bit) represents a
      select_mask now to represent the bits used for event ID encoding.
      If a platform directly encodes each raw PMU event as a unique ID,
      the value of select_mask will be 0xffffffff_ffffffff.
      
      Signed-off-by: default avatarVincent Chen <vincent.chen@sifive.com>
      Signed-off-by: default avatarAtish <Patra&lt;atishp@rivosinc.com>
      Reviewed-by: default avatarAnup Patel <anup.patel@wdc.com>
      2428987c
  11. Dec 02, 2021
    • Jessica Clarke's avatar
      lib: sbi: Improve fatal error handling · 14faee69
      Jessica Clarke authored
      
      
      BUG and BUG_ON are not informative and are rather lazy interfaces, only
      telling the user that something went wrong in a given function, but not
      what, requiring the user to find the sources corresponding to their
      firmware (which may not be available) and figure out how that BUG(_ON)
      was hit. Even SBI_ASSERT in its current form, which does include the
      condition that triggered it in the output, isn't necessarily very
      informative. In some cases, the error may be fixable by the user, but
      they need to know the problem in order to have any hope of fixing it.
      It's also a nuisance for developers, whose development trees may have
      changed significantly since the release in question being used, and so
      line numbers can make it harder for them to understand which error case
      a user has hit.
      
      This patch introduces a new sbi_panic function which is printf-like,
      allowing detailed error messages to be printed to the console. BUG and
      BUG_ON are removed, since the former is just a worse form of sbi_panic
      and the latter is a worse version of SBI_ASSERT. Finally, SBI_ASSERT is
      augmented to take a set of arguments to pass to sbi_panic on failure,
      used like so (sbi_boot_print_hart's current error case, which currently
      manually calls sbi_printf and sbi_hart_hang):
      
        SBI_ASSERT(xlen >= 1, ("Error %d getting MISA XLEN\n", xlen));
      
      The existing users of BUG are replaced with calls to sbi_panic along
      with informative error messages. BUG_ON and SBI_ASSERT were unused (and,
      in the case of SBI_ASSERT, remain unused).
      
      Many existing users of sbi_hart_hang should be converted to use either
      sbi_panic or SBI_ASSERT after this commit.
      
      Signed-off-by: default avatarJessica Clarke <jrtc27@jrtc27.com>
      Reviewed-by: default avatarAnup Patel <anup.patel@wdc.com>
      Reviewed-by: default avatarXiang W <wxjstz@126.com>
      Reviewed-by: default avatarAtish Patra <atishp@rivosinc.com>
      14faee69
  12. Nov 30, 2021
  13. Nov 23, 2021
  14. Nov 18, 2021
  15. Nov 12, 2021