linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* arch/x86/lib/copy_mc.c:30:1: warning: no previous prototype for 'copy_mc_fragile_handle_tail'
@ 2021-06-09 22:43 kernel test robot
  2021-06-09 23:43 ` Dan Williams
  0 siblings, 1 reply; 6+ messages in thread
From: kernel test robot @ 2021-06-09 22:43 UTC (permalink / raw)
  To: Dan Williams; +Cc: kbuild-all, linux-kernel, Borislav Petkov, Tony Luck

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

Hi Dan,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   368094df48e680fa51cedb68537408cfa64b788e
commit: ec6347bb43395cb92126788a1a5b25302543f815 x86, powerpc: Rename memcpy_mcsafe() to copy_mc_to_{user, kernel}()
date:   8 months ago
config: x86_64-randconfig-r025-20210610 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ec6347bb43395cb92126788a1a5b25302543f815
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout ec6347bb43395cb92126788a1a5b25302543f815
        # save the attached .config to linux build tree
        make W=1 ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> arch/x86/lib/copy_mc.c:30:1: warning: no previous prototype for 'copy_mc_fragile_handle_tail' [-Wmissing-prototypes]
      30 | copy_mc_fragile_handle_tail(char *to, char *from, unsigned len)
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +/copy_mc_fragile_handle_tail +30 arch/x86/lib/copy_mc.c

    24	
    25	/*
    26	 * Similar to copy_user_handle_tail, probe for the write fault point, or
    27	 * source exception point.
    28	 */
    29	__visible notrace unsigned long
  > 30	copy_mc_fragile_handle_tail(char *to, char *from, unsigned len)
    31	{
    32		for (; len; --len, to++, from++)
    33			if (copy_mc_fragile(to, from, 1))
    34				break;
    35		return len;
    36	}
    37	#else
    38	/*
    39	 * No point in doing careful copying, or consulting a static key when
    40	 * there is no #MC handler in the CONFIG_X86_MCE=n case.
    41	 */
    42	void enable_copy_mc_fragile(void)
    43	{
    44	}
    45	#define copy_mc_fragile_enabled (0)
    46	#endif
    47	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 30945 bytes --]

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

* Re: arch/x86/lib/copy_mc.c:30:1: warning: no previous prototype for 'copy_mc_fragile_handle_tail'
  2021-06-09 22:43 arch/x86/lib/copy_mc.c:30:1: warning: no previous prototype for 'copy_mc_fragile_handle_tail' kernel test robot
@ 2021-06-09 23:43 ` Dan Williams
  2021-06-09 23:55   ` Luck, Tony
  0 siblings, 1 reply; 6+ messages in thread
From: Dan Williams @ 2021-06-09 23:43 UTC (permalink / raw)
  To: kernel test robot
  Cc: kbuild-all, Linux Kernel Mailing List, Borislav Petkov, Tony Luck

On Wed, Jun 9, 2021 at 3:43 PM kernel test robot <lkp@intel.com> wrote:
>
> Hi Dan,
>
> FYI, the error/warning still remains.
>
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   368094df48e680fa51cedb68537408cfa64b788e
> commit: ec6347bb43395cb92126788a1a5b25302543f815 x86, powerpc: Rename memcpy_mcsafe() to copy_mc_to_{user, kernel}()
> date:   8 months ago
> config: x86_64-randconfig-r025-20210610 (attached as .config)
> compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
> reproduce (this is a W=1 build):
>         # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ec6347bb43395cb92126788a1a5b25302543f815
>         git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>         git fetch --no-tags linus master
>         git checkout ec6347bb43395cb92126788a1a5b25302543f815
>         # save the attached .config to linux build tree
>         make W=1 ARCH=x86_64
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
>
> All warnings (new ones prefixed by >>):
>
> >> arch/x86/lib/copy_mc.c:30:1: warning: no previous prototype for 'copy_mc_fragile_handle_tail' [-Wmissing-prototypes]
>       30 | copy_mc_fragile_handle_tail(char *to, char *from, unsigned len)
>          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~

This routine is only ever called from ASM code, so the fact that there
is no C declaration is expected.

For W=1 builds we could do something like this:

diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
index bad4dee4f0e4..b87f40cbc3d5 100644
--- a/arch/x86/lib/Makefile
+++ b/arch/x86/lib/Makefile
@@ -44,6 +44,7 @@ obj-$(CONFIG_SMP) += msr-smp.o cache-smp.o
 lib-y := delay.o misc.o cmdline.o cpu.o
 lib-y += usercopy_$(BITS).o usercopy.o getuser.o putuser.o
 lib-y += memcpy_$(BITS).o
+CFLAGS_copy_mc.o = -Wno-strict-prototypes
 lib-$(CONFIG_ARCH_HAS_COPY_MC) += copy_mc.o copy_mc_64.o
 lib-$(CONFIG_INSTRUCTION_DECODER) += insn.o inat.o insn-eval.o
 lib-$(CONFIG_RANDOMIZE_BASE) += kaslr.o

...but I don't like it nor adding a dummy declaration.

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

* RE: arch/x86/lib/copy_mc.c:30:1: warning: no previous prototype for 'copy_mc_fragile_handle_tail'
  2021-06-09 23:43 ` Dan Williams
@ 2021-06-09 23:55   ` Luck, Tony
  2021-06-10  0:13     ` Dan Williams
  0 siblings, 1 reply; 6+ messages in thread
From: Luck, Tony @ 2021-06-09 23:55 UTC (permalink / raw)
  To: Williams, Dan J, lkp
  Cc: kbuild-all, Linux Kernel Mailing List, Borislav Petkov

> This routine is only ever called from ASM code, so the fact that there
> is no C declaration is expected.

Does the asm code really need to call back into C?

