Page MenuHomeFreeBSD

D41876.id.diff
No OneTemporary

D41876.id.diff

diff --git a/sys/cddl/dev/kinst/amd64/kinst_isa.c b/sys/cddl/dev/kinst/amd64/kinst_isa.c
--- a/sys/cddl/dev/kinst/amd64/kinst_isa.c
+++ b/sys/cddl/dev/kinst/amd64/kinst_isa.c
@@ -22,7 +22,6 @@
#include "kinst.h"
#define KINST_PUSHL_RBP 0x55
-#define KINST_POPL_RBP 0x5d
#define KINST_STI 0xfb
#define KINST_POPF 0x9d
@@ -502,7 +501,7 @@
const char *func;
int error, instrsize, n, off;
uint8_t *instr, *limit, *tmp;
- bool push_found, pop_found;
+ bool push_found;
pd = opaque;
func = symval->name;
@@ -521,17 +520,20 @@
* manipulations since they might correspond to exception handlers.
*/
tmp = instr;
- push_found = pop_found = false;
+ push_found = false;
while (tmp < limit) {
- if (*tmp == KINST_PUSHL_RBP)
+ /*
+ * Checking for 'pop %rbp' as well makes the filtering too
+ * strict as it would skip functions that never return (e.g.,
+ * vnlru_proc()).
+ */
+ if (*tmp == KINST_PUSHL_RBP) {
push_found = true;
- else if (*tmp == KINST_POPL_RBP)
- pop_found = true;
- if (push_found && pop_found)
break;
+ }
tmp += dtrace_instr_size(tmp);
}
- if (!push_found || !pop_found)
+ if (!push_found)
return (0);
n = 0;
diff --git a/sys/cddl/dev/kinst/riscv/kinst_isa.c b/sys/cddl/dev/kinst/riscv/kinst_isa.c
--- a/sys/cddl/dev/kinst/riscv/kinst_isa.c
+++ b/sys/cddl/dev/kinst/riscv/kinst_isa.c
@@ -448,7 +448,7 @@
kinst_patchval_t *insn, v;
uint8_t *instr, *limit;
int instrsize, n, off;
- bool lrsc_block, store_found, ret_found;
+ bool lrsc_block, store_found;
pd = opaque;
func = symval->name;
@@ -464,16 +464,15 @@
return (0);
/* Check for the usual function prologue. */
+ store_found = false;
for (insn = (kinst_patchval_t *)instr;
insn < (kinst_patchval_t *)limit; insn++) {
- if (dtrace_instr_sdsp(&insn) || dtrace_instr_c_sdsp(&insn))
+ if (dtrace_instr_sdsp(&insn) || dtrace_instr_c_sdsp(&insn)) {
store_found = true;
- else if (dtrace_instr_ret(&insn) || dtrace_instr_c_ret(&insn))
- ret_found = true;
- if (store_found && ret_found)
break;
+ }
}
- if (!store_found || !ret_found)
+ if (!store_found)
return (0);
n = 0;

File Metadata

Mime Type
text/plain
Expires
Wed, Sep 25, 11:01 PM (19 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
12795601
Default Alt Text
D41876.id.diff (2 KB)

Event Timeline