enable crash on other architectures
This commit is contained in:
parent
17cfc21f1f
commit
0a346ea311
@ -149,3 +149,5 @@ CONFIG_SMC911X=m
|
|||||||
# CONFIG_SCSI_IPS is not set
|
# CONFIG_SCSI_IPS is not set
|
||||||
# CONFIG_SCSI_CXGB3_ISCSI is not set
|
# CONFIG_SCSI_CXGB3_ISCSI is not set
|
||||||
# CONFIG_SCSI_CXGB4_ISCSI is not set
|
# CONFIG_SCSI_CXGB4_ISCSI is not set
|
||||||
|
|
||||||
|
CONFIG_CRASH=m
|
||||||
|
@ -379,3 +379,5 @@ CONFIG_BACKLIGHT_PWM=m
|
|||||||
CONFIG_CPU_IDLE_MULTIPLE_DRIVERS=n
|
CONFIG_CPU_IDLE_MULTIPLE_DRIVERS=n
|
||||||
|
|
||||||
CONFIG_XZ_DEC_POWERPC=y
|
CONFIG_XZ_DEC_POWERPC=y
|
||||||
|
|
||||||
|
CONFIG_CRASH=m
|
||||||
|
@ -277,3 +277,5 @@ CONFIG_SCM_BLOCK_CLUSTER_WRITE=y
|
|||||||
# CONFIG_IEEE802154_DRIVERS is not set
|
# CONFIG_IEEE802154_DRIVERS is not set
|
||||||
|
|
||||||
# CONFIG_FMC is not set
|
# CONFIG_FMC is not set
|
||||||
|
|
||||||
|
CONFIG_CRASH=m
|
||||||
|
@ -1,24 +1,57 @@
|
|||||||
From f72d640713d01b3b704c6e84ab49b62f19fc9c22 Mon Sep 17 00:00:00 2001
|
From 9fcd8dd1ccc20ea8d466d48e887e92b832e22d56 Mon Sep 17 00:00:00 2001
|
||||||
From: Kyle McMartin <kyle@phobos.i.jkkm.org>
|
From: Kyle McMartin <kyle@dreadnought.bos.jkkm.org>
|
||||||
Date: Tue, 30 Mar 2010 00:16:25 -0400
|
Date: Tue, 5 Nov 2013 13:16:00 -0500
|
||||||
Subject: [PATCH] dev-crash-driver.patch
|
Subject: [PATCH] crash-driver
|
||||||
|
|
||||||
---
|
---
|
||||||
arch/ia64/include/asm/crash.h | 90 +++++++++++++++++++++++++++++
|
arch/arm/include/asm/crash.h | 6 ++
|
||||||
|
arch/arm64/include/asm/crash.h | 6 ++
|
||||||
|
arch/ia64/include/asm/crash.h | 90 +++++++++++++++++++++++++++
|
||||||
arch/ia64/kernel/ia64_ksyms.c | 3 +
|
arch/ia64/kernel/ia64_ksyms.c | 3 +
|
||||||
arch/x86/include/asm/crash.h | 75 ++++++++++++++++++++++++
|
arch/powerpc/include/asm/crash.h | 6 ++
|
||||||
arch/x86/mm/ioremap.c | 2 +
|
arch/s390/include/asm/crash.h | 60 ++++++++++++++++++
|
||||||
|
arch/x86/include/asm/crash.h | 6 ++
|
||||||
drivers/char/Kconfig | 3 +
|
drivers/char/Kconfig | 3 +
|
||||||
drivers/char/Makefile | 2 +
|
drivers/char/Makefile | 2 +
|
||||||
drivers/char/crash.c | 128 +++++++++++++++++++++++++++++++++++++++++
|
drivers/char/crash.c | 128 +++++++++++++++++++++++++++++++++++++++
|
||||||
7 files changed, 303 insertions(+), 0 deletions(-)
|
include/asm-generic/crash.h | 72 ++++++++++++++++++++++
|
||||||
|
11 files changed, 382 insertions(+)
|
||||||
|
create mode 100644 arch/arm/include/asm/crash.h
|
||||||
|
create mode 100644 arch/arm64/include/asm/crash.h
|
||||||
create mode 100644 arch/ia64/include/asm/crash.h
|
create mode 100644 arch/ia64/include/asm/crash.h
|
||||||
|
create mode 100644 arch/powerpc/include/asm/crash.h
|
||||||
|
create mode 100644 arch/s390/include/asm/crash.h
|
||||||
create mode 100644 arch/x86/include/asm/crash.h
|
create mode 100644 arch/x86/include/asm/crash.h
|
||||||
create mode 100644 drivers/char/crash.c
|
create mode 100644 drivers/char/crash.c
|
||||||
|
create mode 100644 include/asm-generic/crash.h
|
||||||
|
|
||||||
|
diff --git a/arch/arm/include/asm/crash.h b/arch/arm/include/asm/crash.h
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..1d2e537
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/arch/arm/include/asm/crash.h
|
||||||
|
@@ -0,0 +1,6 @@
|
||||||
|
+#ifndef _ARM_CRASH_H
|
||||||
|
+#define _ARM_CRASH_H
|
||||||
|
+
|
||||||
|
+#include <asm-generic/crash.h>
|
||||||
|
+
|
||||||
|
+#endif /* _ARM_CRASH_H */
|
||||||
|
diff --git a/arch/arm64/include/asm/crash.h b/arch/arm64/include/asm/crash.h
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..a7fcc28
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/arch/arm64/include/asm/crash.h
|
||||||
|
@@ -0,0 +1,6 @@
|
||||||
|
+#ifndef _ARM64_CRASH_H
|
||||||
|
+#define _ARM64_CRASH_H
|
||||||
|
+
|
||||||
|
+#include <asm-generic/crash.h>
|
||||||
|
+
|
||||||
|
+#endif /* _ARM64_CRASH_H */
|
||||||
diff --git a/arch/ia64/include/asm/crash.h b/arch/ia64/include/asm/crash.h
|
diff --git a/arch/ia64/include/asm/crash.h b/arch/ia64/include/asm/crash.h
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000..541af84
|
index 0000000..28bd955
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/arch/ia64/include/asm/crash.h
|
+++ b/arch/ia64/include/asm/crash.h
|
||||||
@@ -0,0 +1,90 @@
|
@@ -0,0 +1,90 @@
|
||||||
@ -113,7 +146,7 @@ index 0000000..541af84
|
|||||||
+
|
+
|
||||||
+#endif /* _ASM_IA64_CRASH_H */
|
+#endif /* _ASM_IA64_CRASH_H */
|
||||||
diff --git a/arch/ia64/kernel/ia64_ksyms.c b/arch/ia64/kernel/ia64_ksyms.c
|
diff --git a/arch/ia64/kernel/ia64_ksyms.c b/arch/ia64/kernel/ia64_ksyms.c
|
||||||
index 7f4a0ed..552fe24 100644
|
index 5b7791d..aee4b87 100644
|
||||||
--- a/arch/ia64/kernel/ia64_ksyms.c
|
--- a/arch/ia64/kernel/ia64_ksyms.c
|
||||||
+++ b/arch/ia64/kernel/ia64_ksyms.c
|
+++ b/arch/ia64/kernel/ia64_ksyms.c
|
||||||
@@ -84,6 +84,9 @@ EXPORT_SYMBOL(ia64_save_scratch_fpregs);
|
@@ -84,6 +84,9 @@ EXPORT_SYMBOL(ia64_save_scratch_fpregs);
|
||||||
@ -126,50 +159,47 @@ index 7f4a0ed..552fe24 100644
|
|||||||
#if defined(CONFIG_IA64_ESI) || defined(CONFIG_IA64_ESI_MODULE)
|
#if defined(CONFIG_IA64_ESI) || defined(CONFIG_IA64_ESI_MODULE)
|
||||||
extern void esi_call_phys (void);
|
extern void esi_call_phys (void);
|
||||||
EXPORT_SYMBOL_GPL(esi_call_phys);
|
EXPORT_SYMBOL_GPL(esi_call_phys);
|
||||||
diff --git a/arch/x86/include/asm/crash.h b/arch/x86/include/asm/crash.h
|
diff --git a/arch/powerpc/include/asm/crash.h b/arch/powerpc/include/asm/crash.h
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000..dfcc006
|
index 0000000..daa8c4d
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/arch/x86/include/asm/crash.h
|
+++ b/arch/powerpc/include/asm/crash.h
|
||||||
@@ -0,0 +1,73 @@
|
@@ -0,0 +1,6 @@
|
||||||
+#ifndef _ASM_I386_CRASH_H
|
+#ifndef _PPC64_CRASH_H
|
||||||
+#define _ASM_I386_CRASH_H
|
+#define _PPC64_CRASH_H
|
||||||
+
|
+
|
||||||
+/*
|
+#include <asm-generic/crash.h>
|
||||||
+ * linux/include/asm-i386/crash.h
|
+
|
||||||
+ *
|
+#endif /* _PPC64_CRASH_H */
|
||||||
+ * Copyright (c) 2004 Red Hat, Inc. All rights reserved.
|
diff --git a/arch/s390/include/asm/crash.h b/arch/s390/include/asm/crash.h
|
||||||
+ *
|
new file mode 100644
|
||||||
+ * This program is free software; you can redistribute it and/or modify
|
index 0000000..552be5e
|
||||||
+ * it under the terms of the GNU General Public License as published by
|
--- /dev/null
|
||||||
+ * the Free Software Foundation; either version 2, or (at your option)
|
+++ b/arch/s390/include/asm/crash.h
|
||||||
+ * any later version.
|
@@ -0,0 +1,60 @@
|
||||||
+ *
|
+#ifndef _S390_CRASH_H
|
||||||
+ * This program is distributed in the hope that it will be useful,
|
+#define _S390_CRASH_H
|
||||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
+ * GNU General Public License for more details.
|
|
||||||
+ *
|
|
||||||
+ * You should have received a copy of the GNU General Public License
|
|
||||||
+ * along with this program; if not, write to the Free Software
|
|
||||||
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
||||||
+ *
|
|
||||||
+ */
|
|
||||||
+
|
+
|
||||||
+#ifdef __KERNEL__
|
+#ifdef __KERNEL__
|
||||||
+
|
+
|
||||||
+#include <linux/mm.h>
|
+#include <linux/mm.h>
|
||||||
+#include <linux/highmem.h>
|
+#include <linux/highmem.h>
|
||||||
+#include <asm/mmzone.h>
|
|
||||||
+
|
+
|
||||||
+static inline void *
|
+/*
|
||||||
+map_virtual(u64 offset, struct page **pp)
|
+ * For swapped prefix pages get bounce buffer using xlate_dev_mem_ptr()
|
||||||
|
+ */
|
||||||
|
+static inline void *map_virtual(u64 offset, struct page **pp)
|
||||||
+{
|
+{
|
||||||
+ struct page *page;
|
+ struct page *page;
|
||||||
+ unsigned long pfn;
|
+ unsigned long pfn;
|
||||||
+ void *vaddr;
|
+ void *vaddr;
|
||||||
+
|
+
|
||||||
+ pfn = (unsigned long)(offset >> PAGE_SHIFT);
|
+ vaddr = xlate_dev_mem_ptr(offset);
|
||||||
|
+ pfn = ((unsigned long) vaddr) >> PAGE_SHIFT;
|
||||||
|
+ if ((unsigned long) vaddr != offset)
|
||||||
|
+ page = pfn_to_page(pfn);
|
||||||
|
+ else
|
||||||
|
+ page = NULL;
|
||||||
+
|
+
|
||||||
+ if (!page_is_ram(pfn)) {
|
+ if (!page_is_ram(pfn)) {
|
||||||
+ printk(KERN_INFO
|
+ printk(KERN_INFO
|
||||||
@ -183,30 +213,44 @@ index 0000000..dfcc006
|
|||||||
+ return NULL;
|
+ return NULL;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ page = pfn_to_page(pfn);
|
|
||||||
+
|
|
||||||
+ vaddr = kmap(page);
|
|
||||||
+ if (!vaddr) {
|
|
||||||
+ printk(KERN_INFO
|
|
||||||
+ "crash memory driver: pfn: %lx kmap(page: %lx) failed\n",
|
|
||||||
+ pfn, (unsigned long)page);
|
|
||||||
+ return NULL;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ *pp = page;
|
+ *pp = page;
|
||||||
+ return (vaddr + (offset & (PAGE_SIZE-1)));
|
+ return vaddr;
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
|
+/*
|
||||||
|
+ * Free bounce buffer if necessary
|
||||||
|
+ */
|
||||||
+static inline void unmap_virtual(struct page *page)
|
+static inline void unmap_virtual(struct page *page)
|
||||||
+{
|
+{
|
||||||
+ kunmap(page);
|
+ void *vaddr;
|
||||||
|
+
|
||||||
|
+ if (page) {
|
||||||
|
+ /*
|
||||||
|
+ * Because for bounce buffers vaddr will never be 0
|
||||||
|
+ * unxlate_dev_mem_ptr() will always free the bounce buffer.
|
||||||
|
+ */
|
||||||
|
+ vaddr = (void *)(page_to_pfn(page) << PAGE_SHIFT);
|
||||||
|
+ unxlate_dev_mem_ptr(0, vaddr);
|
||||||
|
+ }
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+#endif /* __KERNEL__ */
|
+#endif /* __KERNEL__ */
|
||||||
+
|
+
|
||||||
+#endif /* _ASM_I386_CRASH_H */
|
+#endif /* _S390_CRASH_H */
|
||||||
|
diff --git a/arch/x86/include/asm/crash.h b/arch/x86/include/asm/crash.h
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..27a4156
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/arch/x86/include/asm/crash.h
|
||||||
|
@@ -0,0 +1,6 @@
|
||||||
|
+#ifndef _X86_CRASH_H
|
||||||
|
+#define _X86_CRASH_H
|
||||||
|
+
|
||||||
|
+#include <asm-generic/crash.h>
|
||||||
|
+
|
||||||
|
+#endif /* _X86_CRASH_H */
|
||||||
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
|
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
|
||||||
index 423fd56..e04a561 100644
|
index 1421997..72a8b74 100644
|
||||||
--- a/drivers/char/Kconfig
|
--- a/drivers/char/Kconfig
|
||||||
+++ b/drivers/char/Kconfig
|
+++ b/drivers/char/Kconfig
|
||||||
@@ -4,6 +4,9 @@
|
@@ -4,6 +4,9 @@
|
||||||
@ -220,10 +264,10 @@ index 423fd56..e04a561 100644
|
|||||||
|
|
||||||
config DEVKMEM
|
config DEVKMEM
|
||||||
diff --git a/drivers/char/Makefile b/drivers/char/Makefile
|
diff --git a/drivers/char/Makefile b/drivers/char/Makefile
|
||||||
index 32762ba..3d5d525 100644
|
index 7ff1d0d..3ed67af 100644
|
||||||
--- a/drivers/char/Makefile
|
--- a/drivers/char/Makefile
|
||||||
+++ b/drivers/char/Makefile
|
+++ b/drivers/char/Makefile
|
||||||
@@ -65,3 +65,5 @@ obj-$(CONFIG_JS_RTC) += js-rtc.o
|
@@ -62,3 +62,5 @@ obj-$(CONFIG_JS_RTC) += js-rtc.o
|
||||||
js-rtc-y = rtc.o
|
js-rtc-y = rtc.o
|
||||||
|
|
||||||
obj-$(CONFIG_TILE_SROM) += tile-srom.o
|
obj-$(CONFIG_TILE_SROM) += tile-srom.o
|
||||||
@ -231,7 +275,7 @@ index 32762ba..3d5d525 100644
|
|||||||
+obj-$(CONFIG_CRASH) += crash.o
|
+obj-$(CONFIG_CRASH) += crash.o
|
||||||
diff --git a/drivers/char/crash.c b/drivers/char/crash.c
|
diff --git a/drivers/char/crash.c b/drivers/char/crash.c
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000..e5437de
|
index 0000000..a142bb3
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/drivers/char/crash.c
|
+++ b/drivers/char/crash.c
|
||||||
@@ -0,0 +1,128 @@
|
@@ -0,0 +1,128 @@
|
||||||
@ -363,6 +407,84 @@ index 0000000..e5437de
|
|||||||
+module_exit(crash_cleanup_module);
|
+module_exit(crash_cleanup_module);
|
||||||
+
|
+
|
||||||
+MODULE_LICENSE("GPL");
|
+MODULE_LICENSE("GPL");
|
||||||
|
diff --git a/include/asm-generic/crash.h b/include/asm-generic/crash.h
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..8a0a69a
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/include/asm-generic/crash.h
|
||||||
|
@@ -0,0 +1,72 @@
|
||||||
|
+#ifndef __CRASH_H__
|
||||||
|
+#define __CRASH_H__
|
||||||
|
+
|
||||||
|
+/*
|
||||||
|
+ * include/linux/crash.h
|
||||||
|
+ *
|
||||||
|
+ * Copyright (c) 2013 Red Hat, Inc. All rights reserved.
|
||||||
|
+ *
|
||||||
|
+ * This program is free software; you can redistribute it and/or modify
|
||||||
|
+ * it under the terms of the GNU General Public License as published by
|
||||||
|
+ * the Free Software Foundation; either version 2, or (at your option)
|
||||||
|
+ * any later version.
|
||||||
|
+ *
|
||||||
|
+ * This program is distributed in the hope that it will be useful,
|
||||||
|
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
+ * GNU General Public License for more details.
|
||||||
|
+ *
|
||||||
|
+ * You should have received a copy of the GNU General Public License
|
||||||
|
+ * along with this program; if not, write to the Free Software
|
||||||
|
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
+ *
|
||||||
|
+ */
|
||||||
|
+
|
||||||
|
+#ifdef __KERNEL__
|
||||||
|
+
|
||||||
|
+#include <linux/mm.h>
|
||||||
|
+#include <linux/highmem.h>
|
||||||
|
+
|
||||||
|
+static inline void *
|
||||||
|
+map_virtual(u64 offset, struct page **pp)
|
||||||
|
+{
|
||||||
|
+ struct page *page;
|
||||||
|
+ unsigned long pfn;
|
||||||
|
+ void *vaddr;
|
||||||
|
+
|
||||||
|
+ pfn = (unsigned long)(offset >> PAGE_SHIFT);
|
||||||
|
+
|
||||||
|
+ if (!page_is_ram(pfn)) {
|
||||||
|
+ printk(KERN_INFO
|
||||||
|
+ "crash memory driver: !page_is_ram(pfn: %lx)\n", pfn);
|
||||||
|
+ return NULL;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (!pfn_valid(pfn)) {
|
||||||
|
+ printk(KERN_INFO
|
||||||
|
+ "crash memory driver: invalid pfn: %lx )\n", pfn);
|
||||||
|
+ return NULL;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ page = pfn_to_page(pfn);
|
||||||
|
+
|
||||||
|
+ vaddr = kmap(page);
|
||||||
|
+ if (!vaddr) {
|
||||||
|
+ printk(KERN_INFO
|
||||||
|
+ "crash memory driver: pfn: %lx kmap(page: %lx) failed\n",
|
||||||
|
+ pfn, (unsigned long)page);
|
||||||
|
+ return NULL;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ *pp = page;
|
||||||
|
+ return (vaddr + (offset & (PAGE_SIZE-1)));
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static inline void unmap_virtual(struct page *page)
|
||||||
|
+{
|
||||||
|
+ kunmap(page);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+#endif /* __KERNEL__ */
|
||||||
|
+
|
||||||
|
+#endif /* __CRASH_H__ */
|
||||||
--
|
--
|
||||||
1.7.6
|
1.8.3.1
|
||||||
|
|
||||||
|
@ -2247,6 +2247,9 @@ fi
|
|||||||
# ||----w |
|
# ||----w |
|
||||||
# || ||
|
# || ||
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Nov 05 2013 Kyle McMartin <kyle@fedoraproject.org>
|
||||||
|
- Enable crash on {arm,aarch64,ppc64,s390x}
|
||||||
|
|
||||||
* Mon Nov 04 2013 Josh Boyer <jwboyer@fedoraproject.org> - 3.12.0-1
|
* Mon Nov 04 2013 Josh Boyer <jwboyer@fedoraproject.org> - 3.12.0-1
|
||||||
- Linux v3.12
|
- Linux v3.12
|
||||||
- Disable debugging options.
|
- Disable debugging options.
|
||||||
|
Loading…
Reference in New Issue
Block a user