Could you just have the asm code do "jmp .L_read_trailing_bytes" (might need to only do that if %ecx is non-zero)?

-Tony

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

* Re: arch/x86/lib/copy_mc.c:30:1: warning: no previous prototype for 'copy_mc_fragile_handle_tail'
  2021-06-09 23:55   ` Luck, Tony
@ 2021-06-10  0:13     ` Dan Williams
  0 siblings, 0 replies; 6+ messages in thread
From: Dan Williams @ 2021-06-10  0:13 UTC (permalink / raw)
  To: Luck, Tony; +Cc: lkp, kbuild-all, Linux Kernel Mailing List, Borislav Petkov

On Wed, Jun 9, 2021 at 4:55 PM Luck, Tony <tony.luck@intel.com> wrote:
>
> > This routine is only ever called from ASM code, so the fact that there
> > is no C declaration is expected.
>
> Does the asm code really need to call back into C?
>
> Could you just have the asm code do "jmp .L_read_trailing_bytes" (might need to only do that if %ecx is non-zero)?

I could... it turns out when Peter did this:

3693ca81151e x86/uaccess: Move copy_user_handle_tail() into asm

...he did not also go fixup my cargo culting. I'll take a look...

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

* arch/x86/lib/copy_mc.c:30:1: warning: no previous prototype for 'copy_mc_fragile_handle_tail'
@ 2021-04-28  8:32 kernel test robot
  0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2021-04-28  8:32 UTC (permalink / raw)
  To: Dan Williams; +Cc: kbuild-all, linux-kernel, Borislav Petkov, Tony Luck

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

Hi Dan,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   acd3d28594536e9096c1ea76c5867d8a68babef6
commit: ec6347bb43395cb92126788a1a5b25302543f815 x86, powerpc: Rename memcpy_mcsafe() to copy_mc_to_{user, kernel}()
date:   7 months ago
config: x86_64-randconfig-r016-20210428 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ec6347bb43395cb92126788a1a5b25302543f815
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout ec6347bb43395cb92126788a1a5b25302543f815
        # save the attached .config to linux build tree
        make W=1 W=1 ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> arch/x86/lib/copy_mc.c:30:1: warning: no previous prototype for 'copy_mc_fragile_handle_tail' [-Wmissing-prototypes]
      30 | copy_mc_fragile_handle_tail(char *to, char *from, unsigned len)
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +/copy_mc_fragile_handle_tail +30 arch/x86/lib/copy_mc.c

    24	
    25	/*
    26	 * Similar to copy_user_handle_tail, probe for the write fault point, or
    27	 * source exception point.
    28	 */
    29	__visible notrace unsigned long
  > 30	copy_mc_fragile_handle_tail(char *to, char *from, unsigned len)
    31	{
    32		for (; len; --len, to++, from++)
    33			if (copy_mc_fragile(to, from, 1))
    34				break;
    35		return len;
    36	}
    37	#else
    38	/*
    39	 * No point in doing careful copying, or consulting a static key when
    40	 * there is no #MC handler in the CONFIG_X86_MCE=n case.
    41	 */
    42	void enable_copy_mc_fragile(void)
    43	{
    44	}
    45	#define copy_mc_fragile_enabled (0)
    46	#endif
    47	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 37140 bytes --]

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

* arch/x86/lib/copy_mc.c:30:1: warning: no previous prototype for 'copy_mc_fragile_handle_tail'
@ 2021-03-30 18:10 kernel test robot
  0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2021-03-30 18:10 UTC (permalink / raw)
  To: Dan Williams; +Cc: kbuild-all, linux-kernel, Borislav Petkov, Tony Luck

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   1e43c377a79f9189fea8f2711b399d4e8b4e609b
commit: ec6347bb43395cb92126788a1a5b25302543f815 x86, powerpc: Rename memcpy_mcsafe() to copy_mc_to_{user, kernel}()
date:   6 months ago
config: x86_64-randconfig-r002-20210330 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ec6347bb43395cb92126788a1a5b25302543f815
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout ec6347bb43395cb92126788a1a5b25302543f815
        # save the attached .config to linux build tree
        make W=1 ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> arch/x86/lib/copy_mc.c:30:1: warning: no previous prototype for 'copy_mc_fragile_handle_tail' [-Wmissing-prototypes]
      30 | copy_mc_fragile_handle_tail(char *to, char *from, unsigned len)
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +/copy_mc_fragile_handle_tail +30 arch/x86/lib/copy_mc.c

    24	
    25	/*
    26	 * Similar to copy_user_handle_tail, probe for the write fault point, or
    27	 * source exception point.
    28	 */
    29	__visible notrace unsigned long
  > 30	copy_mc_fragile_handle_tail(char *to, char *from, unsigned len)
    31	{
    32		for (; len; --len, to++, from++)
    33			if (copy_mc_fragile(to, from, 1))
    34				break;
    35		return len;
    36	}
    37	#else
    38	/*
    39	 * No point in doing careful copying, or consulting a static key when
    40	 * there is no #MC handler in the CONFIG_X86_MCE=n case.
    41	 */
    42	void enable_copy_mc_fragile(void)
    43	{
    44	}
    45	#define copy_mc_fragile_enabled (0)
    46	#endif
    47	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 32822 bytes --]

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

end of thread, other threads:[~2021-06-10  0:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-09 22:43 arch/x86/lib/copy_mc.c:30:1: warning: no previous prototype for 'copy_mc_fragile_handle_tail' kernel test robot
2021-06-09 23:43 ` Dan Williams
2021-06-09 23:55   ` Luck, Tony
2021-06-10  0:13     ` Dan Williams
  -- strict thread matches above, loose matches on Subject: below --
2021-04-28  8:32 kernel test robot
2021-03-30 18:10 kernel test robot

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).