LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH v5 1/3] Add notrace to lib/ucmpdi2.c
@ 2018-04-03  9:24 Matt Redfearn
  2018-04-03  9:24 ` [PATCH v5 2/3] lib: Rename compiler intrinsic selects to GENERIC_LIB_* Matt Redfearn
  2018-04-03  9:24 ` [PATCH v5 3/3] MIPS: use generic GCC library routines from lib/ Matt Redfearn
  0 siblings, 2 replies; 11+ messages in thread
From: Matt Redfearn @ 2018-04-03  9:24 UTC (permalink / raw)
  To: Palmer Dabbelt, Antony Pavlov, James Hogan, Ralf Baechle
  Cc: linux-mips, Matt Redfearn, Geert Uytterhoeven, linux-kernel

From: Palmer Dabbelt <palmer@sifive.com>

As part of the MIPS conversion to use the generic GCC library routines,
Matt Redfearn discovered that I'd missed a notrace on __ucmpdi2().  This
patch rectifies the problem.

CC: Matt Redfearn <matt.redfearn@mips.com>
CC: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Matt Redfearn <matt.redfearn@mips.com>
Signed-off-by: Matt Redfearn <matt.redfearn@mips.com>
---

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2:
  add notrace to lib/ucmpdi2.c

 lib/ucmpdi2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/ucmpdi2.c b/lib/ucmpdi2.c
index 25ca2d4c1e19..597998169a96 100644
--- a/lib/ucmpdi2.c
+++ b/lib/ucmpdi2.c
@@ -17,7 +17,7 @@
 #include <linux/module.h>
 #include <linux/libgcc.h>
 
-word_type __ucmpdi2(unsigned long long a, unsigned long long b)
+word_type notrace __ucmpdi2(unsigned long long a, unsigned long long b)
 {
 	const DWunion au = {.ll = a};
 	const DWunion bu = {.ll = b};
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v5 2/3] lib: Rename compiler intrinsic selects to GENERIC_LIB_*
  2018-04-03  9:24 [PATCH v5 1/3] Add notrace to lib/ucmpdi2.c Matt Redfearn
@ 2018-04-03  9:24 ` Matt Redfearn
  2018-04-03 22:39   ` Palmer Dabbelt
  2018-04-03  9:24 ` [PATCH v5 3/3] MIPS: use generic GCC library routines from lib/ Matt Redfearn
  1 sibling, 1 reply; 11+ messages in thread
From: Matt Redfearn @ 2018-04-03  9:24 UTC (permalink / raw)
  To: Palmer Dabbelt, Antony Pavlov, James Hogan, Ralf Baechle
  Cc: linux-mips, Matt Redfearn, Luis R. Rodriguez, Robin Murphy,
	Geert Uytterhoeven, linux-riscv, Chris Mason, Yury Norov,
	Jeremy Kerr, Florian Fainelli, Greg Kroah-Hartman, Andrew Morton,
	Bart Van Assche, Rob Herring, Nick Terrell, Dan Williams,
	Albert Ou, Al Viro, Tom Herbert, linux-kernel,
	Richard Weinberger, Paul E. McKenney

When these are included into arch Kconfig files, maintaining
alphabetical ordering of the selects means these get split up. To allow
for keeping things tidier and alphabetical, rename the selects to
GENERIC_LIB_*

Signed-off-by: Matt Redfearn <matt.redfearn@mips.com>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>

---

Changes in v5: None
Changes in v4:
Rename Kconfig symbols GENERIC_* -> GENERIC_LIB_*

Changes in v3: None
Changes in v2: None

 arch/riscv/Kconfig |  6 +++---
 lib/Kconfig        | 12 ++++++------
 lib/Makefile       | 12 ++++++------
 3 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index 04807c7f64cc..20185aaaf933 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -104,9 +104,9 @@ config ARCH_RV32I
 	bool "RV32I"
 	select CPU_SUPPORTS_32BIT_KERNEL
 	select 32BIT
-	select GENERIC_ASHLDI3
-	select GENERIC_ASHRDI3
-	select GENERIC_LSHRDI3
+	select GENERIC_LIB_ASHLDI3
+	select GENERIC_LIB_ASHRDI3
+	select GENERIC_LIB_LSHRDI3
 
 config ARCH_RV64I
 	bool "RV64I"
diff --git a/lib/Kconfig b/lib/Kconfig
index e96089499371..e54ebe00937e 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -588,20 +588,20 @@ config STRING_SELFTEST
 
 endmenu
 
-config GENERIC_ASHLDI3
+config GENERIC_LIB_ASHLDI3
 	bool
 
-config GENERIC_ASHRDI3
+config GENERIC_LIB_ASHRDI3
 	bool
 
-config GENERIC_LSHRDI3
+config GENERIC_LIB_LSHRDI3
 	bool
 
-config GENERIC_MULDI3
+config GENERIC_LIB_MULDI3
 	bool
 
-config GENERIC_CMPDI2
+config GENERIC_LIB_CMPDI2
 	bool
 
-config GENERIC_UCMPDI2
+config GENERIC_LIB_UCMPDI2
 	bool
diff --git a/lib/Makefile b/lib/Makefile
index a90d4fcd748f..7425e177f08c 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -253,9 +253,9 @@ obj-$(CONFIG_SBITMAP) += sbitmap.o
 obj-$(CONFIG_PARMAN) += parman.o
 
 # GCC library routines
-obj-$(CONFIG_GENERIC_ASHLDI3) += ashldi3.o
-obj-$(CONFIG_GENERIC_ASHRDI3) += ashrdi3.o
-obj-$(CONFIG_GENERIC_LSHRDI3) += lshrdi3.o
-obj-$(CONFIG_GENERIC_MULDI3) += muldi3.o
-obj-$(CONFIG_GENERIC_CMPDI2) += cmpdi2.o
-obj-$(CONFIG_GENERIC_UCMPDI2) += ucmpdi2.o
+obj-$(CONFIG_GENERIC_LIB_ASHLDI3) += ashldi3.o
+obj-$(CONFIG_GENERIC_LIB_ASHRDI3) += ashrdi3.o
+obj-$(CONFIG_GENERIC_LIB_LSHRDI3) += lshrdi3.o
+obj-$(CONFIG_GENERIC_LIB_MULDI3) += muldi3.o
+obj-$(CONFIG_GENERIC_LIB_CMPDI2) += cmpdi2.o
+obj-$(CONFIG_GENERIC_LIB_UCMPDI2) += ucmpdi2.o
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v5 3/3] MIPS: use generic GCC library routines from lib/
  2018-04-03  9:24 [PATCH v5 1/3] Add notrace to lib/ucmpdi2.c Matt Redfearn
  2018-04-03  9:24 ` [PATCH v5 2/3] lib: Rename compiler intrinsic selects to GENERIC_LIB_* Matt Redfearn
