From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52471) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5eim-0001wA-BS for qemu-devel@nongnu.org; Wed, 25 May 2016 15:44:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b5eig-0002JW-EM for qemu-devel@nongnu.org; Wed, 25 May 2016 15:43:59 -0400 Received: from mail-lb0-x241.google.com ([2a00:1450:4010:c04::241]:36107) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5eif-0002JJ-KG for qemu-devel@nongnu.org; Wed, 25 May 2016 15:43:54 -0400 Received: by mail-lb0-x241.google.com with SMTP id r5so3238889lbj.3 for ; Wed, 25 May 2016 12:43:53 -0700 (PDT) References: <20160524171856.1000-1-bobby.prani@gmail.com> <20160524171856.1000-3-bobby.prani@gmail.com> <8a9b6d4e-278a-08b5-d1fb-d66e28e8e3ac@twiddle.net> <87twhmc54i.fsf@linaro.org> From: Sergey Fedorov Message-ID: <57460076.1080301@gmail.com> Date: Wed, 25 May 2016 22:43:50 +0300 MIME-Version: 1.0 In-Reply-To: <87twhmc54i.fsf@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [RFC PATCH 2/3] tcg: Add support for fence generation in x86 backend List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Alex_Benn=c3=a9e?= , Richard Henderson Cc: Pranith Kumar , Peter Maydell , "open list:i386 target" On 25/05/16 22:25, Alex Bennée wrote: > Richard Henderson writes: >> On 05/24/2016 10:18 AM, Pranith Kumar wrote: >>> Signed-off-by: Pranith Kumar >>> --- >>> tcg/i386/tcg-target.h | 1 + >>> tcg/i386/tcg-target.inc.c | 9 +++++++++ >>> tcg/tcg-opc.h | 2 +- >>> tcg/tcg.c | 1 + >>> 4 files changed, 12 insertions(+), 1 deletion(-) >>> >>> diff --git a/tcg/i386/tcg-target.h b/tcg/i386/tcg-target.h >>> index 92be341..93ea42e 100644 >>> --- a/tcg/i386/tcg-target.h >>> +++ b/tcg/i386/tcg-target.h >>> @@ -100,6 +100,7 @@ extern bool have_bmi1; >>> #define TCG_TARGET_HAS_muls2_i32 1 >>> #define TCG_TARGET_HAS_muluh_i32 0 >>> #define TCG_TARGET_HAS_mulsh_i32 0 >>> +#define TCG_TARGET_HAS_fence 1 >> This has to be defined for all hosts. >> >> The default implementation should be a function call into tcg-runtime.c that >> calls smp_mb(). > That would solves the problem of converting the various backends > piecemeal - although obviously we should move to all backends having > "native" support ASAP. However by introducing expensive substitute > functions we will slow down the translations as each front end is > expanded to translate the target barrier ops. I think it would better not to defer native support for the operation. It should be relatively simple instruction. Otherwise we could wind up deferring this indefinitely. > Should we make the emitting of the function call/TCGop conditional on > MTTCG being enabled? If we are running in round-robin mode there is no > need to issue any fence operations. Good idea. Kind regards, Sergey