All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Mosberger <davidm@napali.hpl.hp.com>
To: Ingo Molnar <mingo@redhat.com>
Cc: davidm@hpl.hp.com, suresh.b.siddha@intel.com,
	jun.nakajima@intel.com, Andrew Morton <akpm@osdl.org>,
	Linus Torvalds <torvalds@osdl.org>,
	linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: serious performance regression due to NX patch
Date: Sat, 17 Jul 2004 00:35:01 +0000	[thread overview]
Message-ID: <16632.29749.550202.245115@napali.hpl.hp.com> (raw)
In-Reply-To: <Pine.LNX.4.58.0407110536130.2248@devserv.devel.redhat.com>

>>>>> On Sun, 11 Jul 2004 05:39:23 -0400 (EDT), Ingo Molnar <mingo@redhat.com> said:

  Ingo> On Sun, 11 Jul 2004, Ingo Molnar wrote:

  >> ok, agreed. I'll check that it still does the right thing on x86.

  Ingo> it doesnt seem to do the right thing for !PT_GNU_STACK applications on 
  Ingo> x86:

How about the patch below (on top of Linus' current bk tree)?  Only
platforms which had VM_DATA_DEFAULT_FLAGS changed (as a result of the
NX patch) will need to define LEGACY_VM_DATA_DEFAULT_FLAGS to the old
value.  AFAIK, that's x86 only, so the impact is very minimal and
should retain the existing behavior on all other platforms.

	--david

=== fs/binfmt_elf.c 1.80 vs edited ==--- 1.80/fs/binfmt_elf.c	2004-07-16 16:46:22 -07:00
+++ edited/fs/binfmt_elf.c	2004-07-16 17:25:26 -07:00
@@ -662,9 +662,9 @@
 		SET_PERSONALITY(elf_ex, ibcs2_interpreter);
 	}
 
-	/* Now that personality is set, we can use VM_DATA_DEFAULT_FLAGS.  */
+	/* Now that personality is set, we can use LEGACY_VM_DATA_DEFAULT_FLAGS.  */
 	if (no_gnu_stack)
-		def_flags |= VM_DATA_DEFAULT_FLAGS & (VM_EXEC | VM_MAYEXEC);
+		def_flags |= LEGACY_VM_DATA_DEFAULT_FLAGS & (VM_EXEC | VM_MAYEXEC);
 
 	/* OK, we are done with that, now set up the arg stuff,
 	   and then start this sucker up */
=== include/asm-i386/page.h 1.26 vs edited ==--- 1.26/include/asm-i386/page.h	2004-07-01 17:00:00 -07:00
+++ edited/include/asm-i386/page.h	2004-07-16 17:24:26 -07:00
@@ -142,6 +142,7 @@
 
 #define VM_DATA_DEFAULT_FLAGS	(VM_READ | VM_WRITE | \
 				 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
+#define LEGACY_VM_DATA_DEFAULT_FLAGS	(VM_DATA_DEFAULT_FLAGS | VM_EXEC)
 
 #endif /* __KERNEL__ */
 
=== include/linux/mm.h 1.138 vs edited ==--- 1.138/include/linux/mm.h	2004-07-06 22:19:25 -07:00
+++ edited/include/linux/mm.h	2004-07-16 17:23:41 -07:00
@@ -136,6 +136,10 @@
 #define VM_HUGETLB	0x00400000	/* Huge TLB Page VM */
 #define VM_NONLINEAR	0x00800000	/* Is non-linear (remap_file_pages) */
 
+#ifndef LEGACY_VM_DATA_DEFAULT_FLAGS
+#define LEGACY_VM_DATA_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS
+#endif
+
 #ifndef VM_STACK_DEFAULT_FLAGS		/* arch can override this */
 #define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS
 #endif

