From: "Alex Bennée" <alex.bennee@linaro.org>
To: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Cc: Thomas Huth <thuth@redhat.com>,
qemu-ppc@nongnu.org, qemu-devel@nongnu.org,
David Gibson <david@gibson.dropbear.id.au>,
Benjamin Herrenschmidt <bherren@au1.ibm.com>
Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH] target/ppc/excp_helper: Take BQL before calling cpu_interrupt()
Date: Thu, 15 Jun 2017 10:09:19 +0100 [thread overview]
Message-ID: <87r2ylmxc0.fsf@linaro.org> (raw)
In-Reply-To: <877f0et1zo.fsf@abhimanyu.i-did-not-set--mail-host-address--so-tickle-me>
Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> writes:
> Alex Bennée <alex.bennee@linaro.org> writes:
>
>> Thomas Huth <thuth@redhat.com> writes:
>>
>>> Since the introduction of MTTCG, using the msgsnd instruction
>>> abort()s if being called without holding the BQL. So let's protect
>>> that part of the code now with qemu_mutex_lock_iothread().
>>>
>>> Buglink: https://bugs.launchpad.net/qemu/+bug/1694998
>>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>>
>> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
>>
>> p.s. I was checking the ppc code for other CPU_FOREACH patterns and I
>> noticed the tlb_flush calls could probably use the tlb_flush_all_cpus
>> API instead of manually looping themselves.
>
> Will that be synchronous call? In PPC, we do lazy tlb flush, the tlb
> flushes are batched until a synchronization point (for optimization).
No by default the non-synced flushes will occur at the end of the
current executing block (cpu->exit_request is set and the work is done
when we exit the run-loop).
> The batching is achieved using a tlb_need_flush (global/local) and when
> there is isync/ptesync or an exception, the actual flush is done. At
> this point we need to make sure that the flush is synchronous.
If you want to ensure the flush is synchronous you need to call the
_all_cpus_synced variants and do a cpu_loop_exit in your helper. This
ensures that all the flushes queued up will be executed before execution
starts at the next PC of the calling thread.
>
>> You should also double check the semantics to make sure none of them
>> need to use the _synced variant and a cpu_exit if the flush needs to
>> complete w.r.t the originating CPU.
>
> Regards,
> Nikunj
--
Alex Bennée
next prev parent reply other threads:[~2017-06-15 9:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-13 10:55 [Qemu-devel] [PATCH] target/ppc/excp_helper: Take BQL before calling cpu_interrupt() Thomas Huth
2017-06-13 14:14 ` Alex Bennée
2017-06-15 2:32 ` [Qemu-devel] [Qemu-ppc] " Nikunj A Dadhania
2017-06-15 9:09 ` Alex Bennée [this message]
2017-06-13 15:29 ` [Qemu-devel] " David Gibson
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=87r2ylmxc0.fsf@linaro.org \
--to=alex.bennee@linaro.org \
--cc=bherren@au1.ibm.com \
--cc=david@gibson.dropbear.id.au \
--cc=nikunj@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=thuth@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.