From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37995) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmjIk-0004Eu-OF for qemu-devel@nongnu.org; Tue, 29 Aug 2017 12:23:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dmjIf-0004TS-6g for qemu-devel@nongnu.org; Tue, 29 Aug 2017 12:23:42 -0400 MIME-Version: 1.0 In-Reply-To: <3148d084-9bff-2d8e-f1a7-fba94a1e7f87@linaro.org> References: <20170829063313.10237-1-bobby.prani@gmail.com> <20170829063313.10237-5-bobby.prani@gmail.com> <3148d084-9bff-2d8e-f1a7-fba94a1e7f87@linaro.org> From: Pranith Kumar Date: Tue, 29 Aug 2017 12:23:05 -0400 Message-ID: Content-Type: text/plain; charset="UTF-8" Subject: Re: [Qemu-devel] [RFC v3 PATCH 5/5] tcg/softmmu: Increase size of TLB caches List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: =?UTF-8?B?QWxleCBCZW5uw6ll?= , Paolo Bonzini , Peter Crosthwaite , Claudio Fontana , Andrzej Zaborowski , Aurelien Jarno , Alexander Graf , Stefan Weil , "open list:Overall" , "open list:AArch64 target" On Tue, Aug 29, 2017 at 11:01 AM, Richard Henderson wrote: > On 08/28/2017 11:33 PM, Pranith Kumar wrote: >> + * TODO: rewrite this comment >> */ >> -#define CPU_TLB_BITS \ >> - MIN(8, \ >> - TCG_TARGET_TLB_DISPLACEMENT_BITS - CPU_TLB_ENTRY_BITS - \ >> - (NB_MMU_MODES <= 1 ? 0 : \ >> - NB_MMU_MODES <= 2 ? 1 : \ >> - NB_MMU_MODES <= 4 ? 2 : \ >> - NB_MMU_MODES <= 8 ? 3 : 4)) >> +#define CPU_TLB_BITS MIN(12, TCG_TARGET_TLB_MAX_INDEX_BITS) >> > > Ah, no. This will cause several builds to fail. > You still need to restrict the *total* size of > the TLB to TCG_TARGET_TLB_DISPLACEMENT_BITS. > > (That's not a 100% accurate statement, but is close. > See the QEMU_BUILD_BUG_ON in tcg/*/*.c for specifics.) > > The upshot is that if a target has 2 MMU modes, > we can allow them to be bigger. But if it has 8, > we have to make them smaller. > > I was expecting you to write > > MIN(MIN(12, TCG_TARGET_TLB_MAX_INDEX_BITS) > TCG_TARGET_TLB_DISPLACEMENT_BITS - CPU_TLB_ENTRY_BITS - > ...) I see what you mean. I will fix the blunder and send an updated patch. Thanks! -- Pranith