public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: James Hogan <james.hogan@mips.com>
To: Antony Pavlov <antonynpavlov@gmail.com>
Cc: Matt Redfearn <matt.redfearn@mips.com>,
	Palmer Dabbelt <palmer@sifive.com>, <linux-mips@linux-mips.org>,
	<linux-kernel@vger.kernel.org>,
	Ralf Baechle <ralf@linux-mips.org>
Subject: Re: [PATCH] MIPS: use generic GCC library routines from lib/
Date: Thu, 18 Jan 2018 20:28:36 +0000	[thread overview]
Message-ID: <20180118202835.GE27409@jhogan-linux.mipstec.com> (raw)
In-Reply-To: <20180117163418.ba77b2f72298092fb843fda7@gmail.com>

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

On Wed, Jan 17, 2018 at 04:34:18PM +0300, Antony Pavlov wrote:
> On Wed, 17 Jan 2018 09:03:48 +0000
> Matt Redfearn <matt.redfearn@mips.com> wrote:
> 
> > Hi,
> > 
> > On Wed, Jan 17, 2018 at 09:51:21AM +0300, Antony Pavlov wrote:
> > > 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>
> > > Cc: Palmer Dabbelt <palmer@sifive.com>
> > > Cc: Ralf Baechle <ralf@linux-mips.org>
> > > Cc: linux-mips@linux-mips.org
> > > Cc: linux-kernel@vger.kernel.org
> > > ---
> > >  arch/mips/Kconfig       |  5 +++++
> > >  arch/mips/lib/Makefile  |  2 +-
> > >  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(+), 143 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 350a990fc719..9cd49ee848c6 100644
> > > --- a/arch/mips/Kconfig
> > > +++ b/arch/mips/Kconfig
> > > @@ -73,6 +73,11 @@ config MIPS
> > >  	select RTC_LIB if !MACH_LOONGSON64
> > >  	select SYSCTL_EXCEPTION_TRACE
> > >  	select VIRT_TO_BUS
> > > +	select GENERIC_ASHLDI3
> > > +	select GENERIC_ASHRDI3
> > > +	select GENERIC_LSHRDI3
> > > +	select GENERIC_CMPDI2
> > > +	select GENERIC_UCMPDI2
> > 
> > Please preserve alphabetical order
> 
> Ok, I'll fix order in v2 patch.
> 
> > > --- 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)
> > 
> > The version of __ucmpdi2 in /lib/ is not marked notrace. We have seen
> > issues before with compiler intrinsics not being marked notrace - see
> > aedcfbe06558 ("MIPS: lib: Mark intrinsics notrace")
> > 
> > Please ensure that the /lib/ version is equivalent before switching to
> > that version.
> 
> Good shot! I have missed this 'notrace'.
> 
> lib/ucmpdi2.c differ from other GCC library routines files from lib
> related to my patch (ashldi3.c, ashrdi3.c, cmpdi2.c, lshrdi3.c):
> only lib/ucmpdi2.c has no 'notrace' flag. In other details the files
> look equivalent. The files arch/mips/lib/libgcc.h and include/linux/libgcc.h
> have no fundamental differences.
> 
> to Palmer:
> Can we add notrace to lib/ucmpdi2.c?

FWIW, with both matt's comments addressed:
Reviewed-by: James Hogan <jhogan@kernel.org>

Cheers
James

> It looks like that nobody (even RISC-V code)
> uses GENERIC_CMPDI2 and GENERIC_UCMPDI2. Why?
> Do you use them in your local branches?
> 
> -- 
> Best regards,
>   Antony Pavlov
> 

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

  parent reply	other threads:[~2018-01-18 20:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-17  6:51 [PATCH] MIPS: use generic GCC library routines from lib/ Antony Pavlov
2018-01-17  9:03 ` Matt Redfearn
2018-01-17 13:34   ` Antony Pavlov
2018-01-18 16:05     ` Palmer Dabbelt
2018-01-18 20:28     ` James Hogan [this message]
2018-01-18 16:05   ` Palmer Dabbelt
2018-01-18  1:34 ` Palmer Dabbelt
2018-01-18 20:05   ` Antony Pavlov
2018-01-18 19:54     ` James Hogan
2018-01-18 20:24       ` James Hogan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180118202835.GE27409@jhogan-linux.mipstec.com \
    --to=james.hogan@mips.com \
    --cc=antonynpavlov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=matt.redfearn@mips.com \
    --cc=palmer@sifive.com \
    --cc=ralf@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox