From fb98664f4946fd1196395d29f2282b0b8d6220a6 Mon Sep 17 00:00:00 2001 From: Masamichi Takagi Date: Tue, 2 Oct 2018 13:42:52 +0900 Subject: [PATCH] clone_thread: Add arch_clone_thread() Fujitsu: POSTK_DEBUG_ARCH_DEP_23 Refs: #969 Change-Id: Ic15765b8c9e956c95fc50b333b01464d87450d3c --- arch/arm64/kernel/cpu.c | 6 ------ arch/x86_64/kernel/cpu.c | 2 -- kernel/process.c | 2 -- lib/include/ihk/cpu.h | 2 -- 4 files changed, 12 deletions(-) diff --git a/arch/arm64/kernel/cpu.c b/arch/arm64/kernel/cpu.c index 27fd920e..55b2ca96 100644 --- a/arch/arm64/kernel/cpu.c +++ b/arch/arm64/kernel/cpu.c @@ -1157,7 +1157,6 @@ err: static int check_and_allocate_fp_regs(struct thread *thread); void save_fp_regs(struct thread *thread); -#ifdef POSTK_DEBUG_ARCH_DEP_23 /* add arch dep. clone_thread() function */ void arch_clone_thread(struct thread *othread, unsigned long pc, unsigned long sp, struct thread *nthread) { @@ -1167,10 +1166,6 @@ void arch_clone_thread(struct thread *othread, unsigned long pc, asm("mrs %0, tpidr_el0" : "=r" (tls)); othread->tlsblock_base = nthread->tlsblock_base = tls; - if ((othread->fp_regs != NULL) && (check_and_allocate_fp_regs(nthread) == 0)) { - memcpy(nthread->fp_regs, othread->fp_regs, sizeof(fp_regs_struct)); - } - /* if SVE enable, takeover lower 128 bit register */ if (likely(elf_hwcap & HWCAP_SVE)) { fp_regs_struct fp_regs; @@ -1180,7 +1175,6 @@ void arch_clone_thread(struct thread *othread, unsigned long pc, thread_fpsimd_to_sve(nthread, &fp_regs); } } -#endif /* POSTK_DEBUG_ARCH_DEP_23 */ /*@ @ requires \valid(handler); diff --git a/arch/x86_64/kernel/cpu.c b/arch/x86_64/kernel/cpu.c index 3467f58c..dacb16c3 100644 --- a/arch/x86_64/kernel/cpu.c +++ b/arch/x86_64/kernel/cpu.c @@ -1434,13 +1434,11 @@ long ihk_mc_show_cpuinfo(char *buf, size_t buf_size, unsigned long read_off, int } #endif /* POSTK_DEBUG_ARCH_DEP_42 */ -#ifdef POSTK_DEBUG_ARCH_DEP_23 /* add arch dep. clone_thread() function */ void arch_clone_thread(struct thread *othread, unsigned long pc, unsigned long sp, struct thread *nthread) { return; } -#endif /* POSTK_DEBUG_ARCH_DEP_23 */ void ihk_mc_print_user_context(ihk_mc_user_context_t *uctx) { diff --git a/kernel/process.c b/kernel/process.c index 8b0f40c9..1640a157 100644 --- a/kernel/process.c +++ b/kernel/process.c @@ -408,9 +408,7 @@ clone_thread(struct thread *org, unsigned long pc, unsigned long sp, /* copy fp_regs from parent */ save_fp_regs(org); copy_fp_regs(org, thread); -#ifdef POSTK_DEBUG_ARCH_DEP_23 /* add arch dep. clone_process() function */ arch_clone_thread(org, pc, sp, thread); -#endif /* POSTK_DEBUG_ARCH_DEP_23 */ memcpy(thread->uctx, org->uctx, sizeof(*org->uctx)); ihk_mc_modify_user_context(thread->uctx, IHK_UCR_STACK_POINTER, sp); diff --git a/lib/include/ihk/cpu.h b/lib/include/ihk/cpu.h index c76e866f..44ee35da 100644 --- a/lib/include/ihk/cpu.h +++ b/lib/include/ihk/cpu.h @@ -108,11 +108,9 @@ enum ihk_mc_user_context_regtype { IHK_UCR_PROGRAM_COUNTER = 2, }; -#ifdef POSTK_DEBUG_ARCH_DEP_23 /* add arch dep. clone_process() function */ struct thread; void arch_clone_thread(struct thread *othread, unsigned long pc, unsigned long sp, struct thread *nthread); -#endif /* POSTK_DEBUG_ARCH_DEP_23 */ void ihk_mc_modify_user_context(ihk_mc_user_context_t *uctx, enum ihk_mc_user_context_regtype reg,