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]
Date:   Thu, 28 Jul 2022 21:30:42 +0800
From:   Xi Ruoyao <xry111@...111.site>
To:     Youling Tang <tangyouling@...ngson.cn>, loongarch@...ts.linux.dev
Cc:     linux-kernel@...r.kernel.org, WANG Xuerui <kernel@...0n.name>,
        Huacai Chen <chenhuacai@...nel.org>,
        Jinyang He <hejinyang@...ngson.cn>
Subject: Re: [PATCH v2 4/4] LoongArch: Support modules with new relocation
 types

On Thu, 2022-07-28 at 20:41 +0800, Youling Tang wrote:
> Unaligned is handled more efficiently before overflow checking, while
> being consistent with apply_r_larch_sop_imm_field.

Will move unaligned before overflow in V3.

> > +
> > +       *location &= ~(u32)0x3ffffff;
> > +       *location |= (offset >> 18) & 0x3ff;
> > +       *location |= ((offset >> 2) & 0xffff) << 10;
> 
> It may be better to use the loongarch_instruction format to modify the
> immediate field of the instruction, similar to the following:
> 
> union loongarch_instruction *insn = (union loongarch_instruction *)location;
> 
> offset >>= 2;
> insn->reg0i26_format.immediate_l = offset & 0xffff;
> insn->reg0i26_format.immediate_h = (offset >> 16) & 0x3ff;

Will use union loongarch_instruction in V3.  Why didn't I notice it
before? :(

Thanks for the review!

-- 
Xi Ruoyao <xry111@...111.site>
School of Aerospace Science and Technology, Xidian University

Powered by blists - more mailing lists