All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guo Ren <guoren@kernel.org>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-csky@vger.kernel.org,
	linux-arch <linux-arch@vger.kernel.org>,
	Guo Ren <guoren@linux.alibaba.com>
Subject: Re: [PATCH] csky: uaccess.h: Coding convention with asm generic
Date: Wed, 28 Apr 2021 16:29:38 +0800	[thread overview]
Message-ID: <CAJF2gTTSMC947zisNs+j_2rMoBqoOy-j1jvVBk2DNrf0Xt6sWA@mail.gmail.com> (raw)
In-Reply-To: <20210428031807.GA27619@roeck-us.net>

Thx, Guenter

On Wed, Apr 28, 2021 at 11:18 AM Guenter Roeck <linux@roeck-us.net> wrote:
>
> On Wed, Apr 21, 2021 at 08:54:15AM +0000, guoren@kernel.org wrote:
> > From: Guo Ren <guoren@linux.alibaba.com>
> >
> > Using asm-generic/uaccess.h to prevent duplicated code:
> >  - Add user_addr_max which mentioned in generic uaccess.h
> >  - Remove custom definitions of KERNEL/USER_DS, get/set_fs,
> >    uaccess_kerenl
> >  - Using generic extable.h instead of custom definitions in
> >    uaccess.h
> >
> > Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
> > Cc: Arnd Bergmann <arnd@arndb.de>
>
> Building csky:tinyconfig ... failed
> --------------
> Error log:
> csky-linux-ld: fs/readdir.o: in function `__put_user_fn':
> readdir.c:(.text+0x7c): undefined reference to `__put_user_bad'
> csky-linux-ld: fs/readdir.o: in function `$d':
> readdir.c:(.text+0x1bc): undefined reference to `__put_user_bad'
> make[1]: *** [Makefile:1277: vmlinux] Error 1
> make: *** [Makefile:222: __sub-make] Error 2
It's a bug, I can't put __put_user_bad in __put_user_fn, and
__put_user has done that:

/*
 * These are the main single-value transfer routines.  They automatically
 * use the right size if we just have the right pointer type.
 * This version just falls back to copy_{from,to}_user, which should
 * provide a fast-path for small values.
 */
#define __put_user(x, ptr) \
({                                                              \
        __typeof__(*(ptr)) __x = (x);                           \
        int __pu_err = -EFAULT;                                 \
        __chk_user_ptr(ptr);                                    \
        switch (sizeof (*(ptr))) {                              \
        case 1:                                                 \
        case 2:                                                 \
        case 4:                                                 \
        case 8:                                                 \
                __pu_err = __put_user_fn(sizeof (*(ptr)),       \
                                         ptr, &__x);            \
                break;                                          \
        default:                                                \
                __put_user_bad();                               \
                break;                                          \
         }                                                      \
        __pu_err;                                               \
})

Also, the same problem in __get_user, and I didn't implement "case 8:".

I'll fix up it in another patch and implement __get_user_case_8
(similar with arch/arc.)

>
> Bisect log attached.
>
> Guenter
>
> ---
> # bad: [3f1fee3e7237347f09a2c7fa538119e6d9ea4b84] Add linux-next specific files for 20210426
> # good: [9f4ad9e425a1d3b6a34617b8ea226d56a119a717] Linux 5.12
> git bisect start 'HEAD' 'v5.12'
> # bad: [bb8f486776983897309645c98705670c3d2a16e5] Merge remote-tracking branch 'crypto/master'
> git bisect bad bb8f486776983897309645c98705670c3d2a16e5
> # bad: [6ab4f4364c450991a476eef5bc57bef3586354ed] Merge remote-tracking branch 'jc_docs/docs-next'
> git bisect bad 6ab4f4364c450991a476eef5bc57bef3586354ed
> # bad: [fd73cab0b2a046136842b23f027dae3686588ba5] Merge remote-tracking branch 'parisc-hd/for-next'
> git bisect bad fd73cab0b2a046136842b23f027dae3686588ba5
> # good: [f0e6103e023e0ede67848ddcd6b07044574f4fd3] soc: document merges
> git bisect good f0e6103e023e0ede67848ddcd6b07044574f4fd3
> # good: [70361dc0add47d3818acf9c33718ce7395f8aaa5] Merge remote-tracking branch 'arm-soc/for-next'
> git bisect good 70361dc0add47d3818acf9c33718ce7395f8aaa5
> # good: [f62ad9f6e1100e3a1b6ca7a004fd5a972ff768df] Merge remote-tracking branch 'ti-k3/ti-k3-next'
> git bisect good f62ad9f6e1100e3a1b6ca7a004fd5a972ff768df
> # bad: [b3b33dda4fd25e201c77f0ce9277dd34f31e86ce] Merge remote-tracking branch 'h8300/h8300-next'
> git bisect bad b3b33dda4fd25e201c77f0ce9277dd34f31e86ce
> # good: [6a861bd8cf3c96f5825d031732e365b7721a84a5] Merge branch 'clk-qcom' into clk-next
> git bisect good 6a861bd8cf3c96f5825d031732e365b7721a84a5
> # good: [1dd129f1deec0606fb70992521a7e5bcd2f85c69] Merge branch 'clk-qcom' into clk-next
> git bisect good 1dd129f1deec0606fb70992521a7e5bcd2f85c69
> # good: [8808515be0ed4e33de9bfdc65f4c1b547ee11065] h8300: Replace <linux/clk-provider.h> by <linux/of_clk.h>
> git bisect good 8808515be0ed4e33de9bfdc65f4c1b547ee11065
> # good: [e27d3ecdeb8923f35cb856fd20be14256aaa7575] Merge remote-tracking branch 'clk/clk-next'
> git bisect good e27d3ecdeb8923f35cb856fd20be14256aaa7575
> # bad: [d3900e8d918f8fbd1366b9c2998e2830e66a0081] csky: uaccess.h: Coding convention with asm generic
> git bisect bad d3900e8d918f8fbd1366b9c2998e2830e66a0081
> # good: [0b1f557a1fa02174a982f557581e348d91987ec6] csky: Fixup typos
> git bisect good 0b1f557a1fa02174a982f557581e348d91987ec6
> # good: [8bfe70e696584deeed1de1bcbfcde405aa1a1344] csky: fix syscache.c fallthrough warning
> git bisect good 8bfe70e696584deeed1de1bcbfcde405aa1a1344
> # first bad commit: [d3900e8d918f8fbd1366b9c2998e2830e66a0081] csky: uaccess.h: Coding convention with asm generic



-- 
Best Regards
 Guo Ren

ML: https://lore.kernel.org/linux-csky/

  reply	other threads:[~2021-04-28  8:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-21  8:54 [PATCH] csky: uaccess.h: Coding convention with asm generic guoren
2021-04-21 14:48 ` Christoph Hellwig
2021-04-28  3:18 ` Guenter Roeck
2021-04-28  8:29   ` Guo Ren [this message]
2021-04-28  9:25     ` Arnd Bergmann
2021-04-28 12:49       ` Christoph Hellwig
2021-04-28 13:07         ` Guo Ren
2021-04-28 13:48         ` Arnd Bergmann
2021-04-28 13:03       ` Guo Ren

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=CAJF2gTTSMC947zisNs+j_2rMoBqoOy-j1jvVBk2DNrf0Xt6sWA@mail.gmail.com \
    --to=guoren@kernel.org \
    --cc=arnd@arndb.de \
    --cc=guoren@linux.alibaba.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-csky@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.