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:   Mon, 05 Sep 2022 16:15:07 +0530
From:   "Naveen N. Rao" <naveen.n.rao@...ux.vnet.ibm.com>
To:     Christophe Leroy <christophe.leroy@...roup.eu>,
        Segher Boessenkool <segher@...nel.crashing.org>
Cc:     "aik@...abs.ru" <aik@...abs.ru>,
        "chenzhongjin@...wei.com" <chenzhongjin@...wei.com>,
        "jpoimboe@...hat.com" <jpoimboe@...hat.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
        "mbenes@...e.cz" <mbenes@...e.cz>,
        "mingo@...hat.com" <mingo@...hat.com>,
        "npiggin@...il.com" <npiggin@...il.com>,
        "peterz@...radead.org" <peterz@...radead.org>,
        "rostedt@...dmis.org" <rostedt@...dmis.org>,
        Sathvika Vasireddy <sv@...ux.ibm.com>
Subject: Re: [PATCH v2 16/16] objtool/powerpc: Add --mcount specific
 implementation

Segher Boessenkool wrote:
> On Wed, Aug 31, 2022 at 12:50:07PM +0000, Christophe Leroy wrote:
>> Le 29/08/2022 à 07:52, Sathvika Vasireddy a écrit :
>> > +	opcode = insn >> 26;
>> > +
>> > +	switch (opcode) {
>> > +	case 18: /* bl */
>> 
>> case 18 is more than 'bl', it includes also 'b'.
>> In both cases, the calculation of *immediate is the same.
> 
> It also is "ba" and "bla", sometimes written as "b[l][a]".
> 
>> It would therefore be more correct to perform the calculation and setup 
>> of *immediate outside the 'if ((insn & 3) == 1)', that would avoid 
>> unnecessary churn the day we add support for branches without link.

Yeah, and probably move the comments around:

+	case 18: /* b[l][a] */
+		if ((insn & 3) == 1) { /* bl */

>> 
>> > +		if ((insn & 3) == 1) {
>> > +			*type = INSN_CALL;
>> > +			*immediate = insn & 0x3fffffc;
>> > +			if (*immediate & 0x2000000)
>> > +				*immediate -= 0x4000000;
>> > +		}
>> > +		break;
>> > +	}
> 
> Does this handle AA=1 correctly at all?  That is valid both with and
> without relocations, just like AA=0.  Same for AA=1 LK=0 btw.
> 
> If you only handle AA=0, the code should explicitly test for that.

The code does test for AA=0 LK=1 with the if statement there?


- Naveen

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