[S390] pfault: delay register of pfault interrupt
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Wed, 5 Jan 2011 11:47:39 +0000 (12:47 +0100)
committerMartin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com>
Wed, 5 Jan 2011 11:47:26 +0000 (12:47 +0100)
Use an early init call to initialize pfault. That way it is possible to
use the register_external_interrupt() instead of the early variant.
No need to enable pfault any earlier since it has only effect if user
space processes are running.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/include/asm/system.h
arch/s390/kernel/traps.c
arch/s390/mm/fault.c

index 3ad16dbf622eebea0529250dac2b8487b9c48427..4ab2779fdb027a955b792dd5b57ddfce21670176 100644 (file)
@@ -101,11 +101,9 @@ extern void account_vtime(struct task_struct *, struct task_struct *);
 extern void account_tick_vtime(struct task_struct *);
 
 #ifdef CONFIG_PFAULT
-extern void pfault_irq_init(void);
 extern int pfault_init(void);
 extern void pfault_fini(void);
 #else /* CONFIG_PFAULT */
-#define pfault_irq_init()      do { } while (0)
 #define pfault_init()          ({-1;})
 #define pfault_fini()          do { } while (0)
 #endif /* CONFIG_PFAULT */
index bc4f32fcfa5791904ed8e20e048280f97e0535df..f6342ec084a41471ed17771f7169f0f524e8e3c6 100644 (file)
@@ -733,5 +733,4 @@ void __init trap_init(void)
         pgm_check_table[0x15] = &operand_exception;
         pgm_check_table[0x1C] = &space_switch_exception;
         pgm_check_table[0x1D] = &hfp_sqrt_exception;
-       pfault_irq_init();
 }
index 839b16df72b3d12d0cada745166fb54e7cc5f95a..dccb85d91538c92824664caf312f3f35721d3219 100644 (file)
@@ -481,8 +481,7 @@ int __handle_fault(unsigned long uaddr, unsigned long pgm_int_code, int write)
 /*
  * 'pfault' pseudo page faults routines.
  */
-static ext_int_info_t ext_int_pfault;
-static int pfault_disable = 0;
+static int pfault_disable;
 
 static int __init nopfault(char *str)
 {
@@ -594,24 +593,28 @@ static void pfault_interrupt(unsigned int ext_int_code,
        }
 }
 
-void __init pfault_irq_init(void)
+static int __init pfault_irq_init(void)
 {
-       if (!MACHINE_IS_VM)
-               return;
+       int rc;
 
+       if (!MACHINE_IS_VM)
+               return 0;
        /*
         * Try to get pfault pseudo page faults going.
         */
-       if (register_early_external_interrupt(0x2603, pfault_interrupt,
-                                             &ext_int_pfault) != 0)
-               panic("Couldn't request external interrupt 0x2603");
-
+       rc = register_external_interrupt(0x2603, pfault_interrupt);
+       if (rc) {
+               pfault_disable = 1;
+               return rc;
+       }
        if (pfault_init() == 0)
-               return;
+               return 0;
 
        /* Tough luck, no pfault. */
        pfault_disable = 1;
-       unregister_early_external_interrupt(0x2603, pfault_interrupt,
-                                           &ext_int_pfault);
+       unregister_external_interrupt(0x2603, pfault_interrupt);
+       return 0;
 }
+early_initcall(pfault_irq_init);
+
 #endif