vserver 2.0 rc7
[linux-2.6.git] / arch / s390 / mm / fault.c
index d6bd3d4..75fde94 100644 (file)
@@ -62,8 +62,8 @@ void bust_spinlocks(int yes)
                oops_in_progress = 1;
        } else {
                int loglevel_save = console_loglevel;
-               oops_in_progress = 0;
                console_unblank();
+               oops_in_progress = 0;
                /*
                 * OK, the message is on the console.  Now we call printk()
                 * without oops_in_progress set so that printk will give klogd
@@ -87,6 +87,7 @@ static int __check_access_register(struct pt_regs *regs, int error_code)
        if (areg == 0)
                /* Access via access register 0 -> kernel address */
                return 0;
+       save_access_regs(current->thread.acrs);
        if (regs && areg < NUM_ACRS && current->thread.acrs[areg] <= 1)
                /*
                 * access register contains 0 -> kernel address,
@@ -115,11 +116,11 @@ static inline int check_user_space(struct pt_regs *regs, int error_code)
         *   3: Home Segment Table Descriptor
         */
        int descriptor = S390_lowcore.trans_exc_code & 3;
-       if (descriptor == 1) {
-               save_access_regs(current->thread.acrs);
+       if (unlikely(descriptor == 1))
                return __check_access_register(regs, error_code);
-       }
-       return descriptor >> 1;
+       if (descriptor == 2)
+               return current->thread.mm_segment.ar4;
+       return descriptor != 0;
 }
 
 /*
@@ -206,7 +207,7 @@ do_exception(struct pt_regs *regs, unsigned long error_code, int is_protection)
         * we are not in an interrupt and that there is a 
         * user context.
         */
-        if (user_address == 0 || in_interrupt() || !mm)
+        if (user_address == 0 || in_atomic() || !mm)
                 goto no_context;
 
        /*