@ 2018-04-03  9:24 ` Matt Redfearn
  2018-04-03 16:07   ` James Hogan
  1 sibling, 1 reply; 11+ messages in thread
From: Matt Redfearn @ 2018-04-03  9:24 UTC (permalink / raw)
  To: Palmer Dabbelt, Antony Pavlov, James Hogan, Ralf Baechle
  Cc: linux-mips, Matt Redfearn, linux-kernel, Thomas Gleixner,
	Philippe Ombredanne, Paul Burton, Kate Stewart,
	Greg Kroah-Hartman, Al Viro

From: Antony Pavlov <antonynpavlov@gmail.com>

The commit b35cd9884fa5 ("lib: Add shared copies of some GCC library
routines") makes it possible to share generic GCC library routines by
several architectures.

This commit removes several generic GCC library routines from
arch/mips/lib/ in favour of similar routines from lib/.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
[Matt Redfearn] Use GENERIC_LIB_* named Kconfig entries
Signed-off-by: Matt Redfearn <matt.redfearn@mips.com>
Cc: Palmer Dabbelt <palmer@sifive.com>
Cc: Matt Redfearn <matt.redfearn@mips.com>
Cc: James Hogan <jhogan@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org

---

Changes in v5:
  Actually delete the MIPS lib routines

Changes in v4:
  Rework to use the new GENERIC_LIB_ Kconfig entries

Changes in v3:
  Maintain alphabetical order of MIPS Kconfig

Changes in v2: None

 arch/mips/Kconfig       |  5 +++++
 arch/mips/lib/Makefile  |  3 +--
 arch/mips/lib/ashldi3.c | 30 ------------------------------
 arch/mips/lib/ashrdi3.c | 32 --------------------------------
 arch/mips/lib/cmpdi2.c  | 28 ----------------------------
 arch/mips/lib/lshrdi3.c | 30 ------------------------------
 arch/mips/lib/ucmpdi2.c | 22 ----------------------
 7 files changed, 6 insertions(+), 144 deletions(-)
 delete mode 100644 arch/mips/lib/ashldi3.c
 delete mode 100644 arch/mips/lib/ashrdi3.c
 delete mode 100644 arch/mips/lib/cmpdi2.c
 delete mode 100644 arch/mips/lib/lshrdi3.c
 delete mode 100644 arch/mips/lib/ucmpdi2.c

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 8128c3b68d6b..98955a76c656 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -22,6 +22,11 @@ config MIPS
 	select GENERIC_CPU_AUTOPROBE
 	select GENERIC_IRQ_PROBE
 	select GENERIC_IRQ_SHOW
+	select GENERIC_LIB_ASHLDI3
+	select GENERIC_LIB_ASHRDI3
+	select GENERIC_LIB_CMPDI2
+	select GENERIC_LIB_LSHRDI3
+	select GENERIC_LIB_UCMPDI2
 	select GENERIC_PCI_IOMAP
 	select GENERIC_SCHED_CLOCK if !CAVIUM_OCTEON_SOC
 	select GENERIC_SMP_IDLE_THREAD
diff --git a/arch/mips/lib/Makefile b/arch/mips/lib/Makefile
index e84e12655fa8..6537e022ef62 100644
--- a/arch/mips/lib/Makefile
+++ b/arch/mips/lib/Makefile
@@ -16,5 +16,4 @@ obj-$(CONFIG_CPU_R3000)		+= r3k_dump_tlb.o
 obj-$(CONFIG_CPU_TX39XX)	+= r3k_dump_tlb.o
 
 # libgcc-style stuff needed in the kernel
-obj-y += ashldi3.o ashrdi3.o bswapsi.o bswapdi.o cmpdi2.o lshrdi3.o multi3.o \
-	 ucmpdi2.o
+obj-y += bswapsi.o bswapdi.o multi3.o
diff --git a/arch/mips/lib/ashldi3.c b/arch/mips/lib/ashldi3.c
deleted file mode 100644
index 24cd6903e797..000000000000
--- a/arch/mips/lib/ashldi3.c
+++ /dev/null
@@ -1,30 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-#include <linux/export.h>
-
-#include "libgcc.h"
-
-long long notrace __ashldi3(long long u, word_type b)
-{
-	DWunion uu, w;
-	word_type bm;
-
-	if (b == 0)
-		return u;
-
-	uu.ll = u;
-	bm = 32 - b;
-
-	if (bm <= 0) {
-		w.s.low = 0;
-		w.s.high = (unsigned int) uu.s.low << -bm;
-	} else {
-		const unsigned int carries = (unsigned int) uu.s.low >> bm;
-
-		w.s.low = (unsigned int) uu.s.low << b;
-		w.s.high = ((unsigned int) uu.s.high << b) | carries;
-	}
-
-	return w.ll;
-}
-
-EXPORT_SYMBOL(__ashldi3);
diff --git a/arch/mips/lib/ashrdi3.c b/arch/mips/lib/ashrdi3.c
deleted file mode 100644
index 23f5295af51e..000000000000
--- a/arch/mips/lib/ashrdi3.c
+++ /dev/null
@@ -1,32 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-#include <linux/export.h>
-
-#include "libgcc.h"
-
-long long notrace __ashrdi3(long long u, word_type b)
-{
-	DWunion uu, w;
-	word_type bm;
-
-	if (b == 0)
-		return u;
-
-	uu.ll = u;
-	bm = 32 - b;
-
-	if (bm <= 0) {
-		/* w.s.high = 1..1 or 0..0 */
-		w.s.high =
-		    uu.s.high >> 31;
-		w.s.low = uu.s.high >> -bm;
-	} else {
-		const unsigned int carries = (unsigned int) uu.s.high << bm;
-
-		w.s.high = uu.s.high >> b;
-		w.s.low = ((unsigned int) uu.s.low >> b) | carries;
-	}
-
-	return w.ll;
-}
-
-EXPORT_SYMBOL(__ashrdi3);
diff --git a/arch/mips/lib/cmpdi2.c b/arch/mips/lib/cmpdi2.c
deleted file mode 100644
index 93cfc785927d..000000000000
--- a/arch/mips/lib/cmpdi2.c
+++ /dev/null
@@ -1,28 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-#include <linux/export.h>
-
-#include "libgcc.h"
-
-word_type notrace __cmpdi2(long long a, long long b)
-{
-	const DWunion au = {
-		.ll = a
-	};
-	const DWunion bu = {
-		.ll = b
-	};
-
-	if (au.s.high < bu.s.high)
-		return 0;
-	else if (au.s.high > bu.s.high)
-		return 2;
-
-	if ((unsigned int) au.s.low < (unsigned int) bu.s.low)
-		return 0;
-	else if ((unsigned int) au.s.low > (unsigned int) bu.s.low)
-		return 2;
-
-	return 1;
-}
-
-EXPORT_SYMBOL(__cmpdi2);
diff --git a/arch/mips/lib/lshrdi3.c b/arch/mips/lib/lshrdi3.c
deleted file mode 100644
index 914b971aca3b..000000000000
--- a/arch/mips/lib/lshrdi3.c
+++ /dev/null
@@ -1,30 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-#include <linux/export.h>
-
-#include "libgcc.h"
-
-long long notrace __lshrdi3(long long u, word_type b)
-{
-	DWunion uu, w;
-	word_type bm;
-
-	if (b == 0)
-		return u;
-
-	uu.ll = u;
-	bm = 32 - b;
-
-	if (bm <= 0) {
-		w.s.high = 0;
-		w.s.low = (unsigned int) uu.s.high >> -bm;
-	} else {
-		const unsigned int carries = (unsigned int) uu.s.high << bm;
-
-		w.s.high = (unsigned int) uu.s.high >> b;
-		w.s.low = ((unsigned int) uu.s.low >> b) | carries;
-	}
-
-	return w.ll;
-}
-
-EXPORT_SYMBOL(__lshrdi3);
diff --git a/arch/mips/lib/ucmpdi2.c b/arch/mips/lib/ucmpdi2.c
deleted file mode 100644
index c31c78ca4175..000000000000
--- a/arch/mips/lib/ucmpdi2.c
+++ /dev/null
@@ -1,22 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-#include <linux/export.h>
-
-#include "libgcc.h"
-
-word_type notrace __ucmpdi2(unsigned long long a, unsigned long long b)
-{
-	const DWunion au = {.ll = a};
-	const DWunion bu = {.ll = b};
-
-	if ((unsigned int) au.s.high < (unsigned int) bu.s.high)
-		return 0;
-	else if ((unsigned int) au.s.high > (unsigned int) bu.s.high)
-		return 2;
-	if ((unsigned int) au.s.low < (unsigned int) bu.s.low)
-		return 0;
-	else if ((unsigned int) au.s.low > (unsigned int) bu.s.low)
-		return 2;
-	return 1;
-}
-
-EXPORT_SYMBOL(__ucmpdi2);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH v5 3/3] MIPS: use generic GCC library routines from lib/
  2018-04-03  9:24 ` [PATCH v5 3/3] MIPS: use generic GCC library routines from lib/ Matt Redfearn
@ 2018-04-03 16:07   ` James Hogan
  2018-04-04  9:18     ` [PATCH] MIPS: vmlinuz: Fix compiler intrinsics location and build directly Matt Redfearn
  0 siblings, 1 reply; 11+ messages in thread
From: James Hogan @ 2018-04-03 16:07 UTC (permalink / raw)
  To: Matt Redfearn
  Cc: Palmer Dabbelt, Antony Pavlov, Ralf Baechle, linux-mips,
	linux-kernel, Thomas Gleixner, Philippe Ombredanne, Paul Burton,
	Kate Stewart, Greg Kroah-Hartman, Al Viro

[-- Attachment #1: Type: text/plain, Size: 1141 bytes --]

On Tue, Apr 03, 2018 at 10:24:26AM +0100, Matt Redfearn wrote:
> From: Antony Pavlov <antonynpavlov@gmail.com>
> 
> The commit b35cd9884fa5 ("lib: Add shared copies of some GCC library
> routines") makes it possible to share generic GCC library routines by
> several architectures.
> 
> This commit removes several generic GCC library routines from
> arch/mips/lib/ in favour of similar routines from lib/.
> 
> Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
> [Matt Redfearn] Use GENERIC_LIB_* named Kconfig entries
> Signed-off-by: Matt Redfearn <matt.redfearn@mips.com>
> Cc: Palmer Dabbelt <palmer@sifive.com>
> Cc: Matt Redfearn <matt.redfearn@mips.com>
> Cc: James Hogan <jhogan@kernel.org>
> Cc: Ralf Baechle <ralf@linux-mips.org>
> Cc: linux-mips@linux-mips.org
> Cc: linux-kernel@vger.kernel.org

ci20_defconfig:
make[1]: *** No rule to make target 'arch/mips/lib/ashldi3.c', needed by 'arch/mips/boot/compressed/ashldi3.c'.  Stop.
make[1]: *** Waiting for unfinished jobs....
make: *** [arch/mips/Makefile +395 : vmlinuz] Error 2

same for db1xxx_defconfig (and possibly others).

Thanks
James

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v5 2/3] lib: Rename compiler intrinsic selects to GENERIC_LIB_*
  2018-04-03  9:24 ` [PATCH v5 2/3] lib: Rename compiler intrinsic selects to GENERIC_LIB_* Matt Redfearn
