From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:35415) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1grECA-0004Gh-Qj for qemu-devel@nongnu.org; Tue, 05 Feb 2019 22:48:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1grEC9-0000Dr-UW for qemu-devel@nongnu.org; Tue, 05 Feb 2019 22:48:18 -0500 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:38726) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1grEC7-00009H-DD for qemu-devel@nongnu.org; Tue, 05 Feb 2019 22:48:17 -0500 Received: by mail-wr1-x442.google.com with SMTP id v13so5972442wrw.5 for ; Tue, 05 Feb 2019 19:48:14 -0800 (PST) References: <20190205151810.571-1-peter.maydell@linaro.org> From: Richard Henderson Message-ID: Date: Wed, 6 Feb 2019 03:48:10 +0000 MIME-Version: 1.0 In-Reply-To: <20190205151810.571-1-peter.maydell@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] accel/tcg: Consider cluster index in tb_lookup__cpu_state() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell , qemu-devel@nongnu.org Cc: patches@linaro.org, Howard Spoelstra , Cleber Rosa , =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= , Mark Cave-Ayland , Paolo Bonzini , "Emilio G . Cota" On 2/5/19 3:18 PM, Peter Maydell wrote: > In commit f7b78602fdc6c6e4be we added the CPU cluster number to the > cflags field of the TB hash; this included adding it to the value > kept in tb->cflags, since we pass that field directly into the hash > calculation in some places. Unfortunately we forgot to check whether > other parts of the code were doing comparisons against tb->cflags > that would need to be updated. > > It turns out that there is exactly one such place: the > tb_lookup__cpu_state() function checks whether the TB it has > found in the tb_jmp_cache has a tb->cflags matching the cf_mask > that is passed in. The tb->cflags has the cluster_index in it > but the cf_mask does not. > > Hoist the "add cluster index to the cf_mask" code up from > tb_htable_lookup() to tb_lookup__cpu_state() so it can be considered > in the "did this TB match in the jmp cache" condition, as well as > when we do the full hash lookup by physical PC, flags, etc. > (tb_htable_lookup() is only called from tb_lookup__cpu_state(), > so this change doesn't require any further knock-on changes.) > > Fixes: f7b78602fdc6c6e4be ("accel/tcg: Add cluster number to TCG TB hash") > Reported-by: Howard Spoelstra > Reported-by: Cleber Rosa > Signed-off-by: Peter Maydell > --- Queued, thanks. r~