Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932733AbcDHMpr (ORCPT ); Fri, 8 Apr 2016 08:45:47 -0400 Received: from foss.arm.com ([217.140.101.70]:39390 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751757AbcDHMpp (ORCPT ); Fri, 8 Apr 2016 08:45:45 -0400 Subject: Re: [PATCH 02/17] arm64: Cleanup VTCR_EL2 and VTTBR field values To: Christoffer Dall References: <1459787177-12767-1-git-send-email-suzuki.poulose@arm.com> <1459787177-12767-3-git-send-email-suzuki.poulose@arm.com> <20160408124346.GN8961@cbox> Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, marc.zyngier@arm.com, mark.rutland@arm.com, will.deacon@arm.com, catalin.marinas@arm.com From: Suzuki K Poulose Message-ID: <5707A7F5.1010104@arm.com> Date: Fri, 8 Apr 2016 13:45:41 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <20160408124346.GN8961@cbox> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1610 Lines: 48 On 08/04/16 13:43, Christoffer Dall wrote: >> +#define VTCR_EL2_T0SZ_IPA VTCR_EL2_T0SZ_40B >> +#define VTCR_EL2_COMMON_BITS (VTCR_EL2_SH0_INNER | VTCR_EL2_ORGN0_WBWA | \ >> + VTCR_EL2_IRGN0_WBWA | VTCR_EL2_SL0_LVL1 | \ >> + VTCR_EL2_RES1 | VTCR_EL2_T0SZ_IPA) >> #ifdef CONFIG_ARM64_64K_PAGES >> /* >> * Stage2 translation configuration: >> - * 40bits input (T0SZ = 24) >> * 64kB pages (TG0 = 1) >> * 2 level page tables (SL = 1) >> */ >> -#define VTCR_EL2_FLAGS (VTCR_EL2_TG0_64K | VTCR_EL2_SH0_INNER | \ >> - VTCR_EL2_ORGN0_WBWA | VTCR_EL2_IRGN0_WBWA | \ >> - VTCR_EL2_SL0_LVL1 | VTCR_EL2_T0SZ_40B | \ >> - VTCR_EL2_RES1) >> -#define VTTBR_X (38 - VTCR_EL2_T0SZ_40B) >> +#define VTCR_EL2_TGRAN_FLAGS (VTCR_EL2_TG0_64K | VTCR_EL2_SL0_LVL1) >> +#define VTTBR_X_TGRAN_MAGIC 38 >> #else >> /* >> * Stage2 translation configuration: >> - * 40bits input (T0SZ = 24) >> * 4kB pages (TG0 = 0) >> * 3 level page tables (SL = 1) >> */ >> -#define VTCR_EL2_FLAGS (VTCR_EL2_TG0_4K | VTCR_EL2_SH0_INNER | \ >> - VTCR_EL2_ORGN0_WBWA | VTCR_EL2_IRGN0_WBWA | \ >> - VTCR_EL2_SL0_LVL1 | VTCR_EL2_T0SZ_40B | \ >> - VTCR_EL2_RES1) >> -#define VTTBR_X (37 - VTCR_EL2_T0SZ_40B) >> +#define VTCR_EL2_TGRAN_FLAGS (VTCR_EL2_TG0_4K | VTCR_EL2_SL0_LVL1) >> +#define VTTBR_X_TGRAN_MAGIC 37 >> #endif > > why do we add VTCR_EL2_SL0_LVL1 in both the common bits and TGRAN_FLAGS > define? Oops! It should only be part of TGRAN_FLAGS. Thanks for spotting, will fix it. > Otherwise: > > Reviewed-by: Christoffer Dall Thanks Suzuki