Skip to contentSkip to conversation

powerpc32: Kexec support for PPC440X chipsets

PATCH Superseded Suzuki K. Poulose 4 participants 6 messages Jul 12, 2011 – Jul 18, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 powerpc32: Kexec support for PPC440X chipsets

Changes from V1: Uses a tmp mapping in the other address space to setup
the 1:1 mapping (suggested by Sebastian Andrzej Siewior).

Note: Should we do the same for kernel entry code for PPC44x ?

This patch adds kexec support for PPC440 based chipsets.This work is based on the KEXEC patches for FSL BookE.

The FSL BookE patch and the code flow could be found at the link below:

	http://patchwork.ozlabs.org/patch/49359/

Steps:

1) Invalidate all the TLB entries except the one this code is run from
2) Create a tmp mapping for our code in the other address space and jump to it
3) Invalidate the entry we used
4) Create a 1:1 mapping for 0-2GiB in blocks of 256M
5) Jump to the new 1:1 mapping and invalidate the tmp mapping

I have tested this patches on Ebony, Sequoia boards and Virtex on QEMU. It would be great if somebody could test this on the other boards.

Cc Sebastian Andrzej Siewior <[email protected]>

---

 arch/powerpc/Kconfig             |    2 
 arch/powerpc/include/asm/kexec.h |    2 
 arch/powerpc/kernel/misc_32.S    |  170 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 172 insertions(+), 2 deletions(-)
arch/powerpc/Kconfig +1 -1
index 423145a6..d04fae0 100644
@@ -349,7 +349,7 @@ config ARCH_ENABLE_MEMORY_HOTREMOVE
 
 config KEXEC
 	bool "kexec system call (EXPERIMENTAL)"
-	depends on (PPC_BOOK3S || FSL_BOOKE) && EXPERIMENTAL
+	depends on (PPC_BOOK3S || FSL_BOOKE || (44x && !SMP && !47x)) && EXPERIMENTAL
 	help
 	  kexec is a system call that implements the ability to shutdown your
 	  current kernel, and to start another kernel.  It is like a reboot
arch/powerpc/include/asm/kexec.h +1 -1
index 8a33698..f921eb1 100644
@@ -2,7 +2,7 @@
 #define _ASM_POWERPC_KEXEC_H
 #ifdef __KERNEL__
 
