Skip to contentSkip to conversation

crypto - some SPDX cleanups for arch code

PATCH In review Ard Biesheuvel 4 participants 10 messages Jun 6, 2023 – Jun 23, 2023

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover crypto - some SPDX cleanups for arch code

Some SPDX cleanups for the arch crypto code on ARM, arm64 and x86

Ard Biesheuvel (3):
crypto: arm64 - add some missing SPDX headers
crypto: arm - add some missing SPDX headers
crypto: x86 - add some missing SPDX headers

 arch/arm/crypto/chacha-neon-core.S          | 10 +----
 arch/arm/crypto/crc32-ce-core.S             | 30 ++-----------
 arch/arm/crypto/crct10dif-ce-core.S         | 40 +----------------
 arch/arm64/crypto/chacha-neon-core.S        | 10 +----
 arch/arm64/crypto/chacha-neon-glue.c        | 10 +----
 arch/arm64/crypto/crct10dif-ce-core.S       | 40 +----------------
 arch/x86/crypto/aesni-intel_avx-x86_64.S    | 36 +--------------
 arch/x86/crypto/camellia-aesni-avx-asm_64.S |  7 +--
 arch/x86/crypto/crc32-pclmul_glue.c         | 24 +---------
 arch/x86/crypto/crc32c-pcl-intel-asm_64.S   | 29 +-----------
 arch/x86/crypto/crct10dif-pcl-asm_64.S      | 36 +--------------
 arch/x86/crypto/crct10dif-pclmul_glue.c     | 16 +------
 arch/x86/crypto/sha1_avx2_x86_64_asm.S      | 46 +-------------------
 arch/x86/crypto/sha1_ni_asm.S               | 46 +-------------------
 arch/x86/crypto/sha256-avx-asm.S            | 28 +-----------
 arch/x86/crypto/sha256-avx2-asm.S           | 29 +-----------
 arch/x86/crypto/sha256-ssse3-asm.S          | 29 +-----------
 arch/x86/crypto/sha256_ni_asm.S             | 46 +-------------------
 arch/x86/crypto/sha256_ssse3_glue.c         | 15 +------
 arch/x86/crypto/sha512-avx-asm.S            | 29 +-----------
 arch/x86/crypto/sha512-avx2-asm.S           | 29 +-----------
 arch/x86/crypto/sha512-ssse3-asm.S          | 29 +-----------
 arch/x86/crypto/sha512_ssse3_glue.c         | 16 +------
 arch/x86/crypto/twofish_glue.c              | 16 +------
 24 files changed, 26 insertions(+), 620 deletions(-)
Signature · 1 line
2.39.2
#1 lore raw

PATCH 1/3 crypto: arm64 - add some missing SPDX headers

Add some missing SPDX headers, and drop the associated boilerplate license text to/from the arm64 implementations of ChaCha and CRC-T10DIF.

---
 arch/arm64/crypto/chacha-neon-core.S  | 10 +----
 arch/arm64/crypto/chacha-neon-glue.c  | 10 +----
 arch/arm64/crypto/crct10dif-ce-core.S | 40 +-------------------
 3 files changed, 3 insertions(+), 57 deletions(-)
arch/arm64/crypto/chacha-neon-core.S +1 -9
index b70ac76f2610ce08..400c6239321aa7bc 100644
@@ -1,21 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
 /*
  * ChaCha/XChaCha NEON helper functions
  *
  * Copyright (C) 2016-2018 Linaro, Ltd. <[email protected]>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
  * Originally based on:
  * ChaCha20 256-bit cipher algorithm, RFC7539, x64 SSSE3 functions
  *
  * Copyright (C) 2015 Martin Willi
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
  */
 
 #include <linux/linkage.h>
arch/arm64/crypto/chacha-neon-glue.c +1 -9
index af2bbca38e70fb35..c61152d6d9bd2137 100644
@@ -1,22 +1,14 @@
+// SPDX-License-Identifier: GPL-2.0-only
 /*
  * ARM NEON and scalar accelerated ChaCha and XChaCha stream ciphers,
  * including ChaCha20 (RFC7539)
  *
  * Copyright (C) 2016 - 2017 Linaro, Ltd. <[email protected]>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
  * Based on:
  * ChaCha20 256-bit cipher algorithm, RFC7539, SIMD glue code
  *
  * Copyright (C) 2015 Martin Willi
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
  */
 
 #include <crypto/algapi.h>
arch/arm64/crypto/crct10dif-ce-core.S +1 -39
index 5604de61d06d04ee..bebdf4c72a5013c2 100644
@@ -1,13 +1,10 @@
+/* SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause */
 //
 // Accelerated CRC-T10DIF using arm64 NEON and Crypto Extensions instructions
 //
 // Copyright (C) 2016 Linaro Ltd <[email protected]>
 // Copyright (C) 2019 Google LLC <[email protected]>
 //
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2 as
-// published by the Free Software Foundation.
-//
 
 // Derived from the x86 version:
 //
@@ -21,41 +18,6 @@
 //     James Guilford <[email protected]>
 //     Tim Chen <[email protected]>
 //
