Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2169161lqo; Mon, 13 May 2024 09:39:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVESx42hYHXy1DbkJrBh4S7sxSEgo9qH8WcJ0UWjQ03U5XFalZ/3n++/BpMO0N9EuYyZrRxOBPKi2qlzQMhzrggvjVNsBOnIHU3UM483w== X-Google-Smtp-Source: AGHT+IFTBPZbeVKrTl1P1sN0+NwHBcjealeVrRAHYSJqPPxaRtvekJyKFd/9tFTB2VLB5MW1D5Ar X-Received: by 2002:a05:6870:708b:b0:23e:ec96:b62e with SMTP id 586e51a60fabf-24171ffc51fmr13352939fac.0.1715618349639; Mon, 13 May 2024 09:39:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715618349; cv=pass; d=google.com; s=arc-20160816; b=KGD9udnOqEIxjHdhPbxr77dePREA9ENeQOdidBIOpBrMP2zU6g1SRs85c3ituguSgb AaOxzfZKMvDThKShniSxRP4/0+RJqDsxF6nNGrlOagmSRPiWMssD9k8WkD1uxnhobDgE T8zcH2xXy/Q0L8Ehb1SGdg28xC0v0fS490ckeSPBwyTjWUkh8IjCzlO/J0Tjk9wgG+/8 fwzUrkVE/sBhx1VCVTgZugub6c1Lyk4rrQOi0KPC1hUdTfDMpRx+Z5WouPDgDdJG2t6y KnyvDb6og3lSNFslK1AwewuSgCKkSArXi6zrkFOsSDTAiFU6ZHbHmGUqPlxVq6xcQDo3 7hYg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=KY3cT6SCnKF9OI9hYqUjAOO8UM5VQpdiX3x3fyHt8so=; fh=0PvXTblvcOsrMPT3yEGqxR5sUU4n6OEeMAbaOpzry54=; b=HBd/mFO/YU3+X8K9f7pjJwQ0owv6VplgADEitFfgqOsu1SiKawUOvOvWFM4lbyZsca M/boVUxxA3AgK3vbgwPGTxD9yvfnqCdDJFswWAqRZs6RIXDHuAuUbMY5xXfGoUEMhk6v et2g7ORPALr6N18+E58KXCDLdJVFNr5xIofTnAxhJTlxhXeZ0fCh8i9jwRUtBQhIB0k9 qqGN38G/Il2dQRuCFz1828qfwvWR0NTOrI8CEgpjMJuZOpX3EcviW7sWEh3YxW53xMJ/ su++ZA8lJNY26GbgmBA/XFtoUKZqdTbbhAwerxSzbJvb4xWkMScSQFpuVEo8Mq7l7tz9 gyVQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-177841-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177841-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-63409e82760si9710472a12.52.2024.05.13.09.39.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 09:39:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-177841-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-177841-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177841-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 44503284F52 for ; Mon, 13 May 2024 16:39:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 30ACB1946F; Mon, 13 May 2024 16:39:00 +0000 (UTC) Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9BA2C208A1; Mon, 13 May 2024 16:38:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715618339; cv=none; b=R0H7c09MH9nzalO4YXvQdpsnk0YwSJJ05zZxK3sWanS82DMNNnpdyzFvbLfZJRZGkYL7WCYzzjWFe3RAoCGujq/Y3t5Dd+o84CNVoH32CzF+3zJnGr/zJF/4SOp9hvwi/7ZGxmUDkg0L1sYKkXCP/GwFGE7BgXJV0WtWNfx1Zao= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715618339; c=relaxed/simple; bh=fhiBDdzgfG8w+pcwYov50xsdrVpjMez9OR8PkWTcBTM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=LuoaaTXMH+synXiWwM+oPiOq4coGdBvbAsk3sQA/XothX+1Sf2hqde7ez5Sr2/NZLdDLs8kZhE1X0sWMOXYZ13fzSQnye8V/ZAdD25TaOuI9SDQLQ+YHWNQAqGkHOZaFu7AaHZiCnuOxwoXvlIJoWckNFWfosk89oWLxaBpYvGc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2E331C113CC; Mon, 13 May 2024 16:38:56 +0000 (UTC) Date: Mon, 13 May 2024 17:38:53 +0100 From: Catalin Marinas To: Steven Price 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 Subject: Re: [PATCH v2 07/14] arm64: Make the PHYS_MASK_SHIFT dynamic Message-ID: References: <20240412084213.1733764-1-steven.price@arm.com> <20240412084213.1733764-8-steven.price@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240412084213.1733764-8-steven.price@arm.com> 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. > 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 ;)). -- Catalin