mirror of
https://github.com/torvalds/linux.git
synced 2024-11-25 13:41:51 +00:00
ef08c0fadd
After we fixed the uprobe inst endian in aarch_be, the sparse check report
the following warning info:
sparse warnings: (new ones prefixed by >>)
>> kernel/events/uprobes.c:223:25: sparse: sparse: restricted __le32 degrades to integer
>> kernel/events/uprobes.c:574:56: sparse: sparse: incorrect type in argument 4 (different base types)
@@ expected unsigned int [addressable] [usertype] opcode @@ got restricted __le32 [usertype] @@
kernel/events/uprobes.c:574:56: sparse: expected unsigned int [addressable] [usertype] opcode
kernel/events/uprobes.c:574:56: sparse: got restricted __le32 [usertype]
>> kernel/events/uprobes.c:1483:32: sparse: sparse: incorrect type in initializer (different base types)
@@ expected unsigned int [usertype] insn @@ got restricted __le32 [usertype] @@
kernel/events/uprobes.c:1483:32: sparse: expected unsigned int [usertype] insn
kernel/events/uprobes.c:1483:32: sparse: got restricted __le32 [usertype]
use the __le32 to u32 for uprobe_opcode_t, to keep the same.
Fixes: 60f07e22a7
("arm64:uprobe fix the uprobe SWBP_INSN in big-endian")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: junhua huang <huang.junhua@zte.com.cn>
Link: https://lore.kernel.org/r/202212280954121197626@zte.com.cn
Signed-off-by: Will Deacon <will@kernel.org>
34 lines
647 B
C
34 lines
647 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Copyright (C) 2014-2016 Pratyush Anand <panand@redhat.com>
|
|
*/
|
|
|
|
#ifndef _ASM_UPROBES_H
|
|
#define _ASM_UPROBES_H
|
|
|
|
#include <asm/debug-monitors.h>
|
|
#include <asm/insn.h>
|
|
#include <asm/probes.h>
|
|
|
|
#define MAX_UINSN_BYTES AARCH64_INSN_SIZE
|
|
|
|
#define UPROBE_SWBP_INSN cpu_to_le32(BRK64_OPCODE_UPROBES)
|
|
#define UPROBE_SWBP_INSN_SIZE AARCH64_INSN_SIZE
|
|
#define UPROBE_XOL_SLOT_BYTES MAX_UINSN_BYTES
|
|
|
|
typedef __le32 uprobe_opcode_t;
|
|
|
|
struct arch_uprobe_task {
|
|
};
|
|
|
|
struct arch_uprobe {
|
|
union {
|
|
u8 insn[MAX_UINSN_BYTES];
|
|
u8 ixol[MAX_UINSN_BYTES];
|
|
};
|
|
struct arch_probe_insn api;
|
|
bool simulate;
|
|
};
|
|
|
|
#endif
|