linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Will Deacon <will.deacon@arm.com>
To: jinho lim <jordan.lim@samsung.com>
Cc: mark.rutland@arm.com, anshuman.khandual@arm.com,
	marc.zyngier@arm.com, andreyknvl@google.com,
	linux-kernel@vger.kernel.org, seroto7@gmail.com,
	ebiederm@xmission.com, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] arm64: remove useless condition
Date: Wed, 19 Jun 2019 13:18:48 +0100	[thread overview]
Message-ID: <20190619121848.GE7767@fuggles.cambridge.arm.com> (raw)
In-Reply-To: <20190619113857.5053-1-jordan.lim@samsung.com>

On Wed, Jun 19, 2019 at 08:38:57PM +0900, jinho lim wrote:
> dump_instr function checks user_mode internally.
> 
> Signed-off-by: jinho lim <jordan.lim@samsung.com>
> ---
>  arch/arm64/kernel/traps.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
> index ccc13b45d9b1..694e78b950ca 100644
> --- a/arch/arm64/kernel/traps.c
> +++ b/arch/arm64/kernel/traps.c
> @@ -182,8 +182,7 @@ static int __die(const char *str, int err, struct pt_regs *regs)
>  	print_modules();
>  	show_regs(regs);
>  
> -	if (!user_mode(regs))
> -		dump_instr(KERN_EMERG, regs);
> +	dump_instr(KERN_EMERG, regs);

I don't think this is right, because it means we'll now dump the current
user instruction on the die() path.

Instead, we should probably rename dump_instr to dump_kernel_instr(),
and have it return immediately if user_mode(regs). We can also kill
__dump_instr completely.

Will

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

      reply	other threads:[~2019-06-19 12:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20190619113904epcas1p23e2c335cda62dfa5ea02c4eb5cb0d788@epcas1p2.samsung.com>
2019-06-19 11:38 ` [PATCH] arm64: remove useless condition jinho lim
2019-06-19 12:18   ` Will Deacon [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=20190619121848.GE7767@fuggles.cambridge.arm.com \
    --to=will.deacon@arm.com \
    --cc=andreyknvl@google.com \
    --cc=anshuman.khandual@arm.com \
    --cc=ebiederm@xmission.com \
    --cc=jordan.lim@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    --cc=mark.rutland@arm.com \
    --cc=seroto7@gmail.com \
    /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).