Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve PTDUMP and introduce new fields #51

Closed
wants to merge 6 commits into from

Commits on Nov 2, 2023

  1. RISC-V: Probe misaligned access speed in parallel

    Probing for misaligned access speed takes about 0.06 seconds. On a
    system with 64 cores, doing this in smp_callin() means it's done
    serially, extending boot time by 3.8 seconds. That's a lot of boot time.
    
    Instead of measuring each CPU serially, let's do the measurements on
    all CPUs in parallel. If we disable preemption on all CPUs, the
    jiffies stop ticking, so we can do this in stages of 1) everybody
    except core 0, then 2) core 0.
    
    The measurement call in smp_callin() stays around, but is now
    conditionalized to only run if a new CPU shows up after the round of
    in-parallel measurements has run. The goal is to have the measurement
    call not run during boot or suspend/resume, but only on a hotplug
    addition.
    
    Reported-by: Jisheng Zhang <jszhang@kernel.org>
    Closes: https://lore.kernel.org/all/mhng-9359993d-6872-4134-83ce-c97debe1cf9a@palmer-ri-x1c9/T/#mae9b8f40016f9df428829d33360144dc5026bcbf
    Fixes: 584ea65 ("RISC-V: Probe for unaligned access speed")
    Signed-off-by: Evan Green <evan@rivosinc.com>
    Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
    Tested-by: Andrew Jones <ajones@ventanamicro.com>
    Tested-by: Jisheng Zhang <jszhang@kernel.org>
    Acked-by: Conor Dooley <conor.dooley@microchip.com>
    Link: https://lore.kernel.org/r/20230920193801.3035093-1-evan@rivosinc.com
    Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
    evangreen authored and palmer-dabbelt committed Nov 2, 2023
    Configuration menu
    Copy the full SHA
    d51ebb2 View commit details
    Browse the repository at this point in the history
  2. Merge patch series "Add support to handle misaligned accesses in S-mode"

    Clément Léger <cleger@rivosinc.com> says:
    
    Since commit 61cadb9 ("Provide new description of misaligned load/store
    behavior compatible with privileged architecture.") in the RISC-V ISA
    manual, it is stated that misaligned load/store might not be supported.
    However, the RISC-V kernel uABI describes that misaligned accesses are
    supported. In order to support that, this series adds support for S-mode
    handling of misaligned accesses as well support for prctl(PR_UNALIGN).
    
    Handling misaligned access in kernel allows for a finer grain control
    of the misaligned accesses behavior, and thanks to the prctl() call,
    can allow disabling misaligned access emulation to generate SIGBUS. User
    space can then optimize its software by removing such access based on
    SIGBUS generation.
    
    This series is useful when using a SBI implementation that does not
    handle misaligned traps as well as detecting misaligned accesses
    generated by userspace application using the prctrl(PR_SET_UNALIGN)
    feature.
    
    This series can be tested using the spike simulator[1] and a modified
    openSBI version[2] which allows to always delegate misaligned load/store to
    S-mode. A test[3] that exercise various instructions/registers can be
    executed to verify the unaligned access support.
    
    [1] https://github.com/riscv-software-src/riscv-isa-sim
    [2] https://github.com/rivosinc/opensbi/tree/dev/cleger/no_misaligned
    [3] https://github.com/clementleger/unaligned_test
    
    * b4-shazam-merge:
      riscv: add support for PR_SET_UNALIGN and PR_GET_UNALIGN
      riscv: report misaligned accesses emulation to hwprobe
      riscv: annotate check_unaligned_access_boot_cpu() with __init
      riscv: add support for sysctl unaligned_enabled control
      riscv: add floating point insn support to misaligned access emulation
      riscv: report perf event for misaligned fault
      riscv: add support for misaligned trap handling in S-mode
      riscv: remove unused functions in traps_misaligned.c
    
    [Palmer: Evan pointed out an extra __init on
    unaligned_emulation_finish(), I've squashed it in as a merge conflict.]
    
    Link: https://lore.kernel.org/r/20231004151405.521596-1-cleger@rivosinc.com
    Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
    palmer-dabbelt committed Nov 2, 2023
    Configuration menu
    Copy the full SHA
    8aefa03 View commit details
    Browse the repository at this point in the history
  3. adding ci files

    Björn Töpel committed Nov 2, 2023
    Configuration menu
    Copy the full SHA
    0cc8016 View commit details
    Browse the repository at this point in the history
  4. riscv: Improve PTDUMP to show RSW with non-zero value

    RSW field can be used to encode 2 bits of software
    defined information. Currently, PTDUMP only prints
    "RSW" when its value is 1 or 3.
    
    To fix this issue and improve the debugging experience
    with PTDUMP, we redefine _PAGE_SPECIAL to its original
    value and use _PAGE_SOFT as the RSW mask, allow it to
    print the RSW with any non-zero value.
    
    This patch also removes the val from the struct prot_bits
    as it is no longer needed.
    
    Signed-off-by: Yu Chien Peter Lin <peterlin@andestech.com>
    Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>
    Tested-by: Alexandre Ghiti <alexghiti@rivosinc.com>
    Signed-off-by: Björn Töpel <bjorn@rivosinc.com>
    lyctw authored and Björn Töpel committed Nov 2, 2023
    Configuration menu
    Copy the full SHA
    2aa274a View commit details
    Browse the repository at this point in the history
  5. riscv: Introduce PBMT field to PTDUMP

    This patch introduces the PBMT field to the PTDUMP, so it can
    display the memory attributes for NC or IO.
    
    Signed-off-by: Yu Chien Peter Lin <peterlin@andestech.com>
    Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>
    Tested-by: Alexandre Ghiti <alexghiti@rivosinc.com>
    Signed-off-by: Björn Töpel <bjorn@rivosinc.com>
    lyctw authored and Björn Töpel committed Nov 2, 2023
    Configuration menu
    Copy the full SHA
    d464d4c View commit details
    Browse the repository at this point in the history
  6. riscv: Introduce NAPOT field to PTDUMP

    This patch introduces the NAPOT field to PTDUMP, allowing it
    to display the letter "N" for pages that have the 63rd bit set.
    
    Signed-off-by: Yu Chien Peter Lin <peterlin@andestech.com>
    Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>
    Tested-by: Alexandre Ghiti <alexghiti@rivosinc.com>
    Signed-off-by: Björn Töpel <bjorn@rivosinc.com>
    lyctw authored and Björn Töpel committed Nov 2, 2023
    Configuration menu
    Copy the full SHA
    e4b75cc View commit details
    Browse the repository at this point in the history