Skip to contentSkip to conversation

hwinfo problem since 2.6.28

DISCUSSION Suresh Siddha 2 participants 2 messages Jan 9, 2009 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#2 lore raw
In reply to a message not in the archive
Quoted 13 lines
Quoted 13 lines

Date: Tue, 6 Jan 2009 09:53:14 +0100
From: "Beschorner Daniel" <[email protected]>
To: <[email protected]>
Subject: hwinfo problem since 2.6.28

Since 2.6.28 my hwinfo tool crashes badly on 2 years old OpenSuSE 10.2 x64/SMP.
Older kernels run fine, I did a "make oldconfig" and rather used defaults (just skipping low-64k checks).
This seems to be the only affected binary as far I can see. Did I miss a new legacy/compat option or is it a bug?

Quoted 6 lines
Quoted 6 lines

Thank you!
Daniel

hwinfo: Corrupted page table at address 7fd04de3ec00 PGD 7dc33067 PUD 3efe067 PMD 27b83067 PTE fffffffffffffbff Bad pagetable: 000d [#9] SMP

Daniel, Can you please check and ack if the appended patch fixes this page table corruption issue? We tried to reproduce your issue locally here but didn't succeed because of different hwinfo versions.

thanks,
suresh
---

From: Suresh Siddha <[email protected]>
Subject: x86: fix PTE corruption issue while mapping RAM using /dev/mem

Beschorner Daniel reported:

Quoted 2 lines

hwinfo problem since 2.6.28, showing this in the oops:
Corrupted page table at address 7fd04de3ec00

PaX Team reported a regression with this commit:

Quoted 5 lines
	commit 9542ada803198e6eba29d3289abb39ea82047b92
	Author: Suresh Siddha <[email protected]>
	Date:   Wed Sep 24 08:53:33 2008 -0700

	    x86: track memtype for RAM in page struct

This commit breaks mapping any RAM page through /dev/mem, as the reserve_memtype() was not initializing the return attribute type and as such corrupting the PTE entry that was setup with the return attribute type.

Because of this bug, application mapping this RAM page through /dev/mem will die with "Corrupted page table at address xxxx" message in the kernel log and also the kernel identity mapping which maps the underlying RAM page gets converted to UC.

Fix this by initializing the return attribute type before calling reserve_ram_pages_type()

---

arch/x86/mm/pat.c +3 -3
index 85cbd3c..d52ba1a 100644
@@ -333,6 +333,9 @@ int reserve_memtype(u64 start, u64 end, unsigned long req_type,
 					      req_type & _PAGE_CACHE_MASK);
 	}
 
+	if (new_type)
+		*new_type = actual_type;
+
 	is_range_ram = pagerange_is_ram(start, end);
 	if (is_range_ram == 1)
 		return reserve_ram_pages_type(start, end, req_type, new_type);
@@ -347,9 +350,6 @@ int reserve_memtype(u64 start, u64 end, unsigned long req_type,
 	new->end	= end;
 	new->type	= actual_type;
 
-	if (new_type)
-		*new_type = actual_type;
-
 	spin_lock(&memtype_lock);
 
 	if (cached_entry && start >= cached_start)
#3 lore raw
Quoted 15 lines
Quoted 1 line
Quoted 1 line

Since 2.6.28 my hwinfo tool crashes badly on 2 years old

OpenSuSE 10.2

Quoted 6 lines
Quoted 6 lines

x64/SMP.
Older kernels run fine, I did a "make oldconfig" and rather used defaults (just skipping low-64k checks).
This seems to be the only affected binary as far I can see. Did I miss a new legacy/compat option or is it a bug?

Quoted 6 lines
Quoted 6 lines

Thank you!
Daniel

hwinfo: Corrupted page table at address 7fd04de3ec00 PGD 7dc33067 PUD 3efe067 PMD 27b83067 PTE fffffffffffffbff Bad pagetable: 000d [#9] SMP

Quoted 7 lines

Daniel, Can you please check and ack if the appended patch fixes this page table corruption issue? We tried to reproduce your issue locally here but didn't succeed because of different hwinfo versions.

thanks,
suresh
---

Works great! hwinfo runs fine again.

Thank you!
Daniel