linux-ia64.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ia64: fix an addr to taddr in huge_pte_offset()
@ 2023-04-17  5:17 Hugh Dickins
  2023-04-18 20:29 ` Mike Kravetz
  2023-04-19  9:29 ` Mike Rapoport
  0 siblings, 2 replies; 3+ messages in thread
From: Hugh Dickins @ 2023-04-17  5:17 UTC (permalink / raw
  To: Andrew Morton
  Cc: Mike Rapoport, Mike Kravetz, Ard Biesheuvel, linux-ia64, linux-mm

I know nothing of ia64 htlbpage_to_page(), but guess that the p4d
line should be using taddr rather than addr, like everywhere else.

Fixes: c03ab9e32a2c ("ia64: add support for folded p4d page tables")
Signed-off-by: Hugh Dickins <hughd@google.com
---
Just something noticed when visiting recently in the source:
thought we might fix it before ia64 is consigned to history;
I'm unable to say anything about the user-visible effects!

 arch/ia64/mm/hugetlbpage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- 6.3-rc7/arch/ia64/mm/hugetlbpage.c
+++ linux/arch/ia64/mm/hugetlbpage.c
@@ -58,7 +58,7 @@ huge_pte_offset (struct mm_struct *mm, unsigned long addr, unsigned long sz)
 
 	pgd = pgd_offset(mm, taddr);
 	if (pgd_present(*pgd)) {
-		p4d = p4d_offset(pgd, addr);
+		p4d = p4d_offset(pgd, taddr);
 		if (p4d_present(*p4d)) {
 			pud = pud_offset(p4d, taddr);
 			if (pud_present(*pud)) {

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ia64: fix an addr to taddr in huge_pte_offset()
  2023-04-17  5:17 [PATCH] ia64: fix an addr to taddr in huge_pte_offset() Hugh Dickins
@ 2023-04-18 20:29 ` Mike Kravetz
  2023-04-19  9:29 ` Mike Rapoport
  1 sibling, 0 replies; 3+ messages in thread
From: Mike Kravetz @ 2023-04-18 20:29 UTC (permalink / raw
  To: Hugh Dickins
  Cc: Andrew Morton, Mike Rapoport, Ard Biesheuvel, linux-ia64,
	linux-mm

On 04/16/23 22:17, Hugh Dickins wrote:
> I know nothing of ia64 htlbpage_to_page(), but guess that the p4d
> line should be using taddr rather than addr, like everywhere else.
> 
> Fixes: c03ab9e32a2c ("ia64: add support for folded p4d page tables")
> Signed-off-by: Hugh Dickins <hughd@google.com
> ---
> Just something noticed when visiting recently in the source:
> thought we might fix it before ia64 is consigned to history;
> I'm unable to say anything about the user-visible effects!

Good eye!

I know as little about ia64 as you.  However, that single use of addr
within the routine certainly looks wrong.

Acked-by: Mike Kravetz <mike.kravetz@oracle.com>
-- 
Mike Kravetz

> 
>  arch/ia64/mm/hugetlbpage.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- 6.3-rc7/arch/ia64/mm/hugetlbpage.c
> +++ linux/arch/ia64/mm/hugetlbpage.c
> @@ -58,7 +58,7 @@ huge_pte_offset (struct mm_struct *mm, unsigned long addr, unsigned long sz)
>  
>  	pgd = pgd_offset(mm, taddr);
>  	if (pgd_present(*pgd)) {
> -		p4d = p4d_offset(pgd, addr);
> +		p4d = p4d_offset(pgd, taddr);
>  		if (p4d_present(*p4d)) {
>  			pud = pud_offset(p4d, taddr);
>  			if (pud_present(*pud)) {

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ia64: fix an addr to taddr in huge_pte_offset()
  2023-04-17  5:17 [PATCH] ia64: fix an addr to taddr in huge_pte_offset() Hugh Dickins
  2023-04-18 20:29 ` Mike Kravetz
@ 2023-04-19  9:29 ` Mike Rapoport
  1 sibling, 0 replies; 3+ messages in thread
From: Mike Rapoport @ 2023-04-19  9:29 UTC (permalink / raw
  To: Hugh Dickins
  Cc: Andrew Morton, Mike Kravetz, Ard Biesheuvel, linux-ia64, linux-mm

On Sun, Apr 16, 2023 at 10:17:05PM -0700, Hugh Dickins wrote:
> I know nothing of ia64 htlbpage_to_page(), but guess that the p4d
> line should be using taddr rather than addr, like everywhere else.
> 
> Fixes: c03ab9e32a2c ("ia64: add support for folded p4d page tables")
> Signed-off-by: Hugh Dickins <hughd@google.com

htlbpage_to_page() does weird things I don't understand, but I should have
used taddr indeed :)

Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>

> ---
> Just something noticed when visiting recently in the source:
> thought we might fix it before ia64 is consigned to history;
> I'm unable to say anything about the user-visible effects!
> 
>  arch/ia64/mm/hugetlbpage.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- 6.3-rc7/arch/ia64/mm/hugetlbpage.c
> +++ linux/arch/ia64/mm/hugetlbpage.c
> @@ -58,7 +58,7 @@ huge_pte_offset (struct mm_struct *mm, unsigned long addr, unsigned long sz)
>  
>  	pgd = pgd_offset(mm, taddr);
>  	if (pgd_present(*pgd)) {
> -		p4d = p4d_offset(pgd, addr);
> +		p4d = p4d_offset(pgd, taddr);
>  		if (p4d_present(*p4d)) {
>  			pud = pud_offset(p4d, taddr);
>  			if (pud_present(*pud)) {

-- 
Sincerely yours,
Mike.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-04-19  9:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-17  5:17 [PATCH] ia64: fix an addr to taddr in huge_pte_offset() Hugh Dickins
2023-04-18 20:29 ` Mike Kravetz
2023-04-19  9:29 ` Mike Rapoport

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).