libcare-dump: change the return value gensrc: skip vector instruction in str_do_gotpcrel Signed-off-by: yezengruan <yezengruan@huawei.com> (cherry picked from commit c1712c9eb7c34f10f44dd0e1688acc713cbb98b6)
This commit is contained in:
parent
d6bcb14dbc
commit
5138d02845
31
gensrc-skip-vector-instruction-in-str_do_gotpcrel.patch
Normal file
31
gensrc-skip-vector-instruction-in-str_do_gotpcrel.patch
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
From ca5e000a30eae58e84c98fef9c511ef61ec00fbe Mon Sep 17 00:00:00 2001
|
||||||
|
From: Chuan Zheng <zhengchuan@huawei.com>
|
||||||
|
Date: Mon, 26 Apr 2021 14:48:34 +0800
|
||||||
|
Subject: [PATCH] gensrc: skip vector instruction in str_do_gotpcrel
|
||||||
|
|
||||||
|
We might have "move (%rip) %0xmm0" in qemu hotpatch, which causes
|
||||||
|
gensrc failure in str_do_gotpcrel.
|
||||||
|
Fix it by skipping it because we do not need anything for vector command.
|
||||||
|
---
|
||||||
|
src/kpatch_gensrc.c | 5 +++++
|
||||||
|
1 file changed, 5 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/src/kpatch_gensrc.c b/src/kpatch_gensrc.c
|
||||||
|
index a16b652..4f978f8 100644
|
||||||
|
--- a/src/kpatch_gensrc.c
|
||||||
|
+++ b/src/kpatch_gensrc.c
|
||||||
|
@@ -291,6 +291,11 @@ void str_do_gotpcrel(struct kp_file *f, char *dst, char *src)
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ if (strstr(movdst.s, "%xmm") != NULL) {
|
||||||
|
+ /* Is SSE (%xmm0, etc), bail out */
|
||||||
|
+ goto out;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
/* Use full 64-bit counterpart of the destination register
|
||||||
|
* as the auxiliary register */
|
||||||
|
get_full_reg(&movdst, auxreg);
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
38
libcare-dump-change-the-return-value.patch
Normal file
38
libcare-dump-change-the-return-value.patch
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
From 037c9ac7e9d3eaa072ae1edaad2bc22e18f4333a Mon Sep 17 00:00:00 2001
|
||||||
|
From: jiang-dawei15 <jiangdawei15@huawei.com>
|
||||||
|
Date: Thu, 5 May 2022 10:39:47 +0800
|
||||||
|
Subject: [PATCH] libcare-dump:change the return value
|
||||||
|
|
||||||
|
---
|
||||||
|
src/libcare-dump.c | 8 +++++++-
|
||||||
|
1 file changed, 7 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/libcare-dump.c b/src/libcare-dump.c
|
||||||
|
index 8736452..b712709 100644
|
||||||
|
--- a/src/libcare-dump.c
|
||||||
|
+++ b/src/libcare-dump.c
|
||||||
|
@@ -45,6 +45,7 @@ void usage()
|
||||||
|
|
||||||
|
int kpatch_dump_kpatch_header(const char *input_file)
|
||||||
|
{
|
||||||
|
+ int rv;
|
||||||
|
int fdi = -1;
|
||||||
|
int ret = -1;
|
||||||
|
int elf_size;
|
||||||
|
@@ -67,7 +68,12 @@ int kpatch_dump_kpatch_header(const char *input_file)
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
|
- ret = read(fdi, &kp, sizeof(struct kpatch_file));
|
||||||
|
+ rv = read(fdi, &kp, sizeof(struct kpatch_file));
|
||||||
|
+ if (rv <= 0) {
|
||||||
|
+ printf("Read kpatch file '%s' failed.\n", input_file);
|
||||||
|
+ goto cleanup;
|
||||||
|
+ }
|
||||||
|
+ ret = 0;
|
||||||
|
printf("%-25s %s\n", "Patch Name:", input_file);
|
||||||
|
printf("%-25s %s\n", "Magic:", kp.magic);
|
||||||
|
printf("%-25s %s\n", "Patch id:", kp.id);
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
@ -3,7 +3,7 @@
|
|||||||
Version: 1.0.0
|
Version: 1.0.0
|
||||||
Name: libcareplus
|
Name: libcareplus
|
||||||
Summary: LibcarePlus tools
|
Summary: LibcarePlus tools
|
||||||
Release: 9
|
Release: 10
|
||||||
Group: Applications/System
|
Group: Applications/System
|
||||||
License: GPLv2
|
License: GPLv2
|
||||||
Url: https://gitee.com/openeuler/libcareplus
|
Url: https://gitee.com/openeuler/libcareplus
|
||||||
@ -20,6 +20,8 @@ Patch0008: kpatch_parse-fix-failed-to-recognize-.cold.patch
|
|||||||
Patch0009: help-modify-some-help-information.patch
|
Patch0009: help-modify-some-help-information.patch
|
||||||
Patch0010: libcare-patch-make-fix-some-bugs.patch
|
Patch0010: libcare-patch-make-fix-some-bugs.patch
|
||||||
Patch0011: selinux-enable-libcare-ctl-to-mprotect-qemu-process.patch
|
Patch0011: selinux-enable-libcare-ctl-to-mprotect-qemu-process.patch
|
||||||
|
Patch0012: libcare-dump-change-the-return-value.patch
|
||||||
|
Patch0013: gensrc-skip-vector-instruction-in-str_do_gotpcrel.patch
|
||||||
|
|
||||||
BuildRequires: elfutils-libelf-devel libunwind-devel gcc systemd
|
BuildRequires: elfutils-libelf-devel libunwind-devel gcc systemd
|
||||||
|
|
||||||
@ -151,6 +153,10 @@ exit 0
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue May 10 2022 yezengruan <yezengruan@huawei.com> 1.0.0-10
|
||||||
|
- libcare-dump: change the return value
|
||||||
|
- gensrc: skip vector instruction in str_do_gotpcrel
|
||||||
|
|
||||||
* Wed Apr 27 2022 yezengruan <yezengruan@huawei.com> 1.0.0-9
|
* Wed Apr 27 2022 yezengruan <yezengruan@huawei.com> 1.0.0-9
|
||||||
- update the format of changelog
|
- update the format of changelog
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user