Skip to contentSkip to conversation

x86/mm: Assign the initail value to the pmd_idx

PATCH In review Minfei Huang 4 participants 4 messages Jul 12, 2015 – Jul 20, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/mm: Assign the initail value to the pmd_idx

From: Minfei Huang <[email protected]>

The variable pmd_idx is undefined, when we try to start the loop to calculate the page.

Assign the proper value which indexes the start address to make it work well.

---
 arch/x86/mm/init_32.c | 1 +
 1 file changed, 1 insertion(+)
arch/x86/mm/init_32.c +1 -0
index 8340e45..68aec42 100644
@@ -137,6 +137,7 @@ page_table_range_init_count(unsigned long start, unsigned long end)
 
 	vaddr = start;
 	pgd_idx = pgd_index(vaddr);
+	pmd_idx = pmd_index(vaddr);
 
 	for ( ; (pgd_idx < PTRS_PER_PGD) && (vaddr != end); pgd_idx++) {
 		for (; (pmd_idx < PTRS_PER_PMD) && (vaddr != end);
Signature · 1 line
2.2.2
#1 lore raw

ping.

Can someone help review this patch?

Thanks
Minfei

Quoted 28 lines · Minfei Huang

From: Minfei Huang <[email protected]>

The variable pmd_idx is undefined, when we try to start the loop to calculate the page.

Assign the proper value which indexes the start address to make it work well.

---
 arch/x86/mm/init_32.c | 1 +
 1 file changed, 1 insertion(+)
arch/x86/mm/init_32.c +1 -0
index 8340e45..68aec42 100644
@@ -137,6 +137,7 @@ page_table_range_init_count(unsigned long start, unsigned long end)
 
 	vaddr = start;
 	pgd_idx = pgd_index(vaddr);
+	pmd_idx = pmd_index(vaddr);
 
 	for ( ; (pgd_idx < PTRS_PER_PGD) && (vaddr != end); pgd_idx++) {
 		for (; (pmd_idx < PTRS_PER_PMD) && (vaddr != end);
Signature · 1 line
2.2.2
Reviewed-by on v1 1/1
#2 lore raw
In reply to Minfei Huang
Quoted 18 lines · Minfei Huang

From: Minfei Huang <[email protected]>

The variable pmd_idx is undefined, when we try to start the loop to calculate the page.

Assign the proper value which indexes the start address to make it work well.

---
 arch/x86/mm/init_32.c | 1 +
 1 file changed, 1 insertion(+)
arch/x86/mm/init_32.c +0 -0
index 8340e45..68aec42 100644

arch/x86/mm/init_32.c page_table_range_init_count(unsigned long start, unsigned long end) · line 143

Quoted 7 lines
arch/x86/mm/init_32.c +1 -0
@@ -137,6 +137,7 @@ page_table_range_init_count(unsigned long start, unsigned long end)
 
        vaddr = start;
        pgd_idx = pgd_index(vaddr);
+       pmd_idx = pmd_index(vaddr);
 
        for ( ; (pgd_idx < PTRS_PER_PGD) && (vaddr != end); pgd_idx++) {
                for (; (pmd_idx < PTRS_PER_PMD) && (vaddr != end);
#3 lore raw

[tip:x86/mm] x86/mm: Initialize pmd_idx in page_table_range_init_count()

In reply to Minfei Huang
x86/mm: Initialize pmd_idx in page_table_range_init_count()
Commit-ID:  9962eea9e55f797f05f20ba6448929cab2a9f018
Gitweb:     http://git.kernel.org/tip/9962eea9e55f797f05f20ba6448929cab2a9f018
Author:     Minfei Huang <[email protected]>
AuthorDate: Sun, 12 Jul 2015 20:18:42 +0800
Committer:  Thomas Gleixner <[email protected]>
CommitDate: Mon, 20 Jul 2015 23:14:47 +0200

x86/mm: Initialize pmd_idx in page_table_range_init_count()

The variable pmd_idx is not initialized for the first iteration of the for loop.

Assign the proper value which indexes the start address.

Fixes 719272c45b82 'x86, mm: only call early_ioremap_page_table_range_init() once'
Reviewed-by [email protected]
---
 arch/x86/mm/init_32.c | 1 +
 1 file changed, 1 insertion(+)
arch/x86/mm/init_32.c +1 -0
index c8140e1..c23ab1e 100644
@@ -137,6 +137,7 @@ page_table_range_init_count(unsigned long start, unsigned long end)
 
 	vaddr = start;
 	pgd_idx = pgd_index(vaddr);
+	pmd_idx = pmd_index(vaddr);
 
 	for ( ; (pgd_idx < PTRS_PER_PGD) && (vaddr != end); pgd_idx++) {
 		for (; (pmd_idx < PTRS_PER_PMD) && (vaddr != end);