All of lore.kernel.org
 help / color / mirror / Atom feed
From: AKASHI Takahiro <takahiro.akashi@linaro.org>
To: Catalin Marinas <catalin.marinas@arm.com>
Cc: mark.rutland@arm.com, geoff@infradead.org,
	kexec@lists.infradead.org, will.deacon@arm.com,
	james.morse@arm.com, bauerman@linux.vnet.ibm.com,
	dyoung@redhat.com, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v28 4/9] arm64: kdump: implement machine_crash_shutdown()
Date: Tue, 29 Nov 2016 14:47:04 +0900	[thread overview]
Message-ID: <20161129054703.GC23034@linaro.org> (raw)
In-Reply-To: <20161128150433.GC17125@e104818-lin.cambridge.arm.com>

On Mon, Nov 28, 2016 at 03:04:33PM +0000, Catalin Marinas wrote:
> On Thu, Nov 24, 2016 at 06:58:05PM +0900, AKASHI Takahiro wrote:
> > diff --git a/arch/arm64/include/asm/kexec.h b/arch/arm64/include/asm/kexec.h
> > index 04744dc..b5168e8 100644
> > --- a/arch/arm64/include/asm/kexec.h
> > +++ b/arch/arm64/include/asm/kexec.h
> > @@ -40,7 +40,47 @@
> >  static inline void crash_setup_regs(struct pt_regs *newregs,
> >  				    struct pt_regs *oldregs)
> >  {
> > -	/* Empty routine needed to avoid build errors. */
> > +	if (oldregs) {
> > +		memcpy(newregs, oldregs, sizeof(*newregs));
> > +	} else {
> > +		u64 tmp1, tmp2;
> > +
> > +		__asm__ __volatile__ (
> > +			"stp	 x0,   x1, [%2, #16 *  0]\n"
> > +			"stp	 x2,   x3, [%2, #16 *  1]\n"
> > +			"stp	 x4,   x5, [%2, #16 *  2]\n"
> > +			"stp	 x6,   x7, [%2, #16 *  3]\n"
> > +			"stp	 x8,   x9, [%2, #16 *  4]\n"
> > +			"stp	x10,  x11, [%2, #16 *  5]\n"
> > +			"stp	x12,  x13, [%2, #16 *  6]\n"
> > +			"stp	x14,  x15, [%2, #16 *  7]\n"
> > +			"stp	x16,  x17, [%2, #16 *  8]\n"
> > +			"stp	x18,  x19, [%2, #16 *  9]\n"
> > +			"stp	x20,  x21, [%2, #16 * 10]\n"
> > +			"stp	x22,  x23, [%2, #16 * 11]\n"
> > +			"stp	x24,  x25, [%2, #16 * 12]\n"
> > +			"stp	x26,  x27, [%2, #16 * 13]\n"
> > +			"stp	x28,  x29, [%2, #16 * 14]\n"
> > +			"mov	 %0,  sp\n"
> > +			"stp	x30,  %0,  [%2, #16 * 15]\n"
> > +
> > +			"/* faked current PSTATE */\n"
> > +			"mrs	 %0, CurrentEL\n"
> > +			"mrs	 %1, SPSEL\n"
> > +			"orr	 %0, %0, %1\n"
> > +			"mrs	 %1, DAIF\n"
> > +			"orr	 %0, %0, %1\n"
> > +			"mrs	 %1, NZCV\n"
> > +			"orr	 %0, %0, %1\n"
> > +			/* pc */
> > +			"adr	 %1, 1f\n"
> > +		"1:\n"
> > +			"stp	 %1, %0,   [%2, #16 * 16]\n"
> > +			: "+r" (tmp1), "+r" (tmp2)
> > +			: "r" (newregs)
> > +			: "memory"
> 
> tmp1 and tmp2 are not input arguments here, so you should use the "=&"
> modifier. With my compiler, I get warnings of these variables being used
> uninitialised.

Thank you for this heads-up.
(I misunderstood "+" a bit.)
With this change applied, I confirmed that kdump still works.

-Takahiro AKASHI

> -- 
> Catalin

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

WARNING: multiple messages have this Message-ID (diff)
From: takahiro.akashi@linaro.org (AKASHI Takahiro)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v28 4/9] arm64: kdump: implement machine_crash_shutdown()
Date: Tue, 29 Nov 2016 14:47:04 +0900	[thread overview]
Message-ID: <20161129054703.GC23034@linaro.org> (raw)
In-Reply-To: <20161128150433.GC17125@e104818-lin.cambridge.arm.com>

On Mon, Nov 28, 2016 at 03:04:33PM +0000, Catalin Marinas wrote:
> On Thu, Nov 24, 2016 at 06:58:05PM +0900, AKASHI Takahiro wrote:
> > diff --git a/arch/arm64/include/asm/kexec.h b/arch/arm64/include/asm/kexec.h
> > index 04744dc..b5168e8 100644
> > --- a/arch/arm64/include/asm/kexec.h
> > +++ b/arch/arm64/include/asm/kexec.h
> > @@ -40,7 +40,47 @@
> >  static inline void crash_setup_regs(struct pt_regs *newregs,
> >  				    struct pt_regs *oldregs)
> >  {
> > -	/* Empty routine needed to avoid build errors. */
> > +	if (oldregs) {
> > +		memcpy(newregs, oldregs, sizeof(*newregs));
> > +	} else {
> > +		u64 tmp1, tmp2;
> > +
> > +		__asm__ __volatile__ (
> > +			"stp	 x0,   x1, [%2, #16 *  0]\n"
> > +			"stp	 x2,   x3, [%2, #16 *  1]\n"
> > +			"stp	 x4,   x5, [%2, #16 *  2]\n"
> > +			"stp	 x6,   x7, [%2, #16 *  3]\n"
> > +			"stp	 x8,   x9, [%2, #16 *  4]\n"
> > +			"stp	x10,  x11, [%2, #16 *  5]\n"
> > +			"stp	x12,  x13, [%2, #16 *  6]\n"
> > +			"stp	x14,  x15, [%2, #16 *  7]\n"
> > +			"stp	x16,  x17, [%2, #16 *  8]\n"
> > +			"stp	x18,  x19, [%2, #16 *  9]\n"
> > +			"stp	x20,  x21, [%2, #16 * 10]\n"
> > +			"stp	x22,  x23, [%2, #16 * 11]\n"
> > +			"stp	x24,  x25, [%2, #16 * 12]\n"
> > +			"stp	x26,  x27, [%2, #16 * 13]\n"
> > +			"stp	x28,  x29, [%2, #16 * 14]\n"
> > +			"mov	 %0,  sp\n"
> > +			"stp	x30,  %0,  [%2, #16 * 15]\n"
> > +
> > +			"/* faked current PSTATE */\n"
> > +			"mrs	 %0, CurrentEL\n"
> > +			"mrs	 %1, SPSEL\n"
> > +			"orr	 %0, %0, %1\n"
> > +			"mrs	 %1, DAIF\n"
> > +			"orr	 %0, %0, %1\n"
> > +			"mrs	 %1, NZCV\n"
> > +			"orr	 %0, %0, %1\n"
> > +			/* pc */
> > +			"adr	 %1, 1f\n"
> > +		"1:\n"
> > +			"stp	 %1, %0,   [%2, #16 * 16]\n"
> > +			: "+r" (tmp1), "+r" (tmp2)
> > +			: "r" (newregs)
> > +			: "memory"
> 
> tmp1 and tmp2 are not input arguments here, so you should use the "=&"
> modifier. With my compiler, I get warnings of these variables being used
> uninitialised.

Thank you for this heads-up.
(I misunderstood "+" a bit.)
With this change applied, I confirmed that kdump still works.

-Takahiro AKASHI

> -- 
> Catalin

  reply	other threads:[~2016-11-29  5:47 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-24  9:55 [PATCH v28 0/9] arm64: add kdump support AKASHI Takahiro
2016-11-24  9:55 ` AKASHI Takahiro
2016-11-24  9:57 ` [PATCH v28 1/9] memblock: add memblock_cap_memory_range() AKASHI Takahiro
2016-11-24  9:57   ` AKASHI Takahiro
2016-11-24  9:57   ` AKASHI Takahiro
2016-11-24 10:26   ` Catalin Marinas
2016-11-24 10:26     ` Catalin Marinas
2016-11-24 10:26     ` Catalin Marinas
2016-11-24  9:58 ` [PATCH v28 2/9] arm64: limit memory regions based on DT property, usable-memory-range AKASHI Takahiro
2016-11-24  9:58   ` AKASHI Takahiro
2016-11-24  9:58 ` [PATCH v28 3/9] arm64: kdump: reserve memory for crash dump kernel AKASHI Takahiro
2016-11-24  9:58   ` AKASHI Takahiro
2016-11-24  9:58 ` [PATCH v28 4/9] arm64: kdump: implement machine_crash_shutdown() AKASHI Takahiro
2016-11-24  9:58   ` AKASHI Takahiro
2016-11-28 15:04   ` Catalin Marinas
2016-11-28 15:04     ` Catalin Marinas
2016-11-29  5:47     ` AKASHI Takahiro [this message]
2016-11-29  5:47       ` AKASHI Takahiro
2016-11-24  9:58 ` [PATCH v28 5/9] arm64: kdump: add VMCOREINFO's for user-space tools AKASHI Takahiro
2016-11-24  9:58   ` AKASHI Takahiro
2016-11-24  9:58 ` [PATCH v28 6/9] arm64: kdump: provide /proc/vmcore file AKASHI Takahiro
2016-11-24  9:58   ` AKASHI Takahiro
2016-11-24  9:58 ` [PATCH v28 7/9] arm64: kdump: enable kdump in defconfig AKASHI Takahiro
2016-11-24  9:58   ` AKASHI Takahiro
2016-11-24  9:58 ` [PATCH v28 8/9] Documentation: kdump: describe arm64 port AKASHI Takahiro
2016-11-24  9:58   ` AKASHI Takahiro
2016-11-24  9:59 ` [PATCH v28 9/9] Documentation: dt: chosen properties for arm64 kdump AKASHI Takahiro
2016-11-24  9:59   ` AKASHI Takahiro
2016-11-24  9:59   ` AKASHI Takahiro
2016-11-24 17:14   ` Catalin Marinas
2016-11-24 17:14     ` Catalin Marinas
2016-11-24 17:14     ` Catalin Marinas
2016-11-30 20:44     ` Rob Herring
2016-11-30 20:44       ` Rob Herring
2016-11-30 20:44       ` Rob Herring
2016-11-25 16:20 ` [PATCH v28 0/9] arm64: add kdump support Catalin Marinas
2016-11-25 16:20   ` Catalin Marinas
2016-11-29 11:05   ` Will Deacon
2016-11-29 11:05     ` Will Deacon

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=20161129054703.GC23034@linaro.org \
    --to=takahiro.akashi@linaro.org \
    --cc=bauerman@linux.vnet.ibm.com \
    --cc=catalin.marinas@arm.com \
    --cc=dyoung@redhat.com \
    --cc=geoff@infradead.org \
    --cc=james.morse@arm.com \
    --cc=kexec@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=will.deacon@arm.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 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.