Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/crypto/aes/arch Use .p2align rather than .align.



details:   https://anonhg.NetBSD.org/src/rev/181262a51d75
branches:  trunk
changeset: 1011471:181262a51d75
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Tue Jun 30 21:41:03 2020 +0000

description:
Use .p2align rather than .align.

Apparently on arm, .align is actually an alias for .p2align, taking a
power of two rather than a number of bytes, so aes_armv8_64.o was
bloated to 32KB with obscene alignment when it only needed to be
barely past 4KB.

Do the same for the x86 aes_ni_64.S -- even though .align takes a
number of bytes rather than a power of two on x86, let's just stay
away from the temptations of the evil .align directive.

diffstat:

 sys/crypto/aes/arch/arm/aes_armv8_64.S |  12 ++++++------
 sys/crypto/aes/arch/x86/aes_ni_64.S    |   4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

diffs (72 lines):

diff -r 2c2a4ed1d394 -r 181262a51d75 sys/crypto/aes/arch/arm/aes_armv8_64.S
--- a/sys/crypto/aes/arch/arm/aes_armv8_64.S    Tue Jun 30 21:27:18 2020 +0000
+++ b/sys/crypto/aes/arch/arm/aes_armv8_64.S    Tue Jun 30 21:41:03 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: aes_armv8_64.S,v 1.1 2020/06/29 23:31:41 riastradh Exp $       */
+/*     $NetBSD: aes_armv8_64.S,v 1.2 2020/06/30 21:41:03 riastradh Exp $       */
 
 /*-
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
  *     secret.
  */
        .section .rodata
-       .align  4
+       .p2align 2
        .type   rcon,@object
 rcon:
        .long   0x01
@@ -63,7 +63,7 @@
  *     RotWord on word 1, and then copy it into all the other words.
  */
        .section .rodata
-       .align  16
+       .p2align 4
        .type   unshiftrows_rotword_1,@object
 unshiftrows_rotword_1:
        .byte   0x01,0x0e,0x0b,0x04
@@ -79,7 +79,7 @@
  *     3 into all the other words.
  */
        .section .rodata
-       .align  16
+       .p2align 4
        .type   unshiftrows_3,@object
 unshiftrows_3:
        .byte   0x0c,0x09,0x06,0x03
@@ -95,7 +95,7 @@
  *     RotWord on word 3, and then copy it into all the other words.
  */
        .section .rodata
-       .align  16
+       .p2align 4
        .type   unshiftrows_rotword_3,@object
 unshiftrows_rotword_3:
        .byte   0x09,0x06,0x03,0x0c
@@ -846,7 +846,7 @@
 END(aesarmv8_xts_mulx)
 
        .section .rodata
-       .align  16
+       .p2align 4
        .type   xtscarry,@object
 xtscarry:
        .byte   0x87,0,0,0, 0,0,0,0,  1,0,0,0, 0,0,0,0
diff -r 2c2a4ed1d394 -r 181262a51d75 sys/crypto/aes/arch/x86/aes_ni_64.S
--- a/sys/crypto/aes/arch/x86/aes_ni_64.S       Tue Jun 30 21:27:18 2020 +0000
+++ b/sys/crypto/aes/arch/x86/aes_ni_64.S       Tue Jun 30 21:41:03 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: aes_ni_64.S,v 1.1 2020/06/29 23:29:40 riastradh Exp $  */
+/*     $NetBSD: aes_ni_64.S,v 1.2 2020/06/30 21:41:04 riastradh Exp $  */
 
 /*-
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -930,7 +930,7 @@
 END(aesni_xts_mulx)
 
        .section .rodata
-       .align 16
+       .p2align 4
        .type   xtscarry,@object
 xtscarry:
        .byte   0x87,0,0,0, 0,0,0,0,  1,0,0,0, 0,0,0,0



Home | Main Index | Thread Index | Old Index