All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@suse.de>
To: Magnus Damm <magnus.damm@gmail.com>
Cc: Magnus Damm <magnus@valinux.co.jp>,
	Xen devel list <xen-devel@lists.xensource.com>,
	Horms <horms@verge.net.au>
Subject: Re: kexec trouble
Date: Wed, 06 Dec 2006 09:48:34 +0100	[thread overview]
Message-ID: <457683E2.6000205@suse.de> (raw)
In-Reply-To: <aec7e5c30612052008t21c40202ye5cfa44a9e4c70ff@mail.gmail.com>

Magnus Damm wrote:
> For you a runtime check makes sense, especially now when our code is
> merged and you have a conflict. It does however sound like you are
> pissed because the conflict, but I don't think you should blame that
> on us.

Yes, a bit, especially as we've talked a bit about dom0/domU kexec at
the Xen Summit, so I assumed you are aware of the problem.  The
sparse/patches split of the code also makes it hard to change it.

> Simon and I reposted the patches at least 10 times over the
> last half a year - so you had your time to come with feedback.

Yes, I should have checked before.  -ENOTIME.  Bad decision
nevertheless, now it probably costs even more time to fix it up
afterwards ....

> That aside, what about doing as little as possible now? Use
> is_initial_xendomain() or something like that to switch between the
> different dom0 and domU implementations. And whenever domU and dom0
> runs under paravirt we fix up to code to remove the #ifdef and add
> native mode support.

I'd go for the function pointer approach.  I think it is easier to
maintain in the long run.  Wrapper functions which look at
is_initial_xendomain() then call either xen0_machine_kexec or
xenU_machine_kexec quickly get messy with lots of #ifdef CONFIG_FOOBAR,
and it would be a temporary solution only anyway.

I think you compile in native code too, although it is dead code, right?
So we can make machine_kexec() + friends function pointers, rename the
native functions and initialize the function pointers to the native
versions.  I think it should even be possible to make them function
pointers for i386/x86_64 archs only.  Things keep working with
CONFIG_XEN=n then, and with CONFIG_XEN=y the initialization function
just switches the function pointers (depending on is_initial_domain()).
 This also eliminates the first set of #ifdefs in kernel/kexec.c ;)

> Replacing the #ifdefs with a runtime check that is fine by me. I'm
> think it's nice to avoid #ifdefs if possible, but again - our scope of
> implementation was simply to add dom0 support. We did not care about
> domU support or paravirt that wasn't included at that time.

Having "#ifdef CONFIG_XEN" in kernel/kexec.c most likely never ever is
accepted mainline (and we do seek mainline merge, don't we?).  IMHO that
is enough reason to avoid it in the first place.

cheers,
  Gerd

-- 
Gerd Hoffmann <kraxel@suse.de>

  reply	other threads:[~2006-12-06  8:48 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-05 14:37 kexec trouble Gerd Hoffmann
2006-12-05 15:53 ` Magnus Damm
2006-12-05 16:55   ` Gerd Hoffmann
2006-12-06  4:08     ` Magnus Damm
2006-12-06  8:48       ` Gerd Hoffmann [this message]
2006-12-06  9:41         ` Magnus Damm
2006-12-06 10:31           ` Gerd Hoffmann
2006-12-06 11:11             ` Magnus Damm
2006-12-06 13:23               ` Gerd Hoffmann
2006-12-06 13:40                 ` Muli Ben-Yehuda
2006-12-07 11:24               ` Gerd Hoffmann
2006-12-08  4:15                 ` Magnus Damm
2006-12-08 10:01                   ` Gerd Hoffmann
2006-12-08 10:24                     ` Ian Campbell
2006-12-08 11:28                       ` Gerd Hoffmann
2006-12-08 11:32                         ` Keir Fraser
2006-12-08 11:52                         ` Ian Campbell
2006-12-08 15:49                         ` Ian Campbell
2006-12-06  8:37   ` Keir Fraser
2006-12-06  9:08     ` Magnus Damm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=457683E2.6000205@suse.de \
    --to=kraxel@suse.de \
    --cc=horms@verge.net.au \
    --cc=magnus.damm@gmail.com \
    --cc=magnus@valinux.co.jp \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.