lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <993a2d7e-d7a2-3017-5a81-517ef6f85049@loongson.cn>
Date:   Mon, 24 Apr 2023 09:19:05 +0800
From:   Tiezhu Yang <yangtiezhu@...ngson.cn>
To:     Huacai Chen <chenhuacai@...nel.org>
Cc:     WANG Xuerui <kernel@...0n.name>, loongarch@...ts.linux.dev,
        linux-kernel@...r.kernel.org, loongson-kernel@...ts.loongnix.cn
Subject: Re: [PATCH v3 4/6] LoongArch: Add uprobes support



On 04/23/2023 09:12 PM, Huacai Chen wrote:
> Hi, Tiezhu,
>
> On Wed, Apr 19, 2023 at 5:57 PM Tiezhu Yang <yangtiezhu@...ngson.cn> wrote:
>>
>> Uprobes is the user-space counterpart to kprobes, this commit
>> adds uprobes support for LoongArch.

...

>> +#define MAX_UINSN_BYTES                8
>> +#define UPROBE_XOL_SLOT_BYTES  MAX_UINSN_BYTES
> In old versions we define UPROBE_XOL_SLOT_BYTES to 128, why we use 8 now?

I assume "the old version" maybe comes from mips, I am not quite sure 
the backgrounds. For LoongArch, there are 2 xol slots to save 2 
instructions, each of them is 32 bit, 2*32bit=8bytes, so 
UPROBE_XOL_SLOT_BYTES can be 8.

>> +
>> +#define UPROBE_XOLBP_INSN      larch_insn_gen_break(BRK_UPROBE_XOLBP)
>> +#define UPROBE_SWBP_INSN       larch_insn_gen_break(BRK_UPROBE_BP)
>> +#define UPROBE_SWBP_INSN_SIZE  LOONGARCH_INSN_SIZE

...

>>         case BRK_UPROBE_XOLBP:
>> -               if (notify_die(DIE_UPROBE_XOL, "Uprobe_XOL", regs, bcode,
>> -                              current->thread.trap_nr, SIGTRAP) == NOTIFY_STOP)
>> +               if (uprobe_singlestep_handler(regs))
> As I know, XOL means "execute out of line", is it an alias of "single step"?

I think so, the instruction filled in xol slots is to single step, 
arm64, riscv, csky also uses "single step" for the related code, 
powerpc, s390 uses "DIE_SSTEP".

Thanks,
Tiezhu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