mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 04:10:18 +09:00
Revert "arm64: probes: Fix uprobes for big-endian kernels"
This reverts commit 14841bb7a5 which is
commit 13f8f1e05f1dc36dbba6cba0ae03354c0dafcde7 upstream.
It breaks the Android kernel abi and can be brought back in the future
in an abi-safe way if it is really needed.
Bug: 161946584
Change-Id: I3e6141d5184c37814b1ea62f3e2966e97e3e3932
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
@@ -10,9 +10,11 @@
|
|||||||
#include <asm/insn.h>
|
#include <asm/insn.h>
|
||||||
#include <asm/probes.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 cpu_to_le32(BRK64_OPCODE_UPROBES)
|
||||||
#define UPROBE_SWBP_INSN_SIZE AARCH64_INSN_SIZE
|
#define UPROBE_SWBP_INSN_SIZE AARCH64_INSN_SIZE
|
||||||
#define UPROBE_XOL_SLOT_BYTES AARCH64_INSN_SIZE
|
#define UPROBE_XOL_SLOT_BYTES MAX_UINSN_BYTES
|
||||||
|
|
||||||
typedef u32 uprobe_opcode_t;
|
typedef u32 uprobe_opcode_t;
|
||||||
|
|
||||||
@@ -21,8 +23,8 @@ struct arch_uprobe_task {
|
|||||||
|
|
||||||
struct arch_uprobe {
|
struct arch_uprobe {
|
||||||
union {
|
union {
|
||||||
__le32 insn;
|
u8 insn[MAX_UINSN_BYTES];
|
||||||
__le32 ixol;
|
u8 ixol[MAX_UINSN_BYTES];
|
||||||
};
|
};
|
||||||
struct arch_probe_insn api;
|
struct arch_probe_insn api;
|
||||||
bool simulate;
|
bool simulate;
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ int arch_uprobe_analyze_insn(struct arch_uprobe *auprobe, struct mm_struct *mm,
|
|||||||
else if (!IS_ALIGNED(addr, AARCH64_INSN_SIZE))
|
else if (!IS_ALIGNED(addr, AARCH64_INSN_SIZE))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
insn = le32_to_cpu(auprobe->insn);
|
insn = *(probe_opcode_t *)(&auprobe->insn[0]);
|
||||||
|
|
||||||
switch (arm_probe_decode_insn(insn, &auprobe->api)) {
|
switch (arm_probe_decode_insn(insn, &auprobe->api)) {
|
||||||
case INSN_REJECTED:
|
case INSN_REJECTED:
|
||||||
@@ -108,7 +108,7 @@ bool arch_uprobe_skip_sstep(struct arch_uprobe *auprobe, struct pt_regs *regs)
|
|||||||
if (!auprobe->simulate)
|
if (!auprobe->simulate)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
insn = le32_to_cpu(auprobe->insn);
|
insn = *(probe_opcode_t *)(&auprobe->insn[0]);
|
||||||
addr = instruction_pointer(regs);
|
addr = instruction_pointer(regs);
|
||||||
|
|
||||||
if (auprobe->api.handler)
|
if (auprobe->api.handler)
|
||||||
|
|||||||
Reference in New Issue
Block a user