From: Alexander Graf <agraf@suse.de>
To: QEMU-devel Developers <qemu-devel@nongnu.org>
Cc: Anthony Liguori <aliguori@us.ibm.com>
Subject: [Qemu-devel] [PATCH 5/5] xen: make xen_enabled even more clever
Date: Fri, 22 Jul 2011 14:43:40 +0200 [thread overview]
Message-ID: <1311338620-26932-6-git-send-email-agraf@suse.de> (raw)
In-Reply-To: <1311338620-26932-1-git-send-email-agraf@suse.de>
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@suse.de>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
---
configure | 5 +++++
hw/xen.h | 2 +-
2 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/configure b/configure
index 90fe09f..e5ecec9 100755
--- a/configure
+++ b/configure
@@ -3277,7 +3277,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;
--
1.6.0.2
prev parent reply other threads:[~2011-07-23 20:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-22 12:43 [Qemu-devel] [PULL 0/5] Xen patch queue 2011-07-23 Alexander Graf
2011-07-22 12:43 ` [Qemu-devel] [PATCH 1/5] xen: introduce xen_change_state_handler Alexander Graf
2011-07-22 12:43 ` [Qemu-devel] [PATCH 2/5] xen: Fix xen_enabled() Alexander Graf
2011-07-22 12:43 ` [Qemu-devel] [PATCH 3/5] exec.c: Use ram_addr_t in cpu_physical_memory_rw(...) Alexander Graf
2011-07-22 12:43 ` [Qemu-devel] [PATCH 4/5] xen: remove CONFIG_XEN_MAPCACHE Alexander Graf
2011-07-22 12:43 ` Alexander Graf [this message]
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=1311338620-26932-6-git-send-email-agraf@suse.de \
--to=agraf@suse.de \
--cc=aliguori@us.ibm.com \
--cc=qemu-devel@nongnu.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).