diff options
author | Tiezhu Yang <yangtiezhu@loongson.cn> | 2023-06-29 20:58:44 +0800 |
---|---|---|
committer | Huacai Chen <chenhuacai@loongson.cn> | 2023-06-29 20:58:44 +0800 |
commit | b82fad4d5deb2c2a15fdb581a1e6725dcea666e7 (patch) | |
tree | 6164aec71b77cf5e8bd2be1c3d6f4f48cec09a48 /arch/loongarch/kernel | |
parent | 3d2c3daf82544283c5597028a8a3efc9ac0fb02b (diff) |
LoongArch: Check for AMO instructions in insns_not_supported()
Like llsc instructions, the atomic memory access instructions shouldn't
be supported for probing, so check for them in insns_not_supported().
Closes: https://lore.kernel.org/all/SY4P282MB351877A70A0333C790FE85A5C09C9@SY4P282MB3518.AUSP282.PROD.OUTLOOK.COM/
Tested-by: Jeff Xie <xiehuan09@gmail.com>
Reported-by: Hengqi Chen <hengqi.chen@gmail.com>
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Diffstat (limited to 'arch/loongarch/kernel')
-rw-r--r-- | arch/loongarch/kernel/inst.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/loongarch/kernel/inst.c b/arch/loongarch/kernel/inst.c index 18e197515d7f..a3169cf1cc31 100644 --- a/arch/loongarch/kernel/inst.c +++ b/arch/loongarch/kernel/inst.c @@ -135,6 +135,12 @@ void simu_branch(struct pt_regs *regs, union loongarch_instruction insn) bool insns_not_supported(union loongarch_instruction insn) { + switch (insn.reg3_format.opcode) { + case amswapw_op ... ammindbdu_op: + pr_notice("atomic memory access instructions are not supported\n"); + return true; + } + switch (insn.reg2i14_format.opcode) { case llw_op: case lld_op: |