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: <1442961271.19102.289.camel@freescale.com>
Date:	Tue, 22 Sep 2015 17:34:31 -0500
From:	Scott Wood <scottwood@...escale.com>
To:	Christophe Leroy <christophe.leroy@....fr>
CC:	Joakim Tjernlund <joakim.tjernlund@...nsmode.se>,
	"paulus@...ba.org" <paulus@...ba.org>,
	"mpe@...erman.id.au" <mpe@...erman.id.au>,
	"benh@...nel.crashing.org" <benh@...nel.crashing.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>
Subject: Re: [PATCH v2 22/25] powerpc32: move xxxxx_dcache_range() functions
 inline

On Tue, 2015-09-22 at 22:57 +0200, Christophe Leroy wrote:
> Here is what I get in asm. First one is with "if (i) mb();". We see gcc 
> puts a beqlr. This is the form that is closest to what we had in the 
> former misc_32.S
> Second one if with "mb()". Here we get a branch to sync for a useless sync

I was more concerned with keeping the code simple than the asm output.

> c000e0ac <my_flush_dcache_range1>:
> c000e0ac:       54 63 00 36     rlwinm  r3,r3,0,0,27
> c000e0b0:       38 84 00 0f     addi    r4,r4,15
> c000e0b4:       7d 23 20 50     subf    r9,r3,r4
> c000e0b8:       55 29 e1 3f     rlwinm. r9,r9,28,4,31
> c000e0bc:       4d 82 00 20     beqlr
> c000e0c0:       7d 29 03 a6     mtctr   r9
> c000e0c4:       7c 00 18 6c     dcbst   0,r3
> c000e0c8:       38 63 00 10     addi    r3,r3,16
> c000e0cc:       42 00 ff f8     bdnz    c000e0c4 
> <my_flush_dcache_range1+0x18>
> c000e0d0:       7c 00 04 ac     sync
> c000e0d4:       4e 80 00 20     blr
> 
> c000e0d8 <my_flush_dcache_range2>:
> c000e0d8:       54 63 00 36     rlwinm  r3,r3,0,0,27
> c000e0dc:       38 84 00 0f     addi    r4,r4,15
> c000e0e0:       7d 23 20 50     subf    r9,r3,r4
> c000e0e4:       55 29 e1 3f     rlwinm. r9,r9,28,4,31
> c000e0e8:       41 82 00 14     beq     c000e0fc 
> <my_flush_dcache_range2+0x24>
> c000e0ec:       7d 29 03 a6     mtctr   r9
> c000e0f0:       7c 00 18 6c     dcbst   0,r3
> c000e0f4:       38 63 00 10     addi    r3,r3,16
> c000e0f8:       42 00 ff f8     bdnz    c000e0f0 
> <my_flush_dcache_range2+0x18>
> c000e0fc:       7c 00 04 ac     sync
> c000e100:       4e 80 00 20     blr

Who cares whether the case that should rarely if ever happen gets a beqlr or a
branch to sync+blr?

-Scott

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