This is a backport of the following upstream commit:
commit 158d763 Author: WANG Chao chaowang@redhat.com Date: Tue Jan 7 01:37:34 2014 +0800
vmcore-dmesg: struct_val_u64() not casting u64 to u32
It seems gcc doesn't check return type from inline function. struct_val_u64() should return u64 otherwise upper 32bit is lost.
Signed-off-by: WANG Chao chaowang@redhat.com Acked-by: Vivek Goyal vgoyal@redhat.com Signed-off-by: Simon Horman horms@verge.net.au
timestamp in vmcore-dmesg is u64 type but it's truncated to u32, which results in wrong time stamp. So let's backport this patch to fix this issue.
Signed-off-by: WANG Chao chaowang@redhat.com --- ...esg-struct_val_u64-not-casting-u64-to-u32.patch | 31 ++++++++++++++++++++++ kexec-tools.spec | 2 ++ 2 files changed, 33 insertions(+) create mode 100644 kexec-tools-2.0.4-vmcore-dmesg-struct_val_u64-not-casting-u64-to-u32.patch
diff --git a/kexec-tools-2.0.4-vmcore-dmesg-struct_val_u64-not-casting-u64-to-u32.patch b/kexec-tools-2.0.4-vmcore-dmesg-struct_val_u64-not-casting-u64-to-u32.patch new file mode 100644 index 0000000..e2e43ff --- /dev/null +++ b/kexec-tools-2.0.4-vmcore-dmesg-struct_val_u64-not-casting-u64-to-u32.patch @@ -0,0 +1,31 @@ +From 158d7638f1669a8d34def55ab81f10993e68e76a Mon Sep 17 00:00:00 2001 +From: WANG Chao chaowang@redhat.com +Date: Tue, 7 Jan 2014 01:37:34 +0800 +Subject: [PATCH] vmcore-dmesg: struct_val_u64() not casting u64 to u32 + +It seems gcc doesn't check return type from inline function. +struct_val_u64() should return u64 otherwise upper 32bit is lost. + +Signed-off-by: WANG Chao chaowang@redhat.com +Acked-by: Vivek Goyal vgoyal@redhat.com +Signed-off-by: Simon Horman horms@verge.net.au +--- + vmcore-dmesg/vmcore-dmesg.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/vmcore-dmesg/vmcore-dmesg.c b/vmcore-dmesg/vmcore-dmesg.c +index 0f477c0..df14c89 100644 +--- a/vmcore-dmesg/vmcore-dmesg.c ++++ b/vmcore-dmesg/vmcore-dmesg.c +@@ -529,7 +529,7 @@ static inline uint32_t struct_val_u32(char *ptr, unsigned int offset) + return(file32_to_cpu(*(uint32_t *)(ptr + offset))); + } + +-static inline uint32_t struct_val_u64(char *ptr, unsigned int offset) ++static inline uint64_t struct_val_u64(char *ptr, unsigned int offset) + { + return(file64_to_cpu(*(uint64_t *)(ptr + offset))); + } +-- +1.8.4.2 + diff --git a/kexec-tools.spec b/kexec-tools.spec index 4bf50af..927a513 100644 --- a/kexec-tools.spec +++ b/kexec-tools.spec @@ -94,6 +94,7 @@ Patch613: kexec-tools-2.0.4-makedumpfile-Assign-non-printable-value-as-short-opt Patch614: kexec-tools-2.0.4-makedumpfile-Add-help-and-man-message-for-help.patch Patch615: kexec-tools-2.0.4-makedumpfile-Add-non-mmap-option-to-disable-mmap-manually.patch Patch616: kexec-tools-2.0.4-makedumpfile-Fall-back-to-read-when-mmap-fails.patch +Patch617: kexec-tools-2.0.4-vmcore-dmesg-struct_val_u64-not-casting-u64-to-u32.patch
%description kexec-tools provides /sbin/kexec binary that facilitates a new @@ -141,6 +142,7 @@ tar -z -x -v -f %{SOURCE19} %patch614 -p1 %patch615 -p1 %patch616 -p1 +%patch617 -p1
tar -z -x -v -f %{SOURCE13}
On Tue, Jan 14, 2014 at 05:20:00PM +0800, WANG Chao wrote:
This is a backport of the following upstream commit:
commit 158d763 Author: WANG Chao chaowang@redhat.com Date: Tue Jan 7 01:37:34 2014 +0800
vmcore-dmesg: struct_val_u64() not casting u64 to u32 It seems gcc doesn't check return type from inline function. struct_val_u64() should return u64 otherwise upper 32bit is lost. Signed-off-by: WANG Chao <chaowang@redhat.com> Acked-by: Vivek Goyal <vgoyal@redhat.com> Signed-off-by: Simon Horman <horms@verge.net.au>
timestamp in vmcore-dmesg is u64 type but it's truncated to u32, which results in wrong time stamp. So let's backport this patch to fix this issue.
Signed-off-by: WANG Chao chaowang@redhat.com
Acked-by: Vivek Goyal vgoyal@redhat.com
Vivek
...esg-struct_val_u64-not-casting-u64-to-u32.patch | 31 ++++++++++++++++++++++ kexec-tools.spec | 2 ++ 2 files changed, 33 insertions(+) create mode 100644 kexec-tools-2.0.4-vmcore-dmesg-struct_val_u64-not-casting-u64-to-u32.patch
diff --git a/kexec-tools-2.0.4-vmcore-dmesg-struct_val_u64-not-casting-u64-to-u32.patch b/kexec-tools-2.0.4-vmcore-dmesg-struct_val_u64-not-casting-u64-to-u32.patch new file mode 100644 index 0000000..e2e43ff --- /dev/null +++ b/kexec-tools-2.0.4-vmcore-dmesg-struct_val_u64-not-casting-u64-to-u32.patch @@ -0,0 +1,31 @@ +From 158d7638f1669a8d34def55ab81f10993e68e76a Mon Sep 17 00:00:00 2001 +From: WANG Chao chaowang@redhat.com +Date: Tue, 7 Jan 2014 01:37:34 +0800 +Subject: [PATCH] vmcore-dmesg: struct_val_u64() not casting u64 to u32
+It seems gcc doesn't check return type from inline function. +struct_val_u64() should return u64 otherwise upper 32bit is lost.
+Signed-off-by: WANG Chao chaowang@redhat.com +Acked-by: Vivek Goyal vgoyal@redhat.com +Signed-off-by: Simon Horman horms@verge.net.au +---
- vmcore-dmesg/vmcore-dmesg.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+diff --git a/vmcore-dmesg/vmcore-dmesg.c b/vmcore-dmesg/vmcore-dmesg.c +index 0f477c0..df14c89 100644 +--- a/vmcore-dmesg/vmcore-dmesg.c ++++ b/vmcore-dmesg/vmcore-dmesg.c +@@ -529,7 +529,7 @@ static inline uint32_t struct_val_u32(char *ptr, unsigned int offset)
- return(file32_to_cpu(*(uint32_t *)(ptr + offset)));
- }
+-static inline uint32_t struct_val_u64(char *ptr, unsigned int offset) ++static inline uint64_t struct_val_u64(char *ptr, unsigned int offset)
- {
- return(file64_to_cpu(*(uint64_t *)(ptr + offset)));
- }
+-- +1.8.4.2
diff --git a/kexec-tools.spec b/kexec-tools.spec index 4bf50af..927a513 100644 --- a/kexec-tools.spec +++ b/kexec-tools.spec @@ -94,6 +94,7 @@ Patch613: kexec-tools-2.0.4-makedumpfile-Assign-non-printable-value-as-short-opt Patch614: kexec-tools-2.0.4-makedumpfile-Add-help-and-man-message-for-help.patch Patch615: kexec-tools-2.0.4-makedumpfile-Add-non-mmap-option-to-disable-mmap-manually.patch Patch616: kexec-tools-2.0.4-makedumpfile-Fall-back-to-read-when-mmap-fails.patch +Patch617: kexec-tools-2.0.4-vmcore-dmesg-struct_val_u64-not-casting-u64-to-u32.patch
%description kexec-tools provides /sbin/kexec binary that facilitates a new @@ -141,6 +142,7 @@ tar -z -x -v -f %{SOURCE19} %patch614 -p1 %patch615 -p1 %patch616 -p1 +%patch617 -p1
tar -z -x -v -f %{SOURCE13}
-- 1.8.4.2
kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec