On Fri, Jul 01, 2022 at 04:48:16PM -0300, Marcos Paulo de Souza wrote: > The shadow variable type will be used in klp_shadow_alloc/get/free > functions instead of id/ctor/dtor parameters. As a result, all callers > use the same callbacks consistently[*][**]. > > The structure will be used in the next patch that will manage the > lifetime of shadow variables and execute garbage collection automatically. > > [*] From the user POV, it might have been easier to pass $id instead > of pointer to struct klp_shadow_type. > > The problem is that each livepatch registers its own struct > klp_shadow_type and defines its own @ctor/@dtor callbacks. It would > be unclear what callback should be used. They should be compatible. > > This problem is gone when each livepatch explicitly uses its > own struct klp_shadow_type pointing to its own callbacks. > > [**] test_klp_shadow_vars.c uses a custom @dtor to show that it was called. > The message must be disabled when called via klp_shadow_free_all() > because the ordering of freed variables is not well defined there. > It has to be done using another hack after switching to > klp_shadow_types. > > Signed-off-by: Marcos Paulo de Souza <mpdesouza@xxxxxxxx> > Signed-off-by: Petr Mladek <pmladek@xxxxxxxx> Invalid SOB chain, see Documentation/process/submitting-patches.rst -- Josh