All of lore.kernel.org
 help / color / mirror / Atom feed
* [mips-sjhill:mips-for-linux-next 58/62] arch/mips/kernel/uprobes.c:304:15: error: variable or field 'kstart' declared void
@ 2016-09-23 18:06 kbuild test robot
  2016-09-26 10:24 ` Ralf Baechle
  0 siblings, 1 reply; 4+ messages in thread
From: kbuild test robot @ 2016-09-23 18:06 UTC (permalink / raw)
  To: James Hogan; +Cc: kbuild-all, linux-mips, Ralf Baechle

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

tree:   git://git.linux-mips.org/pub/scm/sjhill/linux-sjhill.git mips-for-linux-next
head:   3cd97a2d95ac84bf17d4d538960d3e17585a791c
commit: a0b7ccb92e7b57f3c4cf5bf8a875fe7ecf00fe2c [58/62] MIPS: uprobes: Flush icache via kernel address
config: mips-allmodconfig (attached as .config)
compiler: mips-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout a0b7ccb92e7b57f3c4cf5bf8a875fe7ecf00fe2c
        # save the attached .config to linux build tree
        make.cross ARCH=mips 

All error/warnings (new ones prefixed by >>):

   arch/mips/kernel/uprobes.c: In function 'arch_uprobe_copy_ixol':
>> arch/mips/kernel/uprobes.c:304:15: error: variable or field 'kstart' declared void
     void *kaddr, kstart;
                  ^~~~~~
>> arch/mips/kernel/uprobes.c:308:9: warning: assignment makes integer from pointer without a cast [-Wint-conversion]
     kstart = kaddr + (vaddr & ~PAGE_MASK);
            ^
>> arch/mips/kernel/uprobes.c:309:9: warning: passing argument 1 of 'memcpy' makes pointer from integer without a cast [-Wint-conversion]
     memcpy(kstart, src, len);
            ^~~~~~
   In file included from include/linux/string.h:18:0,
                    from include/linux/bitmap.h:8,
                    from include/linux/cpumask.h:11,
                    from arch/mips/include/asm/processor.h:15,
                    from arch/mips/include/asm/thread_info.h:15,
                    from include/linux/thread_info.h:54,
                    from include/asm-generic/preempt.h:4,
                    from ./arch/mips/include/generated/asm/preempt.h:1,
                    from include/linux/preempt.h:59,
                    from include/linux/spinlock.h:50,
                    from include/linux/wait.h:8,
                    from include/linux/fs.h:5,
                    from include/linux/highmem.h:4,
                    from arch/mips/kernel/uprobes.c:1:
   arch/mips/include/asm/string.h:138:14: note: expected 'void *' but argument is of type 'int'
    extern void *memcpy(void *__to, __const__ void *__from, size_t __n);
                 ^~~~~~

vim +/kstart +304 arch/mips/kernel/uprobes.c

   298				*(uprobe_opcode_t *)&auprobe->orig_inst[0].word);
   299	}
   300	
   301	void __weak arch_uprobe_copy_ixol(struct page *page, unsigned long vaddr,
   302					  void *src, unsigned long len)
   303	{
 > 304		void *kaddr, kstart;
   305	
   306		/* Initialize the slot */
   307		kaddr = kmap_atomic(page);
 > 308		kstart = kaddr + (vaddr & ~PAGE_MASK);
 > 309		memcpy(kstart, src, len);
   310		flush_icache_range(kstart, kstart + len);
   311		kunmap_atomic(kaddr);
   312	}

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

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

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

* Re: [mips-sjhill:mips-for-linux-next 58/62] arch/mips/kernel/uprobes.c:304:15: error: variable or field 'kstart' declared void
  2016-09-23 18:06 [mips-sjhill:mips-for-linux-next 58/62] arch/mips/kernel/uprobes.c:304:15: error: variable or field 'kstart' declared void kbuild test robot
@ 2016-09-26 10:24 ` Ralf Baechle
  2016-09-26 13:07   ` James Hogan
  0 siblings, 1 reply; 4+ messages in thread
From: Ralf Baechle @ 2016-09-26 10:24 UTC (permalink / raw)
  To: kbuild test robot; +Cc: James Hogan, kbuild-all, linux-mips

On Sat, Sep 24, 2016 at 02:06:11AM +0800, kbuild test robot wrote:

> From: kbuild test robot <fengguang.wu@intel.com>
> To: James Hogan <james.hogan@imgtec.com>
> Cc: kbuild-all@01.org, linux-mips@linux-mips.org, Ralf Baechle
>  <ralf@linux-mips.org>
> Subject: [mips-sjhill:mips-for-linux-next 58/62]
>  arch/mips/kernel/uprobes.c:304:15: error: variable or field 'kstart'
>  declared void
> Content-Type: multipart/mixed; boundary="5mCyUwZo2JvN/JJP"
> 
> tree:   git://git.linux-mips.org/pub/scm/sjhill/linux-sjhill.git mips-for-linux-next
> head:   3cd97a2d95ac84bf17d4d538960d3e17585a791c
> commit: a0b7ccb92e7b57f3c4cf5bf8a875fe7ecf00fe2c [58/62] MIPS: uprobes: Flush icache via kernel address
> config: mips-allmodconfig (attached as .config)
> compiler: mips-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
> reproduce:
>         wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         git checkout a0b7ccb92e7b57f3c4cf5bf8a875fe7ecf00fe2c
>         # save the attached .config to linux build tree
>         make.cross ARCH=mips 
> 
> All error/warnings (new ones prefixed by >>):
> 
>    arch/mips/kernel/uprobes.c: In function 'arch_uprobe_copy_ixol':
> >> arch/mips/kernel/uprobes.c:304:15: error: variable or field 'kstart' declared void
>      void *kaddr, kstart;
>                   ^~~~~~
> >> arch/mips/kernel/uprobes.c:308:9: warning: assignment makes integer from pointer without a cast [-Wint-conversion]
>      kstart = kaddr + (vaddr & ~PAGE_MASK);
>             ^
> >> arch/mips/kernel/uprobes.c:309:9: warning: passing argument 1 of 'memcpy' makes pointer from integer without a cast [-Wint-conversion]
>      memcpy(kstart, src, len);
>             ^~~~~~
>    In file included from include/linux/string.h:18:0,
>                     from include/linux/bitmap.h:8,
>                     from include/linux/cpumask.h:11,
>                     from arch/mips/include/asm/processor.h:15,
>                     from arch/mips/include/asm/thread_info.h:15,
>                     from include/linux/thread_info.h:54,
>                     from include/asm-generic/preempt.h:4,
>                     from ./arch/mips/include/generated/asm/preempt.h:1,
>                     from include/linux/preempt.h:59,
>                     from include/linux/spinlock.h:50,
>                     from include/linux/wait.h:8,
>                     from include/linux/fs.h:5,
>                     from include/linux/highmem.h:4,
>                     from arch/mips/kernel/uprobes.c:1:
>    arch/mips/include/asm/string.h:138:14: note: expected 'void *' but argument is of type 'int'
>     extern void *memcpy(void *__to, __const__ void *__from, size_t __n);
>                  ^~~~~~
> 
> vim +/kstart +304 arch/mips/kernel/uprobes.c
> 
>    298				*(uprobe_opcode_t *)&auprobe->orig_inst[0].word);
>    299	}
>    300	
>    301	void __weak arch_uprobe_copy_ixol(struct page *page, unsigned long vaddr,
>    302					  void *src, unsigned long len)
>    303	{
>  > 304		void *kaddr, kstart;
>    305	
>    306		/* Initialize the slot */
>    307		kaddr = kmap_atomic(page);
>  > 308		kstart = kaddr + (vaddr & ~PAGE_MASK);
>  > 309		memcpy(kstart, src, len);
>    310		flush_icache_range(kstart, kstart + len);
>    311		kunmap_atomic(kaddr);
>    312	}

Something like below patch should do the trick.  James?

  Ralf

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

 arch/mips/kernel/uprobes.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/mips/kernel/uprobes.c b/arch/mips/kernel/uprobes.c
index 9a507ab..a896417 100644
--- a/arch/mips/kernel/uprobes.c
+++ b/arch/mips/kernel/uprobes.c
@@ -301,14 +301,14 @@ int set_orig_insn(struct arch_uprobe *auprobe, struct mm_struct *mm,
 void __weak arch_uprobe_copy_ixol(struct page *page, unsigned long vaddr,
 				  void *src, unsigned long len)
 {
-	void *kaddr, kstart;
+	unsigned long kaddr, kstart;
 
 	/* Initialize the slot */
-	kaddr = kmap_atomic(page);
+	kaddr = (unsigned long)kmap_atomic(page);
 	kstart = kaddr + (vaddr & ~PAGE_MASK);
-	memcpy(kstart, src, len);
+	memcpy((void *)kstart, src, len);
 	flush_icache_range(kstart, kstart + len);
-	kunmap_atomic(kaddr);
+	kunmap_atomic((void *)kaddr);
 }
 
 /**

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

* Re: [mips-sjhill:mips-for-linux-next 58/62] arch/mips/kernel/uprobes.c:304:15: error: variable or field 'kstart' declared void
  2016-09-26 10:24 ` Ralf Baechle
