linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Murilo Opsfelder Araujo <muriloo@linux.ibm.com>
To: Christophe Leroy <christophe.leroy@c-s.fr>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v3 1/3] powerpc/process: fix casting and missing header
Date: Fri, 21 Sep 2018 17:24:15 -0300	[thread overview]
Message-ID: <20180921202415.GA19940@kermit-br-ibm-com> (raw)
In-Reply-To: <113d4a559f6eec448b253bf5f0b4f2a8ffb187af.1536327756.git.christophe.leroy@c-s.fr>

On Fri, Sep 07, 2018 at 01:47:29PM +0000, Christophe Leroy wrote:
> This patch fixes the following warnings. The first ones are leftovers
> from when __get_user() was replaced by probe_kernel_address().
> 
> The last one is from when show_user_instructions() was added.
> 
> arch/powerpc/kernel/process.c:1287:22: warning: incorrect type in argument 2 (different address spaces)
> arch/powerpc/kernel/process.c:1287:22:    expected void const *src
> arch/powerpc/kernel/process.c:1287:22:    got unsigned int [noderef] <asn:1>*<noident>
> arch/powerpc/kernel/process.c:1319:21: warning: incorrect type in argument 2 (different address spaces)
> arch/powerpc/kernel/process.c:1319:21:    expected void const *src
> arch/powerpc/kernel/process.c:1319:21:    got unsigned int [noderef] <asn:1>*<noident>
> arch/powerpc/kernel/process.c:1302:6: warning: symbol 'show_user_instructions' was not declared. Should it be static?
> 
> Fixes: 7b051f665c32d ("powerpc: Use probe_kernel_address in show_instructions")
> Fixes: 88b0fe1757359 ("powerpc: Add show_user_instructions()")
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

Smoke test passed.  Thank you.

Reviewed-by: Murilo Opsfelder Araujo <muriloo@linux.ibm.com>

> ---
>  v3: new in v3 to fix sparse warnings reported by snowpatch on the serie
> 
>  arch/powerpc/kernel/process.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
> index 913c5725cdb2..e108e1ef2b85 100644
> --- a/arch/powerpc/kernel/process.c
> +++ b/arch/powerpc/kernel/process.c
> @@ -65,6 +65,7 @@
>  #include <asm/livepatch.h>
>  #include <asm/cpu_has_feature.h>
>  #include <asm/asm-prototypes.h>
> +#include <asm/stacktrace.h>
>  
>  #include <linux/kprobes.h>
>  #include <linux/kdebug.h>
> @@ -1284,7 +1285,7 @@ static void show_instructions(struct pt_regs *regs)
>  #endif
>  
>  		if (!__kernel_text_address(pc) ||
> -		     probe_kernel_address((unsigned int __user *)pc, instr)) {
> +		    probe_kernel_address((const void *)pc, instr)) {
>  			pr_cont("XXXXXXXX ");
>  		} else {
>  			if (regs->nip == pc)
> @@ -1316,7 +1317,7 @@ void show_user_instructions(struct pt_regs *regs)
>  			pr_info("%s[%d]: code: ", current->comm, current->pid);
>  		}
>  
> -		if (probe_kernel_address((unsigned int __user *)pc, instr)) {
> +		if (probe_kernel_address((const void *)pc, instr)) {
>  			pr_cont("XXXXXXXX ");
>  		} else {
>  			if (regs->nip == pc)
> -- 
> 2.13.3
> 

-- 
Murilo


      parent reply	other threads:[~2018-09-21 20:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-07 13:47 [PATCH v3 1/3] powerpc/process: fix casting and missing header Christophe Leroy
2018-09-07 13:47 ` [PATCH v3 2/3] powerpc/process: fix interleaved output in show_user_instructions() Christophe Leroy
2018-09-21 20:25   ` Murilo Opsfelder Araujo
2018-09-07 13:47 ` [PATCH v3 3/3] powerpc/process: Constify the number of insns printed by show instructions functions Christophe Leroy
2018-09-21 20:25   ` Murilo Opsfelder Araujo
2018-09-21 20:24 ` Murilo Opsfelder Araujo [this message]

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=20180921202415.GA19940@kermit-br-ibm-com \
    --to=muriloo@linux.ibm.com \
    --cc=benh@kernel.crashing.org \
    --cc=christophe.leroy@c-s.fr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@samba.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;
as well as URLs for NNTP newsgroup(s).