Skip to content

Commit 092f623

Browse files
committed
Merge tag 'xtensa-20230110' of https://github.com/jcmvbkbc/linux-xtensa
Pull xtensa fixes from Max Filippov: - fix xtensa allmodconfig build broken by the kcsan test - drop unused members of struct thread_struct * tag 'xtensa-20230110' of https://github.com/jcmvbkbc/linux-xtensa: xtensa: drop unused members of struct thread_struct kcsan: test: don't put the expect array on the stack
2 parents 40c18f3 + 4414c1f commit 092f623

File tree

4 files changed

+6
-16
lines changed

4 files changed

+6
-16
lines changed

arch/xtensa/include/asm/processor.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,6 @@ struct thread_struct {
154154
unsigned long ra; /* kernel's a0: return address and window call size */
155155
unsigned long sp; /* kernel's a1: stack pointer */
156156

157-
/* struct xtensa_cpuinfo info; */
158-
159-
unsigned long bad_vaddr; /* last user fault */
160-
unsigned long bad_uaddr; /* last kernel fault accessing user space */
161-
unsigned long error_code;
162157
#ifdef CONFIG_HAVE_HW_BREAKPOINT
163158
struct perf_event *ptrace_bp[XCHAL_NUM_IBREAK];
164159
struct perf_event *ptrace_wp[XCHAL_NUM_DBREAK];
@@ -176,10 +171,6 @@ struct thread_struct {
176171
{ \
177172
ra: 0, \
178173
sp: sizeof(init_stack) + (long) &init_stack, \
179-
/*info: {0}, */ \
180-
bad_vaddr: 0, \
181-
bad_uaddr: 0, \
182-
error_code: 0, \
183174
}
184175

185176

arch/xtensa/kernel/traps.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,6 @@ static void do_unaligned_user(struct pt_regs *regs)
362362
__die_if_kernel("Unhandled unaligned exception in kernel",
363363
regs, SIGKILL);
364364

365-
current->thread.bad_vaddr = regs->excvaddr;
366-
current->thread.error_code = -3;
367365
pr_info_ratelimited("Unaligned memory access to %08lx in '%s' "
368366
"(pid = %d, pc = %#010lx)\n",
369367
regs->excvaddr, current->comm,

arch/xtensa/mm/fault.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,6 @@ void do_page_fault(struct pt_regs *regs)
206206
bad_area:
207207
mmap_read_unlock(mm);
208208
if (user_mode(regs)) {
209-
current->thread.bad_vaddr = address;
210-
current->thread.error_code = is_write;
211209
force_sig_fault(SIGSEGV, code, (void *) address);
212210
return;
213211
}
@@ -232,7 +230,6 @@ void do_page_fault(struct pt_regs *regs)
232230
/* Send a sigbus, regardless of whether we were in kernel
233231
* or user mode.
234232
*/
235-
current->thread.bad_vaddr = address;
236233
force_sig_fault(SIGBUS, BUS_ADRERR, (void *) address);
237234

238235
/* Kernel mode? Handle exceptions or die */
@@ -252,7 +249,6 @@ bad_page_fault(struct pt_regs *regs, unsigned long address, int sig)
252249
if ((entry = search_exception_tables(regs->pc)) != NULL) {
253250
pr_debug("%s: Exception at pc=%#010lx (%lx)\n",
254251
current->comm, regs->pc, entry->fixup);
255-
current->thread.bad_uaddr = address;
256252
regs->pc = entry->fixup;
257253
return;
258254
}

kernel/kcsan/kcsan_test.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ static bool __report_matches(const struct expect_report *r)
159159
const bool is_assert = (r->access[0].type | r->access[1].type) & KCSAN_ACCESS_ASSERT;
160160
bool ret = false;
161161
unsigned long flags;
162-
typeof(observed.lines) expect;
162+
typeof(*observed.lines) *expect;
163163
const char *end;
164164
char *cur;
165165
int i;
@@ -168,6 +168,10 @@ static bool __report_matches(const struct expect_report *r)
168168
if (!report_available())
169169
return false;
170170

171+
expect = kmalloc(sizeof(observed.lines), GFP_KERNEL);
172+
if (WARN_ON(!expect))
173+
return false;
174+
171175
/* Generate expected report contents. */
172176

173177
/* Title */
@@ -253,6 +257,7 @@ static bool __report_matches(const struct expect_report *r)
253257
strstr(observed.lines[2], expect[1])));
254258
out:
255259
spin_unlock_irqrestore(&observed.lock, flags);
260+
kfree(expect);
256261
return ret;
257262
}
258263

0 commit comments

Comments
 (0)