From mboxrd@z Thu Jan 1 00:00:00 1970 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 E0DF63A4536 for ; Thu, 9 Apr 2026 10:33:48 +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=1775730829; cv=none; b=tXXajxlkGpFL2uSZAmaiB6OjgaXMNfjBmv2GDBKC62wp0k9n8W5BMyD2sZI2/KcA+JK9hCaT9ezX0pV911jZWU719DpMfhN1FRsIqKg9VQpbuLBifuVmNPz+iYBUJVS1Hg2rKG20yGZhHkC01OHbbiZ50yhjlofOwqgfbDrCWbs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775730829; c=relaxed/simple; bh=TNpoG6jI5tUlUTjT6ng/gxK0PSSrOAvTDidVFPbVzI4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=dqm3KP2G7qip6BMxgpc/nkml4TfrReNyLRg/BCpkcubtvOzl8M8MIXmKb46CGMX/Xmz82jKVp1s6KFsZbtGZNNOfKohX2oK77xra/PFAzGp3S54j+CKU9NTeRDl2J4plnjKnR/hnqfXpuerCkfO8s37/vTHSUK80uOyTt3ncX0A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=orvo0MZx; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="orvo0MZx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D0B1CC19424; Thu, 9 Apr 2026 10:33:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775730828; bh=TNpoG6jI5tUlUTjT6ng/gxK0PSSrOAvTDidVFPbVzI4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=orvo0MZx+9BgWSKdcdjIjZM78aRRqk52xsQRs/dx4vvzLle+gsk275Dc2SFF0l16c iXiyU6gWr5G+gjcSqa1AxqUl1CS06FnZyI50l/0f+ZoGS1AgwJrmfePzeyTpf+h+/L quTJs6pzboQRHwuZfUFx/RrVRnNsWwuWPXL75BficN9lewEnKvzx7aVpEON50Ssg6z 3/ox1uad544T+pg543Lv/nByorHBIxlZmrW/RcM3vrxNXhgmpGpGemo5LVN4JD9uRz B7XyNXv6xVbmrCfNSxP7GAnQpRS5x7U60UxwASry2gvxTISV3rowKMPC13VMb9uByq z/qpI/Pm4z38Q== Date: Thu, 9 Apr 2026 13:33:41 +0300 From: Mike Rapoport To: Anshuman Khandual Cc: linux-arm-kernel@lists.infradead.org, Catalin Marinas , Will Deacon , Ryan Roberts , Mark Rutland , Lorenzo Stoakes , Andrew Morton , David Hildenbrand , Linu Cherian , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [RFC V1 01/16] mm: Abstract printing of pxd_val() Message-ID: References: <20260224051153.3150613-1-anshuman.khandual@arm.com> <20260224051153.3150613-2-anshuman.khandual@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: <20260224051153.3150613-2-anshuman.khandual@arm.com> Hi Anshuman, On Tue, Feb 24, 2026 at 10:41:38AM +0530, Anshuman Khandual wrote: > Ahead of adding support for D128 pgtables, refactor places that print > PTE values to use the new __PRIpte format specifier and __PRIpte_args() > macro to prepare the argument(s). When using D128 pgtables in future, > we can simply redefine __PRIpte and __PTIpte_args(). > > Besides there is also an assumption about pxd_val() being always capped > at 'unsigned long long' size but that will not work for D128 pgtables. > Just increase its size to u128 if the compiler supports via a separate > data type pxdval_t which also defaults to existing 'unsigned long long'. > > Cc: Andrew Morton > Cc: David Hildenbrand > Cc: Lorenzo Stoakes > Cc: Mike Rapoport > Cc: linux-mm@kvack.org > Cc: linux-kernel@vger.kernel.org > Signed-off-by: Anshuman Khandual > --- > include/linux/pgtable.h | 5 +++++ > mm/memory.c | 29 +++++++++++++++++++---------- > 2 files changed, 24 insertions(+), 10 deletions(-) > > diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h > index a50df42a893f..da17139a1279 100644 > --- a/include/linux/pgtable.h > +++ b/include/linux/pgtable.h > @@ -17,6 +17,11 @@ > #include > #include > > +#ifndef __PRIpte > +#define __PRIpte "016llx" > +#define __PRIpte_args(val) ((u64)val) > +#endif > + > #if 5 - defined(__PAGETABLE_P4D_FOLDED) - defined(__PAGETABLE_PUD_FOLDED) - \ > defined(__PAGETABLE_PMD_FOLDED) != CONFIG_PGTABLE_LEVELS > #error CONFIG_PGTABLE_LEVELS is not consistent with __PAGETABLE_{P4D,PUD,PMD}_FOLDED > diff --git a/mm/memory.c b/mm/memory.c > index 07778814b4a8..cfc3077fc52f 100644 > --- a/mm/memory.c > +++ b/mm/memory.c > @@ -532,9 +532,15 @@ static bool is_bad_page_map_ratelimited(void) > return false; > } > > +#ifdef __SIZEOF_INT128__ > + typedef u128 pxdval_t; I don't think the typedef should be indented. > +#else > + typedef unsigned long long pxdval_t; > +#endif Don't we want this in, say, include/linux/pgtable.h? -- Sincerely yours, Mike.