From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44707) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1asDKk-0005TF-AF for qemu-devel@nongnu.org; Mon, 18 Apr 2016 13:51:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1asDKh-0007Af-4u for qemu-devel@nongnu.org; Mon, 18 Apr 2016 13:51:38 -0400 Received: from mail-lf0-x22f.google.com ([2a00:1450:4010:c07::22f]:36472) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1asDKg-0007AZ-T5 for qemu-devel@nongnu.org; Mon, 18 Apr 2016 13:51:35 -0400 Received: by mail-lf0-x22f.google.com with SMTP id g184so226007316lfb.3 for ; Mon, 18 Apr 2016 10:51:34 -0700 (PDT) References: <1460666749-24452-1-git-send-email-sergey.fedorov@linaro.org> <1460666749-24452-5-git-send-email-sergey.fedorov@linaro.org> <87inzfvwiq.fsf@linaro.org> <5714F7C4.6040306@gmail.com> <87h9eyx2e9.fsf@linaro.org> From: Sergey Fedorov Message-ID: <57151EA4.7040309@gmail.com> Date: Mon, 18 Apr 2016 20:51:32 +0300 MIME-Version: 1.0 In-Reply-To: <87h9eyx2e9.fsf@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v3 4/4] tcg: rework tb_invalidated_flag List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Alex_Benn=c3=a9e?= Cc: Sergey Fedorov , qemu-devel@nongnu.org, Paolo Bonzini , Peter Crosthwaite , Richard Henderson , =?UTF-8?Q?Andreas_F=c3=a4rber?= On 18/04/16 20:17, Alex Bennée wrote: > Sergey Fedorov writes: > >> On 18/04/16 17:09, Alex Bennée wrote: >>> Sergey Fedorov writes: >>>> diff --git a/cpu-exec.c b/cpu-exec.c >> (snip) >>>> @@ -507,14 +510,12 @@ int cpu_exec(CPUState *cpu) >>>> } >>>> tb_lock(); >>>> tb = tb_find_fast(cpu); >>>> - /* Note: we do it here to avoid a gcc bug on Mac OS X when >>>> - doing it in tb_find_slow */ >>> Is this still true? Would it make more sense to push the patching down >>> to the gen_code? >> This comment comes up to the commit: >> >> commit 1538800276aa7228d74f9d00bf275f54dc9e9b43 >> Author: bellard >> Date: Mon Dec 19 01:42:32 2005 +0000 >> >> workaround for gcc bug on PowerPC >> >> >> It was added more than ten years ago. Anyway, now this code is here not >> because of the bug: we need to reset 'next_tb' which is a local variable >> in cpu_exec(). Personally, I don't think it would be neater to hide it >> into gen_code(). Do you have some thoughts on how we could benefit from >> doing so? BTW, I had a feeling that it may be useful to reorganize >> cpu_exec() a bit, although I don't have a solid idea of how to do this >> so far. > I'm mainly eyeing the tb_lock/unlock which would be nice to push further > down the call chain if we can, especially if the need to lock > tb_find_fast can be removed later on. Yes, it would be nice to possibly have all tb_lock/unlock() calls (or at least their pairs) in the same block. There is a lot to be thought over :) Kind regards, Sergey