From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1BB3D282F12 for ; Fri, 10 Apr 2026 04:21:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775794916; cv=none; b=sb0LnotAMoeRBEmL0gkXqRi2AuocXA6z+H4Qy/mkfSf2hsKrI0Sab2OAWNvxuRqnGr8oqkddVSnFvzXyQR5NSKX/g28uC+QwKiCgVs628zypyC4dar6qtnNtD1HMajFAmkE0klyLH7bldJgKKYK+j5yzwc1qumWcYhxgCR5TK88= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775794916; c=relaxed/simple; bh=yNYtRWemxBehsStI8lS7zwbuvuaTycWq8O+12cp0kh0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=mdgZFVe15lxrYEhiVulWFHD6xhz/D4cfr1dwV6oLEOfE02MQx3TiSUMs1TGuOtHz04NBjshuPtlGNQwUhKcppr417aB8ptSf0ii+BNaMa/R7b56YbGUZNTlBCT/Oxd6wm2wD5LTn7as7+TcZvmhjBoaaKUAT4JEsgLSzrxouf5I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=V7lLGyCR; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="V7lLGyCR" 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 845DC2008; Thu, 9 Apr 2026 21:21:48 -0700 (PDT) Received: from [10.163.181.174] (unknown [10.163.181.174]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 668AD3FAF5; Thu, 9 Apr 2026 21:21:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1775794914; bh=yNYtRWemxBehsStI8lS7zwbuvuaTycWq8O+12cp0kh0=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=V7lLGyCRjzBFKUjJy+Tws9lDROrQyWlkUAfTsMgWOPjwWM4bQpWwJ7us2nynvVNU+ /HHMG0BJUWIRBfYoH5pUaQ5zBK9mvngorFK4TzUQjF2xigTG21/X0vRfbEMRa5pvIA tE5gLPUsBiB3zI+Vp6r3xRWJKI42w0c3dDz1YYsU= Message-ID: <18173611-b233-42a4-867d-1e474feee534@arm.com> Date: Fri, 10 Apr 2026 09:51:47 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC V1 01/16] mm: Abstract printing of pxd_val() To: Mike Rapoport 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 References: <20260224051153.3150613-1-anshuman.khandual@arm.com> <20260224051153.3150613-2-anshuman.khandual@arm.com> Content-Language: en-US From: Anshuman Khandual In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 09/04/26 4:03 PM, Mike Rapoport wrote: > 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. Sure will drop the indent from pxdval_t. > >> +#else >> + typedef unsigned long long pxdval_t; >> +#endif > > Don't we want this in, say, include/linux/pgtable.h? > Sure will move the typedef into the above header.