[PATCH 5/8] kexec: extend hypercall with improved load/unload ops
Daniel Kiper
daniel.kiper at oracle.com
Fri Mar 8 07:21:49 EST 2013
On Fri, Mar 08, 2013 at 11:40:44AM +0000, David Vrabel wrote:
> On 08/03/13 11:23, Daniel Kiper wrote:
> > On Thu, Feb 21, 2013 at 05:48:11PM +0000, David Vrabel wrote:
> >>
> >> + /* Need to switch to 32-bit mode? */
> >> + testq $KEXEC_RELOC_FLAG_COMPAT, %r8
> >> + jnz call_32_bit
> >
> > Why do you need that? This is not needed because purgatory code
> > from kexec-tools always switches to 32-bit mode. Please check
> > kexec-tools/purgatory/arch/x86_64/entry64.S.
>
> The sub-architecture is a property of the image. Why should the tool
> know or care about the sub-architecture of the hypervisor?
>
> The ABI isn't designed only for kexec-tools.
OK, but I think it is much easier to assume that machine state
is not changed by kexec syscall/hypercall and move out this
task to separate module (in this case purgatory code) which does
all needed things (in this case sets it to "native" mode which is
close to machine state after BIOS initialization; as I know this
assumption is common for other architectures too). This way you
could get what you need (e.g. 64-bit -> 64-bit, 64-bit -> 32-bit, ...)
without changing a single instruction in hypervisor or kernel.
Just do changes in purgatory (it could be called differently in
your private kexec-tool) and voila.
Additionally, you duplicate code which exists and works well.
Daniel
More information about the kexec
mailing list