@ 2018-04-03 22:39   ` Palmer Dabbelt
  2018-04-04 22:02     ` James Hogan
  0 siblings, 1 reply; 11+ messages in thread
From: Palmer Dabbelt @ 2018-04-03 22:39 UTC (permalink / raw)
  To: matt.redfearn
  Cc: antonynpavlov, jhogan, ralf, linux-mips, matt.redfearn, mcgrof,
	robin.murphy, geert, linux-riscv, clm, ynorov, jk, f.fainelli,
	Greg KH, akpm, bart.vanassche, robh, terrelln, dan.j.williams,
	albert, viro, tom, linux-kernel, richard, paulmck

On Tue, 03 Apr 2018 02:24:25 PDT (-0700), matt.redfearn@mips.com wrote:
> When these are included into arch Kconfig files, maintaining
> alphabetical ordering of the selects means these get split up. To allow
> for keeping things tidier and alphabetical, rename the selects to
> GENERIC_LIB_*
>
> Signed-off-by: Matt Redfearn <matt.redfearn@mips.com>
> Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
>
> ---
>
> Changes in v5: None
> Changes in v4:
> Rename Kconfig symbols GENERIC_* -> GENERIC_LIB_*
>
> Changes in v3: None
> Changes in v2: None
>
>  arch/riscv/Kconfig |  6 +++---
>  lib/Kconfig        | 12 ++++++------
>  lib/Makefile       | 12 ++++++------
>  3 files changed, 15 insertions(+), 15 deletions(-)
>
> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> index 04807c7f64cc..20185aaaf933 100644
> --- a/arch/riscv/Kconfig
> +++ b/arch/riscv/Kconfig
> @@ -104,9 +104,9 @@ config ARCH_RV32I
>  	bool "RV32I"
>  	select CPU_SUPPORTS_32BIT_KERNEL
>  	select 32BIT
> -	select GENERIC_ASHLDI3
> -	select GENERIC_ASHRDI3
> -	select GENERIC_LSHRDI3
> +	select GENERIC_LIB_ASHLDI3
> +	select GENERIC_LIB_ASHRDI3
> +	select GENERIC_LIB_LSHRDI3
>
>  config ARCH_RV64I
>  	bool "RV64I"
> diff --git a/lib/Kconfig b/lib/Kconfig
> index e96089499371..e54ebe00937e 100644
> --- a/lib/Kconfig
> +++ b/lib/Kconfig
> @@ -588,20 +588,20 @@ config STRING_SELFTEST
>
>  endmenu
>
> -config GENERIC_ASHLDI3
> +config GENERIC_LIB_ASHLDI3
>  	bool
>
> -config GENERIC_ASHRDI3
> +config GENERIC_LIB_ASHRDI3
>  	bool
>
> -config GENERIC_LSHRDI3
> +config GENERIC_LIB_LSHRDI3
>  	bool
>
> -config GENERIC_MULDI3
> +config GENERIC_LIB_MULDI3
>  	bool
>
> -config GENERIC_CMPDI2
> +config GENERIC_LIB_CMPDI2
>  	bool
>
> -config GENERIC_UCMPDI2
> +config GENERIC_LIB_UCMPDI2
>  	bool
> diff --git a/lib/Makefile b/lib/Makefile
> index a90d4fcd748f..7425e177f08c 100644
> --- a/lib/Makefile
> +++ b/lib/Makefile
> @@ -253,9 +253,9 @@ obj-$(CONFIG_SBITMAP) += sbitmap.o
>  obj-$(CONFIG_PARMAN) += parman.o
>
>  # GCC library routines
> -obj-$(CONFIG_GENERIC_ASHLDI3) += ashldi3.o
> -obj-$(CONFIG_GENERIC_ASHRDI3) += ashrdi3.o
> -obj-$(CONFIG_GENERIC_LSHRDI3) += lshrdi3.o
> -obj-$(CONFIG_GENERIC_MULDI3) += muldi3.o
> -obj-$(CONFIG_GENERIC_CMPDI2) += cmpdi2.o
> -obj-$(CONFIG_GENERIC_UCMPDI2) += ucmpdi2.o
> +obj-$(CONFIG_GENERIC_LIB_ASHLDI3) += ashldi3.o
> +obj-$(CONFIG_GENERIC_LIB_ASHRDI3) += ashrdi3.o
> +obj-$(CONFIG_GENERIC_LIB_LSHRDI3) += lshrdi3.o
> +obj-$(CONFIG_GENERIC_LIB_MULDI3) += muldi3.o
> +obj-$(CONFIG_GENERIC_LIB_CMPDI2) += cmpdi2.o
> +obj-$(CONFIG_GENERIC_LIB_UCMPDI2) += ucmpdi2.o

