>From adf7f226151969db067a22d09b96b7c0558af622 Mon Sep 17 00:00:00 2001
From: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
Date: Thu, 28 Apr 2011 07:41:05 +0900
Subject: [PATCH 1/5] x86_64: Handle _PAGE_PROTNONE as machine specific data

The definition of _PAGE_PROTNONE changed in version 2.6.28 from
_PAGE_PSE to _PAGE_GLOBAL.

See commit 1796316a8b028a148be48ba5d4e7be493a39d173.
---
 defs.h   |    3 ++-
 x86_64.c |    7 +++++++
 2 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/defs.h b/defs.h
index d01ace7..6710f61 100755
--- a/defs.h
+++ b/defs.h
@@ -2432,7 +2432,7 @@ struct load_module {
 #define _PAGE_PSE       0x080   /* 2MB page */
 #define _PAGE_FILE      0x040   /* set:pagecache, unset:swap */
 #define _PAGE_GLOBAL    0x100   /* Global TLB entry */
-#define _PAGE_PROTNONE  0x080   /* If not present */
+#define _PAGE_PROTNONE  (machdep->machspec->page_protnone)
 #define _PAGE_NX        (1UL<<_PAGE_BIT_NX)
 
 #define SWP_TYPE(entry) (((entry) >> 1) & 0x3f)
@@ -4272,6 +4272,7 @@ struct machine_specific {
 	ulong *crash_nmi_rsp;
 	ulong vsyscall_page;
 	ulong thread_return;
+	ulong page_protnone;
 };
 
 #define KSYMS_START    (0x1)
diff --git a/x86_64.c b/x86_64.c
index eaf6373..ba73cf9 100755
--- a/x86_64.c
+++ b/x86_64.c
@@ -436,6 +436,13 @@ x86_64_init(int when)
 		x86_64_irq_eframe_link_init();
 		x86_64_framepointer_init();
 		x86_64_thread_return_init();
+
+		if (THIS_KERNEL_VERSION >= LINUX(2,6,28)) {
+			machdep->machspec->page_protnone = _PAGE_GLOBAL;
+		} else {
+			machdep->machspec->page_protnone = _PAGE_PSE;
+		}
+
 		break;
 
 	case POST_VM:
-- 
1.7.4.4

