From: Harvey Harrison <harvey.harrison@gmail.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: LKML <linux-kernel@vger.kernel.org>,
"H. Peter Anvin" <hpa@zytor.com>,
Thomas Gleixner <tglx@linutronix.de>
Subject: [PATCH] x86: More users of PF_ constants in fault_32|64.c
Date: Tue, 08 Jan 2008 16:48:54 -0800 [thread overview]
Message-ID: <1199839734.6424.19.camel@brick> (raw)
Should be the last of the error_code tests that could use
the PF_ defines. Makes X86_32|64 a little closer.
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
---
arch/x86/mm/fault_32.c | 7 ++++---
arch/x86/mm/fault_64.c | 2 +-
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/arch/x86/mm/fault_32.c b/arch/x86/mm/fault_32.c
index 50a9930..adf5fed 100644
--- a/arch/x86/mm/fault_32.c
+++ b/arch/x86/mm/fault_32.c
@@ -404,7 +404,8 @@ void __kprobes do_page_fault(struct pt_regs *regs, unsigned long error_code)
* protection error (error_code & 9) == 0.
*/
if (unlikely(address >= TASK_SIZE)) {
- if (!(error_code & 0x0000000d) && vmalloc_fault(address) >= 0)
+ if (!(error_code & (PF_RSVD|PF_USER|PF_PROT)) &&
+ vmalloc_fault(address) >= 0)
return;
if (notify_page_fault(regs))
return;
@@ -607,7 +608,7 @@ no_context:
__typeof__(pte_val(__pte(0))) page;
#ifdef CONFIG_X86_PAE
- if (error_code & 16) {
+ if (error_code & PF_INSTR) {
pte_t *pte = lookup_address(address);
if (pte && pte_present(*pte) && !pte_exec_kernel(*pte))
@@ -678,7 +679,7 @@ out_of_memory:
goto survive;
}
printk("VM: killing process %s\n", tsk->comm);
- if (error_code & 4)
+ if (error_code & PF_USER)
do_group_exit(SIGKILL);
goto no_context;
diff --git a/arch/x86/mm/fault_64.c b/arch/x86/mm/fault_64.c
index 018ab78..267a1d5 100644
--- a/arch/x86/mm/fault_64.c
+++ b/arch/x86/mm/fault_64.c
@@ -681,7 +681,7 @@ out_of_memory:
goto again;
}
printk("VM: killing process %s\n", tsk->comm);
- if (error_code & 4)
+ if (error_code & PF_USER)
do_group_exit(SIGKILL);
goto no_context;
--
1.5.4.rc2.1164.g6451
next reply other threads:[~2008-01-09 0:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-09 0:48 Harvey Harrison [this message]
2008-01-09 16:13 ` [PATCH] x86: More users of PF_ constants in fault_32|64.c Ingo Molnar
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=1199839734.6424.19.camel@brick \
--to=harvey.harrison@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
/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.