Sorry, I'm not sure if this is the right patch -- someone suggested acking 
this, but it's already Review-By me and if I understand correctly it's going 
through your tree.  I'm a bit new to this, but if it helps then here's a

Acked-By: Palmer Dabbelt <palmer@sifive.com>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH] MIPS: vmlinuz: Fix compiler intrinsics location and build directly
  2018-04-03 16:07   ` James Hogan
@ 2018-04-04  9:18     ` Matt Redfearn
  2018-04-05 10:13       ` Matt Redfearn
  0 siblings, 1 reply; 11+ messages in thread
From: Matt Redfearn @ 2018-04-04  9:18 UTC (permalink / raw)
  To: James Hogan, Ralf Baechle
  Cc: linux-mips, Alban Bedel, Antony Pavlov, Palmer Dabbelt,
	Matt Redfearn, Bartosz Golaszewski, linux-kernel

Since commit "MIPS: use generic GCC library routines from lib/", MIPS
now uses the generic lib/ashldi3.c, but bswapsi.c still comes from
arch/mips/lib. The rules for including these into vmlinuz need updating
to reflect these locations.
Both objects need to be built with different CFLAGS for inclusion to
vmlinuz rather than simply including the object built for the main
kernel image. But the copy of the source C file can be avoided by simply
calling cmd,cc_o_c to build the object from the source directly. This
also removes the need for the .gitignore file to ignore the copied
files, and the extra-y rule to clean them.

Signed-off-by: Matt Redfearn <matt.redfearn@mips.com>
---

 arch/mips/boot/compressed/.gitignore | 2 --
 arch/mips/boot/compressed/Makefile   | 8 ++++----
 2 files changed, 4 insertions(+), 6 deletions(-)
 delete mode 100644 arch/mips/boot/compressed/.gitignore

diff --git a/arch/mips/boot/compressed/.gitignore b/arch/mips/boot/compressed/.gitignore
deleted file mode 100644
index ebae133f1d00..000000000000
--- a/arch/mips/boot/compressed/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-ashldi3.c
-bswapsi.c
diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile
index adce180f3ee4..8f04d659a915 100644
--- a/arch/mips/boot/compressed/Makefile
+++ b/arch/mips/boot/compressed/Makefile
@@ -46,10 +46,10 @@ $(obj)/uart-ath79.c: $(srctree)/arch/mips/ath79/early_printk.c
 
 vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o $(obj)/bswapsi.o
 
-extra-y += ashldi3.c bswapsi.c
-$(obj)/ashldi3.o $(obj)/bswapsi.o: KBUILD_CFLAGS += -I$(srctree)/arch/mips/lib
-$(obj)/ashldi3.c $(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c
-	$(call cmd,shipped)
+$(obj)/ashldi3.o: $(srctree)/lib/ashldi3.c
+	$(call cmd,cc_o_c)
+$(obj)/bswapsi.o: $(srctree)/arch/mips/lib/bswapsi.c
+	$(call cmd,cc_o_c)
 
 targets := $(notdir $(vmlinuzobjs-y))
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH v5 2/3] lib: Rename compiler intrinsic selects to GENERIC_LIB_*
  2018-04-03 22:39   ` Palmer Dabbelt
