OSDN Git Service

xtensa: drop unused members of struct thread_struct
authorMax Filippov <jcmvbkbc@gmail.com>
Sat, 7 Jan 2023 07:30:57 +0000 (23:30 -0800)
committerMax Filippov <jcmvbkbc@gmail.com>
Sat, 7 Jan 2023 07:33:11 +0000 (23:33 -0800)
bad_vaddr, bad_uaddr and error_code fields are set but never read by the
xtensa arch-specific code. Drop them. Also drop the commented out info
field.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
arch/xtensa/include/asm/processor.h
arch/xtensa/kernel/traps.c
arch/xtensa/mm/fault.c

index 228e4df..a6d09fe 100644 (file)
@@ -154,11 +154,6 @@ struct thread_struct {
        unsigned long ra; /* kernel's a0: return address and window call size */
        unsigned long sp; /* kernel's a1: stack pointer */
 
-       /* struct xtensa_cpuinfo info; */
-
-       unsigned long bad_vaddr; /* last user fault */
-       unsigned long bad_uaddr; /* last kernel fault accessing user space */
-       unsigned long error_code;
 #ifdef CONFIG_HAVE_HW_BREAKPOINT
        struct perf_event *ptrace_bp[XCHAL_NUM_IBREAK];
        struct perf_event *ptrace_wp[XCHAL_NUM_DBREAK];
@@ -176,10 +171,6 @@ struct thread_struct {
 {                                                                      \
        ra:             0,                                              \
        sp:             sizeof(init_stack) + (long) &init_stack,        \
-       /*info:         {0}, */                                         \
-       bad_vaddr:      0,                                              \
-       bad_uaddr:      0,                                              \
-       error_code:     0,                                              \
 }
 
 
index 0c25e03..cd98366 100644 (file)
@@ -362,8 +362,6 @@ static void do_unaligned_user(struct pt_regs *regs)
        __die_if_kernel("Unhandled unaligned exception in kernel",
                        regs, SIGKILL);
 
-       current->thread.bad_vaddr = regs->excvaddr;
-       current->thread.error_code = -3;
        pr_info_ratelimited("Unaligned memory access to %08lx in '%s' "
                            "(pid = %d, pc = %#010lx)\n",
                            regs->excvaddr, current->comm,
index 8c781b0..faf7cf3 100644 (file)
@@ -206,8 +206,6 @@ good_area:
 bad_area:
        mmap_read_unlock(mm);
        if (user_mode(regs)) {
-               current->thread.bad_vaddr = address;
-               current->thread.error_code = is_write;
                force_sig_fault(SIGSEGV, code, (void *) address);
                return;
        }
@@ -232,7 +230,6 @@ do_sigbus:
        /* Send a sigbus, regardless of whether we were in kernel
         * or user mode.
         */
-       current->thread.bad_vaddr = address;
        force_sig_fault(SIGBUS, BUS_ADRERR, (void *) address);
 
        /* Kernel mode? Handle exceptions or die */
@@ -252,7 +249,6 @@ bad_page_fault(struct pt_regs *regs, unsigned long address, int sig)
        if ((entry = search_exception_tables(regs->pc)) != NULL) {
                pr_debug("%s: Exception at pc=%#010lx (%lx)\n",
                         current->comm, regs->pc, entry->fixup);
-               current->thread.bad_uaddr = address;
                regs->pc = entry->fixup;
                return;
        }