-#ifdef CONFIG_FSL_BOOKE
+#if defined(CONFIG_FSL_BOOKE) || defined(CONFIG_44x)
 
 /*
  * On FSL-BookE we setup a 1:1 mapping which covers the first 2GiB of memory
arch/powerpc/kernel/misc_32.S +170 -0

182 lines not on this page · raw message

#1 lore raw
Quoted 40 lines · Suzuki K. Poulose

Changes from V1: Uses a tmp mapping in the other address space to setup
the 1:1 mapping (suggested by Sebastian Andrzej Siewior).

Note: Should we do the same for kernel entry code for PPC44x ?

This patch adds kexec support for PPC440 based chipsets.This work is based on the KEXEC patches for FSL BookE.

The FSL BookE patch and the code flow could be found at the link below:

	http://patchwork.ozlabs.org/patch/49359/

Steps:

1) Invalidate all the TLB entries except the one this code is run from
2) Create a tmp mapping for our code in the other address space and jump to it
3) Invalidate the entry we used
4) Create a 1:1 mapping for 0-2GiB in blocks of 256M
5) Jump to the new 1:1 mapping and invalidate the tmp mapping

I have tested this patches on Ebony, Sequoia boards and Virtex on QEMU. It would be great if somebody could test this on the other boards.

Cc Sebastian Andrzej Siewior <[email protected]>

---

arch/powerpc/Kconfig             |    2 
arch/powerpc/include/asm/kexec.h |    2 
arch/powerpc/kernel/misc_32.S    |  170 ++++++++++++++++++++++++++++++++++++++
3 files changed, 172 insertions(+), 2 deletions(-)
arch/powerpc/Kconfig +0 -0
index 423145a6..d04fae0 100644
@@ -349,7 +349,7 @@ config ARCH_ENABLE_MEMORY_HOTREMOVE
 

config KEXEC
bool "kexec system call (EXPERIMENTAL)"

arch/powerpc/Kconfig config ARCH_ENABLE_MEMORY_HOTREMOVE · line 352

Quoted 2 lines
arch/powerpc/Kconfig +1 -1
-	depends on (PPC_BOOK3S || FSL_BOOKE) && EXPERIMENTAL
+	depends on (PPC_BOOK3S || FSL_BOOKE || (44x && !SMP && !47x)) && EXPERIMENTAL

Is there something special about 47x that its not supported?

Quoted 3 lines

help
kexec is a system call that implements the ability to shutdown your current kernel, and to start another kernel. It is like a reboot

- k
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#2 lore raw
Quoted 41 lines · Kumar Gala
Quoted 38 lines · Suzuki K. Poulose

Changes from V1: Uses a tmp mapping in the other address space to setup
the 1:1 mapping (suggested by Sebastian Andrzej Siewior).

Note: Should we do the same for kernel entry code for PPC44x ?

This patch adds kexec support for PPC440 based chipsets.This work is based on the KEXEC patches for FSL BookE.

The FSL BookE patch and the code flow could be found at the link below:

	http://patchwork.ozlabs.org/patch/49359/

Steps:

1) Invalidate all the TLB entries except the one this code is run from
2) Create a tmp mapping for our code in the other address space and jump to it
3) Invalidate the entry we used
4) Create a 1:1 mapping for 0-2GiB in blocks of 256M
5) Jump to the new 1:1 mapping and invalidate the tmp mapping

I have tested this patches on Ebony, Sequoia boards and Virtex on QEMU. It would be great if somebody could test this on the other boards.

Cc Sebastian Andrzej Siewior<[email protected]>

---

arch/powerpc/Kconfig             |    2
arch/powerpc/include/asm/kexec.h |    2
arch/powerpc/kernel/misc_32.S    |  170 ++++++++++++++++++++++++++++++++++++++
3 files changed, 172 insertions(+), 2 deletions(-)
arch/powerpc/Kconfig +0 -0
index 423145a6..d04fae0 100644
@@ -349,7 +349,7 @@ config ARCH_ENABLE_MEMORY_HOTREMOVE
 
Quoted 6 lines

arch/powerpc/Kconfig

Quoted 4 lines

config KEXEC
bool "kexec system call (EXPERIMENTAL)"

arch/powerpc/Kconfig +1 -1
-	depends on (PPC_BOOK3S || FSL_BOOKE)&&  EXPERIMENTAL
+	depends on (PPC_BOOK3S || FSL_BOOKE || (44x&&  !SMP&&  !47x))&&  EXPERIMENTAL

Is there something special about 47x that its not supported?

At the moment, I have not written the code for doing the 47x TLB setup which is slightly different from 44x.

It is in my TODO list. I don't have access to a 47x yet. I will work on it once I get access to the board.

Thanks
Suzuki

Quoted 10 lines
Quoted 4 lines

help
kexec is a system call that implements the ability to shutdown your current kernel, and to start another kernel. It is like a reboot

- k
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#3 lore raw
In reply to Kumar Gala
Quoted 41 lines · Kumar Gala
Quoted 38 lines · Suzuki K. Poulose

Changes from V1: Uses a tmp mapping in the other address space to setup
the 1:1 mapping (suggested by Sebastian Andrzej Siewior).

Note: Should we do the same for kernel entry code for PPC44x ?

This patch adds kexec support for PPC440 based chipsets.This work is based on the KEXEC patches for FSL BookE.

The FSL BookE patch and the code flow could be found at the link below:

	http://patchwork.ozlabs.org/patch/49359/

Steps:

1) Invalidate all the TLB entries except the one this code is run from
2) Create a tmp mapping for our code in the other address space and jump to it
3) Invalidate the entry we used
4) Create a 1:1 mapping for 0-2GiB in blocks of 256M
5) Jump to the new 1:1 mapping and invalidate the tmp mapping

I have tested this patches on Ebony, Sequoia boards and Virtex on QEMU. It would be great if somebody could test this on the other boards.

Cc Sebastian Andrzej Siewior <[email protected]>

---

arch/powerpc/Kconfig             |    2 
arch/powerpc/include/asm/kexec.h |    2 
arch/powerpc/kernel/misc_32.S    |  170 ++++++++++++++++++++++++++++++++++++++
3 files changed, 172 insertions(+), 2 deletions(-)
arch/powerpc/Kconfig +0 -0
index 423145a6..d04fae0 100644
@@ -349,7 +349,7 @@ config ARCH_ENABLE_MEMORY_HOTREMOVE
 
Quoted 6 lines

arch/powerpc/Kconfig config ARCH_ENABLE_MEMORY_HOTREMOVE · line 352

Quoted 4 lines

config KEXEC
bool "kexec system call (EXPERIMENTAL)"

arch/powerpc/Kconfig +1 -1
-	depends on (PPC_BOOK3S || FSL_BOOKE) && EXPERIMENTAL
+	depends on (PPC_BOOK3S || FSL_BOOKE || (44x && !SMP && !47x)) && EXPERIMENTAL

Is there something special about 47x that its not supported?

It's a different MMU type (again), that is similar to 44x but not exact. We can't run a single kernel image on both yet, for example.

Also, they aren't widely available so testing on them is difficult.

josh

#4 lore raw
In reply to Suzuki K. Poulose
Quoted 4 lines · * Suzuki K. Poulose | 2011-07-12 12:14:16 [+0530]:

Changes from V1: Uses a tmp mapping in the other address space to setup
the 1:1 mapping (suggested by Sebastian Andrzej Siewior).

Note: Should we do the same for kernel entry code for PPC44x ?

You have one the kernel mapping. Then you make your temporary mapping which might be just the one valid TLB entry (after you invalidated the others). After that you setup multiple mappings to cover 0..2GiB address space. Since the kernel runs at 0xC.... and you need 0x0.. for the same memory you end up at some point with two mappings for the same memory. The reference manual says one should not have two active mappings for piece of memory. That is why the "other address space" is should be used.
So I think using this "other address space" for the entry code isn't a bad idea.

However, I'm fine with this patch.

Sebastian

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#5 lore raw
In reply to Suzuki K. Poulose
Quoted 14 lines · Suzuki K. Poulose

Changes from V1: Uses a tmp mapping in the other address space to setup
the 1:1 mapping (suggested by Sebastian Andrzej Siewior).

Note: Should we do the same for kernel entry code for PPC44x ?

This patch adds kexec support for PPC440 based chipsets.This work is based on the KEXEC patches for FSL BookE.

The FSL BookE patch and the code flow could be found at the link below:

	http://patchwork.ozlabs.org/patch/49359/

Steps:

Quoted 8 lines

1) Invalidate all the TLB entries except the one this code is run from
2) Create a tmp mapping for our code in the other address space and jump to it
3) Invalidate the entry we used
4) Create a 1:1 mapping for 0-2GiB in blocks of 256M
5) Jump to the new 1:1 mapping and invalidate the tmp mapping

I have tested this patches on Ebony, Sequoia boards and Virtex on QEMU. It would be great if somebody could test this on the other boards.

Forgot to mention:

You would need the current snapshot of kexec-tools, available at

git://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git

The following commits(in the current tree) are needed for the support of ppc32.

commit 13f6d71bdf9836b90ae4ec21209383f1a3c56b0f
kexec-tools: ppc32: Fixup ThreadPointer for purgatory code

commit 9ec3fac7e8840fb31891ba49a626c5dd33e09e86
kexec-tools: powerpc: Use the #address-cells information to parsememory/reg

commit 806ef8870539a6c74a2a98188d0207a038b16f77
Fix memory errors on ppc

Thanks

Suzuki