From 5138d02845b477cc537ef3286e7c528503a69a61 Mon Sep 17 00:00:00 2001 From: yezengruan Date: Tue, 10 May 2022 15:02:00 +0800 Subject: [PATCH] update spec with openeuler !31 !4 libcare-dump: change the return value gensrc: skip vector instruction in str_do_gotpcrel Signed-off-by: yezengruan (cherry picked from commit c1712c9eb7c34f10f44dd0e1688acc713cbb98b6) --- ...ector-instruction-in-str_do_gotpcrel.patch | 31 +++++++++++++++ libcare-dump-change-the-return-value.patch | 38 +++++++++++++++++++ libcareplus.spec | 8 +++- 3 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 gensrc-skip-vector-instruction-in-str_do_gotpcrel.patch create mode 100644 libcare-dump-change-the-return-value.patch diff --git a/gensrc-skip-vector-instruction-in-str_do_gotpcrel.patch b/gensrc-skip-vector-instruction-in-str_do_gotpcrel.patch new file mode 100644 index 0000000..f3b77b5 --- /dev/null +++ b/gensrc-skip-vector-instruction-in-str_do_gotpcrel.patch @@ -0,0 +1,31 @@ +From ca5e000a30eae58e84c98fef9c511ef61ec00fbe Mon Sep 17 00:00:00 2001 +From: Chuan Zheng +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 + diff --git a/libcare-dump-change-the-return-value.patch b/libcare-dump-change-the-return-value.patch new file mode 100644 index 0000000..e0b452f --- /dev/null +++ b/libcare-dump-change-the-return-value.patch @@ -0,0 +1,38 @@ +From 037c9ac7e9d3eaa072ae1edaad2bc22e18f4333a Mon Sep 17 00:00:00 2001 +From: jiang-dawei15 +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 + diff --git a/libcareplus.spec b/libcareplus.spec index d26a504..e08347c 100644 --- a/libcareplus.spec +++ b/libcareplus.spec @@ -3,7 +3,7 @@ Version: 1.0.0 Name: libcareplus Summary: LibcarePlus tools -Release: 9 +Release: 10 Group: Applications/System License: GPLv2 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 Patch0010: libcare-patch-make-fix-some-bugs.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 @@ -151,6 +153,10 @@ exit 0 %endif %changelog +* Tue May 10 2022 yezengruan 1.0.0-10 +- libcare-dump: change the return value +- gensrc: skip vector instruction in str_do_gotpcrel + * Wed Apr 27 2022 yezengruan 1.0.0-9 - update the format of changelog