@ 2018-04-04 22:02     ` James Hogan
  2018-04-05  0:14       ` Palmer Dabbelt
  0 siblings, 1 reply; 11+ messages in thread
From: James Hogan @ 2018-04-04 22:02 UTC (permalink / raw)
  To: Palmer Dabbelt
  Cc: matt.redfearn, antonynpavlov, ralf, linux-mips, mcgrof,
	robin.murphy, geert, linux-riscv, clm, ynorov, jk, f.fainelli,
	Greg KH, akpm, bart.vanassche, robh, terrelln, dan.j.williams,
	albert, viro, tom, linux-kernel, richard, paulmck

[-- Attachment #1: Type: text/plain, Size: 885 bytes --]

On Tue, Apr 03, 2018 at 03:39:34PM -0700, Palmer Dabbelt wrote:
> Sorry, I'm not sure if this is the right patch -- someone suggested acking 
> this, but it's already Review-By me and if I understand correctly it's going 
> through your tree.  I'm a bit new to this, but if it helps then here's a
> 
> Acked-By: Palmer Dabbelt <palmer@sifive.com>

Thanks Palmer.

No worries. FYI Documentation/process/submitting-patches.rst appears to
now contain lots of gory detail about what Acked-by and Reviewed-by are
supposed to mean.

In this case an acked-by is needed to show your approval of the parts of
the patch which touch the subsystem you are responsible for (and/or code
which you have authored) so that the patch can go via another tree. It
usually indicates that you've reviewed those parts of the patch too, but
not necessarily the whole thing.

Cheers
James

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v5 2/3] lib: Rename compiler intrinsic selects to GENERIC_LIB_*
  2018-04-04 22:02     ` James Hogan
@ 2018-04-05  0:14       ` Palmer Dabbelt
  0 siblings, 0 replies; 11+ messages in thread
