From: Jan Bobek <jan.bobek@gmail.com> To: qemu-devel@nongnu.org Cc: "Jan Bobek" <jan.bobek@gmail.com>, "Richard Henderson" <richard.henderson@linaro.org>, "Alex Bennée" <alex.bennee@linaro.org>, "Peter Maydell" <peter.maydell@linaro.org>, "Stefan Hajnoczi" <stefanha@redhat.com> Subject: [Qemu-devel] [RISU PATCH 5/5] risu_i386: remove old unused code Date: Mon, 8 Apr 2019 14:27:48 -0400 [thread overview] Message-ID: <20190408182748.1238-6-jan.bobek@gmail.com> (raw) In-Reply-To: <20190408182748.1238-1-jan.bobek@gmail.com> The code being removed is a remnant of the past implementation; it has since been replaced by its more powerful, architecture-independent counterpart in reginfo.c. Signed-off-by: Jan Bobek <jan.bobek@gmail.com> --- risu_i386.c | 58 ----------------------------------------------------- 1 file changed, 58 deletions(-) diff --git a/risu_i386.c b/risu_i386.c index eb4dff4..14b0db3 100644 --- a/risu_i386.c +++ b/risu_i386.c @@ -16,13 +16,6 @@ #include "risu.h" #include "risu_reginfo_i386.h" -struct reginfo master_ri, apprentice_ri; - -static int insn_is_ud2(uint32_t insn) -{ - return ((insn & 0xffff) == 0x0b0f); -} - void advance_pc(void *vuc) { ucontext_t *uc = (ucontext_t *) vuc; @@ -61,54 +54,3 @@ uintptr_t get_pc(struct reginfo *ri) { return ri->gregs[REG_EIP]; } - -int send_register_info(int sock, void *uc) -{ - struct reginfo ri; - fill_reginfo(&ri, uc); - return send_data_pkt(sock, &ri, sizeof(ri)); -} - -/* Read register info from the socket and compare it with that from the - * ucontext. Return 0 for match, 1 for end-of-test, 2 for mismatch. - * NB: called from a signal handler. - */ -int recv_and_compare_register_info(int sock, void *uc) -{ - int resp; - fill_reginfo(&master_ri, uc); - recv_data_pkt(sock, &apprentice_ri, sizeof(apprentice_ri)); - if (memcmp(&master_ri, &apprentice_ri, sizeof(master_ri)) != 0) { - /* mismatch */ - resp = 2; - } else if (insn_is_ud2(master_ri.faulting_insn)) { - /* end of test */ - resp = 1; - } else { - /* either successful match or expected undef */ - resp = 0; - } - send_response_byte(sock, resp); - return resp; -} - -/* Print a useful report on the status of the last comparison - * done in recv_and_compare_register_info(). This is called on - * exit, so need not restrict itself to signal-safe functions. - * Should return 0 if it was a good match (ie end of test) - * and 1 for a mismatch. - */ -int report_match_status(void) -{ - fprintf(stderr, "match status...\n"); - fprintf(stderr, "master reginfo:\n"); - dump_reginfo(&master_ri); - fprintf(stderr, "apprentice reginfo:\n"); - dump_reginfo(&apprentice_ri); - if (memcmp(&master_ri, &apprentice_ri, sizeof(master_ri)) == 0) { - fprintf(stderr, "match!\n"); - return 0; - } - fprintf(stderr, "mismatch!\n"); - return 1; -} -- 2.20.1
WARNING: multiple messages have this Message-ID (diff)
From: Jan Bobek <jan.bobek@gmail.com> To: qemu-devel@nongnu.org Cc: "Alex Bennée" <alex.bennee@linaro.org>, "Richard Henderson" <richard.henderson@linaro.org>, "Jan Bobek" <jan.bobek@gmail.com>, "Stefan Hajnoczi" <stefanha@redhat.com>, "Peter Maydell" <peter.maydell@linaro.org> Subject: [Qemu-devel] [RISU PATCH 5/5] risu_i386: remove old unused code Date: Mon, 8 Apr 2019 14:27:48 -0400 [thread overview] Message-ID: <20190408182748.1238-6-jan.bobek@gmail.com> (raw) Message-ID: <20190408182748.4bsXA5U94vU5M5l66f_09xA_eaOzkWlVOE8Gq4CyGuA@z> (raw) In-Reply-To: <20190408182748.1238-1-jan.bobek@gmail.com> The code being removed is a remnant of the past implementation; it has since been replaced by its more powerful, architecture-independent counterpart in reginfo.c. Signed-off-by: Jan Bobek <jan.bobek@gmail.com> --- risu_i386.c | 58 ----------------------------------------------------- 1 file changed, 58 deletions(-) diff --git a/risu_i386.c b/risu_i386.c index eb4dff4..14b0db3 100644 --- a/risu_i386.c +++ b/risu_i386.c @@ -16,13 +16,6 @@ #include "risu.h" #include "risu_reginfo_i386.h" -struct reginfo master_ri, apprentice_ri; - -static int insn_is_ud2(uint32_t insn) -{ - return ((insn & 0xffff) == 0x0b0f); -} - void advance_pc(void *vuc) { ucontext_t *uc = (ucontext_t *) vuc; @@ -61,54 +54,3 @@ uintptr_t get_pc(struct reginfo *ri) { return ri->gregs[REG_EIP]; } - -int send_register_info(int sock, void *uc) -{ - struct reginfo ri; - fill_reginfo(&ri, uc); - return send_data_pkt(sock, &ri, sizeof(ri)); -} - -/* Read register info from the socket and compare it with that from the - * ucontext. Return 0 for match, 1 for end-of-test, 2 for mismatch. - * NB: called from a signal handler. - */ -int recv_and_compare_register_info(int sock, void *uc) -{ - int resp; - fill_reginfo(&master_ri, uc); - recv_data_pkt(sock, &apprentice_ri, sizeof(apprentice_ri)); - if (memcmp(&master_ri, &apprentice_ri, sizeof(master_ri)) != 0) { - /* mismatch */ - resp = 2; - } else if (insn_is_ud2(master_ri.faulting_insn)) { - /* end of test */ - resp = 1; - } else { - /* either successful match or expected undef */ - resp = 0; - } - send_response_byte(sock, resp); - return resp; -} - -/* Print a useful report on the status of the last comparison - * done in recv_and_compare_register_info(). This is called on - * exit, so need not restrict itself to signal-safe functions. - * Should return 0 if it was a good match (ie end of test) - * and 1 for a mismatch. - */ -int report_match_status(void) -{ - fprintf(stderr, "match status...\n"); - fprintf(stderr, "master reginfo:\n"); - dump_reginfo(&master_ri); - fprintf(stderr, "apprentice reginfo:\n"); - dump_reginfo(&apprentice_ri); - if (memcmp(&master_ri, &apprentice_ri, sizeof(master_ri)) == 0) { - fprintf(stderr, "match!\n"); - return 0; - } - fprintf(stderr, "mismatch!\n"); - return 1; -} -- 2.20.1
next prev parent reply other threads:[~2019-04-08 18:28 UTC|newest] Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-04-08 18:27 [Qemu-devel] [RISU PATCH 0/5] Fix RISU build for i386 Jan Bobek 2019-04-08 18:27 ` Jan Bobek 2019-04-08 18:27 ` [Qemu-devel] [RISU PATCH 1/5] risu_i386: move reginfo_t and related defines to risu_reginfo_i386.h Jan Bobek 2019-04-08 18:27 ` Jan Bobek 2019-04-25 13:39 ` Alex Bennée 2019-04-25 13:39 ` Alex Bennée 2019-04-08 18:27 ` [Qemu-devel] [RISU PATCH 2/5] risu_i386: move reginfo-related code to risu_reginfo_i386.c Jan Bobek 2019-04-08 18:27 ` Jan Bobek 2019-04-25 13:39 ` Alex Bennée 2019-04-25 13:39 ` Alex Bennée 2019-04-08 18:27 ` [Qemu-devel] [RISU PATCH 3/5] risu_reginfo_i386: implement arch-specific reginfo interface Jan Bobek 2019-04-08 18:27 ` Jan Bobek 2019-04-25 13:42 ` Alex Bennée 2019-04-25 13:42 ` Alex Bennée 2019-04-08 18:27 ` [Qemu-devel] [RISU PATCH 4/5] risu_i386: implement missing CPU-specific functions Jan Bobek 2019-04-08 18:27 ` Jan Bobek 2019-04-08 18:27 ` Jan Bobek [this message] 2019-04-08 18:27 ` [Qemu-devel] [RISU PATCH 5/5] risu_i386: remove old unused code Jan Bobek 2019-04-25 13:43 ` Alex Bennée 2019-04-25 13:43 ` Alex Bennée 2019-04-08 22:18 ` [Qemu-devel] [RISU PATCH 0/5] Fix RISU build for i386 Richard Henderson 2019-04-08 22:18 ` Richard Henderson 2019-04-12 1:43 ` Jan Bobek 2019-04-12 1:43 ` Jan Bobek 2019-04-25 13:45 ` Alex Bennée 2019-04-25 13:45 ` Alex Bennée 2019-05-15 14:32 ` Jan Bobek
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20190408182748.1238-6-jan.bobek@gmail.com \ --to=jan.bobek@gmail.com \ --cc=alex.bennee@linaro.org \ --cc=peter.maydell@linaro.org \ --cc=qemu-devel@nongnu.org \ --cc=richard.henderson@linaro.org \ --cc=stefanha@redhat.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.