Skip to content

Commit 6ee1e67

Browse files
committed
ARM: kernel: Get rid of thread_info::used_cp[] array
We keep track of which coprocessor triggered a fault in the used_cp[] array in thread_info, but this data is never used anywhere. So let's remove it. Linus did some digging and found out that the last user of this field was removed in commit bb1a773 ("kill unused dump_fpu() instances"). Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
1 parent 4708fb0 commit 6ee1e67

File tree

5 files changed

+0
-11
lines changed

5 files changed

+0
-11
lines changed

arch/arm/include/asm/thread_info.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ struct thread_info {
6666
__u32 cpu_domain; /* cpu domain */
6767
struct cpu_context_save cpu_context; /* cpu context */
6868
__u32 abi_syscall; /* ABI type and syscall nr */
69-
__u8 used_cp[16]; /* thread used copro */
7069
unsigned long tp_value[2]; /* TLS registers */
7170
union fp_state fpstate __attribute__((aligned(8)));
7271
union vfp_state vfpstate;

arch/arm/kernel/asm-offsets.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ int main(void)
4747
DEFINE(TI_CPU_DOMAIN, offsetof(struct thread_info, cpu_domain));
4848
DEFINE(TI_CPU_SAVE, offsetof(struct thread_info, cpu_context));
4949
DEFINE(TI_ABI_SYSCALL, offsetof(struct thread_info, abi_syscall));
50-
DEFINE(TI_USED_CP, offsetof(struct thread_info, used_cp));
5150
DEFINE(TI_TP_VALUE, offsetof(struct thread_info, tp_value));
5251
DEFINE(TI_FPSTATE, offsetof(struct thread_info, fpstate));
5352
#ifdef CONFIG_VFP

arch/arm/kernel/entry-armv.S

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -591,19 +591,13 @@ call_fpe:
591591
and r8, r0, r5
592592
cmp r8, r7 @ NEON instruction?
593593
bne 2b
594-
mov r7, #1
595-
strb r7, [r10, #TI_USED_CP + 10] @ mark CP#10 as used
596-
strb r7, [r10, #TI_USED_CP + 11] @ mark CP#11 as used
597594
b do_vfp @ let VFP handler handle this
598595
1:
599596
#endif
600597
tst r0, #0x08000000 @ only CDP/CPRT/LDC/STC have bit 27
601598
tstne r0, #0x04000000 @ bit 26 set on both ARM and Thumb-2
602599
reteq lr
603600
and r8, r0, #0x00000f00 @ mask out CP number
604-
mov r7, #1
605-
add r6, r10, r8, lsr #8 @ add used_cp[] array offset first
606-
strb r7, [r6, #TI_USED_CP] @ set appropriate used_cp[]
607601
#ifdef CONFIG_IWMMXT
608602
@ Test if we need to give access to iWMMXt coprocessors
609603
ldr r5, [r10, #TI_FLAGS]

arch/arm/kernel/process.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,6 @@ void flush_thread(void)
222222

223223
flush_ptrace_hw_breakpoint(tsk);
224224

225-
memset(thread->used_cp, 0, sizeof(thread->used_cp));
226225
memset(&tsk->thread.debug, 0, sizeof(struct debug_info));
227226
memset(&thread->fpstate, 0, sizeof(union fp_state));
228227

arch/arm/kernel/ptrace.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -584,8 +584,6 @@ static int fpa_set(struct task_struct *target,
584584
{
585585
struct thread_info *thread = task_thread_info(target);
586586

587-
thread->used_cp[1] = thread->used_cp[2] = 1;
588-
589587
return user_regset_copyin(&pos, &count, &kbuf, &ubuf,
590588
&thread->fpstate,
591589
0, sizeof(struct user_fp));

0 commit comments

Comments
 (0)