WARNING: multiple messages have this Message-ID (diff)
From: David Mosberger <davidm@napali.hpl.hp.com>
To: Ingo Molnar <mingo@redhat.com>
Cc: davidm@hpl.hp.com, suresh.b.siddha@intel.com,
	jun.nakajima@intel.com, Andrew Morton <akpm@osdl.org>,
	Linus Torvalds <torvalds@osdl.org>,
	linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: serious performance regression due to NX patch
Date: Fri, 16 Jul 2004 17:35:01 -0700	[thread overview]
Message-ID: <16632.29749.550202.245115@napali.hpl.hp.com> (raw)
In-Reply-To: <Pine.LNX.4.58.0407110536130.2248@devserv.devel.redhat.com>

>>>>> On Sun, 11 Jul 2004 05:39:23 -0400 (EDT), Ingo Molnar <mingo@redhat.com> said:

  Ingo> On Sun, 11 Jul 2004, Ingo Molnar wrote:

  >> ok, agreed. I'll check that it still does the right thing on x86.

  Ingo> it doesnt seem to do the right thing for !PT_GNU_STACK applications on 
  Ingo> x86:

How about the patch below (on top of Linus' current bk tree)?  Only
platforms which had VM_DATA_DEFAULT_FLAGS changed (as a result of the
NX patch) will need to define LEGACY_VM_DATA_DEFAULT_FLAGS to the old
value.  AFAIK, that's x86 only, so the impact is very minimal and
should retain the existing behavior on all other platforms.

	--david

===== fs/binfmt_elf.c 1.80 vs edited =====
--- 1.80/fs/binfmt_elf.c	2004-07-16 16:46:22 -07:00
+++ edited/fs/binfmt_elf.c	2004-07-16 17:25:26 -07:00
@@ -662,9 +662,9 @@
 		SET_PERSONALITY(elf_ex, ibcs2_interpreter);
 	}
 
-	/* Now that personality is set, we can use VM_DATA_DEFAULT_FLAGS.  */
+	/* Now that personality is set, we can use LEGACY_VM_DATA_DEFAULT_FLAGS.  */
 	if (no_gnu_stack)
-		def_flags |= VM_DATA_DEFAULT_FLAGS & (VM_EXEC | VM_MAYEXEC);
+		def_flags |= LEGACY_VM_DATA_DEFAULT_FLAGS & (VM_EXEC | VM_MAYEXEC);
 
 	/* OK, we are done with that, now set up the arg stuff,
 	   and then start this sucker up */
===== include/asm-i386/page.h 1.26 vs edited =====
--- 1.26/include/asm-i386/page.h	2004-07-01 17:00:00 -07:00
+++ edited/include/asm-i386/page.h	2004-07-16 17:24:26 -07:00
@@ -142,6 +142,7 @@
 
 #define VM_DATA_DEFAULT_FLAGS	(VM_READ | VM_WRITE | \
 				 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
+#define LEGACY_VM_DATA_DEFAULT_FLAGS	(VM_DATA_DEFAULT_FLAGS | VM_EXEC)
 
 #endif /* __KERNEL__ */
 
===== include/linux/mm.h 1.138 vs edited =====
--- 1.138/include/linux/mm.h	2004-07-06 22:19:25 -07:00
+++ edited/include/linux/mm.h	2004-07-16 17:23:41 -07:00
@@ -136,6 +136,10 @@
 #define VM_HUGETLB	0x00400000	/* Huge TLB Page VM */
 #define VM_NONLINEAR	0x00800000	/* Is non-linear (remap_file_pages) */
 
