diff options
author | Palmer Dabbelt <palmerdabbelt@google.com> | 2021-01-22 19:34:29 -0800 |
---|---|---|
committer | Palmer Dabbelt <palmerdabbelt@google.com> | 2021-02-18 23:18:02 -0800 |
commit | 5dd671333171d1ba44c16e1404f72788412e36f4 (patch) | |
tree | e41905abd61331577a2add3263502d044029c028 /arch/riscv/kernel/probes/kprobes.c | |
parent | d4c34d09ab03e1e631fe195ddf35365a1273be9c (diff) |
RISC-V: probes: Treat the instruction stream as host-endian
Neither of these are actually correct: the instruction stream is defined
(for versions of the ISA manual newer than 2.2) as a stream of 16-bit
little-endian parcels, which is different than just being little-endian.
In theory we should represent this as a type, but we don't have any
concrete plans for the big endian stuff so it doesn't seem worth the
time -- we've got variants of this all over the place.
Instead I'm just dropping the unnecessary type conversion, which is a
NOP on LE systems but causes an sparse error as the types are all mixed
up.
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
Acked-by: Guo Ren <guoren@kernel.org>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
Diffstat (limited to 'arch/riscv/kernel/probes/kprobes.c')
-rw-r--r-- | arch/riscv/kernel/probes/kprobes.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/riscv/kernel/probes/kprobes.c b/arch/riscv/kernel/probes/kprobes.c index e60893bd87db..a2ec18662fee 100644 --- a/arch/riscv/kernel/probes/kprobes.c +++ b/arch/riscv/kernel/probes/kprobes.c @@ -57,7 +57,7 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p) } /* copy instruction */ - p->opcode = le32_to_cpu(*p->addr); + p->opcode = *p->addr; /* decode instruction */ switch (riscv_probe_decode_insn(p->addr, &p->ainsn.api)) { |