From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id d14sm28999234wmd.19.2017.02.01.03.03.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Feb 2017 03:03:17 -0800 (PST) Received: from zen (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTPS id 00E353E07AE; Wed, 1 Feb 2017 11:03:20 +0000 (GMT) References: <20170127103922.19658-1-alex.bennee@linaro.org> <20170127103922.19658-17-alex.bennee@linaro.org> <70fe24bb-c8f1-43c4-010f-a682bdd507ef@twiddle.net> User-agent: mu4e 0.9.19; emacs 25.1.91.6 From: Alex =?utf-8?Q?Benn=C3=A9e?= To: Richard Henderson Cc: mttcg@greensocs.com, qemu-devel@nongnu.org, fred.konrad@greensocs.com, a.rigo@virtualopensystems.com, cota@braap.org, bobby.prani@gmail.com, nikunj@linux.vnet.ibm.com, mark.burton@greensocs.com, pbonzini@redhat.com, jan.kiszka@siemens.com, serge.fdrv@gmail.com, peter.maydell@linaro.org, claudio.fontana@huawei.com, bamvor.zhangjian@linaro.org, Peter Crosthwaite , Mark Cave-Ayland , Artyom Tarasenko , "open list\:ARM" Subject: Re: [PATCH v8 16/25] cputlb and arm/sparc targets: convert mmuidx flushes from varg to bitmap In-reply-to: <70fe24bb-c8f1-43c4-010f-a682bdd507ef@twiddle.net> Date: Wed, 01 Feb 2017 11:03:19 +0000 Message-ID: <87efzi41hk.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-TUID: zjcNsjE9eQ4i Richard Henderson writes: > On 01/27/2017 02:39 AM, Alex Bennée wrote: >> + for (mmu_idx = 0; mmu_idx < NB_MMU_MODES; mmu_idx++) { >> >> - tlb_debug("%d\n", mmu_idx); >> + if (test_bit(mmu_idx, &mmu_idx_bitmask)) { >> + tlb_debug("%d\n", mmu_idx); >> >> - memset(env->tlb_table[mmu_idx], -1, sizeof(env->tlb_table[0])); >> - memset(env->tlb_v_table[mmu_idx], -1, sizeof(env->tlb_v_table[0])); >> + memset(env->tlb_table[mmu_idx], -1, sizeof(env->tlb_table[0])); >> + memset(env->tlb_v_table[mmu_idx], -1, sizeof(env->tlb_v_table[0])); >> + } > > Perhaps it doesn't matter since NB_MMU_MODES is so small but > > for (; idxmap != 0; idxmap &= idxmap - 1) { > int mmu_idx = ctz32(idxmap); > ... > } Perhaps but if it is OK with you I'll skip this optimisation for now? We are basically in the slow path by this point and for clarity I'd prefer to keep it as is. -- Alex Bennée From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38806) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cYshC-0002ZI-4i for qemu-devel@nongnu.org; Wed, 01 Feb 2017 06:03:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cYsh7-0002fQ-FV for qemu-devel@nongnu.org; Wed, 01 Feb 2017 06:03:26 -0500 Received: from mail-wm0-x22e.google.com ([2a00:1450:400c:c09::22e]:35036) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cYsh7-0002fE-9n for qemu-devel@nongnu.org; Wed, 01 Feb 2017 06:03:21 -0500 Received: by mail-wm0-x22e.google.com with SMTP id b65so33434499wmf.0 for ; Wed, 01 Feb 2017 03:03:20 -0800 (PST) References: <20170127103922.19658-1-alex.bennee@linaro.org> <20170127103922.19658-17-alex.bennee@linaro.org> <70fe24bb-c8f1-43c4-010f-a682bdd507ef@twiddle.net> From: Alex =?utf-8?Q?Benn=C3=A9e?= In-reply-to: <70fe24bb-c8f1-43c4-010f-a682bdd507ef@twiddle.net> Date: Wed, 01 Feb 2017 11:03:19 +0000 Message-ID: <87efzi41hk.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v8 16/25] cputlb and arm/sparc targets: convert mmuidx flushes from varg to bitmap List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: mttcg@greensocs.com, qemu-devel@nongnu.org, fred.konrad@greensocs.com, a.rigo@virtualopensystems.com, cota@braap.org, bobby.prani@gmail.com, nikunj@linux.vnet.ibm.com, mark.burton@greensocs.com, pbonzini@redhat.com, jan.kiszka@siemens.com, serge.fdrv@gmail.com, peter.maydell@linaro.org, claudio.fontana@huawei.com, bamvor.zhangjian@linaro.org, Peter Crosthwaite , Mark Cave-Ayland , Artyom Tarasenko , "open list:ARM" Richard Henderson writes: > On 01/27/2017 02:39 AM, Alex Bennée wrote: >> + for (mmu_idx = 0; mmu_idx < NB_MMU_MODES; mmu_idx++) { >> >> - tlb_debug("%d\n", mmu_idx); >> + if (test_bit(mmu_idx, &mmu_idx_bitmask)) { >> + tlb_debug("%d\n", mmu_idx); >> >> - memset(env->tlb_table[mmu_idx], -1, sizeof(env->tlb_table[0])); >> - memset(env->tlb_v_table[mmu_idx], -1, sizeof(env->tlb_v_table[0])); >> + memset(env->tlb_table[mmu_idx], -1, sizeof(env->tlb_table[0])); >> + memset(env->tlb_v_table[mmu_idx], -1, sizeof(env->tlb_v_table[0])); >> + } > > Perhaps it doesn't matter since NB_MMU_MODES is so small but > > for (; idxmap != 0; idxmap &= idxmap - 1) { > int mmu_idx = ctz32(idxmap); > ... > } Perhaps but if it is OK with you I'll skip this optimisation for now? We are basically in the slow path by this point and for clarity I'd prefer to keep it as is. -- Alex Bennée