All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc/fadump: Unregister fadump on kexec down path.
@ 2018-04-27  6:23 Mahesh J Salgaonkar
  2018-05-08 14:52 ` Michael Ellerman
  0 siblings, 1 reply; 2+ messages in thread
From: Mahesh J Salgaonkar @ 2018-04-27  6:23 UTC (permalink / raw)
  To: linuxppc-dev

From: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>

Unregister fadump on kexec down path otherwise the fadump registration in
new kexec-ed kernel complains that fadump is already registered. This
makes new kernel to continue using fadump registered by previous kernel
which may lead to invalid vmcore generation. Hence this patch fixes this
issue by un-registering fadump in fadump_cleanup() which is called during
kexec path so that new kernel can register fadump with new valid values.

Fixes: b500afff11f6 ("fadump: Invalidate registration and release reserved memory for general use.")
Cc: stable@vger.kernel.org
Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
---
 arch/powerpc/kernel/fadump.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
index 8ceabef40d3d..07e8396d472b 100644
--- a/arch/powerpc/kernel/fadump.c
+++ b/arch/powerpc/kernel/fadump.c
@@ -1180,6 +1180,9 @@ void fadump_cleanup(void)
 		init_fadump_mem_struct(&fdm,
 			be64_to_cpu(fdm_active->cpu_state_data.destination_address));
 		fadump_invalidate_dump(&fdm);
+	} else if (fw_dump.dump_registered) {
+		/* Un-register Firmware-assisted dump if it was registered. */
+		fadump_unregister_dump(&fdm);
 	}
 }
 

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

* Re: powerpc/fadump: Unregister fadump on kexec down path.
  2018-04-27  6:23 [PATCH] powerpc/fadump: Unregister fadump on kexec down path Mahesh J Salgaonkar
@ 2018-05-08 14:52 ` Michael Ellerman
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2018-05-08 14:52 UTC (permalink / raw)
  To: Mahesh J Salgaonkar, linuxppc-dev

On Fri, 2018-04-27 at 06:23:18 UTC, Mahesh J Salgaonkar wrote:
> From: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
> 
> Unregister fadump on kexec down path otherwise the fadump registration in
> new kexec-ed kernel complains that fadump is already registered. This
> makes new kernel to continue using fadump registered by previous kernel
> which may lead to invalid vmcore generation. Hence this patch fixes this
> issue by un-registering fadump in fadump_cleanup() which is called during
> kexec path so that new kernel can register fadump with new valid values.
> 
> Fixes: b500afff11f6 ("fadump: Invalidate registration and release reserved memory for general use.")
> Cc: stable@vger.kernel.org
> Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/722cde76d68e8cc4f3de42e71c82fd

cheers

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

end of thread, other threads:[~2018-05-08 14:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-27  6:23 [PATCH] powerpc/fadump: Unregister fadump on kexec down path Mahesh J Salgaonkar
2018-05-08 14:52 ` Michael Ellerman

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.