@ 2016-09-26 13:07   ` James Hogan
  2016-09-26 15:29     ` Ralf Baechle
  0 siblings, 1 reply; 4+ messages in thread
From: James Hogan @ 2016-09-26 13:07 UTC (permalink / raw)
  To: Ralf Baechle, kbuild test robot; +Cc: kbuild-all, linux-mips

On 26 September 2016 11:24:38 BST, Ralf Baechle <ralf@linux-mips.org> wrote:
>On Sat, Sep 24, 2016 at 02:06:11AM +0800, kbuild test robot wrote:
>
>> From: kbuild test robot <fengguang.wu@intel.com>
>> To: James Hogan <james.hogan@imgtec.com>
>> Cc: kbuild-all@01.org, linux-mips@linux-mips.org, Ralf Baechle
>>  <ralf@linux-mips.org>
>> Subject: [mips-sjhill:mips-for-linux-next 58/62]
>>  arch/mips/kernel/uprobes.c:304:15: error: variable or field 'kstart'
>>  declared void
>> Content-Type: multipart/mixed; boundary="5mCyUwZo2JvN/JJP"
>> 
>> tree:   git://git.linux-mips.org/pub/scm/sjhill/linux-sjhill.git
>mips-for-linux-next
>> head:   3cd97a2d95ac84bf17d4d538960d3e17585a791c
>> commit: a0b7ccb92e7b57f3c4cf5bf8a875fe7ecf00fe2c [58/62] MIPS:
>uprobes: Flush icache via kernel address
>> config: mips-allmodconfig (attached as .config)
>> compiler: mips-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
>> reproduce:
>>         wget
>https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
>-O ~/bin/make.cross
>>         chmod +x ~/bin/make.cross
>>         git checkout a0b7ccb92e7b57f3c4cf5bf8a875fe7ecf00fe2c
>>         # save the attached .config to linux build tree
>>         make.cross ARCH=mips 
>> 
>> All error/warnings (new ones prefixed by >>):
>> 
>>    arch/mips/kernel/uprobes.c: In function 'arch_uprobe_copy_ixol':
>> >> arch/mips/kernel/uprobes.c:304:15: error: variable or field
>'kstart' declared void
>>      void *kaddr, kstart;
>>                   ^~~~~~
>> >> arch/mips/kernel/uprobes.c:308:9: warning: assignment makes
>integer from pointer without a cast [-Wint-conversion]
>>      kstart = kaddr + (vaddr & ~PAGE_MASK);
>>             ^
>> >> arch/mips/kernel/uprobes.c:309:9: warning: passing argument 1 of
>'memcpy' makes pointer from integer without a cast [-Wint-conversion]
>>      memcpy(kstart, src, len);
>>             ^~~~~~
>>    In file included from include/linux/string.h:18:0,
>>                     from include/linux/bitmap.h:8,
>>                     from include/linux/cpumask.h:11,
>>                     from arch/mips/include/asm/processor.h:15,
>>                     from arch/mips/include/asm/thread_info.h:15,
>>                     from include/linux/thread_info.h:54,
>>                     from include/asm-generic/preempt.h:4,
>>                     from
>./arch/mips/include/generated/asm/preempt.h:1,
>>                     from include/linux/preempt.h:59,
>>                     from include/linux/spinlock.h:50,
>>                     from include/linux/wait.h:8,
>>                     from include/linux/fs.h:5,
>>                     from include/linux/highmem.h:4,
>>                     from arch/mips/kernel/uprobes.c:1:
>>    arch/mips/include/asm/string.h:138:14: note: expected 'void *' but
>argument is of type 'int'
>>     extern void *memcpy(void *__to, __const__ void *__from, size_t
>__n);
>>                  ^~~~~~
>> 
>> vim +/kstart +304 arch/mips/kernel/uprobes.c
>> 
>>    298				*(uprobe_opcode_t *)&auprobe->orig_inst[0].word);
>>    299	}
>>    300	
>>    301	void __weak arch_uprobe_copy_ixol(struct page *page, unsigned
>long vaddr,
>>    302					  void *src, unsigned long len)
>>    303	{
>>  > 304		void *kaddr, kstart;
>>    305	
>>    306		/* Initialize the slot */
>>    307		kaddr = kmap_atomic(page);
>>  > 308		kstart = kaddr + (vaddr & ~PAGE_MASK);
>>  > 309		memcpy(kstart, src, len);
>>    310		flush_icache_range(kstart, kstart + len);
>>    311		kunmap_atomic(kaddr);
>>    312	}
>
>Something like below patch should do the trick.  James?

