[CRIU] [PATCH 09/23] cr-dump.c: introduced the macro CORE_THREAD_INFO to access the machine-specific part of CoreEntry

Pavel Emelyanov xemul at parallels.com
Mon Jan 14 05:01:53 EST 2013


On 01/14/2013 11:25 AM, Alexander Kartashov wrote:
> 
> Signed-off-by: Alexander Kartashov <alekskartashov at parallels.com>
> ---
>  arch/x86/include/asm/types.h |    2 ++
>  parasite-syscall.c           |    2 +-
>  2 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/x86/include/asm/types.h b/arch/x86/include/asm/types.h
> index a75902e..5f605b1 100644
> --- a/arch/x86/include/asm/types.h
> +++ b/arch/x86/include/asm/types.h
> @@ -270,4 +270,6 @@ typedef struct {
>  
>  #define CORE_ENTRY__MARCH CORE_ENTRY__MARCH__X86_64
>  
> +#define CORE_THREAD_INFO(core) core->thread_info

Per-arch thread info data is used in arch-independent code for the
single reason -- put the clear_tid_address in the proper place. The
whole idea of putting it in arch-dependent part of core was mistake.
Let's define the per-arch "clear_tid_address" place in the image,
not the whole arch-thread-info thing.

> +
>  #endif /* __CR_ASM_TYPES_H__ */
> diff --git a/parasite-syscall.c b/parasite-syscall.c
> index d35bed8..ac029c9 100644
> --- a/parasite-syscall.c
> +++ b/parasite-syscall.c
> @@ -376,7 +376,7 @@ int parasite_dump_thread_seized(struct parasite_ctl *ctl, struct pid *tid,
>  	ret = parasite_execute_by_pid(PARASITE_CMD_DUMP_THREAD, ctl, tid->real);
>  
>  	memcpy(&core->thread_core->blk_sigset, &args->blocked, sizeof(args->blocked));
> -	core->thread_info->clear_tid_addr = (u64)args->tid_addr;
> +	CORE_THREAD_INFO(core)->clear_tid_addr = (u64)args->tid_addr;
>  	tid->virt = args->tid;
>  	core_put_tls(core, args->tls);
>  
> 




More information about the CRIU mailing list