Module Name: src
Committed By: riastradh
Date: Tue Jun 30 21:41:04 UTC 2020
Modified Files:
src/sys/crypto/aes/arch/arm: aes_armv8_64.S
src/sys/crypto/aes/arch/x86: aes_ni_64.S
Log Message:
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.
To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/crypto/aes/arch/arm/aes_armv8_64.S
cvs rdiff -u -r1.1 -r1.2 src/sys/crypto/aes/arch/x86/aes_ni_64.S
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/crypto/aes/arch/arm/aes_armv8_64.S
diff -u src/sys/crypto/aes/arch/arm/aes_armv8_64.S:1.1 src/sys/crypto/aes/arch/arm/aes_armv8_64.S:1.2
--- src/sys/crypto/aes/arch/arm/aes_armv8_64.S:1.1 Mon Jun 29 23:31:41 2020
+++ src/sys/crypto/aes/arch/arm/aes_armv8_64.S Tue Jun 30 21:41:03 2020
@@ -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 @@ END(rcon)
* 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 @@ END(unshiftrows_rotword_1)
* 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 @@ END(unshiftrows_3)
* 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 @@ aesarmv8_xts_mulx:
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
Index: src/sys/crypto/aes/arch/x86/aes_ni_64.S
diff -u src/sys/crypto/aes/arch/x86/aes_ni_64.S:1.1 src/sys/crypto/aes/arch/x86/aes_ni_64.S:1.2
--- src/sys/crypto/aes/arch/x86/aes_ni_64.S:1.1 Mon Jun 29 23:29:40 2020
+++ src/sys/crypto/aes/arch/x86/aes_ni_64.S Tue Jun 30 21:41:04 2020
@@ -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 @@ aesni_xts_mulx:
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