-// This software is available to you under a choice of one of two
-// licenses.  You may choose to be licensed under the terms of the GNU
-// General Public License (GPL) Version 2, available from the file
-// COPYING in the main directory of this source tree, or the
-// OpenIB.org BSD license below:
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-//   notice, this list of conditions and the following disclaimer.
-//
-// * Redistributions in binary form must reproduce the above copyright
-//   notice, this list of conditions and the following disclaimer in the
-//   documentation and/or other materials provided with the
-//   distribution.
-//
-// * Neither the name of the Intel Corporation nor the names of its
-//   contributors may be used to endorse or promote products derived from
-//   this software without specific prior written permission.
-//
-//
-// THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION ""AS IS"" AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION OR
-// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
 //       Reference paper titled "Fast CRC Computation for Generic
 //	Polynomials Using PCLMULQDQ Instruction"
 //       URL: http://www.intel.com/content/dam/www/public/us/en/documents
Signature · 1 line
2.39.2
#2 lore raw

PATCH 2/3 crypto: arm - add some missing SPDX headers

In reply to Ard Biesheuvel

Add some missing SPDX headers, and drop the associated boilerplate license text to/from the ARM implementations of ChaCha, CRC-32 and CRC-T10DIF.

---
 arch/arm/crypto/chacha-neon-core.S  | 10 +----
 arch/arm/crypto/crc32-ce-core.S     | 30 ++-------------
 arch/arm/crypto/crct10dif-ce-core.S | 40 +-------------------
 3 files changed, 5 insertions(+), 75 deletions(-)
arch/arm/crypto/chacha-neon-core.S +1 -9
index 13d12f672656bb8d..46d708118ef948ec 100644
@@ -1,21 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
 /*
  * ChaCha/XChaCha NEON helper functions
  *
  * Copyright (C) 2016 Linaro, Ltd. <[email protected]>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
  * Based on:
  * ChaCha20 256-bit cipher algorithm, RFC7539, x64 SSE3 functions
  *
  * Copyright (C) 2015 Martin Willi
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
  */
 
  /*
arch/arm/crypto/crc32-ce-core.S +3 -27
index 3f13a76b9066e0f6..228a1f298f24d3d0 100644
@@ -1,37 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
 /*
  * Accelerated CRC32(C) using ARM CRC, NEON and Crypto Extensions instructions
  *
  * Copyright (C) 2016 Linaro Ltd <[email protected]>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-/* GPL HEADER START
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 only,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License version 2 for more details (a copy is included
- * in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU General Public License
- * version 2 along with this program; If not, see http://www.gnu.org/licenses
- *
- * Please  visit http://www.xyratex.com/contact if you need additional
- * information or have any questions.
- *
- * GPL HEADER END
  */
 
 /*
+ * Derived from the x86 SSE version:
+ *
  * Copyright 2012 Xyratex Technology Limited
  *
  * Using hardware provided PCLMULQDQ instruction to accelerate the CRC32
arch/arm/crypto/crct10dif-ce-core.S +1 -39
index 46c02c518a300ab0..5d24448fae1ccacb 100644
@@ -1,13 +1,10 @@
+/* SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause */
 //
 // Accelerated CRC-T10DIF using ARM NEON and Crypto Extensions instructions
 //
 // Copyright (C) 2016 Linaro Ltd <[email protected]>
 // Copyright (C) 2019 Google LLC <[email protected]>
 //
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2 as
-// published by the Free Software Foundation.
-//
 
 // Derived from the x86 version:
 //
@@ -21,41 +18,6 @@
 //     James Guilford <[email protected]>
 //     Tim Chen <[email protected]>
 //
-// This software is available to you under a choice of one of two
-// licenses.  You may choose to be licensed under the terms of the GNU
-// General Public License (GPL) Version 2, available from the file
-// COPYING in the main directory of this source tree, or the
-// OpenIB.org BSD license below:
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-//   notice, this list of conditions and the following disclaimer.
-//
-// * Redistributions in binary form must reproduce the above copyright
-//   notice, this list of conditions and the following disclaimer in the
-//   documentation and/or other materials provided with the
-//   distribution.
-//
-// * Neither the name of the Intel Corporation nor the names of its
-//   contributors may be used to endorse or promote products derived from
-//   this software without specific prior written permission.
-//
-//
-// THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION ""AS IS"" AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION OR
-// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
 //       Reference paper titled "Fast CRC Computation for Generic
 //	Polynomials Using PCLMULQDQ Instruction"
 //       URL: http://www.intel.com/content/dam/www/public/us/en/documents
Signature · 1 line
2.39.2
#3 lore raw

Re: [PATCH 2/3] crypto: arm - add some missing SPDX headers