+#ifndef LEGACY_VM_DATA_DEFAULT_FLAGS
+#define LEGACY_VM_DATA_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS
+#endif
+
 #ifndef VM_STACK_DEFAULT_FLAGS		/* arch can override this */
 #define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS
 #endif

  parent reply	other threads:[~2004-07-17  0:35 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-10  5:28 serious performance regression due to NX patch David Mosberger
2004-07-10  5:28 ` David Mosberger
2004-07-11  8:38 ` Ingo Molnar
2004-07-11  8:38   ` Ingo Molnar
2004-07-11  9:39   ` Ingo Molnar
2004-07-11  9:39     ` Ingo Molnar
2004-07-11  9:52     ` Ingo Molnar
2004-07-11  9:52       ` Ingo Molnar
2004-07-11 10:02       ` Andrew Morton
2004-07-11 10:02         ` Andrew Morton
2004-07-11 12:19         ` Matthew Wilcox
2004-07-11 12:19           ` Matthew Wilcox
2004-07-11 10:22       ` Christoph Hellwig
2004-07-11 10:22         ` Christoph Hellwig
2004-07-11 12:38       ` Jakub Jelinek
2004-07-11 12:38         ` Jakub Jelinek
2004-07-12 18:08         ` Ingo Molnar
2004-07-12 18:08           ` Ingo Molnar
2004-07-12 18:24           ` Christoph Hellwig
2004-07-12 18:24             ` Christoph Hellwig
2004-07-12 18:29             ` Ingo Molnar
2004-07-12 18:29               ` Ingo Molnar
2004-07-12 19:10               ` David Mosberger
2004-07-12 19:10                 ` David Mosberger
2004-07-12 19:54                 ` Ingo Molnar
2004-07-12 19:54                   ` Ingo Molnar
2004-07-12 20:08                   ` David Mosberger
2004-07-12 20:08                     ` David Mosberger
2004-07-12 20:17           ` Linus Torvalds
2004-07-12 20:17             ` Linus Torvalds
2004-07-12 20:21             ` David Mosberger
2004-07-12 20:21               ` David Mosberger
2004-07-12 20:24             ` David Mosberger
2004-07-12 20:24               ` David Mosberger
2004-07-13  4:23               ` Ingo Molnar
2004-07-13  4:23                 ` Ingo Molnar
2004-07-13  5:23                 ` David Mosberger
2004-07-13  5:23                   ` David Mosberger
2004-07-13 16:05                 ` Mark Haverkamp
2004-07-13 16:05                   ` Mark Haverkamp
2004-07-13 16:49                   ` Daniel McNeil
2004-07-13 16:49                     ` Daniel McNeil
2004-07-14 18:36                     ` [PATCH] mmap PROT_NONE fix (was Re: serious performance regression Daniel McNeil
2004-07-14 18:36                       ` [PATCH] mmap PROT_NONE fix (was Re: serious performance regression due to NX patch) Daniel McNeil
2004-07-17  0:06                   ` serious performance regression due to NX patch David Mosberger
2004-07-17  0:06                     ` David Mosberger
2004-07-17  1:39                     ` Linus Torvalds
2004-07-17  1:39                       ` Linus Torvalds
2004-07-17  4:37                       ` David Mosberger
2004-07-17  4:37                         ` David Mosberger
2004-07-13  3:58             ` Ingo Molnar
2004-07-13  3:58               ` Ingo Molnar
2004-07-17  0:35     ` David Mosberger [this message]
2004-07-17  0:35       ` David Mosberger
     [not found] <2giKE-67F-1@gated-at.bofh.it>
     [not found] ` <2gIc8-6pd-29@gated-at.bofh.it>
     [not found]   ` <2gJ8a-72b-11@gated-at.bofh.it>
     [not found]     ` <2gJhY-776-21@gated-at.bofh.it>
2004-07-11 10:09       ` Andi Kleen
2004-07-11 11:56         ` Ingo Molnar
2004-07-11 12:43           ` Andi Kleen
     [not found]       ` <2gJrv-7kp-5@gated-at.bofh.it>
     [not found]         ` <2gLD2-qn-3@gated-at.bofh.it>
2004-07-11 13:38           ` Andi Kleen
2004-07-11 14:04             ` Matthew Wilcox

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=16632.29749.550202.245115@napali.hpl.hp.com \
    --to=davidm@napali.hpl.hp.com \
    --cc=akpm@osdl.org \
    --cc=davidm@hpl.hp.com \
    --cc=jun.nakajima@intel.com \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=suresh.b.siddha@intel.com \
    --cc=torvalds@osdl.org \
    /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.