From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 33082C25B74 for ; Thu, 16 May 2024 15:34:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=mEcADTm+PxzI3tvuczPggmb8AekT3MEKbi8XN1Ljqbc=; b=RQJgqKOlQewflj Yuw0caZaeRegeYmXN4hSZ4unFTjcmVu0lV0OTL2cpCupWp41ZVLAE0iWcV64oGfnYZIhrnUHWPPdO ep5Ul4UK57oTYudeHeUfWDEnUmUD7g089DgYPTwy3/MgKtYmFNlt/FV5rzy1H3buEnlqKpCoJ2EvA YQXY4Rojso7QdmHV7zqvqxt+rkkqJ47t59jiBA0uee+XgEkE8tC2AGMgRdtQFnLP9F50INGFqKwxm XytfXK/pZDu+o+/tq4QYG4yuGB3eOd2rh3muE8G38p/B0E79oUbdoSXw3dgEC9zy+cvVJauVPBLZd oyZVhZtkJ9w8zczme22A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s7d7z-00000005LOJ-2jd4; Thu, 16 May 2024 15:34:43 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s7d7v-00000005LNR-49eg for linux-arm-kernel@lists.infradead.org; Thu, 16 May 2024 15:34:41 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4266ADA7; Thu, 16 May 2024 08:35:02 -0700 (PDT) Received: from [10.1.25.38] (e122027.cambridge.arm.com [10.1.25.38]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5FBFF3F7A6; Thu, 16 May 2024 08:34:35 -0700 (PDT) Message-ID: Date: Thu, 16 May 2024 16:34:34 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 07/14] arm64: Make the PHYS_MASK_SHIFT dynamic To: Catalin Marinas Cc: kvm@vger.kernel.org, kvmarm@lists.linux.dev, Marc Zyngier , Will Deacon , James Morse , Oliver Upton , Suzuki K Poulose , Zenghui Yu , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Joey Gouly , Alexandru Elisei , Christoffer Dall , Fuad Tabba , linux-coco@lists.linux.dev, Ganapatrao Kulkarni References: <20240412084213.1733764-1-steven.price@arm.com> <20240412084213.1733764-8-steven.price@arm.com> From: Steven Price Content-Language: en-GB In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240516_083440_118459_B467B4E5 X-CRM114-Status: GOOD ( 14.17 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 13/05/2024 17:38, Catalin Marinas wrote: > On Fri, Apr 12, 2024 at 09:42:06AM +0100, Steven Price wrote: >> diff --git a/arch/arm64/include/asm/kvm_arm.h b/arch/arm64/include/asm/kvm_arm.h >> index e01bb5ca13b7..9944aca348bd 100644 >> --- a/arch/arm64/include/asm/kvm_arm.h >> +++ b/arch/arm64/include/asm/kvm_arm.h >> @@ -398,7 +398,7 @@ >> * bits in PAR are res0. >> */ >> #define PAR_TO_HPFAR(par) \ >> - (((par) & GENMASK_ULL(52 - 1, 12)) >> 8) >> + (((par) & GENMASK_ULL(MAX_PHYS_MASK_SHIFT - 1, 12)) >> 8) > > Why does this need to be changed? It's still a constant not dependent on > the new dynamic IPA size. Good question - this appears to be a rebase error. Since commit a0d37784bfd7 ("KVM: arm64: Fix PAR_TO_HPFAR() to work independently of PA_BITS.") this macro no longer uses PHYS_MASK_SHIFT. Previously the change was to just to keep this uses the new 'MAX' constant. >> diff --git a/arch/arm64/include/asm/pgtable-hwdef.h b/arch/arm64/include/asm/pgtable-hwdef.h >> index ef207a0d4f0d..90dc292bed5f 100644 >> --- a/arch/arm64/include/asm/pgtable-hwdef.h >> +++ b/arch/arm64/include/asm/pgtable-hwdef.h >> @@ -206,8 +206,8 @@ >> /* >> * Highest possible physical address supported. >> */ >> -#define PHYS_MASK_SHIFT (CONFIG_ARM64_PA_BITS) >> -#define PHYS_MASK ((UL(1) << PHYS_MASK_SHIFT) - 1) >> +#define MAX_PHYS_MASK_SHIFT (CONFIG_ARM64_PA_BITS) >> +#define MAX_PHYS_MASK ((UL(1) << PHYS_MASK_SHIFT) - 1) > > I prefer to have MAX as suffix in those definitions, it matches other > places like TASK_SIZE_MAX, PHYS_ADDR_MAX (I know PHYS_MASK_MAX doesn't > roll off the tongue easily but very few people tend to read the kernel > aloud ;)). I could rename, but actually given the above rebasing errors it appears these are actually no longer needed, so I'll just drop the MAX_xxx definitions. Thanks, Steve _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel