Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F103539999
D41876.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D41876.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 27, 6:48 AM (21 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14880582
Default Alt Text
D41876.diff (2 KB)
Attached To
Mode
D41876: kinst: do not look for a function epilogue
Attached
Detach File
Event Timeline
Log In to Comment