This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [RFC PATCH 1/2] check safety in workqueue
[cc list from hell trimmed]
(Didn't do an in depth review. Just some things that jumped out on me)
> +# jmp into this function from other functions.
> +.global arch_tmpl_stub_entry
> +arch_tmpl_stub_entry:
> + nop
> + subl $8, %esp #skip segment registers.
> + pushf
> + subl $20, %esp #skip segment registers.
I don't know why you try to fake pt_regs. Seems useless.
> + pushl %eax
> + pushl %ebp
> + pushl %edi
> + pushl %esi
> + pushl %edx
> + pushl %ecx
> + pushl %ebx
You only need to save the registers that are actually clobbered by C here.
> +static void local_flush_icache(void * info)
> +{
> + cpuid_eax(0);
cpuid_eax is not marked volatile, so gcc will likely optimize this away.
x86-64 has a sync_core() that works. But I'm not convinced it even makes
any sense to have.
> +#define ARCH_STUB_VAL_IDX ((long)&arch_tmpl_stub_val - (long)&arch_tmpl_stub_entry + 1)
> +#define ARCH_STUB_CALL_IDX ((long)&arch_tmpl_stub_call - (long)&arch_tmpl_stub_entry + 1)
> +#define ARCH_STUB_INST_IDX ((long)&arch_tmpl_stub_inst - (long)&arch_tmpl_stub_entry)
> +#define ARCH_STUB_END_IDX ((long)&arch_tmpl_stub_end - (long)&arch_tmpl_stub_entry)
> +#define ARCH_STUB_SIZE ((long)&arch_tmpl_stub_end - (long)&arch_tmpl_stub_entry + 5)
You likely need RELOC_HIDEs here, otherwise the gcc optimizer might
do unexpected things again.
-AndI