From: Palmer Dabbelt @ 2018-04-05  0:14 UTC (permalink / raw)
  To: jhogan
  Cc: matt.redfearn, antonynpavlov, ralf, linux-mips, mcgrof,
	robin.murphy, geert, linux-riscv, clm, ynorov, jk, f.fainelli,
	Greg KH, akpm, bart.vanassche, robh, terrelln, dan.j.williams,
	albert, viro, tom, linux-kernel, richard, paulmck

On Wed, 04 Apr 2018 15:02:58 PDT (-0700), jhogan@kernel.org wrote:
> On Tue, Apr 03, 2018 at 03:39:34PM -0700, Palmer Dabbelt wrote:
>> Sorry, I'm not sure if this is the right patch -- someone suggested acking 
>> this, but it's already Review-By me and if I understand correctly it's going 
>> through your tree.  I'm a bit new to this, but if it helps then here's a
>> 
>> Acked-By: Palmer Dabbelt <palmer@sifive.com>
>
> Thanks Palmer.
>
> No worries. FYI Documentation/process/submitting-patches.rst appears to
> now contain lots of gory detail about what Acked-by and Reviewed-by are
> supposed to mean.
>
> In this case an acked-by is needed to show your approval of the parts of
> the patch which touch the subsystem you are responsible for (and/or code
> which you have authored) so that the patch can go via another tree. It
> usually indicates that you've reviewed those parts of the patch too, but
> not necessarily the whole thing.

