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: <6e6a7219-8666-bd9e-770a-e60e4b329832@loongson.cn>
Date:   Tue, 2 Aug 2022 09:30:00 +0800
From:   Youling Tang <tangyouling@...ngson.cn>
To:     Huacai Chen <chenhuacai@...nel.org>,
        Qing Zhang <zhangqing@...ngson.cn>
Cc:     WANG Xuerui <kernel@...0n.name>, loongarch@...ts.linux.dev,
        LKML <linux-kernel@...r.kernel.org>,
        Jiaxun Yang <jiaxun.yang@...goat.com>,
        Jinyang He <hejinyang@...ngson.cn>
Subject: Re: [PATCH 2/4] LoongArch: Add prologue unwinder support



On 08/01/2022 11:26 PM, Huacai Chen wrote:
>> diff --git a/arch/loongarch/include/asm/unwind.h b/arch/loongarch/include/asm/unwind.h
>> index 243330b39d0d..f9f73a26504e 100644
>> --- a/arch/loongarch/include/asm/unwind.h
>> +++ b/arch/loongarch/include/asm/unwind.h
>> @@ -14,6 +14,14 @@
>>  struct unwind_state {
>>         struct stack_info stack_info;
>>         struct task_struct *task;
>> +#if defined(CONFIG_UNWINDER_PROLOGUE)
>> +       unsigned long ra;
>> +       bool enable;
>> +       /*
>> +        * Enable is the prologue analysis method
>> +        * otherwise is the way to guess.
>> +        */
>> +#endif
>>         unsigned long sp, pc;
>>         bool first;
>>         bool error;
> This data struct makes me very uncomfortable, especially "enable" and
> the #ifdef, maybe we can rework it like this?
>
> #define UNWINDER_GUESS     0
> #define UNWINDER_PROLOGURE 1

Maybe it's better to define with enum type?
enum unwind_type {
	UNWINDER_GUESS,
	UNWINDER_PROLOGURE,
};

Youling

> struct unwind_state {
>         char type; /* UNWINDER_xxx */
>         bool first, error;
>         unsigned long sp, pc, ra;
>         struct task_struct *task;
>         struct stack_info stack_info;
> };
>
> Huacai

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