Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/aarch64/aarch64 Simplified termination conditions f...
details: https://anonhg.NetBSD.org/src/rev/a6eed8cb1841
branches: trunk
changeset: 366519:a6eed8cb1841
user: ryo <ryo%NetBSD.org@localhost>
date: Sun May 29 16:13:41 2022 +0000
description:
Simplified termination conditions for ddb backtrace.
Exit backtrace when the user trapframe is invalid. (Mainly in kernel threads).
diffstat:
sys/arch/aarch64/aarch64/db_trace.c | 14 +++-----------
sys/arch/aarch64/aarch64/vm_machdep.c | 6 +++---
2 files changed, 6 insertions(+), 14 deletions(-)
diffs (71 lines):
diff -r 56db38a36c50 -r a6eed8cb1841 sys/arch/aarch64/aarch64/db_trace.c
--- a/sys/arch/aarch64/aarch64/db_trace.c Sun May 29 15:31:12 2022 +0000
+++ b/sys/arch/aarch64/aarch64/db_trace.c Sun May 29 16:13:41 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: db_trace.c,v 1.14 2021/11/27 14:11:04 riastradh Exp $ */
+/* $NetBSD: db_trace.c,v 1.15 2022/05/29 16:13:41 ryo Exp $ */
/*
* Copyright (c) 2017 Ryo Shimizu <ryo%nerv.org@localhost>
@@ -28,7 +28,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.14 2021/11/27 14:11:04 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.15 2022/05/29 16:13:41 ryo Exp $");
#include <sys/param.h>
#include <sys/proc.h>
@@ -288,7 +288,7 @@
db_read_bytes(lastfp + 8, sizeof(lr), (char *)&lr);
lr = aarch64_strip_pac(lr);
- if (!trace_user && IN_USER_VM_ADDRESS(lr))
+ if (lr == 0 || (!trace_user && IN_USER_VM_ADDRESS(lr)))
break;
#if defined(_KERNEL)
@@ -319,14 +319,6 @@
(char *)&fp);
lr = aarch64_strip_pac(lr);
- /*
- * no need to display the frame of el0_trap
- * of kernel thread
- */
- if (((char *)(lastlr - 4) == (char *)el0_trap) &&
- (lr == 0))
- break;
-
pr_traceaddr("tf", (db_addr_t)tf, lastlr - 4, flags, pr);
if (lr == 0)
diff -r 56db38a36c50 -r a6eed8cb1841 sys/arch/aarch64/aarch64/vm_machdep.c
--- a/sys/arch/aarch64/aarch64/vm_machdep.c Sun May 29 15:31:12 2022 +0000
+++ b/sys/arch/aarch64/aarch64/vm_machdep.c Sun May 29 16:13:41 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vm_machdep.c,v 1.12 2021/08/30 22:54:40 jmcneill Exp $ */
+/* $NetBSD: vm_machdep.c,v 1.13 2022/05/29 16:13:41 ryo Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
#include "opt_ddb.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.12 2021/08/30 22:54:40 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.13 2022/05/29 16:13:41 ryo Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -162,9 +162,9 @@
struct trapframe * const ktf = utf - 1;
ktf->tf_reg[27] = (uint64_t)func;
ktf->tf_reg[28] = (uint64_t)arg;
- ktf->tf_reg[29] = 0;
ktf->tf_lr = (uintptr_t)lwp_trampoline;
#ifdef DDB
+ ktf->tf_reg[29] = (uint64_t)utf;
ktf->tf_pc = (uint64_t)&&backtrace_here;
ktf->tf_sp = 0; /* mark as switchframe */
backtrace_here:
Home |
Main Index |
Thread Index |
Old Index