[also Cc'ing Richard]

Quoted 26 lines · Ard Biesheuvel

Add some missing SPDX headers, and drop the associated boilerplate license text to/from the ARM implementations of ChaCha, CRC-32 and CRC-T10DIF.

---
 arch/arm/crypto/chacha-neon-core.S  | 10 +----
 arch/arm/crypto/crc32-ce-core.S     | 30 ++-------------
 arch/arm/crypto/crct10dif-ce-core.S | 40 +-------------------
 3 files changed, 5 insertions(+), 75 deletions(-)
arch/arm/crypto/chacha-neon-core.S +1 -4
index 13d12f672656bb8d..46d708118ef948ec 100644
@@ -1,21 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
 /*
  * ChaCha/XChaCha NEON helper functions
  *
  * Copyright (C) 2016 Linaro, Ltd. <[email protected]>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *

arch/arm/crypto/chacha-neon-core.S line 11

Quoted 10 lines
arch/arm/crypto/chacha-neon-core.S +0 -5
  * Based on:
  * ChaCha20 256-bit cipher algorithm, RFC7539, x64 SSE3 functions
  *
  * Copyright (C) 2015 Martin Willi
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
  */

I think above makes sense, since I had to pick the most restrictive one to satisfy both license option (GPL-2.0+ or GPL-2.0-only).

Quoted 30 lines
arch/arm/crypto/chacha-neon-core.S +0 -0
  /*
arch/arm/crypto/crc32-ce-core.S +1 -18
index 3f13a76b9066e0f6..228a1f298f24d3d0 100644
@@ -1,37 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
 /*
  * Accelerated CRC32(C) using ARM CRC, NEON and Crypto Extensions instructions
  *
  * Copyright (C) 2016 Linaro Ltd <[email protected]>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-/* GPL HEADER START
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 only,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License version 2 for more details (a copy is included

arch/arm/crypto/crc32-ce-core.S line 6

Quoted 10 lines
arch/arm/crypto/crc32-ce-core.S +0 -9
- * in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU General Public License
- * version 2 along with this program; If not, see http://www.gnu.org/licenses
- *
- * Please  visit http://www.xyratex.com/contact if you need additional
- * information or have any questions.
- *
- * GPL HEADER END
  */

Removing second boilerplate for which the text says it musn't be removed?

Quoted 55 lines
arch/arm/crypto/crc32-ce-core.S +2 -0
 /*
+ * Derived from the x86 SSE version:
+ *
  * Copyright 2012 Xyratex Technology Limited
  *
  * Using hardware provided PCLMULQDQ instruction to accelerate the CRC32
arch/arm/crypto/crct10dif-ce-core.S +1 -29
index 46c02c518a300ab0..5d24448fae1ccacb 100644
@@ -1,13 +1,10 @@
+/* SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause */
 //
 // Accelerated CRC-T10DIF using ARM NEON and Crypto Extensions instructions
 //
 // Copyright (C) 2016 Linaro Ltd <[email protected]>
 // Copyright (C) 2019 Google LLC <[email protected]>
 //
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2 as
-// published by the Free Software Foundation.
-//
 
 // Derived from the x86 version:
 //
@@ -21,41 +18,6 @@
 //     James Guilford <[email protected]>
 //     Tim Chen <[email protected]>
 //
-// This software is available to you under a choice of one of two
-// licenses.  You may choose to be licensed under the terms of the GNU
-// General Public License (GPL) Version 2, available from the file
-// COPYING in the main directory of this source tree, or the
-// OpenIB.org BSD license below:
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-//   notice, this list of conditions and the following disclaimer.
-//
-// * Redistributions in binary form must reproduce the above copyright
-//   notice, this list of conditions and the following disclaimer in the
-//   documentation and/or other materials provided with the
-//   distribution.
-//
-// * Neither the name of the Intel Corporation nor the names of its
-//   contributors may be used to endorse or promote products derived from
-//   this software without specific prior written permission.
-//
-//
-// THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION ""AS IS"" AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE

arch/arm/crypto/crct10dif-ce-core.S line 58

Quoted 10 lines
arch/arm/crypto/crct10dif-ce-core.S +0 -10
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION OR
-// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//

This dual BSD/GPL one LGTM.

Thanks.

Signature · 1 line
An old man doll... just what I always wanted! - Clara
#4 lore raw

Re: [PATCH 2/3] crypto: arm - add some missing SPDX headers

Quoted 35 lines · Bagas Sanjaya

[also Cc'ing Richard]

Quoted 31 lines · Ard Biesheuvel

Add some missing SPDX headers, and drop the associated boilerplate license text to/from the ARM implementations of ChaCha, CRC-32 and CRC-T10DIF.

---
 arch/arm/crypto/chacha-neon-core.S  | 10 +----
 arch/arm/crypto/crc32-ce-core.S     | 30 ++-------------
 arch/arm/crypto/crct10dif-ce-core.S | 40 +-------------------
 3 files changed, 5 insertions(+), 75 deletions(-)
arch/arm/crypto/chacha-neon-core.S +1 -5
index 13d12f672656bb8d..46d708118ef948ec 100644
@@ -1,21 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
 /*
  * ChaCha/XChaCha NEON helper functions
  *
  * Copyright (C) 2016 Linaro, Ltd. <[email protected]>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
  * Based on:
  * ChaCha20 256-bit cipher algorithm, RFC7539, x64 SSE3 functions
  *
  * Copyright (C) 2015 Martin Willi
- *
Quoted 8 lines

arch/arm/crypto/chacha-neon-core.S line 11

Quoted 5 lines
arch/arm/crypto/chacha-neon-core.S +0 -4
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
  */

I think above makes sense, since I had to pick the most restrictive one to satisfy both license option (GPL-2.0+ or GPL-2.0-only).

I am not sure "had to pick the most restrictive one" is necessarily correct - the kernel could adopt that approach but I don't think there's any reason why you can't have multiple
SPDX-License-Identifier: lines in a single source file, and it is also syntactically valid to use
SPDX-License-Identifier: GPL-2.0-only AND GPL-2.0-or-later

Richard

#5 lore raw

Re: [PATCH 2/3] crypto: arm - add some missing SPDX headers

Quoted 46 lines · Richard Fontana
Quoted 35 lines · Bagas Sanjaya

[also Cc'ing Richard]

Quoted 31 lines · Ard Biesheuvel

Add some missing SPDX headers, and drop the associated boilerplate license text to/from the ARM implementations of ChaCha, CRC-32 and CRC-T10DIF.

---
 arch/arm/crypto/chacha-neon-core.S  | 10 +----
 arch/arm/crypto/crc32-ce-core.S     | 30 ++-------------
 arch/arm/crypto/crct10dif-ce-core.S | 40 +-------------------
 3 files changed, 5 insertions(+), 75 deletions(-)
arch/arm/crypto/chacha-neon-core.S +1 -5
index 13d12f672656bb8d..46d708118ef948ec 100644
@@ -1,21 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
 /*
  * ChaCha/XChaCha NEON helper functions
  *
  * Copyright (C) 2016 Linaro, Ltd. <[email protected]>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
  * Based on:
  * ChaCha20 256-bit cipher algorithm, RFC7539, x64 SSE3 functions
  *
  * Copyright (C) 2015 Martin Willi
- *
Quoted 8 lines

arch/arm/crypto/chacha-neon-core.S line 11

Quoted 5 lines
arch/arm/crypto/chacha-neon-core.S +0 -4
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
  */

I think above makes sense, since I had to pick the most restrictive one to satisfy both license option (GPL-2.0+ or GPL-2.0-only).

Quoted 7 lines

I am not sure "had to pick the most restrictive one" is necessarily correct - the kernel could adopt that approach but I don't think there's any reason why you can't have multiple
SPDX-License-Identifier: lines in a single source file, and it is also syntactically valid to use
SPDX-License-Identifier: GPL-2.0-only AND GPL-2.0-or-later

For the record, my reasoning was that my code (which is a rewrite of the algorithm using a completely different ISA) is the derived work, and I am permitted to exercise my right granted by the original work to redistribute it under the GPLv2. So this is why the 'outer' license (as well a the SPDX header) is GPLv2 only.

I didn't expect there to be a requirement for SPDX to describe the original licenses of all the constituent parts.

In any case, I am going to take Greg's advice and not pursue this any further - if anyone needs this cleaned up, they can do it themselves.

Thanks for the education on this topic, I'll know better next time :-)

#6 lore raw

PATCH 3/3 crypto: x86 - add some missing SPDX headers

In reply to Ard Biesheuvel

Add some missing SPDX headers, and drop the associated boilerplate license text to/from the x86 accelerated implementations of various crypto algorithms.

---
 arch/x86/crypto/aesni-intel_avx-x86_64.S    | 36 +--------------
 arch/x86/crypto/camellia-aesni-avx-asm_64.S |  7 +--
 arch/x86/crypto/crc32-pclmul_glue.c         | 24 +---------
 arch/x86/crypto/crc32c-pcl-intel-asm_64.S   | 29 +-----------
 arch/x86/crypto/crct10dif-pcl-asm_64.S      | 36 +--------------
 arch/x86/crypto/crct10dif-pclmul_glue.c     | 16 +------
 arch/x86/crypto/sha1_avx2_x86_64_asm.S      | 46 +-------------------
 arch/x86/crypto/sha1_ni_asm.S               | 46 +-------------------
 arch/x86/crypto/sha256-avx-asm.S            | 28 +-----------
 arch/x86/crypto/sha256-avx2-asm.S           | 29 +-----------
 arch/x86/crypto/sha256-ssse3-asm.S          | 29 +-----------
 arch/x86/crypto/sha256_ni_asm.S             | 46 +-------------------
 arch/x86/crypto/sha256_ssse3_glue.c         | 15 +------
 arch/x86/crypto/sha512-avx-asm.S            | 29 +-----------
 arch/x86/crypto/sha512-avx2-asm.S           | 29 +-----------
 arch/x86/crypto/sha512-ssse3-asm.S          | 29 +-----------
 arch/x86/crypto/sha512_ssse3_glue.c         | 16 +------
 arch/x86/crypto/twofish_glue.c              | 16 +------
 18 files changed, 18 insertions(+), 488 deletions(-)
arch/x86/crypto/aesni-intel_avx-x86_64.S +1 -35
index 46cddd78857bd9eb..c4cb35fb8df1641d 100644
@@ -1,40 +1,6 @@
+/* SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause */
 ########################################################################
 # Copyright (c) 2013, Intel Corporation
-#
-# This software is available to you under a choice of one of two
-# licenses.  You may choose to be licensed under the terms of the GNU
-# General Public License (GPL) Version 2, available from the file
-# COPYING in the main directory of this source tree, or the
-# OpenIB.org BSD license below:
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-#   notice, this list of conditions and the following disclaimer.
-#
-# * Redistributions in binary form must reproduce the above copyright
-#   notice, this list of conditions and the following disclaimer in the
-#   documentation and/or other materials provided with the
-#   distribution.
-#
-# * Neither the name of the Intel Corporation nor the names of its
-#   contributors may be used to endorse or promote products derived from
-#   this software without specific prior written permission.
-#
-#
-# THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION ""AS IS"" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES# LOSS OF USE, DATA, OR
-# PROFITS# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 ########################################################################
 ##
 ## Authors:
arch/x86/crypto/camellia-aesni-avx-asm_64.S +1 -6
index 646477a13e110fed..9d717d382cbdd048 100644
@@ -1,13 +1,8 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
 /*
  * x86_64/AVX/AES-NI assembler implementation of Camellia
  *
  * Copyright © 2012-2013 Jussi Kivilinna <[email protected]>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
  */
 
 /*
arch/x86/crypto/crc32-pclmul_glue.c +1 -23
index 98cf3b4e4c9fecfe..c4316c31c269785f 100644
@@ -1,26 +1,4 @@
-/* GPL HEADER START
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 only,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License version 2 for more details (a copy is included
- * in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU General Public License
- * version 2 along with this program; If not, see http://www.gnu.org/licenses
- *
- * Please  visit http://www.xyratex.com/contact if you need additional
- * information or have any questions.
- *
- * GPL HEADER END
- */
-
+/* SPDX-License-Identifier: GPL-2.0-only */
 /*
  * Copyright 2012 Xyratex Technology Limited
  *
arch/x86/crypto/crc32c-pcl-intel-asm_64.S +1 -28
index 81ce0f4db555ce03..21303888071cf27b 100644
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
 /*
  * Implement fast CRC32C with PCLMULQDQ instructions. (x86_64)
  *
@@ -13,34 +14,6 @@
  *	James Guilford <[email protected]>
  *	David Cote <[email protected]>
  *	Tim Chen <[email protected]>
- *
- * This software is available to you under a choice of one of two
- * licenses.  You may choose to be licensed under the terms of the GNU
- * General Public License (GPL) Version 2, available from the file
- * COPYING in the main directory of this source tree, or the
- * OpenIB.org BSD license below:
- *
- *     Redistribution and use in source and binary forms, with or
- *     without modification, are permitted provided that the following
- *     conditions are met:
- *
- *      - Redistributions of source code must retain the above
- *        copyright notice, this list of conditions and the following
- *        disclaimer.
- *
- *      - Redistributions in binary form must reproduce the above
- *        copyright notice, this list of conditions and the following
- *        disclaimer in the documentation and/or other materials
- *        provided with the distribution.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
  */
 
 #include <linux/linkage.h>
arch/x86/crypto/crct10dif-pcl-asm_64.S +1 -35
index 5286db5b8165e632..b48f5ef074d16d00 100644
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause */
 ########################################################################
 # Implement fast CRC-T10DIF computation with SSE and PCLMULQDQ instructions
 #
@@ -9,41 +10,6 @@
 #     James Guilford <[email protected]>
 #     Tim Chen <[email protected]>
 #
-# This software is available to you under a choice of one of two
-# licenses.  You may choose to be licensed under the terms of the GNU
-# General Public License (GPL) Version 2, available from the file
-# COPYING in the main directory of this source tree, or the
-# OpenIB.org BSD license below:
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-#   notice, this list of conditions and the following disclaimer.
-#
-# * Redistributions in binary form must reproduce the above copyright
-#   notice, this list of conditions and the following disclaimer in the
-#   documentation and/or other materials provided with the
-#   distribution.
-#
-# * Neither the name of the Intel Corporation nor the names of its
-#   contributors may be used to endorse or promote products derived from
-#   this software without specific prior written permission.
-#
-#
-# THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION ""AS IS"" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
 #       Reference paper titled "Fast CRC Computation for Generic
 #	Polynomials Using PCLMULQDQ Instruction"
 #       URL: http://www.intel.com/content/dam/www/public/us/en/documents
arch/x86/crypto/crct10dif-pclmul_glue.c +1 -15
index 71291d5af9f4588b..ec8073c90dd9b068 100644
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
 /*
  * Cryptographic API.
  *
@@ -5,21 +6,6 @@
  *
  * Copyright (C) 2013 Intel Corporation
  * Author: Tim Chen <[email protected]>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
  */
 
 #include <linux/types.h>
arch/x86/crypto/sha1_avx2_x86_64_asm.S +1 -45

59 lines not on this page · raw message

arch/x86/crypto/sha1_ni_asm.S +1 -45

57 lines not on this page · raw message

arch/x86/crypto/sha256-avx-asm.S +1 -27
index 53de72bdd851ec8d..57d5484711ed0f32 100644
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
 ########################################################################
 # Implement fast SHA-256 with AVX1 instructions. (x86_64)
 #
@@ -8,33 +9,6 @@
 #     Kirk Yap <[email protected]>
 #     Tim Chen <[email protected]>
 #
-# This software is available to you under a choice of one of two
-# licenses.  You may choose to be licensed under the terms of the GNU
-# General Public License (GPL) Version 2, available from the file
-# COPYING in the main directory of this source tree, or the
-# OpenIB.org BSD license below:
-#
-#     Redistribution and use in source and binary forms, with or
-#     without modification, are permitted provided that the following
-#     conditions are met:
-#
-#      - Redistributions of source code must retain the above
-#        copyright notice, this list of conditions and the following
-#        disclaimer.
-#
-#      - Redistributions in binary form must reproduce the above
-#        copyright notice, this list of conditions and the following
-#        disclaimer in the documentation and/or other materials
-#        provided with the distribution.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
-# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
-# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
 ########################################################################
 #
 # This code is described in an Intel White-Paper:
arch/x86/crypto/sha256-avx2-asm.S +1 -28
index 9918212faf914ffc..3f6fcf3fa3189f05 100644
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
 ########################################################################
 # Implement fast SHA-256 with AVX2 instructions. (x86_64)
 #
@@ -8,34 +9,6 @@
 #     Kirk Yap <[email protected]>
 #     Tim Chen <[email protected]>
 #
-# This software is available to you under a choice of one of two
-# licenses.  You may choose to be licensed under the terms of the GNU
-# General Public License (GPL) Version 2, available from the file
-# COPYING in the main directory of this source tree, or the
-# OpenIB.org BSD license below:
-#
-#     Redistribution and use in source and binary forms, with or
-#     without modification, are permitted provided that the following
-#     conditions are met:
-#
-#      - Redistributions of source code must retain the above
-#        copyright notice, this list of conditions and the following
-#        disclaimer.
-#
-#      - Redistributions in binary form must reproduce the above
-#        copyright notice, this list of conditions and the following
-#        disclaimer in the documentation and/or other materials
-#        provided with the distribution.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
-# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
-# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
-#
 ########################################################################
 #
 # This code is described in an Intel White-Paper:
arch/x86/crypto/sha256-ssse3-asm.S +1 -28
index 93264ee4454325b9..76979e13d95e0bdc 100644
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
 ########################################################################
 # Implement fast SHA-256 with SSSE3 instructions. (x86_64)
 #
@@ -8,34 +9,6 @@
 #     Kirk Yap <[email protected]>
 #     Tim Chen <[email protected]>
 #
-# This software is available to you under a choice of one of two
-# licenses.  You may choose to be licensed under the terms of the GNU
-# General Public License (GPL) Version 2, available from the file
-# COPYING in the main directory of this source tree, or the
-# OpenIB.org BSD license below:
-#
-#     Redistribution and use in source and binary forms, with or
-#     without modification, are permitted provided that the following
-#     conditions are met:
-#
-#      - Redistributions of source code must retain the above
-#        copyright notice, this list of conditions and the following
-#        disclaimer.
-#
-#      - Redistributions in binary form must reproduce the above
-#        copyright notice, this list of conditions and the following
-#        disclaimer in the documentation and/or other materials
-#        provided with the distribution.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
-# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
-# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
-#
 ########################################################################
 #
 # This code is described in an Intel White-Paper:
arch/x86/crypto/sha256_ni_asm.S +1 -45

57 lines not on this page · raw message

arch/x86/crypto/sha256_ssse3_glue.c +1 -14
index 3a5f6be7dbba4e5a..30bc827916824e09 100644
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
 /*
  * Cryptographic API.
  *
@@ -10,20 +11,6 @@
  *
  * Author:
  *     Tim Chen <[email protected]>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
  */
 
 
arch/x86/crypto/sha512-avx-asm.S +1 -28
index d902b8ea07218467..1a1313de42d60baa 100644
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
 ########################################################################
 # Implement fast SHA-512 with AVX instructions. (x86_64)
 #
@@ -9,34 +10,6 @@
 #     David Cote <[email protected]>
 #     Tim Chen <[email protected]>
 #
-# This software is available to you under a choice of one of two
-# licenses.  You may choose to be licensed under the terms of the GNU
-# General Public License (GPL) Version 2, available from the file
-# COPYING in the main directory of this source tree, or the
-# OpenIB.org BSD license below:
-#
-#     Redistribution and use in source and binary forms, with or
-#     without modification, are permitted provided that the following
-#     conditions are met:
-#
-#      - Redistributions of source code must retain the above
-#        copyright notice, this list of conditions and the following
-#        disclaimer.
-#
-#      - Redistributions in binary form must reproduce the above
-#        copyright notice, this list of conditions and the following
-#        disclaimer in the documentation and/or other materials
-#        provided with the distribution.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
-# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
-# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
-#
 ########################################################################
 #
 # This code is described in an Intel White-Paper:
arch/x86/crypto/sha512-avx2-asm.S +1 -28
index f08496cd68708fde..0f39a19f3b9749bd 100644
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
 ########################################################################
 # Implement fast SHA-512 with AVX2 instructions. (x86_64)
 #
@@ -9,34 +10,6 @@
 #     David Cote <[email protected]>
 #     Tim Chen <[email protected]>
 #
-# This software is available to you under a choice of one of two
-# licenses.  You may choose to be licensed under the terms of the GNU
-# General Public License (GPL) Version 2, available from the file
-# COPYING in the main directory of this source tree, or the
-# OpenIB.org BSD license below:
-#
-#     Redistribution and use in source and binary forms, with or
-#     without modification, are permitted provided that the following
-#     conditions are met:
-#
-#      - Redistributions of source code must retain the above
-#        copyright notice, this list of conditions and the following
-#        disclaimer.
-#
-#      - Redistributions in binary form must reproduce the above
-#        copyright notice, this list of conditions and the following
-#        disclaimer in the documentation and/or other materials
-#        provided with the distribution.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
-# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
-# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
-#
 ########################################################################
 #
 # This code is described in an Intel White-Paper:
arch/x86/crypto/sha512-ssse3-asm.S +1 -28
index 65be301568162654..bfd8a68759fccfe2 100644
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
 ########################################################################
 # Implement fast SHA-512 with SSSE3 instructions. (x86_64)
 #
@@ -9,34 +10,6 @@
 #     David Cote <[email protected]>
 #     Tim Chen <[email protected]>
 #
-# This software is available to you under a choice of one of two
-# licenses.  You may choose to be licensed under the terms of the GNU
-# General Public License (GPL) Version 2, available from the file
-# COPYING in the main directory of this source tree, or the
-# OpenIB.org BSD license below:
-#
-#     Redistribution and use in source and binary forms, with or
-#     without modification, are permitted provided that the following
-#     conditions are met:
-#
-#      - Redistributions of source code must retain the above
-#        copyright notice, this list of conditions and the following
-#        disclaimer.
-#
-#      - Redistributions in binary form must reproduce the above
-#        copyright notice, this list of conditions and the following
-#        disclaimer in the documentation and/or other materials
-#        provided with the distribution.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
-# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
-# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
-#
 ########################################################################
 #
 # This code is described in an Intel White-Paper:
arch/x86/crypto/sha512_ssse3_glue.c +1 -15
index 6d3b85e53d0eeb35..a0513534b3c1d1e8 100644
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
 /*
  * Cryptographic API.
  *
@@ -8,21 +9,6 @@
  *
  * Copyright (C) 2013 Intel Corporation
  * Author: Tim Chen <[email protected]>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
  */
 
 #define pr_fmt(fmt)	KBUILD_MODNAME ": " fmt
arch/x86/crypto/twofish_glue.c +1 -15
index 0614beece27932df..a79e90cc149090b4 100644
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
 /*
  * Glue Code for assembler optimized version of TWOFISH
  *
@@ -12,21 +13,6 @@
  * code and thus put it in the public domain. The subsequent authors
  * have put this under the GNU General Public License.
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
- * USA
- *
  * This code is a "clean room" implementation, written from the paper
  * _Twofish: A 128-Bit Block Cipher_ by Bruce Schneier, John Kelsey,
  * Doug Whiting, David Wagner, Chris Hall, and Niels Ferguson, available
Signature · 1 line
2.39.2
Reviewed-by on the v1 series
#7 lore raw
In reply to Ard Biesheuvel
Quoted 24 lines · Ard Biesheuvel

Some SPDX cleanups for the arch crypto code on ARM, arm64 and x86

Ard Biesheuvel (3):
crypto: arm64 - add some missing SPDX headers
crypto: arm - add some missing SPDX headers
crypto: x86 - add some missing SPDX headers

 arch/arm/crypto/chacha-neon-core.S          | 10 +----
 arch/arm/crypto/crc32-ce-core.S             | 30 ++-----------
 arch/arm/crypto/crct10dif-ce-core.S         | 40 +----------------
 arch/arm64/crypto/chacha-neon-core.S        | 10 +----
 arch/arm64/crypto/chacha-neon-glue.c        | 10 +----
 arch/arm64/crypto/crct10dif-ce-core.S       | 40 +----------------
 arch/x86/crypto/aesni-intel_avx-x86_64.S    | 36 +--------------
 arch/x86/crypto/camellia-aesni-avx-asm_64.S |  7 +--
 arch/x86/crypto/crc32-pclmul_glue.c         | 24 +---------
 arch/x86/crypto/crc32c-pcl-intel-asm_64.S   | 29 +-----------
 arch/x86/crypto/crct10dif-pcl-asm_64.S      | 36 +--------------
 arch/x86/crypto/crct10dif-pclmul_glue.c     | 16 +------
 arch/x86/crypto/sha1_avx2_x86_64_asm.S      | 46 +-------------------
 arch/x86/crypto/sha1_ni_asm.S               | 46 +-------------------
 arch/x86/crypto/sha256-avx-asm.S            | 28 +-----------
 arch/x86/crypto/sha256-avx2-asm.S           | 29 +-----------
 arch/x86/crypto/sha256-ssse3-asm.S          | 29 +-----------
Quoted 8 lines
 arch/x86/crypto/sha256_ni_asm.S             | 46 +-------------------
 arch/x86/crypto/sha256_ssse3_glue.c         | 15 +------
 arch/x86/crypto/sha512-avx-asm.S            | 29 +-----------
 arch/x86/crypto/sha512-avx2-asm.S           | 29 +-----------
 arch/x86/crypto/sha512-ssse3-asm.S          | 29 +-----------
 arch/x86/crypto/sha512_ssse3_glue.c         | 16 +------
 arch/x86/crypto/twofish_glue.c              | 16 +------
 24 files changed, 26 insertions(+), 620 deletions(-)

- Eric

#8 lore raw
Quoted 34 lines · Eric Biggers
Quoted 24 lines · Ard Biesheuvel

Some SPDX cleanups for the arch crypto code on ARM, arm64 and x86

Ard Biesheuvel (3):
crypto: arm64 - add some missing SPDX headers
crypto: arm - add some missing SPDX headers
crypto: x86 - add some missing SPDX headers

 arch/arm/crypto/chacha-neon-core.S          | 10 +----
 arch/arm/crypto/crc32-ce-core.S             | 30 ++-----------
 arch/arm/crypto/crct10dif-ce-core.S         | 40 +----------------
 arch/arm64/crypto/chacha-neon-core.S        | 10 +----
 arch/arm64/crypto/chacha-neon-glue.c        | 10 +----
 arch/arm64/crypto/crct10dif-ce-core.S       | 40 +----------------
 arch/x86/crypto/aesni-intel_avx-x86_64.S    | 36 +--------------
 arch/x86/crypto/camellia-aesni-avx-asm_64.S |  7 +--
 arch/x86/crypto/crc32-pclmul_glue.c         | 24 +---------
 arch/x86/crypto/crc32c-pcl-intel-asm_64.S   | 29 +-----------
 arch/x86/crypto/crct10dif-pcl-asm_64.S      | 36 +--------------
 arch/x86/crypto/crct10dif-pclmul_glue.c     | 16 +------
 arch/x86/crypto/sha1_avx2_x86_64_asm.S      | 46 +-------------------
 arch/x86/crypto/sha1_ni_asm.S               | 46 +-------------------
 arch/x86/crypto/sha256-avx-asm.S            | 28 +-----------
 arch/x86/crypto/sha256-avx2-asm.S           | 29 +-----------
 arch/x86/crypto/sha256-ssse3-asm.S          | 29 +-----------
Quoted 8 lines
 arch/x86/crypto/sha256_ni_asm.S             | 46 +-------------------
 arch/x86/crypto/sha256_ssse3_glue.c         | 15 +------
 arch/x86/crypto/sha512-avx-asm.S            | 29 +-----------
 arch/x86/crypto/sha512-avx2-asm.S           | 29 +-----------
 arch/x86/crypto/sha512-ssse3-asm.S          | 29 +-----------
 arch/x86/crypto/sha512_ssse3_glue.c         | 16 +------
 arch/x86/crypto/twofish_glue.c              | 16 +------
 24 files changed, 26 insertions(+), 620 deletions(-)
Quoted 2 lines

Actually, given the discussion on the other thread
https://lore.kernel.org/r/[email protected], maybe it would be best to hold off on this for now? Or at least split this series into more patches, such that each patch does only one "type" of SPDX replacement.

I still think these conversions are probably fine, but some points that perhaps need an explicit explanation are:

* Using GPL-2.0-only for files like chacha-neon-core.S whose file header says GPL v2, but also says GPL v2 or later.

* Replacing with SPDX on files that explicitly say "DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER."

* Using BSD-3-Clause when the license text in the file header has the copyright holder name instead of "copyright holder", thus making it not an exact word-for-word match with LICENSES/preferred/BSD-3-Clause. (It seems there are specific rules for variations that have been approved, e.g. see
https://github.com/spdx/license-list-XML/blob/main/src/BSD-3-Clause.xml and
https://spdx.github.io/spdx-spec/v2.2.2/license-matching-guidelines-and-templates)

* Using "GPL-2.0-only OR BSD-3-Clause" for the two crct10dif-ce-core.S files. They have an unusual file header, and it could be argued that some contributions to those files were intended to be licensed under GPL-2.0-only. FWIW, I am fine with either license for my contributions to those files.

- Eric

#9 lore raw
Quoted 4 lines · Eric Biggers

Actually, given the discussion on the other thread
https://lore.kernel.org/r/[email protected], maybe it would be best to hold off on this for now? Or at least split this series into more patches, such that each patch does only one "type" of SPDX replacement.

Thanks for pointing to my thread! (and Cc'ing Richard of course ...)

If we continue on the conversion, I definitely agree with your latter option (as I have done there).

Quoted 6 lines

I still think these conversions are probably fine, but some points that perhaps need an explicit explanation are:

* Using GPL-2.0-only for files like chacha-neon-core.S whose file header says GPL v2, but also says GPL v2 or later.

In that case, IMO, err to the safe side and assume the most restrictive (GPL-2.0-only).

Quoted 3 lines

* Replacing with SPDX on files that explicitly say "DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER."

Just add the SPDX tag...

Quoted 7 lines

* Using BSD-3-Clause when the license text in the file header has the copyright holder name instead of "copyright holder", thus making it not an exact word-for-word match with LICENSES/preferred/BSD-3-Clause. (It seems there are specific rules for variations that have been approved, e.g. see
https://github.com/spdx/license-list-XML/blob/main/src/BSD-3-Clause.xml and
https://spdx.github.io/spdx-spec/v2.2.2/license-matching-guidelines-and-templates)

Above case is wording variation (for which we conclude that only license boilerplate with exact wording can be replaced by the tag).

Quoted 5 lines

* Using "GPL-2.0-only OR BSD-3-Clause" for the two crct10dif-ce-core.S files. They have an unusual file header, and it could be argued that some contributions to those files were intended to be licensed under GPL-2.0-only. FWIW, I am fine with either license for my contributions to those files.

Dunno.

Thanks.

Signature · 1 line
An old man doll... just what I always wanted! - Clara