* "[PATCH
@ 2005-04-26 10:38 Vincent Hanquez
2005-04-26 11:29 ` [PATCH 4/6][XEN][x86] Use more usermode macro Vincent Hanquez
0 siblings, 1 reply; 2+ messages in thread
From: Vincent Hanquez @ 2005-04-26 10:38 UTC (permalink / raw)
To: "4/6][XEN]", "[x86]", akpm, ", <ian.pratt,
Andrew, Hanquez, linux-kernel, macro,
", more, Morton, Pratt, use, usermode, Vincent"
Cc: Ian
Hi,
The following patch use the user_mode macro where it's possible.
Please apply, or comments.
Signed-off-by: Vincent Hanquez <vincent.hanquez@cl.cam.ac.uk>
diff -Naur linux-2.6.12-rc3.1/arch/i386/kernel/process.c linux-2.6.12-rc3.2/arch/i386/kernel/process.c
--- linux-2.6.12-rc3.1/arch/i386/kernel/process.c 2005-04-22 12:10:22.000000000 +0100
+++ linux-2.6.12-rc3.2/arch/i386/kernel/process.c 2005-04-25 16:09:25.000000000 +0100
@@ -262,7 +262,7 @@
printk("EIP: %04x:[<%08lx>] CPU: %d\n",0xffff & regs->xcs,regs->eip, smp_processor_id());
print_symbol("EIP is at %s\n", regs->eip);
- if (regs->xcs & 3)
+ if (user_mode(regs))
printk(" ESP: %04x:%08lx",0xffff & regs->xss,regs->esp);
printk(" EFLAGS: %08lx %s (%s)\n",
regs->eflags, print_tainted(), system_utsname.release);
diff -Naur linux-2.6.12-rc3.1/arch/i386/kernel/signal.c linux-2.6.12-rc3.2/arch/i386/kernel/signal.c
--- linux-2.6.12-rc3.1/arch/i386/kernel/signal.c 2005-04-21 11:45:46.000000000 +0100
+++ linux-2.6.12-rc3.2/arch/i386/kernel/signal.c 2005-04-25 16:09:53.000000000 +0100
@@ -599,7 +599,7 @@
* kernel mode. Just return without doing anything
* if so.
*/
- if ((regs->xcs & 3) != 3)
+ if (!user_mode(regs))
return 1;
if (current->flags & PF_FREEZE) {
diff -Naur linux-2.6.12-rc3.1/arch/i386/kernel/traps.c linux-2.6.12-rc3.2/arch/i386/kernel/traps.c
--- linux-2.6.12-rc3.1/arch/i386/kernel/traps.c 2005-04-21 11:45:46.000000000 +0100
+++ linux-2.6.12-rc3.2/arch/i386/kernel/traps.c 2005-04-25 16:12:34.000000000 +0100
@@ -209,7 +209,7 @@
esp = (unsigned long) (®s->esp);
ss = __KERNEL_DS;
- if (regs->xcs & 3) {
+ if (user_mode(regs)) {
in_kernel = 0;
esp = regs->esp;
ss = regs->xss & 0xffff;
@@ -265,7 +265,7 @@
char c;
unsigned long eip;
- if (regs->xcs & 3)
+ if (user_mode(regs))
goto no_bug; /* Not in kernel */
eip = regs->eip;
@@ -353,7 +353,7 @@
static inline void die_if_kernel(const char * str, struct pt_regs * regs, long err)
{
- if (!(regs->eflags & VM_MASK) && !(3 & regs->xcs))
+ if (!user_mode_vm(regs))
die(str, regs, err);
}
@@ -366,7 +366,7 @@
goto trap_signal;
}
- if (!(regs->xcs & 3))
+ if (!user_mode(regs))
goto kernel_trap;
trap_signal: {
@@ -487,7 +487,7 @@
if (regs->eflags & VM_MASK)
goto gp_in_vm86;
- if (!(regs->xcs & 3))
+ if (!user_mode(regs))
goto gp_in_kernel;
current->thread.error_code = error_code;
@@ -713,7 +713,7 @@
* check for kernel mode by just checking the CPL
* of CS.
*/
- if ((regs->xcs & 3) == 0)
+ if (!user_mode(regs))
goto clear_TF_reenable;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH 4/6][XEN][x86] Use more usermode macro
2005-04-26 10:38 "[PATCH Vincent Hanquez
@ 2005-04-26 11:29 ` Vincent Hanquez
0 siblings, 0 replies; 2+ messages in thread
From: Vincent Hanquez @ 2005-04-26 11:29 UTC (permalink / raw)
To: linux-kernel; +Cc: ian.pratt, akpm
Hi,
The following patch use the user_mode macro where it's possible.
ignore my previous mail, really sorry for the noise.
Please apply, or comments.
Signed-off-by: Vincent Hanquez <vincent.hanquez@cl.cam.ac.uk>
diff -Naur linux-2.6.12-rc3.1/arch/i386/kernel/process.c linux-2.6.12-rc3.2/arch/i386/kernel/process.c
--- linux-2.6.12-rc3.1/arch/i386/kernel/process.c 2005-04-22 12:10:22.000000000 +0100
+++ linux-2.6.12-rc3.2/arch/i386/kernel/process.c 2005-04-25 16:09:25.000000000 +0100
@@ -262,7 +262,7 @@
printk("EIP: %04x:[<%08lx>] CPU: %d\n",0xffff & regs->xcs,regs->eip, smp_processor_id());
print_symbol("EIP is at %s\n", regs->eip);
- if (regs->xcs & 3)
+ if (user_mode(regs))
printk(" ESP: %04x:%08lx",0xffff & regs->xss,regs->esp);
printk(" EFLAGS: %08lx %s (%s)\n",
regs->eflags, print_tainted(), system_utsname.release);
diff -Naur linux-2.6.12-rc3.1/arch/i386/kernel/signal.c linux-2.6.12-rc3.2/arch/i386/kernel/signal.c
--- linux-2.6.12-rc3.1/arch/i386/kernel/signal.c 2005-04-21 11:45:46.000000000 +0100
+++ linux-2.6.12-rc3.2/arch/i386/kernel/signal.c 2005-04-25 16:09:53.000000000 +0100
@@ -599,7 +599,7 @@
* kernel mode. Just return without doing anything
* if so.
*/
- if ((regs->xcs & 3) != 3)
+ if (!user_mode(regs))
return 1;
if (current->flags & PF_FREEZE) {
diff -Naur linux-2.6.12-rc3.1/arch/i386/kernel/traps.c linux-2.6.12-rc3.2/arch/i386/kernel/traps.c
--- linux-2.6.12-rc3.1/arch/i386/kernel/traps.c 2005-04-21 11:45:46.000000000 +0100
+++ linux-2.6.12-rc3.2/arch/i386/kernel/traps.c 2005-04-25 16:12:34.000000000 +0100
@@ -209,7 +209,7 @@
esp = (unsigned long) (®s->esp);
ss = __KERNEL_DS;
- if (regs->xcs & 3) {
+ if (user_mode(regs)) {
in_kernel = 0;
esp = regs->esp;
ss = regs->xss & 0xffff;
@@ -265,7 +265,7 @@
char c;
unsigned long eip;
- if (regs->xcs & 3)
+ if (user_mode(regs))
goto no_bug; /* Not in kernel */
eip = regs->eip;
@@ -353,7 +353,7 @@
static inline void die_if_kernel(const char * str, struct pt_regs * regs, long err)
{
- if (!(regs->eflags & VM_MASK) && !(3 & regs->xcs))
+ if (!user_mode_vm(regs))
die(str, regs, err);
}
@@ -366,7 +366,7 @@
goto trap_signal;
}
- if (!(regs->xcs & 3))
+ if (!user_mode(regs))
goto kernel_trap;
trap_signal: {
@@ -487,7 +487,7 @@
if (regs->eflags & VM_MASK)
goto gp_in_vm86;
- if (!(regs->xcs & 3))
+ if (!user_mode(regs))
goto gp_in_kernel;
current->thread.error_code = error_code;
@@ -713,7 +713,7 @@
* check for kernel mode by just checking the CPL
* of CS.
*/
- if ((regs->xcs & 3) == 0)
+ if (!user_mode(regs))
goto clear_TF_reenable;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-04-26 11:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-26 10:38 "[PATCH Vincent Hanquez
2005-04-26 11:29 ` [PATCH 4/6][XEN][x86] Use more usermode macro Vincent Hanquez
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox