2018-03-29 13:26:54

by Matt Redfearn

[permalink] [raw]
Subject: [PATCH v4 1/3] Add notrace to lib/ucmpdi2.c

From: Palmer Dabbelt <[email protected]>

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 <[email protected]>
CC: Antony Pavlov <[email protected]>
Signed-off-by: Palmer Dabbelt <[email protected]>
Reviewed-by: Matt Redfearn <[email protected]>
Signed-off-by: Matt Redfearn <[email protected]>
---

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



2018-03-29 13:28:09

by Matt Redfearn

[permalink] [raw]
Subject: [PATCH v4 3/3] MIPS: use generic GCC library routines from lib/

From: Antony Pavlov <[email protected]>

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 <[email protected]>
[Matt Redfearn] Use GENERIC_LIB_* named Kconfig entries
Signed-off-by: Matt Redfearn <[email protected]>
Cc: Palmer Dabbelt <[email protected]>
Cc: Matt Redfearn <[email protected]>
Cc: James Hogan <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: [email protected]
Cc: [email protected]

---

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 +--
2 files changed, 6 insertions(+), 2 deletions(-)

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
--
2.7.4


2018-03-29 13:28:56

by Matt Redfearn

[permalink] [raw]
Subject: [PATCH v4 2/3] lib: Rename compiler intrinsic selects to GENERIC_LIB_*

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 <[email protected]>
Reviewed-by: Palmer Dabbelt <[email protected]>

---

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


2018-03-29 22:01:05

by Palmer Dabbelt

[permalink] [raw]
Subject: Re: [PATCH v4 1/3] Add notrace to lib/ucmpdi2.c

On Thu, 29 Mar 2018 03:41:21 PDT (-0700), [email protected] wrote:
> From: Palmer Dabbelt <[email protected]>
>
> 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 <[email protected]>
> CC: Antony Pavlov <[email protected]>
> Signed-off-by: Palmer Dabbelt <[email protected]>
> Reviewed-by: Matt Redfearn <[email protected]>
> Signed-off-by: Matt Redfearn <[email protected]>
> ---
>
> 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};

Ah, thanks, I think I must have forgotten about this. I assume these three are
going through your tree?

2018-04-03 08:55:26

by James Hogan

[permalink] [raw]
Subject: Re: [PATCH v4 3/3] MIPS: use generic GCC library routines from lib/

On Thu, Mar 29, 2018 at 11:41:23AM +0100, Matt Redfearn wrote:
> This commit removes several generic GCC library routines from
> arch/mips/lib/ in favour of similar routines from lib/.

> 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

Have you missed deleting the files?

Cheers
James


Attachments:
(No filename) (720.00 B)
signature.asc (849.00 B)
Digital signature
Download all attachments

2018-04-03 09:25:09

by Matt Redfearn

[permalink] [raw]
Subject: Re: [PATCH v4 3/3] MIPS: use generic GCC library routines from lib/



On 03/04/18 09:53, James Hogan wrote:
> On Thu, Mar 29, 2018 at 11:41:23AM +0100, Matt Redfearn wrote:
>> This commit removes several generic GCC library routines from
>> arch/mips/lib/ in favour of similar routines from lib/.
>
>> 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
>
> Have you missed deleting the files?

Oops, got lost during the rebase :-/

Thanks,
Matt

>
> Cheers
> James
>

2018-04-03 13:52:36

by Matt Redfearn

[permalink] [raw]
Subject: Re: [PATCH v4 1/3] Add notrace to lib/ucmpdi2.c

Hi Palmer,

On 29/03/18 22:59, Palmer Dabbelt wrote:
> On Thu, 29 Mar 2018 03:41:21 PDT (-0700), [email protected] wrote:
>> From: Palmer Dabbelt <[email protected]>
>>
>> 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 <[email protected]>
>> CC: Antony Pavlov <[email protected]>
>> Signed-off-by: Palmer Dabbelt <[email protected]>
>> Reviewed-by: Matt Redfearn <[email protected]>
>> Signed-off-by: Matt Redfearn <[email protected]>
>> ---
>>
>> 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};
>
> Ah, thanks, I think I must have forgotten about this.  I assume these
> three are going through your tree?

Yeah I think that's the plan - James will need your ack to patch 2 if
that's ok.

Thanks,
Matt

2018-04-03 14:47:14

by James Hogan

[permalink] [raw]
Subject: Re: [PATCH v4 1/3] Add notrace to lib/ucmpdi2.c

On Tue, Apr 03, 2018 at 02:51:06PM +0100, Matt Redfearn wrote:
> On 29/03/18 22:59, Palmer Dabbelt wrote:
> > Ah, thanks, I think I must have forgotten about this.  I assume these
> > three are going through your tree?
>
> Yeah I think that's the plan - James will need your ack to patch 2 if
> that's ok.

Yeh, I've applied v5 for 4.17 with Palmer's reviewed-by, but I'll change
to an ack if thats okay with Palmer.

Cheers
James


Attachments:
(No filename) (448.00 B)
signature.asc (849.00 B)
Digital signature
Download all attachments

2018-04-03 23:09:43

by Palmer Dabbelt

[permalink] [raw]
Subject: Re: [PATCH v4 1/3] Add notrace to lib/ucmpdi2.c

On Tue, 03 Apr 2018 06:51:06 PDT (-0700), [email protected] wrote:
> Hi Palmer,
>
> On 29/03/18 22:59, Palmer Dabbelt wrote:
>> On Thu, 29 Mar 2018 03:41:21 PDT (-0700), [email protected] wrote:
>>> From: Palmer Dabbelt <[email protected]>
>>>
>>> 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 <[email protected]>
>>> CC: Antony Pavlov <[email protected]>
>>> Signed-off-by: Palmer Dabbelt <[email protected]>
>>> Reviewed-by: Matt Redfearn <[email protected]>
>>> Signed-off-by: Matt Redfearn <[email protected]>
>>> ---
>>>
>>> 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};
>>
>> Ah, thanks, I think I must have forgotten about this.  I assume these
>> three are going through your tree?
>
> Yeah I think that's the plan - James will need your ack to patch 2 if
> that's ok.

OK, I think I acked the right one... :)

2018-04-03 23:10:52

by Palmer Dabbelt

[permalink] [raw]
Subject: Re: [PATCH v4 1/3] Add notrace to lib/ucmpdi2.c

On Tue, 03 Apr 2018 07:45:45 PDT (-0700), [email protected] wrote:
> On Tue, Apr 03, 2018 at 02:51:06PM +0100, Matt Redfearn wrote:
>> On 29/03/18 22:59, Palmer Dabbelt wrote:
>> > Ah, thanks, I think I must have forgotten about this.  I assume these
>> > three are going through your tree?
>>
>> Yeah I think that's the plan - James will need your ack to patch 2 if
>> that's ok.
>
> Yeh, I've applied v5 for 4.17 with Palmer's reviewed-by, but I'll change
> to an ack if thats okay with Palmer.
>

Either way is OK for me.