Skip to contentSkip to conversation

about ppc32/kexec

DISCUSSION Ming Lei 1 participant 1 message Apr 16, 2009 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Ming Lei

author
#1 lore raw

Albert,

Quoted 2 lines
Quoted 2 lines

1) In relocate_new_kernel, you put the comment saying switch

the >>MMU off. Can you tell me how these code can achieve it. I don't see it >>happens on FSL85xx(actually 85xx or 44x doesn't allow MMU to turn off).

Quoted 15 lines
Quoted 15 lines
(quoted diff) +14 -0
+       .globl relocate_new_kernel
+relocate_new_kernel:
+       /* r3 = page_list   */
+       /* r4 = reboot_code_buffer */
+       /* r5 = start_address      */
+
+       li      r0, 0
+
+       /*
+        * Set Machine Status Register to a known status,
+        * switch the MMU off and jump to 1: in a single step.
+        */
+
+       mr      r8, r0
Quoted 8 lines

Review

Quoted 6 lines
(quoted diff) +6 -0
+       ori     r8, r8, MSR_RI|MSR_ME
+       mtspr   SRR1, r8
+       addi    r8, r4, 1f - relocate_new_kernel
+       mtspr   SRR0, r8
+       sync
+       rfi

This code sets the MSR to a value where MSR_IR (Instruction Relocate)

and >MSR_DI (Data Relocate) are cleared, and thus the MMU is turned effectively >off.

Quoted 1 line

Turning the MMU off is possible at least on 6xx and 7xx.

I don't understand why you choose to turn the MMU off on ppc. Is there any practical reason? On Freescale 85xx which is close to PPC44x, I did not turn off MMU(I cannot) and I just rely on the current virtual to physical mapping to jump to the start address to execute the second kernel.

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