public inbox for kexec@lists.infradead.org
 help / color / mirror / Atom feed
* RE: about ppc32/kexec
@ 2009-04-17 10:41 Albert Herranz
  2009-04-22 10:40 ` Eric W. Biederman
  0 siblings, 1 reply; 5+ messages in thread
From: Albert Herranz @ 2009-04-17 10:41 UTC (permalink / raw)
  To: Ming Lei; +Cc: kexec


Hi,

> Thank you for the details. Can you explain why with MMU on
> it needs to
> assume in-place memory mappings? Do we always have __pa or
> __va
> available to translate between? We don't need to assume any
> mapping
> since on ppc32 you can always get to virtual address by
> adding
> PAGE_OFFSET to physical address.

Is CONFIG_HIGHMEM covered by that?

> I try to implement kexec for freescal 85xx and IBM44x
> platform so the
> current code for ppc32 definitely need to be either move to
> gamecube
> specific or I create stub for each of 85xx and 44x, which I
> try to
> avoid.

The current code is not gamecube specific, it is ppc32 generic and works for platforms that can turn off their MMU, which is the general case. 44x seems to have a lot of particularities. Guess that's why it has its own *.S's.

IMHO, at least you should try to keep the kexec interface as defined (all kexec structures use physical addresses).

If you can't turn off the MMU on those platforms, you need either to use a 1:1 mapping or deal with the special case in a special way.
You can modify the existing relocate_new_kernel and special case the 4xx or you can create a new relocate_new_kernel_4xx and use that if 4xx.

One way to follow/keep the kexec interface on 4xx for relocate_new_kernel might be:
- relocate the kernel translating physical addresses using a known mapping that can deal with all the memory that kexec is told to use to store the image (i.e. the memory that kexec_load uses to put the different pages that make up the image).
- then get rid of all the memory mappings, make sure to enable a 1:1 mapping that covers all the range of memory supported and jump to the entry point of the loaded image.

Another one could be:
- get rid of all the memory mappings, enable a 1:1 mapping and do the relocation using physical addresses (as they can be used directly then).
- jump to the entry point of the loaded image.

What do you think?

Cheers,
Albert



      


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

^ permalink raw reply	[flat|nested] 5+ messages in thread
* RE: about ppc32/kexec
@ 2009-04-16 22:32 Albert Herranz
  2009-04-16 23:25 ` Ming Lei
  0 siblings, 1 reply; 5+ messages in thread
From: Albert Herranz @ 2009-04-16 22:32 UTC (permalink / raw)
  To: Ming Lei; +Cc: kexec


Hi,

> 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 is designed to boot whatever self contained executable image you want (linux or any other binary). In fact, the ppc port was developed on a GameCube, and was designed to boot Linux and non-Linux binaries from Linux.

It currently avoids making assumptions about in-place memory mappings and works in real addressing mode.
The MMU is turned off to switch to real mode addressing. The relocation code works in real addressing mode to copy the image to its final place and then jumps to the entry point of the loaded image, in real addressing mode.
On kexec-tools, depending on the type of executable image loaded, a small stub is used as the entry point which setups whatever environment (address mappings if needed, etc.) the loaded binary expects, and then jumps to the actual entry point of the binary.
In this way, the setup of the different possible environments for the different types of binary images than can be loaded is moved from kernelspace to userspace. The interface between the kernel and kexec-tools is well defined and constant.

On platforms that cannot turn the MMU off you may need to choose another approach. And you may need to fix kexec-tools too to account for that.

Cheers,
Albert



      


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

^ permalink raw reply	[flat|nested] 5+ messages in thread
[parent not found: <95529.61291.qm@web28312.mail.ukl.yahoo.com>]

end of thread, other threads:[~2009-04-22 10:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-17 10:41 about ppc32/kexec Albert Herranz
2009-04-22 10:40 ` Eric W. Biederman
  -- strict thread matches above, loose matches on Subject: below --
2009-04-16 22:32 Albert Herranz
2009-04-16 23:25 ` Ming Lei
     [not found] <95529.61291.qm@web28312.mail.ukl.yahoo.com>
2009-04-16 18:28 ` Ming Lei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox