[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v2 1/3] livepach: Add .livepatch.hooks functions and test-case
> >> > @@ -70,7 +71,11 @@ struct payload { > >> > unsigned int nsyms; /* Nr of entries in .strtab > >> > and > >> > symbols. */ > >> > struct livepatch_build_id id; /* > >> > ELFNOTE_DESC(.note.gnu.build-id) of the payload. */ > >> > struct livepatch_build_id dep; /* > >> > ELFNOTE_DESC(.livepatch.depends). */ > >> > - char name[XEN_LIVEPATCH_NAME_SIZE]; /* Name of it. */ > >> > + livepatch_loadcall_t **load_funcs; /* The array of funcs to call > >> > after */ > >> > + livepatch_unloadcall_t **unload_funcs;/* load and unload of the > >> > payload. */ > >> > >> These both seem like they want a const in the middle. > > > > I did that initially and found out that the calling ->load_funcs[i] resulted > > in _no_ code being called. > > > > I did not dig in the assembler output to figure out what happend, let me > > do that now. > > Indeed - I can't see how a const modifier here could alter whether > or not the pointed to function gets called. I did a diff on the pre-assemble part (-S) with and without const on the above structs. With 'const' we get: call spin_debug_disable .LVL163: - .loc 1 1093 0 - cmpl $0, 324(%rbx) - je .L112 - movl $0, %r12d -.LVL164: -.L113: - .loc 1 1094 0 - mov %r12d, %edx - movq 312(%rbx), %rax - call *(%rax,%rdx,8) - .loc 1 1093 0 - addl $1, %r12d -.LVL165: - cmpl %r12d, 324(%rbx) - ja .L113 -.LVL166: -.L112: being removed. I thought it may have to do with the function not returning anything. But even after making the typedef return it still omitted the call data->load_funcs[i](); _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |