From: Jerone Young <jyoung5@us.ibm.com>
To: xen-devel <xen-devel@lists.xensource.com>,
"Nakajima, Jun" <jun.nakajima@intel.com>
Subject: [PATCH] Remove NX bit from x86-64 pages
Date: Fri, 08 Jul 2005 00:17:05 -0500 [thread overview]
Message-ID: <1120799826.2578.16.camel@thinkpad> (raw)
[-- Attachment #1: Type: text/plain, Size: 1139 bytes --]
So after a sometime of looking at the code to solve bugzilla #75
http://bugzilla.xensource.com/cgi-bin/bugzilla/show_bug.cgi?id=75
I started to look for strange avenues of why this problem was happening.
Well I found it...on IBM hardware with Intel EM64T cpus the ability for
the CPU to understand the NX bit is disabled by default. I had no idea
this was even possible. Now on AMD 64bit CPUs the CPU always understands
the bit and the OS tells it to enforce it or not. Given this I'm betting
that not just IBM hardware but hardware from other vendors may also ship
with it turned off.
Our problem is that we assume that all x86-64 CPUs will understand this
bit. We also do not have support fully implemented to take advantage of
this bit. A patch from Scott Parish showed this by accident (his patch
removed the NX bit from the pages)...which is how David Barrera the
ability to boot it. So until full nx support is to go in we should
remove it from from the pages for now too avoid strange issues as
bugzilla #75....otherwise they will flood in.
The patch attached removes the bit:
Signed-off-by: Jerone Young <jyoung5@us.ibm.com>
[-- Attachment #2: rm_nx_patch.diff --]
[-- Type: text/x-patch, Size: 2011 bytes --]
--- linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h.old 2005-07-08 00:04:22.000000000 -0500
+++ linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h 2005-07-08 00:05:23.000000000 -0500
@@ -191,21 +191,21 @@ static inline pte_t ptep_get_and_clear(p
#define _PAGE_CHG_MASK (PTE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY)
#define PAGE_NONE __pgprot(_PAGE_PROTNONE | _PAGE_ACCESSED)
-#define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED | _PAGE_NX)
+#define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED)
#define PAGE_SHARED_EXEC __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED)
-#define PAGE_COPY_NOEXEC __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED | _PAGE_NX)
+#define PAGE_COPY_NOEXEC __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED)
#define PAGE_COPY PAGE_COPY_NOEXEC
#define PAGE_COPY_EXEC __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED)
-#define PAGE_READONLY __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED | _PAGE_NX)
+#define PAGE_READONLY __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED)
#define PAGE_READONLY_EXEC __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED)
#define __PAGE_KERNEL \
- (_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_NX | _PAGE_USER )
+ (_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_USER )
#define __PAGE_KERNEL_EXEC \
(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_USER )
#define __PAGE_KERNEL_NOCACHE \
- (_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_PCD | _PAGE_ACCESSED | _PAGE_NX | _PAGE_USER )
+ (_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_PCD | _PAGE_ACCESSED | _PAGE_USER )
#define __PAGE_KERNEL_RO \
- (_PAGE_PRESENT | _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_NX | _PAGE_USER )
+ (_PAGE_PRESENT | _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_USER )
#define __PAGE_KERNEL_VSYSCALL \
(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED | _PAGE_USER )
#define __PAGE_KERNEL_VSYSCALL_NOCACHE \
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
reply other threads:[~2005-07-08 5:17 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1120799826.2578.16.camel@thinkpad \
--to=jyoung5@us.ibm.com \
--cc=jun.nakajima@intel.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.