• Anup Patel's avatar
    RISC-V: Don't enable all interrupts in trap_init() · 6a1ce99d
    Anup Patel authored
    Historically, we have been enabling all interrupts for each
    HART in trap_init(). Ideally, we should only enable M-mode
    interrupts for M-mode kernel and S-mode interrupts for S-mode
    kernel in trap_init().
    
    Currently, we get suprious S-mode interrupts on Kendryte K210
    board running M-mode NO-MMU kernel because we are enabling all
    interrupts in trap_init(). To fix this, we only enable software
    and external interrupt in trap_init(). In future, trap_init()
    will only enable software interrupt and PLIC driver will enable
    external interrupt using CPU notifiers.
    
    Fixes: a4c3733d ("riscv: abstract out CSR names for supervisor vs machine mode")
    Signed-off-by: default avatarAnup Patel <anup.patel@wdc.com>
    Reviewed-by: default avatarAtish Patra <atish.patra@wdc.com>
    Tested-by: Palmer Dabbelt <palmerdabbelt@google.com> [QMEU virt machine with SMP]
    [Palmer: Move the Fixes up to a newer commit]
    Reviewed-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
    Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
    6a1ce99d
traps.c 4.18 KB