From: Alexander Graf <agraf@suse.de>
To: kvm-ppc@vger.kernel.org
Cc: Scott Wood <scottwood@freescale.com>,
linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org
Subject: [PATCH] KVM: PPC: Don't sync timebase when inside KVM
Date: Wed, 29 Feb 2012 03:16:09 +0100 [thread overview]
Message-ID: <1330481769-24390-1-git-send-email-agraf@suse.de> (raw)
When we know that we're running inside of a KVM guest, we don't have to
worry about synchronizing timebases between different CPUs, since the
host already took care of that.
This fixes CPU overcommit scenarios where vCPUs could hang forever trying
to sync each other while not being scheduled.
Reported-by: Stuart Yoder <B08248@freescale.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
---
arch/powerpc/kernel/smp.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 46695fe..670b453 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -49,6 +49,8 @@
#ifdef CONFIG_PPC64
#include <asm/paca.h>
#endif
+#include <linux/kvm_para.h>
+#include <asm/kvm_para.h>
#ifdef DEBUG
#include <asm/udbg.h>
@@ -541,7 +543,7 @@ int __cpuinit __cpu_up(unsigned int cpu)
DBG("Processor %u found.\n", cpu);
- if (smp_ops->give_timebase)
+ if (!kvm_para_available() && smp_ops->give_timebase)
smp_ops->give_timebase();
/* Wait until cpu puts itself in the online map */
@@ -626,7 +628,7 @@ void __devinit start_secondary(void *unused)
if (smp_ops->setup_cpu)
smp_ops->setup_cpu(cpu);
- if (smp_ops->take_timebase)
+ if (!kvm_para_available() && smp_ops->take_timebase)
smp_ops->take_timebase();
secondary_cpu_time_init();
--
1.6.0.2
next reply other threads:[~2012-02-29 2:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-29 2:16 Alexander Graf [this message]
2012-02-29 17:50 ` [PATCH] KVM: PPC: Don't sync timebase when inside KVM Scott Wood
2012-02-29 18:28 ` Alexander Graf
2012-02-29 19:06 ` Scott Wood
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=1330481769-24390-1-git-send-email-agraf@suse.de \
--to=agraf@suse.de \
--cc=kvm-ppc@vger.kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=scottwood@freescale.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 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).