My intention was I think for kstart to be void * (and to use void * arithmetic), but i'm indifferent if you prefer unsigned long for that. Apparently my build coverage was lacking for this patch, sorry about that!

Thanks
James

>
>  Ralf
>
>Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
>
> arch/mips/kernel/uprobes.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
>diff --git a/arch/mips/kernel/uprobes.c b/arch/mips/kernel/uprobes.c
>index 9a507ab..a896417 100644
>--- a/arch/mips/kernel/uprobes.c
>+++ b/arch/mips/kernel/uprobes.c
>@@ -301,14 +301,14 @@ int set_orig_insn(struc arch_uprobe *auprobe,
>struct mm_struct *mm,
>void __weak arch_uprobe_copy_ixol(struct page *page, unsigned long
>vaddr,
> 				  void *src, unsigned long len)
> {
>-	void *kaddr, kstart;
>+	unsigned long kaddr, kstart;
> 
> 	/* Initialize the slot */
>-	kaddr = kmap_atomic(page);
>+	kaddr = (unsigned long)kmap_atomic(page);
> 	kstart = kaddr + (vaddr & ~PAGE_MASK);
>-	memcpy(kstart, src, len);
>+	memcpy((void *)kstart, src, len);
> 	flush_icache_range(kstart, kstart + len);
>-	kunmap_atomic(kaddr);
>+	kunmap_atomic((void *)kaddr);
> }
> 
> /**


--
James Hogan

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

* Re: [mips-sjhill:mips-for-linux-next 58/62] arch/mips/kernel/uprobes.c:304:15: error: variable or field 'kstart' declared void
  2016-09-26 13:07   ` James Hogan
@ 2016-09-26 15:29     ` Ralf Baechle
  0 siblings, 0 replies; 4+ messages in thread
From: Ralf Baechle @ 2016-09-26 15:29 UTC (permalink / raw)
  To: James Hogan; +Cc: linux-mips

On Mon, Sep 26, 2016 at 02:07:03PM +0100, James Hogan wrote:

> My intention was I think for kstart to be void * (and to use void * arithmetic), but i'm indifferent if you prefer unsigned long for that. Apparently my build coverage was lacking for this patch, sorry about that!

Standard C doesn't allow arithmetic on void pointers; GCC does so as
an extension over standard C - and I tend to avoid such extensions, if
possible.  I also tend to prefer unsigned long at a low level for things
such as cache flush operations - but more importantly I try to keep the
number of casts down.

  Ralf

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

end of thread, other threads:[~2016-09-26 15:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-23 18:06 [mips-sjhill:mips-for-linux-next 58/62] arch/mips/kernel/uprobes.c:304:15: error: variable or field 'kstart' declared void kbuild test robot
2016-09-26 10:24 ` Ralf Baechle
2016-09-26 13:07   ` James Hogan
2016-09-26 15:29     ` Ralf Baechle

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.