Skip to content

riscv/riscv_ipi.h: Do not write to CSR_MIP.MSIP as it is read-only#14967

Merged
xiaoxiang781216 merged 1 commit intoapache:masterfrom
tiiuae:rv_ipi_msip
Nov 28, 2024
Merged

riscv/riscv_ipi.h: Do not write to CSR_MIP.MSIP as it is read-only#14967
xiaoxiang781216 merged 1 commit intoapache:masterfrom
tiiuae:rv_ipi_msip

Conversation

@pussuw
Copy link
Copy Markdown
Contributor

@pussuw pussuw commented Nov 27, 2024

Summary

From the RISV-V Privileged Spec v1.10 (3.1.14 MIP/MIE):

Only the bits corresponding to lower-privilege software interrupts (USIP, SSIP), timer interrupts (UTIP, STIP), and external interrupts (UEIP, SEIP) in mip are writable through this CSR address; the remaining bits are read-only.

Thus, it is futile to write to the M-mode status bit via the CSR, only access via RISCV_IPI is valid.

Impact

RISC-V SMP only.

Testing

rv-virt:smp64
rv-virt:smp
rv-virt:ksmp64

From the RISV-V Privileged Spec v1.10 (3.1.14 MIP/MIE):

Only the bits corresponding to lower-privilege software interrupts
(USIP, SSIP), timer interrupts (UTIP, STIP), and external interrupts
(UEIP, SEIP) in mip are writable through this CSR address; the
remaining bits are read-only.

Thus, it is futile to write to the M-mode status bit via the CSR, only
access via RISCV_IPI is valid.
@github-actions github-actions Bot added Arch: risc-v Issues related to the RISC-V (32-bit or 64-bit) architecture Size: XS The size of the change in this PR is very small labels Nov 27, 2024
@xiaoxiang781216 xiaoxiang781216 merged commit 51171d6 into apache:master Nov 28, 2024
@pussuw pussuw deleted the rv_ipi_msip branch December 12, 2024 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: risc-v Issues related to the RISC-V (32-bit or 64-bit) architecture Size: XS The size of the change in this PR is very small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants