[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC v1 12/12] cpus: default MTTCG to on for 32 bit ARM on
From: |
Alex Bennée |
Subject: |
[Qemu-devel] [RFC v1 12/12] cpus: default MTTCG to on for 32 bit ARM on x86 |
Date: |
Fri, 15 Apr 2016 15:23:51 +0100 |
This makes multi-threading the default for 32 bit ARM on x86. It has
been tested with Debian Jessie as well as my extended KVM unit tests
which stress the SMC and TB invalidation code. Those tests can be found
at:
https://github.com/stsquad/kvm-unit-tests/tree/mttcg/current-tests-v5
Signed-off-by: Alex Bennée <address@hidden>
---
cpus.c | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/cpus.c b/cpus.c
index 860e2a9..daa92c7 100644
--- a/cpus.c
+++ b/cpus.c
@@ -171,12 +171,24 @@ opts_init(tcg_register_config);
static bool default_mttcg_enabled(void)
{
- /*
- * TODO: Check if we have a chance to have MTTCG working on this
guest/host.
- * Basically is the atomic instruction implemented? Is there any
- * memory ordering issue?
+ /* Checklist for enabling MTTCG on a given frontend/backend combination
+ *
+ * - Are atomics correctly modelled for an MTTCG environment
+ * - If the backend is weakly ordered
+ * - has the front-end implemented explicit memory ordering ops
+ * - does the back-end generate code to ensure memory ordering
*/
+#if defined(__i386__) || defined(__x86_64__)
+ /* x86 backend is strongly ordered which helps a lot */
+ #if defined(TARGET_ARM)
+ return true;
+ #else
+ return false;
+ #endif
+#else
+ /* Until memory ordering implemented things will likely break */
return false;
+#endif
}
void qemu_tcg_configure(QemuOpts *opts)
--
2.7.4
- Re: [Qemu-devel] [RFC v1 05/12] atomic: introduce cmpxchg_bool, (continued)
- [Qemu-devel] [RFC v1 07/12] cpus: introduce async_safe_run_on_cpu., Alex Bennée, 2016/04/15
- [Qemu-devel] [RFC v1 11/12] arm: atomically check the exclusive value in a STREX, Alex Bennée, 2016/04/15
- [Qemu-devel] [RFC v1 10/12] arm: use tlb_flush_page_all for tlbimva[a], Alex Bennée, 2016/04/15
- [Qemu-devel] [RFC v1 06/12] cpus: pass CPUState to run_on_cpu helpers, Alex Bennée, 2016/04/15
- [Qemu-devel] [RFC v1 09/12] translate-all: introduces tb_flush_safe., Alex Bennée, 2016/04/15
- [Qemu-devel] [RFC v1 08/12] cputlb: introduce tlb_flush_* async work., Alex Bennée, 2016/04/15
- [Qemu-devel] [RFC v1 12/12] cpus: default MTTCG to on for 32 bit ARM on x86,
Alex Bennée <=
- Re: [Qemu-devel] [RFC v1 00/12] Enable MTTCG for 32 bit arm on x86, Alex Bennée, 2016/04/15