|
@@ -31,6 +31,7 @@
|
|
#include <asm/uaccess.h>
|
|
#include <asm/uaccess.h>
|
|
#include <asm/pgtable.h>
|
|
#include <asm/pgtable.h>
|
|
#include <asm/kdebug.h>
|
|
#include <asm/kdebug.h>
|
|
|
|
+#include <asm/s390_ext.h>
|
|
|
|
|
|
#ifndef CONFIG_64BIT
|
|
#ifndef CONFIG_64BIT
|
|
#define __FAIL_ADDR_MASK 0x7ffff000
|
|
#define __FAIL_ADDR_MASK 0x7ffff000
|
|
@@ -394,6 +395,7 @@ void do_dat_exception(struct pt_regs *regs, unsigned long error_code)
|
|
/*
|
|
/*
|
|
* 'pfault' pseudo page faults routines.
|
|
* 'pfault' pseudo page faults routines.
|
|
*/
|
|
*/
|
|
|
|
+static ext_int_info_t ext_int_pfault;
|
|
static int pfault_disable = 0;
|
|
static int pfault_disable = 0;
|
|
|
|
|
|
static int __init nopfault(char *str)
|
|
static int __init nopfault(char *str)
|
|
@@ -422,7 +424,7 @@ int pfault_init(void)
|
|
__PF_RES_FIELD };
|
|
__PF_RES_FIELD };
|
|
int rc;
|
|
int rc;
|
|
|
|
|
|
- if (pfault_disable)
|
|
|
|
|
|
+ if (!MACHINE_IS_VM || pfault_disable)
|
|
return -1;
|
|
return -1;
|
|
asm volatile(
|
|
asm volatile(
|
|
" diag %1,%0,0x258\n"
|
|
" diag %1,%0,0x258\n"
|
|
@@ -440,7 +442,7 @@ void pfault_fini(void)
|
|
pfault_refbk_t refbk =
|
|
pfault_refbk_t refbk =
|
|
{ 0x258, 1, 5, 2, 0ULL, 0ULL, 0ULL, 0ULL };
|
|
{ 0x258, 1, 5, 2, 0ULL, 0ULL, 0ULL, 0ULL };
|
|
|
|
|
|
- if (pfault_disable)
|
|
|
|
|
|
+ if (!MACHINE_IS_VM || pfault_disable)
|
|
return;
|
|
return;
|
|
__ctl_clear_bit(0,9);
|
|
__ctl_clear_bit(0,9);
|
|
asm volatile(
|
|
asm volatile(
|
|
@@ -500,5 +502,25 @@ pfault_interrupt(__u16 error_code)
|
|
set_tsk_need_resched(tsk);
|
|
set_tsk_need_resched(tsk);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-#endif
|
|
|
|
|
|
|
|
|
|
+void __init pfault_irq_init(void)
|
|
|
|
+{
|
|
|
|
+ if (!MACHINE_IS_VM)
|
|
|
|
+ return;
|
|
|
|
+
|
|
|
|
+ /*
|
|
|
|
+ * 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");
|
|
|
|
+
|
|
|
|
+ if (pfault_init() == 0)
|
|
|
|
+ return;
|
|
|
|
+
|
|
|
|
+ /* Tough luck, no pfault. */
|
|
|
|
+ pfault_disable = 1;
|
|
|
|
+ unregister_early_external_interrupt(0x2603, pfault_interrupt,
|
|
|
|
+ &ext_int_pfault);
|
|
|
|
+}
|
|
|
|
+#endif
|