Thanks!

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] MIPS: vmlinuz: Fix compiler intrinsics location and build directly
  2018-04-04  9:18     ` [PATCH] MIPS: vmlinuz: Fix compiler intrinsics location and build directly Matt Redfearn
@ 2018-04-05 10:13       ` Matt Redfearn
  2018-04-05 21:42         ` James Hogan
  0 siblings, 1 reply; 11+ messages in thread
From: Matt Redfearn @ 2018-04-05 10:13 UTC (permalink / raw)
  To: James Hogan, Ralf Baechle
  Cc: linux-mips, Alban Bedel, Antony Pavlov, Palmer Dabbelt,
	Bartosz Golaszewski, linux-kernel

Hi James,

Actually, this patch would be better inserted as patch 3 in the series 
since it can pull in the generic ashldi3 before the MIPS one is removed 
in the final patch. Here's an updated commit message:

MIPS: vmlinuz: Use generic ashldi3 and build directly 

 

In preparation for removing some of the MIPS compiler intrinsics from 

arch/mips/lib, first update the build of vmlinuz to use the generic 

ashldi3 from lib. 

 

Both ashldi3 and bswapsi objects need to be built with different CFLAGS 

for inclusion to vmlinuz rather than simply including the object built 

for the main kernel image. But the current copy of the source C file to 

arch/mips/boot/compressed can be avoided by simply calling cmd,cc_o_c to 

build the object from the source directly. This also removes the need 

for the .gitignore file to ignore the copied files, and the extra-y rule 

to clean them.

Signed-off-by: Matt Redfearn <matt.redfearn@mips.com>

Thanks,
Matt



On 04/04/18 10:18, Matt Redfearn wrote:
> Since commit "MIPS: use generic GCC library routines from lib/", MIPS
> now uses the generic lib/ashldi3.c, but bswapsi.c still comes from
> arch/mips/lib. The rules for including these into vmlinuz need updating
> to reflect these locations.
> Both objects need to be built with different CFLAGS for inclusion to
> vmlinuz rather than simply including the object built for the main
> kernel image. But the copy of the source C file can be avoided by simply
> calling cmd,cc_o_c to build the object from the source directly. This
> also removes the need for the .gitignore file to ignore the copied
> files, and the extra-y rule to clean them.
> 
> Signed-off-by: Matt Redfearn <matt.redfearn@mips.com>
> ---
> 
>   arch/mips/boot/compressed/.gitignore | 2 --
>   arch/mips/boot/compressed/Makefile   | 8 ++++----
>   2 files changed, 4 insertions(+), 6 deletions(-)
>   delete mode 100644 arch/mips/boot/compressed/.gitignore
> 
> diff --git a/arch/mips/boot/compressed/.gitignore b/arch/mips/boot/compressed/.gitignore
> deleted file mode 100644
> index ebae133f1d00..000000000000
> --- a/arch/mips/boot/compressed/.gitignore
> +++ /dev/null
> @@ -1,2 +0,0 @@
> -ashldi3.c
> -bswapsi.c
> diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile
> index adce180f3ee4..8f04d659a915 100644
> --- a/arch/mips/boot/compressed/Makefile
> +++ b/arch/mips/boot/compressed/Makefile
> @@ -46,10 +46,10 @@ $(obj)/uart-ath79.c: $(srctree)/arch/mips/ath79/early_printk.c
>   
>   vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o $(obj)/bswapsi.o
>   
> -extra-y += ashldi3.c bswapsi.c
> -$(obj)/ashldi3.o $(obj)/bswapsi.o: KBUILD_CFLAGS += -I$(srctree)/arch/mips/lib
> -$(obj)/ashldi3.c $(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c
> -	$(call cmd,shipped)
> +$(obj)/ashldi3.o: $(srctree)/lib/ashldi3.c
> +	$(call cmd,cc_o_c)
> +$(obj)/bswapsi.o: $(srctree)/arch/mips/lib/bswapsi.c
> +	$(call cmd,cc_o_c)
>   
>   targets := $(notdir $(vmlinuzobjs-y))
>   
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] MIPS: vmlinuz: Fix compiler intrinsics location and build directly
  2018-04-05 10:13       ` Matt Redfearn
