All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@redhat.com>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Jakub Jelinek <jakub@redhat.com>,
	davidm@hpl.hp.com, suresh.b.siddha@intel.com,
	jun.nakajima@intel.com, Andrew Morton <akpm@osdl.org>,
	linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: serious performance regression due to NX patch
Date: Tue, 13 Jul 2004 03:58:06 +0000	[thread overview]
Message-ID: <Pine.LNX.4.58.0407122354280.13111@devserv.devel.redhat.com> (raw)
In-Reply-To: <Pine.LNX.4.58.0407121315170.1764@ppc970.osdl.org>


On Mon, 12 Jul 2004, Linus Torvalds wrote:

> > so ... this should be #ifndef ia64?
> 
> No. Make it a CONFIG_DEFAULT_NOEXEC and make the relevant architectures do
> a
> 
> 	define_bool DEFAULT_NOEXEC y
> 
> in their Kconfig files.
> 
> In general, we should _never_ use an architecture-define. They just
> always end up becoming more and more hairy, and less and less obvious
> what they are all about.
> 
> So instead, make a readable and explicit config define, and let each
> architecture just set it (or not) as they wish.

ok - patch below. ia64 can now define it - the default is that legacy
binaries have executability expectations.

	Ingo

--- linux/fs/binfmt_elf.c.orig
+++ linux/fs/binfmt_elf.c
@@ -627,8 +627,14 @@ static int load_elf_binary(struct linux_
 				executable_stack = EXSTACK_DISABLE_X;
 			break;
 		}
+#ifndef CONFIG_DEFAULT_NOEXEC
+	/*
+	 * Legacy binaries (unless the arch defaults to noexec) have an
+	 * expectation of executability - turn it on:
+	 */
 	if (i = elf_ex.e_phnum)
 		def_flags |= VM_EXEC | VM_MAYEXEC;
+#endif
 
 	/* Some simple consistency checks for the interpreter */
 	if (elf_interpreter) {

WARNING: multiple messages have this Message-ID (diff)
From: Ingo Molnar <mingo@redhat.com>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Jakub Jelinek <jakub@redhat.com>,
	davidm@hpl.hp.com, suresh.b.siddha@intel.com,
	jun.nakajima@intel.com, Andrew Morton <akpm@osdl.org>,
	linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: serious performance regression due to NX patch
Date: Mon, 12 Jul 2004 23:58:06 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.58.0407122354280.13111@devserv.devel.redhat.com> (raw)
In-Reply-To: <Pine.LNX.4.58.0407121315170.1764@ppc970.osdl.org>


On Mon, 12 Jul 2004, Linus Torvalds wrote:

> > so ... this should be #ifndef ia64?
> 
> No. Make it a CONFIG_DEFAULT_NOEXEC and make the relevant architectures do
> a
> 
> 	define_bool DEFAULT_NOEXEC y
> 
> in their Kconfig files.
> 
> In general, we should _never_ use an architecture-define. They just
> always end up becoming more and more hairy, and less and less obvious
> what they are all about.
> 
> So instead, make a readable and explicit config define, and let each
> architecture just set it (or not) as they wish.

ok - patch below. ia64 can now define it - the default is that legacy
binaries have executability expectations.

	Ingo

--- linux/fs/binfmt_elf.c.orig
+++ linux/fs/binfmt_elf.c
@@ -627,8 +627,14 @@ static int load_elf_binary(struct linux_
 				executable_stack = EXSTACK_DISABLE_X;
 			break;
 		}
+#ifndef CONFIG_DEFAULT_NOEXEC
+	/*
+	 * Legacy binaries (unless the arch defaults to noexec) have an
+	 * expectation of executability - turn it on:
+	 */
 	if (i == elf_ex.e_phnum)
 		def_flags |= VM_EXEC | VM_MAYEXEC;
+#endif
 
 	/* Some simple consistency checks for the interpreter */
 	if (elf_interpreter) {

  parent reply	other threads:[~2004-07-13  3:58 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 [this message]
2004-07-13  3:58               ` Ingo Molnar
2004-07-17  0:35     ` David Mosberger
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=Pine.LNX.4.58.0407122354280.13111@devserv.devel.redhat.com \
    --to=mingo@redhat.com \
    --cc=akpm@osdl.org \
    --cc=davidm@hpl.hp.com \
    --cc=jakub@redhat.com \
    --cc=jun.nakajima@intel.com \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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.