diff options
author | Edgar E. Iglesias <edgar.iglesias@xilinx.com> | 2020-08-17 19:07:19 +0200 |
---|---|---|
committer | Edgar E. Iglesias <edgar.iglesias@xilinx.com> | 2020-08-24 10:47:27 +0200 |
commit | b4919e7dd32ccee3b807b6860bb72f91cd19f063 (patch) | |
tree | aa3c23117809e92baeb8584a1a9b4ffcd30f3dd9 /target/microblaze | |
parent | d449561b130848ad002f7d4c72abf5531ba7222a (diff) |
target/microblaze: mbar: Trap sleeps from user-space
Trap mbar-sleeps from user-space.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reported-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Diffstat (limited to 'target/microblaze')
-rw-r--r-- | target/microblaze/translate.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index 530c15e5ad..a96cb21d96 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -1250,6 +1250,11 @@ static void dec_br(DisasContext *dc) LOG_DIS("sleep\n"); + if (trap_userspace(dc, true)) { + /* Sleep is a privileged instruction. */ + return; + } + t_sync_flags(dc); tcg_gen_st_i32(tmp_1, cpu_env, -offsetof(MicroBlazeCPU, env) |