LKML Archive on lore.kernel.org
 help / color / Atom feed
* Re: [linux-stable-rc:linux-5.4.y 665/2391] drivers/android/binder.c:3776: Error: unrecognized keyword/register name `l.lwz
       [not found] <202010160523.r8yMbvrW-lkp@intel.com>
@ 2020-10-15 21:46 ` Jann Horn
       [not found]   ` <CAAfxs77_h-DHOMFCJBWMuj1H5Rj8OiqC_U1Trs3A8gNCiPvo7w@mail.gmail.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Jann Horn @ 2020-10-15 21:46 UTC (permalink / raw)
  To: Jonas Bonn, Stefan Kristiansson, Stafford Horne, openrisc
  Cc: kbuild-all, Greg Kroah-Hartman, Martijn Coenen,
	kernel test robot, kernel list

+openrisc folks

On Thu, Oct 15, 2020 at 11:28 PM kernel test robot <lkp@intel.com> wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.4.y
> head:   85b0841aab15c12948af951d477183ab3df7de14
> commit: c5665cafbedd2e2a523fe933e452391a02d3adb3 [665/2391] binder: Prevent context manager from incrementing ref 0
> config: openrisc-randconfig-r002-20201014 (attached as .config)
> compiler: or1k-linux-gcc (GCC) 9.3.0
> reproduce (this is a W=1 build):
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/commit/?id=c5665cafbedd2e2a523fe933e452391a02d3adb3
>         git remote add linux-stable-rc https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
>         git fetch --no-tags linux-stable-rc linux-5.4.y
>         git checkout c5665cafbedd2e2a523fe933e452391a02d3adb3
>         # save the attached .config to linux build tree
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=openrisc
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
>
> All errors (new ones prefixed by >>):
>
>    drivers/android/binder.c: Assembler messages:
> >> drivers/android/binder.c:3776: Error: unrecognized keyword/register name `l.lwz ?ap,4(r25)'
>    drivers/android/binder.c:3781: Error: unrecognized keyword/register name `l.addi ?ap,r0,0'

binder is basically doing this:

u64 data_ptr;
if (get_user(data_ptr, (u64 __user *)ptr))
  return -EFAULT;

and GCC complains that that doesn't turn into valid assembly on
openrisc, where get_user() of size 8 expands into this:

#define __get_user_asm2(x, addr, err)                   \
{                                                       \
        unsigned long long __gu_tmp;                    \
        __asm__ __volatile__(                           \
                "1:     l.lwz %1,0(%2)\n"               \
                "2:     l.lwz %H1,4(%2)\n"              \
                "3:\n"                                  \
                ".section .fixup,\"ax\"\n"              \
                "4:     l.addi %0,r0,%3\n"              \
                "       l.addi %1,r0,0\n"               \
                "       l.addi %H1,r0,0\n"              \
                "       l.j 3b\n"                       \
                "       l.nop\n"                        \
                ".previous\n"                           \
                ".section __ex_table,\"a\"\n"           \
                "       .align 2\n"                     \
                "       .long 1b,4b\n"                  \
                "       .long 2b,4b\n"                  \
                ".previous"                             \
                : "=r"(err), "=&r"(__gu_tmp)            \
                : "r"(addr), "i"(-EFAULT), "0"(err));   \
        (x) = (__typeof__(*(addr)))(                    \
                (__typeof__((x)-(x)))__gu_tmp);         \
}

and apparently the "l.lwz %H1,4(%2)" and "l.addi %H1,r0,0" don't turn
into valid assembly when %H1 expands to "?ap"?

I don't know anything about OpenRISC, but this seems like it's
probably an issue in the get_user() implementation.

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

* Re: [linux-stable-rc:linux-5.4.y 665/2391] drivers/android/binder.c:3776: Error: unrecognized keyword/register name `l.lwz
       [not found]   ` <CAAfxs77_h-DHOMFCJBWMuj1H5Rj8OiqC_U1Trs3A8gNCiPvo7w@mail.gmail.com>
@ 2020-10-16  9:06     ` Greg Kroah-Hartman
  2020-10-17 21:08       ` Stafford Horne
  0 siblings, 1 reply; 3+ messages in thread
From: Greg Kroah-Hartman @ 2020-10-16  9:06 UTC (permalink / raw)
  To: Stafford Horne
  Cc: Jann Horn, Jonas Bonn, Stefan Kristiansson, openrisc, kbuild-all,
	Martijn Coenen, kernel test robot, kernel list

On Fri, Oct 16, 2020 at 08:05:17AM +0900, Stafford Horne wrote:
> On Fri, Oct 16, 2020, 6:46 AM Jann Horn <jannh@google.com> wrote:
> 
> > +openrisc folks
> >
> > On Thu, Oct 15, 2020 at 11:28 PM kernel test robot <lkp@intel.com> wrote:
> > > tree:
> > https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
> > linux-5.4.y
> > > head:   85b0841aab15c12948af951d477183ab3df7de14
> > > commit: c5665cafbedd2e2a523fe933e452391a02d3adb3 [665/2391] binder:
> > Prevent context manager from incrementing ref 0
> > > config: openrisc-randconfig-r002-20201014 (attached as .config)
> > > compiler: or1k-linux-gcc (GCC) 9.3.0
> > > reproduce (this is a W=1 build):
> > >         wget
> > https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross
> > -O ~/bin/make.cross
> > >         chmod +x ~/bin/make.cross
> > >         #
> > https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/commit/?id=c5665cafbedd2e2a523fe933e452391a02d3adb3
> > >         git remote add linux-stable-rc
> > https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
> > >         git fetch --no-tags linux-stable-rc linux-5.4.y
> > >         git checkout c5665cafbedd2e2a523fe933e452391a02d3adb3
> > >         # save the attached .config to linux build tree
> > >         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross
> > ARCH=openrisc
> > >
> > > If you fix the issue, kindly add following tag as appropriate
> > > Reported-by: kernel test robot <lkp@intel.com>
> > >
> > > All errors (new ones prefixed by >>):
> > >
> > >    drivers/android/binder.c: Assembler messages:
> > > >> drivers/android/binder.c:3776: Error: unrecognized keyword/register
> > name `l.lwz ?ap,4(r25)'
> > >    drivers/android/binder.c:3781: Error: unrecognized keyword/register
> > name `l.addi ?ap,r0,0'
> >
> > binder is basically doing this:
> >
> > u64 data_ptr;
> > if (get_user(data_ptr, (u64 __user *)ptr))
> >   return -EFAULT;
> >
> > and GCC complains that that doesn't turn into valid assembly on
> > openrisc, where get_user() of size 8 expands into this:
> >
> > #define __get_user_asm2(x, addr, err)                   \
> > {                                                       \
> >         unsigned long long __gu_tmp;                    \
> >         __asm__ __volatile__(                           \
> >                 "1:     l.lwz %1,0(%2)\n"               \
> >                 "2:     l.lwz %H1,4(%2)\n"              \
> >                 "3:\n"                                  \
> >                 ".section .fixup,\"ax\"\n"              \
> >                 "4:     l.addi %0,r0,%3\n"              \
> >                 "       l.addi %1,r0,0\n"               \
> >                 "       l.addi %H1,r0,0\n"              \
> >                 "       l.j 3b\n"                       \
> >                 "       l.nop\n"                        \
> >                 ".previous\n"                           \
> >                 ".section __ex_table,\"a\"\n"           \
> >                 "       .align 2\n"                     \
> >                 "       .long 1b,4b\n"                  \
> >                 "       .long 2b,4b\n"                  \
> >                 ".previous"                             \
> >                 : "=r"(err), "=&r"(__gu_tmp)            \
> >                 : "r"(addr), "i"(-EFAULT), "0"(err));   \
> >         (x) = (__typeof__(*(addr)))(                    \
> >                 (__typeof__((x)-(x)))__gu_tmp);         \
> > }
> >
> > and apparently the "l.lwz %H1,4(%2)" and "l.addi %H1,r0,0" don't turn
> > into valid assembly when %H1 expands to "?ap"?
> >
> > I don't know anything about OpenRISC, but this seems like it's
> > probably an issue in the get_user() implementation.
> >
> 
> This is fixed in 5.9.  I think the patch can be cherry picked by itself.
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/openrisc?h=v5.9&id=d877322bc1adcab9850732275670409e8bcca4c4

Does not apply cleanly to 5.8.y or 5.4.y, can someone please properly
backport it and send it to stable@vger.kernel.org?

thanks,

greg k-h

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

* Re: [linux-stable-rc:linux-5.4.y 665/2391] drivers/android/binder.c:3776: Error: unrecognized keyword/register name `l.lwz
  2020-10-16  9:06     ` Greg Kroah-Hartman
@ 2020-10-17 21:08       ` Stafford Horne
  0 siblings, 0 replies; 3+ messages in thread
