WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: Alexander Graf <agraf@xxxxxxx>
Subject: [Xen-devel] Re: [Qemu-devel] [PATCH 3/3] xen: make xen_enabled even more clever
From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
Date: Mon, 18 Jul 2011 14:52:51 +0100
Cc: Anthony PERARD <anthony.perard@xxxxxxxxxx>, Jan Kiszka <jan.kiszka@xxxxxxxxxxx>, Xen Devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, "qemu-devel@xxxxxxxxxx Developers" <qemu-devel@xxxxxxxxxx>, Stefano Stabellini <Stefano.Stabellini@xxxxxxxxxxxxx>
Delivery-date: Mon, 18 Jul 2011 06:54:23 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=K2/xd6q2oehLb86hWhw8d3oHZ+iA8mhTIgaF79WQ1y4=; b=H8pzDjBQB4r9TgRX2xCaEHr9YnJOZFqiKYDqEI1nne13SueRU6ClVlNqNzHqRr1gXa DPqlCzffMM7Z0tpdfjUZjkF45UwjnjSLTVOR2YGoPD3BFatuzbfGOr8AVkfS07h0Dmmg 6zbl23OYtz3O3EoklfYhMUTGRt/vbs6ZaYkg4=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1310881151-31626-4-git-send-email-agraf@xxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1310881151-31626-1-git-send-email-agraf@xxxxxxx> <1310881151-31626-4-git-send-email-agraf@xxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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

<Prev in Thread] Current Thread [Next in Thread>