[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] Re: [Qemu-devel] [PATCH 3/3] xen: make xen_enabled even more clever



On Sun, Jul 17, 2011 at 06:39, Alexander Graf <agraf@xxxxxxx> wrote:
> When using xen_enabled() we're currently only checking if xen is enabled
> at all during the build. But what if you want to build multiple targets
> out of which only one can potentially run xen code?
>
> That means that for generic code we'll still have to fall back to the
> variable and potentially slow the code down, but it's not as important as
> that is mostly xen device emulation which is not touched for non-xen targets.
>
> The target specific code however can with this patch see that it's unable to
> ever execute xen code. We can thus always return 0 on xen_enabled(), giving
> gcc enough hints to evict the mapcache code from the target memory management
> code.
>
> Signed-off-by: Alexander Graf <agraf@xxxxxxx>
> ---
> Âconfigure | Â Â5 +++++
> Âhw/xen.h Â| Â Â2 +-
> Â2 files changed, 6 insertions(+), 1 deletions(-)
>
> diff --git a/configure b/configure
> index f537130..f79b23b 100755
> --- a/configure
> +++ b/configure
> @@ -3235,7 +3235,12 @@ case "$target_arch2" in
> Â Â if test "$xen" = "yes" -a "$target_softmmu" = "yes" ; then
> Â Â Â target_phys_bits=64
> Â Â Â echo "CONFIG_XEN=y" >> $config_target_mak
> + Â Âelse
> + Â Â Âecho "CONFIG_NO_XEN=y" >> $config_target_mak
> Â Â fi
> + Â Â;;
> + Â*)
> + Â Âecho "CONFIG_NO_XEN=y" >> $config_target_mak
> Âesac
> Âcase "$target_arch2" in
> Â i386|x86_64|ppcemb|ppc|ppc64|s390x)
> diff --git a/hw/xen.h b/hw/xen.h
> index 43b95d6..2162111 100644
> --- a/hw/xen.h
> +++ b/hw/xen.h
> @@ -24,7 +24,7 @@ extern int xen_allowed;
>
> Âstatic inline int xen_enabled(void)
> Â{
> -#ifdef CONFIG_XEN_BACKEND
> +#if defined(CONFIG_XEN_BACKEND) && !defined(CONFIG_NO_XEN)
> Â Â return xen_allowed;
> Â#else
> Â Â return 0;

Cool, better than my fix.

Acked-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>

-- 
Anthony PERARD

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.