Skip to contentSkip to conversation

ia64: fix an addr to taddr in huge_pte_offset()

PATCH Applied Hugh Dickins 3 participants 3 messages Apr 17, 2023 – Apr 19, 2023 Memory management

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ia64: fix an addr to taddr in huge_pte_offset()

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")

---
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(-)
arch/ia64/mm/hugetlbpage.c +1 -1
@@ -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)) {
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Hugh Dickins

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")

---
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.

Signature · 1 line
Mike Kravetz
Quoted 15 lines
 arch/ia64/mm/hugetlbpage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/ia64/mm/hugetlbpage.c +1 -1
@@ -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)) {
Acked-by Mike Rapoport (IBM) on v1 1/1
#2 lore raw
In reply to Hugh Dickins
Quoted 5 lines · Hugh Dickins

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")

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

Quoted 19 lines

---
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(-)
arch/ia64/mm/hugetlbpage.c +1 -1
@@ -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)) {
Signature · 2 lines
Sincerely yours,
Mike.