[Crash-utility] [PATCH] s390x: Add 2GB frame support for page table walker

Michael Holzheu holzheu at linux.vnet.ibm.com
Fri Oct 19 16:20:59 UTC 2012


Hi Dave,

On s390 the new zEC12 machines support 2GB frames. In order to walk page tables
correctly add support to the page table walker function so it detects
2GB frames.

Michael

Signed-off-by: Heiko Carstens <heiko.carstens at de.ibm.com>
Signed-off-by: Michael Holzheu <holzheu at linux.vnet.ibm.com>
---
 s390x.c |    8 ++++++++
 1 file changed, 8 insertions(+)

--- a/s390x.c
+++ b/s390x.c
@@ -643,6 +643,13 @@ int s390x_vtop(ulong table, ulong vaddr,
 		if (!entry)
 			return FALSE;
 		table = entry & ~0xfffULL;
+		/* Check if this a 2GB page */
+		if ((entry & 0x400ULL) && (level == 1)) {
+			/* Add the 2GB frame offset & return the final value. */
+			table &= ~0x7fffffffULL;
+			*phys_addr = table + (vaddr & 0x7fffffffULL);
+			return TRUE;
+		}
 		len = entry & 0x3ULL;
 		level--;
 	}
@@ -650,6 +657,7 @@ int s390x_vtop(ulong table, ulong vaddr,
 	/* Check if this is a large page. */
 	if (entry & 0x400ULL) {
 		/* Add the 1MB page offset and return the final value. */
+		table &= ~0xfffffULL;
 		*phys_addr = table + (vaddr & 0xfffffULL);
 		return TRUE;
 	}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: crash-6.1.0-s390-2gb.diff
Type: text/x-patch
Size: 1102 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/crash-utility/attachments/20121019/b4a6720d/attachment.bin>


More information about the Crash-utility mailing list