Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1286877 > unrolled thread
| Started by | Daniel Kiper <daniel.kiper@oracle.com> |
|---|---|
| First post | 2015-12-08 23:00 +0100 |
| Last post | 2015-12-08 23:10 +0100 |
| Articles | 11 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH 00/14] kexec: Add option to get crash kernel region size Daniel Kiper <daniel.kiper@oracle.com> - 2015-12-08 23:00 +0100
[PATCH 04/14] crashdump/x86: Add print_crashkernel_region_size() function Daniel Kiper <daniel.kiper@oracle.com> - 2015-12-08 23:10 +0100
[PATCH 02/14] kexec: Remove redundant space from help message Daniel Kiper <daniel.kiper@oracle.com> - 2015-12-08 23:10 +0100
[PATCH 03/14] crashdump: Remove stray get_crashkernel_region() declaration Daniel Kiper <daniel.kiper@oracle.com> - 2015-12-08 23:10 +0100
[PATCH 08/14] crashdump/m68k: Add print_crashkernel_region_size() function Daniel Kiper <daniel.kiper@oracle.com> - 2015-12-08 23:10 +0100
[PATCH 10/14] crashdump/ppc: Add print_crashkernel_region_size() function Daniel Kiper <daniel.kiper@oracle.com> - 2015-12-08 23:10 +0100
Re: [PATCH 10/14] crashdump/ppc: Add print_crashkernel_region_size() function Dave Young <dyoung@redhat.com> - 2015-12-09 04:00 +0100
[PATCH 01/14] purgatory: Add purgatory.map and purgatory.ro.sym to clean recipe Daniel Kiper <daniel.kiper@oracle.com> - 2015-12-08 23:10 +0100
[PATCH 06/14] crashdump/cris: Add print_crashkernel_region_size() function Daniel Kiper <daniel.kiper@oracle.com> - 2015-12-08 23:10 +0100
Re: [PATCH 06/14] crashdump/cris: Add print_crashkernel_region_size() function Dave Young <dyoung@redhat.com> - 2015-12-09 04:00 +0100
[PATCH 05/14] crashdump/arm: Add print_crashkernel_region_size() function Daniel Kiper <daniel.kiper@oracle.com> - 2015-12-08 23:10 +0100
| From | Daniel Kiper <daniel.kiper@oracle.com> |
|---|---|
| Date | 2015-12-08 23:00 +0100 |
| Subject | [PATCH 00/14] kexec: Add option to get crash kernel region size |
| Message-ID | <qDysG-7MA-7@gated-at.bofh.it> |
Crash kernel region size is available via sysfs on Linux running on
bare metal. However, this does not work when Linux runs as Xen dom0.
In this case Xen crash kernel region size should be established using
__HYPERVISOR_kexec_op hypercall (Linux kernel kexec functionality does
not make a lot of sense in Xen dom0). Sadly hypercalls are not easily
accessible using shell scripts or something like that. Potentially we
can check "xl dmesg" output for crashkernel option but this is not nice.
So, let's add this functionality, for Linux running on bare metal and
as Xen dom0, to kexec-tools. This way kdump scripts may establish crash
kernel region size in one way regardless of platform. All burden of
platform detection lies on kexec-tools.
Figure (and unit) displayed by this new kexec-tools functionality is
the same as one taken from /sys/kernel/kexec_crash_size.
First three patches are fixes and cleanups. The rest provides above
described functionality for all supported platforms.
Daniel
kexec/arch/arm/crashdump-arm.c | 10 ++++++++++
kexec/arch/cris/kexec-cris.c | 5 +++++
kexec/arch/i386/crashdump-x86.c | 18 +++++++++++++++++-
kexec/arch/ia64/crashdump-ia64.c | 10 ++++++++++
kexec/arch/m68k/kexec-m68k.c | 5 +++++
kexec/arch/mips/crashdump-mips.c | 9 +++++++++
kexec/arch/ppc/crashdump-powerpc.c | 4 ++++
kexec/arch/ppc64/crashdump-ppc64.c | 5 +++++
kexec/arch/s390/kexec-s390.c | 10 ++++++++++
kexec/arch/sh/crashdump-sh.c | 10 ++++++++++
kexec/crashdump.h | 1 -
kexec/kexec.8 | 3 +++
kexec/kexec.c | 6 +++++-
kexec/kexec.h | 5 ++++-
purgatory/Makefile | 2 +-
15 files changed, 98 insertions(+), 5 deletions(-)
Daniel Kiper (14):
purgatory: Add purgatory.map and purgatory.ro.sym to clean recipe
kexec: Remove redundant space from help message
crashdump: Remove stray get_crashkernel_region() declaration
crashdump/x86: Add print_crashkernel_region_size() function
crashdump/arm: Add print_crashkernel_region_size() function
crashdump/cris: Add print_crashkernel_region_size() function
crashdump/ia64: Add print_crashkernel_region_size() function
crashdump/m68k: Add print_crashkernel_region_size() function
crashdump/mips: Add print_crashkernel_region_size() function
crashdump/ppc: Add print_crashkernel_region_size() function
crashdump/ppc64: Add print_crashkernel_region_size() function
crashdump/s390: Add print_crashkernel_region_size() function
crashdump/sh: Add print_crashkernel_region_size() function
kexec: Add option to get crash kernel region size
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Daniel Kiper <daniel.kiper@oracle.com> |
|---|---|
| Date | 2015-12-08 23:10 +0100 |
| Subject | [PATCH 04/14] crashdump/x86: Add print_crashkernel_region_size() function |
| Message-ID | <qDyCl-85p-3@gated-at.bofh.it> |
| In reply to | #1286877 |
Crash kernel region size is available via sysfs on Linux running on
bare metal. However, this does not work when Linux runs as Xen dom0.
In this case Xen crash kernel region size should be established using
__HYPERVISOR_kexec_op hypercall (Linux kernel kexec functionality does
not make a lot of sense in Xen dom0). Sadly hypercalls are not easily
accessible using shell scripts or something like that. Potentially we
can check "xl dmesg" output for crashkernel option but this is not nice.
So, let's add this functionality, for Linux running on bare metal and
as Xen dom0, to kexec-tools. This way kdump scripts may establish crash
kernel region size in one way regardless of platform. All burden of
platform detection lies on kexec-tools.
Figure (and unit) displayed by this new kexec-tools functionality is
the same as one taken from /sys/kernel/kexec_crash_size.
This patch just adds print_crashkernel_region_size() function, which
prints crash kernel region size, for x86 arch. Next patches will add
same named function for other archs supported by kexec-tools. Last patch
of this series will export this functionality to the userspace via
separate kexec utility option.
Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
kexec/arch/i386/crashdump-x86.c | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c
index bbc0f35..10a56a8 100644
--- a/kexec/arch/i386/crashdump-x86.c
+++ b/kexec/arch/i386/crashdump-x86.c
@@ -1056,7 +1056,7 @@ static int crashkernel_mem_callback(void *UNUSED(data), int nr,
return 0;
}
-int is_crashkernel_mem_reserved(void)
+static int get_crashkernel_region(void)
{
int ret;
@@ -1079,3 +1079,19 @@ int is_crashkernel_mem_reserved(void)
return !!crash_reserved_mem_nr;
}
+
+int is_crashkernel_mem_reserved(void)
+{
+ return get_crashkernel_region();
+}
+
+void print_crashkernel_region_size(void)
+{
+ uint64_t start, end;
+
+ if (get_crashkernel_region()) {
+ get_crash_kernel_load_range(&start, &end);
+ printf("%lu\n", end - start + 1);
+ } else
+ printf("0\n");
+}
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Daniel Kiper <daniel.kiper@oracle.com> |
|---|---|
| Date | 2015-12-08 23:10 +0100 |
| Subject | [PATCH 02/14] kexec: Remove redundant space from help message |
| Message-ID | <qDyCl-85p-7@gated-at.bofh.it> |
| In reply to | #1286877 |
Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
kexec/kexec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kexec/kexec.c b/kexec/kexec.c
index f0bd527..20dd93d 100644
--- a/kexec/kexec.c
+++ b/kexec/kexec.c
@@ -969,7 +969,7 @@ void usage(void)
" preserve context)\n"
" to original kernel.\n"
" -s, --kexec-file-syscall Use file based syscall for kexec operation\n"
- " -d, --debug Enable debugging to help spot a failure.\n"
+ " -d, --debug Enable debugging to help spot a failure.\n"
"\n"
"Supported kernel file types and options: \n");
for (i = 0; i < file_types; i++) {
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Daniel Kiper <daniel.kiper@oracle.com> |
|---|---|
| Date | 2015-12-08 23:10 +0100 |
| Subject | [PATCH 03/14] crashdump: Remove stray get_crashkernel_region() declaration |
| Message-ID | <qDyCl-85p-9@gated-at.bofh.it> |
| In reply to | #1286877 |
Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com> --- kexec/crashdump.h | 1 - 1 file changed, 1 deletion(-) diff --git a/kexec/crashdump.h b/kexec/crashdump.h index 95f1f0c..320767b 100644 --- a/kexec/crashdump.h +++ b/kexec/crashdump.h @@ -1,7 +1,6 @@ #ifndef CRASHDUMP_H #define CRASHDUMP_H -int get_crashkernel_region(uint64_t *start, uint64_t *end); extern int get_crash_notes_per_cpu(int cpu, uint64_t *addr, uint64_t *len); extern int get_kernel_vmcoreinfo(uint64_t *addr, uint64_t *len); extern int get_xen_vmcoreinfo(uint64_t *addr, uint64_t *len); -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Daniel Kiper <daniel.kiper@oracle.com> |
|---|---|
| Date | 2015-12-08 23:10 +0100 |
| Subject | [PATCH 08/14] crashdump/m68k: Add print_crashkernel_region_size() function |
| Message-ID | <qDyCm-85p-13@gated-at.bofh.it> |
| In reply to | #1286877 |
Provide just print_crashkernel_region_size() stub. This way
we can properly build kexec utility on m68k arch even
if the functionality is not available on it.
Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
kexec/arch/m68k/kexec-m68k.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/kexec/arch/m68k/kexec-m68k.c b/kexec/arch/m68k/kexec-m68k.c
index 372aa37..a9915a0 100644
--- a/kexec/arch/m68k/kexec-m68k.c
+++ b/kexec/arch/m68k/kexec-m68k.c
@@ -89,6 +89,11 @@ int is_crashkernel_mem_reserved(void)
return 0;
}
+void print_crashkernel_region_size(void)
+{
+ printf("-1\n");
+}
+
unsigned long virt_to_phys(unsigned long addr)
{
return addr + m68k_memoffset;
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Daniel Kiper <daniel.kiper@oracle.com> |
|---|---|
| Date | 2015-12-08 23:10 +0100 |
| Subject | [PATCH 10/14] crashdump/ppc: Add print_crashkernel_region_size() function |
| Message-ID | <qDyCm-85p-11@gated-at.bofh.it> |
| In reply to | #1286877 |
Provide just print_crashkernel_region_size() stub. This way
we can properly build kexec utility on ppc arch even
if the functionality is not available on it.
Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
kexec/arch/ppc/crashdump-powerpc.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/kexec/arch/ppc/crashdump-powerpc.c b/kexec/arch/ppc/crashdump-powerpc.c
index 3dc35eb..19c4a61 100644
--- a/kexec/arch/ppc/crashdump-powerpc.c
+++ b/kexec/arch/ppc/crashdump-powerpc.c
@@ -408,3 +408,7 @@ int is_crashkernel_mem_reserved(void)
return 1;
}
+void print_crashkernel_region_size(void)
+{
+ printf("-1\n");
+}
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Dave Young <dyoung@redhat.com> |
|---|---|
| Date | 2015-12-09 04:00 +0100 |
| Subject | Re: [PATCH 10/14] crashdump/ppc: Add print_crashkernel_region_size() function |
| Message-ID | <qDD90-2iB-15@gated-at.bofh.it> |
| In reply to | #1286885 |
On 12/08/15 at 10:57pm, Daniel Kiper wrote:
> Provide just print_crashkernel_region_size() stub. This way
> we can properly build kexec utility on ppc arch even
> if the functionality is not available on it.
The functionality is available by reading device tree nodes in procfs..
>
> Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
> ---
> kexec/arch/ppc/crashdump-powerpc.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/kexec/arch/ppc/crashdump-powerpc.c b/kexec/arch/ppc/crashdump-powerpc.c
> index 3dc35eb..19c4a61 100644
> --- a/kexec/arch/ppc/crashdump-powerpc.c
> +++ b/kexec/arch/ppc/crashdump-powerpc.c
> @@ -408,3 +408,7 @@ int is_crashkernel_mem_reserved(void)
> return 1;
> }
>
> +void print_crashkernel_region_size(void)
> +{
> + printf("-1\n");
> +}
> --
> 1.7.10.4
>
>
> _______________________________________________
> kexec mailing list
> kexec@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Daniel Kiper <daniel.kiper@oracle.com> |
|---|---|
| Date | 2015-12-08 23:10 +0100 |
| Subject | [PATCH 01/14] purgatory: Add purgatory.map and purgatory.ro.sym to clean recipe |
| Message-ID | <qDyCn-85p-45@gated-at.bofh.it> |
| In reply to | #1286877 |
Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com> --- purgatory/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/purgatory/Makefile b/purgatory/Makefile index 2b5c061..caea7ea 100644 --- a/purgatory/Makefile +++ b/purgatory/Makefile @@ -33,7 +33,7 @@ PURGATORY_SRCS+=$($(ARCH)_PURGATORY_SRCS) PURGATORY_OBJS = $(call objify, $(PURGATORY_SRCS)) purgatory/sha256.o PURGATORY_DEPS = $(call depify, $(PURGATORY_OBJS)) -clean += $(PURGATORY_OBJS) $(PURGATORY_DEPS) $(PURGATORY) +clean += $(PURGATORY_OBJS) $(PURGATORY_DEPS) $(PURGATORY) $(PURGATORY_MAP) $(PURGATORY).sym -include $(PURGATORY_DEPS) -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Daniel Kiper <daniel.kiper@oracle.com> |
|---|---|
| Date | 2015-12-08 23:10 +0100 |
| Subject | [PATCH 06/14] crashdump/cris: Add print_crashkernel_region_size() function |
| Message-ID | <qDyCn-85p-49@gated-at.bofh.it> |
| In reply to | #1286877 |
Provide just print_crashkernel_region_size() stub. This way
we can properly build kexec utility on cris arch even
if the functionality is not available on it.
Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
kexec/arch/cris/kexec-cris.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/kexec/arch/cris/kexec-cris.c b/kexec/arch/cris/kexec-cris.c
index 4ac2f89..8c62191 100644
--- a/kexec/arch/cris/kexec-cris.c
+++ b/kexec/arch/cris/kexec-cris.c
@@ -77,6 +77,11 @@ int is_crashkernel_mem_reserved(void)
return 0;
}
+void print_crashkernel_region_size(void)
+{
+ printf("-1\n");
+}
+
unsigned long virt_to_phys(unsigned long addr)
{
return (addr) & 0x7fffffff;
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Dave Young <dyoung@redhat.com> |
|---|---|
| Date | 2015-12-09 04:00 +0100 |
| Subject | Re: [PATCH 06/14] crashdump/cris: Add print_crashkernel_region_size() function |
| Message-ID | <qDD8Z-2iB-1@gated-at.bofh.it> |
| In reply to | #1286890 |
On 12/08/15 at 10:57pm, Daniel Kiper wrote:
> Provide just print_crashkernel_region_size() stub. This way
> we can properly build kexec utility on cris arch even
> if the functionality is not available on it.
>
> Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
> ---
> kexec/arch/cris/kexec-cris.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/kexec/arch/cris/kexec-cris.c b/kexec/arch/cris/kexec-cris.c
> index 4ac2f89..8c62191 100644
> --- a/kexec/arch/cris/kexec-cris.c
> +++ b/kexec/arch/cris/kexec-cris.c
> @@ -77,6 +77,11 @@ int is_crashkernel_mem_reserved(void)
> return 0;
> }
>
> +void print_crashkernel_region_size(void)
> +{
> + printf("-1\n");
"-1" is meaningless to end user, how about instead telling that there's no
such functionality for the arch.
> +}
> +
> unsigned long virt_to_phys(unsigned long addr)
> {
> return (addr) & 0x7fffffff;
> --
> 1.7.10.4
>
>
> _______________________________________________
> kexec mailing list
> kexec@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Daniel Kiper <daniel.kiper@oracle.com> |
|---|---|
| Date | 2015-12-08 23:10 +0100 |
| Subject | [PATCH 05/14] crashdump/arm: Add print_crashkernel_region_size() function |
| Message-ID | <qDyCn-85p-51@gated-at.bofh.it> |
| In reply to | #1286877 |
Follow similar x86 patch.
Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
kexec/arch/arm/crashdump-arm.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/kexec/arch/arm/crashdump-arm.c b/kexec/arch/arm/crashdump-arm.c
index b523e5f..b3e93ad 100644
--- a/kexec/arch/arm/crashdump-arm.c
+++ b/kexec/arch/arm/crashdump-arm.c
@@ -414,3 +414,13 @@ int is_crashkernel_mem_reserved(void)
return 0;
}
+
+void print_crashkernel_region_size(void)
+{
+ uint64_t start, end;
+
+ if (!parse_iomem_single("Crash kernel\n", &start, &end) && start != end)
+ printf("%lu\n", end - start + 1);
+ else
+ printf("0\n");
+}
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web