@ 2018-04-05 21:42         ` James Hogan
  2018-04-06 23:09           ` James Hogan
  0 siblings, 1 reply; 11+ messages in thread
From: James Hogan @ 2018-04-05 21:42 UTC (permalink / raw)
  To: Matt Redfearn
  Cc: Ralf Baechle, linux-mips, Alban Bedel, Antony Pavlov,
	Palmer Dabbelt, Bartosz Golaszewski, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 314 bytes --]

On Thu, Apr 05, 2018 at 11:13:14AM +0100, Matt Redfearn wrote:
> Actually, this patch would be better inserted as patch 3 in the series 
> since it can pull in the generic ashldi3 before the MIPS one is removed 
> in the final patch. Here's an updated commit message:

Thanks Matt, applied.

Cheers
James

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] MIPS: vmlinuz: Fix compiler intrinsics location and build directly
  2018-04-05 21:42         ` James Hogan
@ 2018-04-06 23:09           ` James Hogan
  0 siblings, 0 replies; 11+ messages in thread
From: James Hogan @ 2018-04-06 23:09 UTC (permalink / raw)
  To: Matt Redfearn
  Cc: Ralf Baechle, linux-mips, Alban Bedel, Antony Pavlov,
	Palmer Dabbelt, Bartosz Golaszewski, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 688 bytes --]

On Thu, Apr 05, 2018 at 10:42:19PM +0100, James Hogan wrote:
> On Thu, Apr 05, 2018 at 11:13:14AM +0100, Matt Redfearn wrote:
> > Actually, this patch would be better inserted as patch 3 in the series 
> > since it can pull in the generic ashldi3 before the MIPS one is removed 
> > in the final patch. Here's an updated commit message:
> 
> Thanks Matt, applied.

Loongson1b/c defconfigs are still broken unfortunately. The .o files
aren't getting generated, apparently due to a different cmd_cc_o_c
definition when CONFIG_MODVERSIONS=y.

I'm gonna drop this patchset from 4.17. Hopefully an updated version can
be applied for 4.18 after the merge window.

Thanks
James

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-04-06 23:09 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-03  9:24 [PATCH v5 1/3] Add notrace to lib/ucmpdi2.c Matt Redfearn
2018-04-03  9:24 ` [PATCH v5 2/3] lib: Rename compiler intrinsic selects to GENERIC_LIB_* Matt Redfearn
2018-04-03 22:39   ` Palmer Dabbelt
2018-04-04 22:02     ` James Hogan
2018-04-05  0:14       ` Palmer Dabbelt
2018-04-03  9:24 ` [PATCH v5 3/3] MIPS: use generic GCC library routines from lib/ Matt Redfearn
2018-04-03 16:07   ` James Hogan
2018-04-04  9:18     ` [PATCH] MIPS: vmlinuz: Fix compiler intrinsics location and build directly Matt Redfearn
2018-04-05 10:13       ` Matt Redfearn
2018-04-05 21:42         ` James Hogan
2018-04-06 23:09           ` James Hogan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).