OSDN Git Service

target/nios2: Prevent writes to read-only or reserved control fields
authorRichard Henderson <richard.henderson@linaro.org>
Thu, 21 Apr 2022 15:17:08 +0000 (08:17 -0700)
committerRichard Henderson <richard.henderson@linaro.org>
Tue, 26 Apr 2022 15:16:41 +0000 (08:16 -0700)
commit796945d596058516f3c66f509e1a4804e4ae198a
tree903974d1f27a1e14b5334497941b997c25d0be57
parentbe77e1d5fe1abaaf70d886719a4084ea9c0c5eec
target/nios2: Prevent writes to read-only or reserved control fields

Create an array of masks which detail the writable and readonly
bits for each control register.  Apply them when writing to
control registers, including the write to status during eret.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20220421151735.31996-38-richard.henderson@linaro.org>
target/nios2/cpu.c
target/nios2/cpu.h
target/nios2/op_helper.c
target/nios2/translate.c