From: Stafford Horne @ 2020-10-17 21:08 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jann Horn, Jonas Bonn, Stefan Kristiansson, openrisc, kbuild-all,
	Martijn Coenen, kernel test robot, kernel list

On Fri, Oct 16, 2020 at 11:06:38AM +0200, Greg Kroah-Hartman wrote:
> On Fri, Oct 16, 2020 at 08:05:17AM +0900, Stafford Horne wrote:
> > On Fri, Oct 16, 2020, 6:46 AM Jann Horn <jannh@google.com> wrote:
> > 
> > > +openrisc folks
> > >
> > > On Thu, Oct 15, 2020 at 11:28 PM kernel test robot <lkp@intel.com> wrote:
> > > > tree:
> > > https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
> > > linux-5.4.y
> > > > head:   85b0841aab15c12948af951d477183ab3df7de14
> > > > commit: c5665cafbedd2e2a523fe933e452391a02d3adb3 [665/2391] binder:
> > > Prevent context manager from incrementing ref 0
> > > > config: openrisc-randconfig-r002-20201014 (attached as .config)
> > > > compiler: or1k-linux-gcc (GCC) 9.3.0
> > > > reproduce (this is a W=1 build):
> > > >         wget
> > > https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross
> > > -O ~/bin/make.cross
> > > >         chmod +x ~/bin/make.cross
> > > >         #
> > > https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/commit/?id=c5665cafbedd2e2a523fe933e452391a02d3adb3
> > > >         git remote add linux-stable-rc
> > > https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
> > > >         git fetch --no-tags linux-stable-rc linux-5.4.y
> > > >         git checkout c5665cafbedd2e2a523fe933e452391a02d3adb3
> > > >         # save the attached .config to linux build tree
> > > >         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross
> > > ARCH=openrisc
> > > >
> > > > If you fix the issue, kindly add following tag as appropriate
> > > > Reported-by: kernel test robot <lkp@intel.com>
> > > >
> > > > All errors (new ones prefixed by >>):
> > > >
> > > >    drivers/android/binder.c: Assembler messages:
> > > > >> drivers/android/binder.c:3776: Error: unrecognized keyword/register
> > > name `l.lwz ?ap,4(r25)'
> > > >    drivers/android/binder.c:3781: Error: unrecognized keyword/register
> > > name `l.addi ?ap,r0,0'
> > >
> > > binder is basically doing this:
> > >
> > > u64 data_ptr;
> > > if (get_user(data_ptr, (u64 __user *)ptr))
> > >   return -EFAULT;
> > >
> > > and GCC complains that that doesn't turn into valid assembly on
> > > openrisc, where get_user() of size 8 expands into this:
> > >
> > > #define __get_user_asm2(x, addr, err)                   \
> > > {                                                       \
> > >         unsigned long long __gu_tmp;                    \
> > >         __asm__ __volatile__(                           \
> > >                 "1:     l.lwz %1,0(%2)\n"               \
> > >                 "2:     l.lwz %H1,4(%2)\n"              \
> > >                 "3:\n"                                  \
> > >                 ".section .fixup,\"ax\"\n"              \
> > >                 "4:     l.addi %0,r0,%3\n"              \
> > >                 "       l.addi %1,r0,0\n"               \
> > >                 "       l.addi %H1,r0,0\n"              \
> > >                 "       l.j 3b\n"                       \
> > >                 "       l.nop\n"                        \
> > >                 ".previous\n"                           \
> > >                 ".section __ex_table,\"a\"\n"           \
> > >                 "       .align 2\n"                     \
> > >                 "       .long 1b,4b\n"                  \
> > >                 "       .long 2b,4b\n"                  \
> > >                 ".previous"                             \
> > >                 : "=r"(err), "=&r"(__gu_tmp)            \
> > >                 : "r"(addr), "i"(-EFAULT), "0"(err));   \
> > >         (x) = (__typeof__(*(addr)))(                    \
> > >                 (__typeof__((x)-(x)))__gu_tmp);         \
> > > }
> > >
> > > and apparently the "l.lwz %H1,4(%2)" and "l.addi %H1,r0,0" don't turn
> > > into valid assembly when %H1 expands to "?ap"?
> > >
> > > I don't know anything about OpenRISC, but this seems like it's
> > > probably an issue in the get_user() implementation.
> > >
> > 
> > This is fixed in 5.9.  I think the patch can be cherry picked by itself.
> > 
> > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/openrisc?h=v5.9&id=d877322bc1adcab9850732275670409e8bcca4c4
> 
> Does not apply cleanly to 5.8.y or 5.4.y, can someone please properly
> backport it and send it to stable@vger.kernel.org?

I will do it.

-Stafford

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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <202010160523.r8yMbvrW-lkp@intel.com>
2020-10-15 21:46 ` [linux-stable-rc:linux-5.4.y 665/2391] drivers/android/binder.c:3776: Error: unrecognized keyword/register name `l.lwz Jann Horn
     [not found]   ` <CAAfxs77_h-DHOMFCJBWMuj1H5Rj8OiqC_U1Trs3A8gNCiPvo7w@mail.gmail.com>
2020-10-16  9:06     ` Greg Kroah-Hartman
2020-10-17 21:08       ` Stafford Horne

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git
	git clone --mirror https://lore.kernel.org/lkml/8 lkml/git/8.git
	git clone --mirror https://lore.kernel.org/lkml/9 lkml/git/9.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git