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

[Backport v3.7-branch] arch: riscv: reset global pointer on exception #81370

Merged
merged 3 commits into from
Nov 14, 2024

Commits on Nov 14, 2024

  1. arch: riscv: add macro to access hardware registers

    Add macros to read / write hardware registers.
    
    Signed-off-by: Yong Cong Sin <ycsin@meta.com>
    Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
    (cherry picked from commit de3a845)
    ycsin authored and github-actions[bot] committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    9af5275 View commit details
    Browse the repository at this point in the history
  2. arch: riscv: reset global pointer on exception

    Reset the gp on exception entry from u-mode to protect the kernel
    against a possible rogue user thread.
    
    Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
    Signed-off-by: Yong Cong Sin <ycsin@meta.com>
    (cherry picked from commit e30db2d)
    ycsin authored and github-actions[bot] committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    301edba View commit details
    Browse the repository at this point in the history
  3. tests: arch: riscv: make sure that gp reg can't be corrupted

    Add a test to make sure that the `gp` global pointer register used for
    relative addressing when `CONFIG_RISCV_GP` is enabled can't be
    corrupted by a rogue user thread.
    
    Signed-off-by: Yong Cong Sin <ycsin@meta.com>
    Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
    (cherry picked from commit 408c151)
    ycsin authored and github-actions[bot] committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    4f73572 View commit details
    Browse the repository at this point in the history