All of lore.kernel.org
 help / color / mirror / Atom feed
From: <jiang.biao2@zte.com.cn>
To: rth@twiddle.net
Cc: shi.zhongbing@zte.com.cn, cota@braap.org, alex.bennee@linaro.org,
	qemu-devel@nongnu.org, jiang.yong5@zte.com.cn
Subject: Re: [Qemu-devel] [PATCH v2 00/45] tcg: support for multipleTCGcontexts
Date: Wed, 19 Jul 2017 14:06:36 +0800 (CST)	[thread overview]
Message-ID: <201707191406361857655@zte.com.cn> (raw)

> For this specific case, the primary problem will be the implicit memory 
> barriers that the i386 guest requires, but that the mips64 host does not provide.
> 
> For tcg/mips/, TCG_TARGET_DEFAULT_MO should be 0, because the mips architecture 
> does not have any implicit memory ordering.  All memory barriers are explicit 
> via SYNC instructions.
> 
> For target/i386, TCG_GUEST_DEFAULT_MO is TCG_MO_ALL & ~TCG_MO_ST_LD, or
> 
>     TCG_MO_LD_LD | TCG_MO_LD_ST | TCG_MO_ST_ST
> 
> which means that implicit memory barriers exist between load/load, load/store, 
> store/store, but not store/load.
> 
> In order to fix this, we need to add the missing barriers to the opcode stream.
> 
> The simplest fix for this is to put a call
> 
>     tcg_gen_mb(TCG_MO_ALL | TCG_BAR_SC)
> 
> at the end of gen_ldst_i32 and gen_ldst_i64.  That should be good enough to 
> make your specific case operate correctly.
> 
> A proper fix will involve (1) emitting those barriers only if the barrier is 
> not implied by the host and (2) optimizing away redundant barriers.
> 
Thanks very much. That really helps a lot.

I'll dig deeper into that and maybe feedback some patches.

                 reply	other threads:[~2017-07-19  6:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=201707191406361857655@zte.com.cn \
    --to=jiang.biao2@zte.com.cn \
    --cc=alex.bennee@linaro.org \
    --cc=cota@braap.org \
    --cc=jiang.yong5@zte.com.cn \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=shi.zhongbing@zte.com.cn \
    /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.