From: "Alex Bennée" <alex.bennee@linaro.org>
To: Aleksandar Markovic <aleksandar.markovic@rt-rk.com>
Cc: qemu-devel@nongnu.org, "Aurelien Jarno" <aurelien@aurel32.net>,
"Fam Zheng" <famz@redhat.com>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Laurent Vivier" <laurent@vivier.eu>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Richard Henderson" <rth@twiddle.net>,
"Riku Voipio" <riku.voipio@iki.fi>,
"Yongbok Kim" <yongbok.kim@mips.com>,
"Aleksandar Markovic" <aleksandar.markovic@mips.com>,
"Goran Ferenc" <goran.ferenc@mips.com>,
"Miodrag Dinic" <miodrag.dinic@mips.com>,
"Petar Jovanovic" <petar.jovanovic@mips.com>,
"Raghu Gandham" <raghu.gandham@mips.com>
Subject: Re: [Qemu-devel] [PATCH v2 4/6] target/mips: hold BQL in mips_vpe_wake()
Date: Wed, 04 Apr 2018 11:24:42 +0100 [thread overview]
Message-ID: <87sh8bclqt.fsf@linaro.org> (raw)
In-Reply-To: <1519324303-5674-5-git-send-email-aleksandar.markovic@rt-rk.com>
Aleksandar Markovic <aleksandar.markovic@rt-rk.com> writes:
> From: Goran Ferenc <goran.ferenc@mips.com>
>
> Hold BQL whenever mips_vpe_wake() is invoked.
>
> Without this patch, MIPS MT with MTTCG enabled triggers an abort in
> tcg_handle_interrupt() due to an unlocked access to cpu_interrupt().
> This patch makes sure that the BQL is held in this case.
>
> Signed-off-by: Goran Ferenc <goran.ferenc@mips.com>
> Signed-off-by: Miodrag Dinic <miodrag.dinic@mips.com>
> Signed-off-by: Aleksandar Markovic <aleksandar.markovic@mips.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
> ---
> target/mips/op_helper.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/target/mips/op_helper.c b/target/mips/op_helper.c
> index 6bd8e59..d71d916 100644
> --- a/target/mips/op_helper.c
> +++ b/target/mips/op_helper.c
> @@ -17,6 +17,7 @@
> * License along with this library; if not, see <http://www.gnu.org/licenses/>.
> */
> #include "qemu/osdep.h"
> +#include "qemu/main-loop.h"
> #include "cpu.h"
> #include "internal.h"
> #include "qemu/host-utils.h"
> @@ -542,7 +543,9 @@ static inline void mips_vpe_wake(MIPSCPU *c)
> /* Don't set ->halted = 0 directly, let it be done via cpu_has_work
> because there might be other conditions that state that c should
> be sleeping. */
> + qemu_mutex_lock_iothread();
> cpu_interrupt(CPU(c), CPU_INTERRUPT_WAKE);
> + qemu_mutex_unlock_iothread();
> }
>
> static inline void mips_vpe_sleep(MIPSCPU *cpu)
--
Alex Bennée
next prev parent reply other threads:[~2018-04-04 10:24 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-22 18:31 [Qemu-devel] [PATCH v2 0/6] target-mips: support MTTCG feature Aleksandar Markovic
2018-02-22 18:31 ` [Qemu-devel] [PATCH v2 1/6] target/mips: compare virtual addresses in LL/SC sequence Aleksandar Markovic
2018-02-22 18:31 ` [Qemu-devel] [PATCH v2 2/6] target/mips: reimplement SC instruction emulation and use cmpxchg Aleksandar Markovic
2018-02-22 22:33 ` Emilio G. Cota
2018-02-22 22:39 ` Emilio G. Cota
2018-02-22 18:31 ` [Qemu-devel] [PATCH v2 3/6] hw/mips_int: hold BQL for all interrupt requests Aleksandar Markovic
2018-04-04 10:23 ` Alex Bennée
2018-04-04 11:23 ` Paolo Bonzini
2018-04-04 13:44 ` Alex Bennée
2018-04-04 14:42 ` Paolo Bonzini
2018-02-22 18:31 ` [Qemu-devel] [PATCH v2 4/6] target/mips: hold BQL in mips_vpe_wake() Aleksandar Markovic
2018-04-04 10:24 ` Alex Bennée [this message]
2018-02-22 18:31 ` [Qemu-devel] [PATCH v2 5/6] hw/mips_cpc: kick a VP when putting it into Run state Aleksandar Markovic
2018-04-04 10:25 ` Alex Bennée
2018-02-22 18:31 ` [Qemu-devel] [PATCH v2 6/6] target/mips: introduce MTTCG-enabled builds Aleksandar Markovic
2018-04-04 10:25 ` Alex Bennée
2018-04-04 10:27 ` [Qemu-devel] [PATCH v2 0/6] target-mips: support MTTCG feature Alex Bennée
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=87sh8bclqt.fsf@linaro.org \
--to=alex.bennee@linaro.org \
--cc=aleksandar.markovic@mips.com \
--cc=aleksandar.markovic@rt-rk.com \
--cc=aurelien@aurel32.net \
--cc=f4bug@amsat.org \
--cc=famz@redhat.com \
--cc=goran.ferenc@mips.com \
--cc=kraxel@redhat.com \
--cc=laurent@vivier.eu \
--cc=miodrag.dinic@mips.com \
--cc=pbonzini@redhat.com \
--cc=petar.jovanovic@mips.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=raghu.gandham@mips.com \
--cc=riku.voipio@iki.fi \
--cc=rth@twiddle.net \
--cc=yongbok.kim@mips.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).