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 15ADE357CED for ; Mon, 13 Jul 2026 02:37:22 +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=1783910247; cv=none; b=ehsHVGAve4PKNrfuhxQDpLojDhmeOMoe1hUUxSAV472RNDWTXSCDYhODXVeD9HrVT/jkeL3aV8AiQHus1d5xXtQZENT/f+dGWsZzpi3AdP4C4tLB4ivLuWnXIVkbnH4sQo3NrYh7j1yJt1xTc7Ul9xEWkJosdR0+FhKpL4xuMLo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783910247; c=relaxed/simple; bh=RAOlbtj+ruxKqMGMvP4gQvTsJRk49a7u1pfA/VZ2Hlc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=l/Z6jGyCwZl4q0zFuBClVDSRt9yrbMKYjwxnXejCSOd8QyJsYB/PicuaIL4iVQmiUnL9XS6CZYbsVgNZ2rs2Xli3BqqYIGjohJ2YF4m7+q26ccGRexTT2xwJ2sR0WsveXSTjpV042ry+v1QDqRP4/YHB+WGX3leLbKpZ4wQRhuQ= 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=VIQGmDqD; 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="VIQGmDqD" 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 690701595; Sun, 12 Jul 2026 19:37:17 -0700 (PDT) Received: from [10.164.18.40] (unknown [10.164.18.40]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4B0D13F93E; Sun, 12 Jul 2026 19:37:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1783910241; bh=RAOlbtj+ruxKqMGMvP4gQvTsJRk49a7u1pfA/VZ2Hlc=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=VIQGmDqDNlk/rPWU66rlk1Zsn5AWDdffk6yCK33tgRZ5OYhYA89d1KnPof3/ZrEat hU9ZtCuwwEmSqx4MGX3G50wExe3jHD0D+cTyncFFQLFSsMMfaxl5Cz1+LEQd0r0K0V s7OXBBf6pU+iLQ0hYdJWCD7s9QhQT2532rowFw4E= Message-ID: <5ee8783e-4deb-48fc-a4c4-96b02d79a6cb@arm.com> Date: Mon, 13 Jul 2026 08:07:16 +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: [PATCH V3] mm: Standardize printing for pgtable entries To: Matthew Wilcox Cc: linux-mm@kvack.org, andriy.shevchenko@linux.intel.com, usama.arif@linux.dev, hughd@google.com, ryan.roberts@arm.com, "David Hildenbrand (Arm)" , Andrew Morton , linux-kernel@vger.kernel.org References: <20260709044334.1741263-1-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 11/07/26 10:28 AM, Matthew Wilcox wrote: > On Thu, Jul 09, 2026 at 10:13:34AM +0530, Anshuman Khandual wrote: >> @@ -532,34 +575,34 @@ static void __print_bad_page_map_pgtable(struct mm_struct *mm, unsigned long add >> * see locking requirements for print_bad_page_map(). >> */ >> pgdp = pgd_offset(mm, addr); >> - pgdv = pgd_val(*pgdp); >> + ptval_to_str(pgd_str, pgd_val(*pgdp)); >> >> if (!pgd_present(*pgdp) || pgd_leaf(*pgdp)) { >> - pr_alert("pgd:%08llx\n", pgdv); >> + pr_alert("pgd:%s\n", pgd_str); > > Why can't we do this as: > > pr_alert("pgd:%*phN\n", sizeof(pgdv), &pgdv); %*phN dumps raw memory bytes and will have different formats on little vs big endian platforms which is not desired here. Debug print here is expected to report pgtable entry canonical value where various platform specific fields can be inspected. > > It'd save us all this stack space. >