CVS commit: src/tests/net/route
Module Name:src Committed By: knakahara Date: Tue Sep 20 02:25:07 UTC 2022 Modified Files: src/tests/net/route: t_route.sh Log Message: tests: add tests for automatic route deletions on an address removal To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/tests/net/route/t_route.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/net/route/t_route.sh diff -u src/tests/net/route/t_route.sh:1.14 src/tests/net/route/t_route.sh:1.15 --- src/tests/net/route/t_route.sh:1.14 Mon Dec 18 04:11:46 2017 +++ src/tests/net/route/t_route.sh Tue Sep 20 02:25:07 2022 @@ -1,4 +1,4 @@ -# $NetBSD: t_route.sh,v 1.14 2017/12/18 04:11:46 ozaki-r Exp $ +# $NetBSD: t_route.sh,v 1.15 2022/09/20 02:25:07 knakahara Exp $ # # Copyright (c) 2016 Internet Initiative Japan Inc. # All rights reserved. @@ -539,6 +539,156 @@ route_command_add6_cleanup() cleanup } +test_route_address_removal() +{ + + rump_server_start $SOCKHOST netinet6 + + export RUMP_SERVER=${SOCKHOST} + rump_server_add_iface $SOCKHOST shmif0 $BUS + + # + # 1. test auto removal of a route that depends a removing address + # + atf_check -s exit:0 rump.ifconfig shmif0 $af $addr1/$prefix + atf_check -s exit:0 -o match:"add net $alt_net(/$prefix)?: gateway $addrgw" \ + rump.route -n add -$af -net $alt_net/$prefix $addrgw + $DEBUG && rump.netstat -nr -f $af + atf_check -s exit:0 rump.ifconfig shmif0 $af $addr1 delete + $DEBUG && rump.netstat -nr -f $af + + # The route should be deleted on the address removal + atf_check -s not-exit:0 -e match:"writing to routing socket: not in table" \ + rump.route -n get -$af $alt_addr + + # + # 2. test auto update of a route that depends a removing address where + #there is another address with the same prefix sharing a connected + #route + # + atf_check -s exit:0 rump.ifconfig shmif0 $af $addr1/$prefix + atf_check -s exit:0 rump.ifconfig shmif0 $af $addr2/$prefix alias + atf_check -s exit:0 -o match:"add net $alt_net(/$prefix)?: gateway $addrgw" \ + rump.route -n add -$af -net $alt_net/$prefix $addrgw + $DEBUG && rump.netstat -nr -f $af + + atf_check -s exit:0 -o match:"local addr: $addr1" \ + rump.route -n get -$af $addrgw + atf_check -s exit:0 -o match:"local addr: $addr1" \ + rump.route -n get -$af $alt_addr + + atf_check -s exit:0 rump.ifconfig shmif0 $af $addr1 delete + $DEBUG && rump.netstat -nr -f $af + + # local addr (rt_ifa) of the connected route should be changed + # on the address removal + atf_check -s exit:0 -o match:"local addr: $addr2" \ + rump.route -n get -$af $addrgw + # local addr (rt_ifa) of the related route should be changed + # on the address removal too + atf_check -s exit:0 -o match:"local addr: $addr2" \ + rump.route -n get -$af $alt_addr + + # cleanup + atf_check -s exit:0 rump.ifconfig shmif0 $af $addr2 delete + + # + # 3. test auto update of a route that depends a removing address where + #there is another address with a different (short) prefix + # + atf_check -s exit:0 rump.ifconfig shmif0 $af $addr1/$prefix + atf_check -s exit:0 rump.ifconfig shmif0 $af $addr2/$prefix_short alias + atf_check -s exit:0 -o match:"add net $alt_net(/$prefix)?: gateway $addrgw" \ + rump.route -n add -$af -net $alt_net/$prefix $addrgw + $DEBUG && rump.netstat -nr -f $af + + atf_check -s exit:0 -o match:"local addr: $addr1" \ + rump.route -n get -$af $addrgw + atf_check -s exit:0 -o match:"local addr: $addr1" \ + rump.route -n get -$af $alt_addr + + atf_check -s exit:0 rump.ifconfig shmif0 $af $addr1 delete + $DEBUG && rump.netstat -nr -f $af + + # local addr (rt_ifa) of the connected route should be changed + # on the address removal + atf_check -s exit:0 -o match:"local addr: $addr2" \ + rump.route -n get -$af $addrgw + if [ $af = inet ]; then + # local addr (rt_ifa) of the related route should be changed + # on the address removal too + atf_check -s exit:0 -o match:"local addr: $addr2" \ + rump.route -n get -$af $alt_addr + else + # For IPv6, each address has its own connected route so the + # address removal just results in a removal of the related route + atf_check -s not-exit:0 \ + -e match:"writing to routing socket: not in table" \ + rump.route -n get -$af $alt_addr + fi + + rump_server_destroy_ifaces +} + +atf_test_case route_address_removal cleanup +route_address_removal_head() +{ + + atf_set "descr" "tests of auto removal/update of routes on address removal (IPv4)" + atf_set "require.progs" "rump_server" +} + +route_address_removal_body() +{ + local addr1=10.0.0.1 + local addr2=10.0.0.2 + local addrgw=10.0.0.3 + local prefix=24 + local prefix_short=16 + local alt_net=10.0.1.0 + local alt_addr=10.0.1.1 + local af=inet + + test_route_address_removal +} + +route_address_removal_cleanup() +{ + + $DEBUG && dump + cleanup +} + +atf_test_case route_address_removal6 cleanup +route_address_removal6_head()
CVS commit: src/tests/net/route
Module Name:src Committed By: knakahara Date: Tue Sep 20 02:25:07 UTC 2022 Modified Files: src/tests/net/route: t_route.sh Log Message: tests: add tests for automatic route deletions on an address removal To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/tests/net/route/t_route.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/sys
Module Name:src Committed By: knakahara Date: Tue Sep 20 02:24:18 UTC 2022 Modified Files: src/sys/sys: param.h Log Message: Welcome to 9.99.100 - changed the prototype of rt_replace_ifa_matched_entries() See also the follwoing thread https://mail-index.netbsd.org/tech-kern/2022/09/15/msg028385.html Advised by kre@n.o, pgoyette@n.o, gutteridge@n.o and dholland@n.o, thanks. To generate a diff of this commit: cvs rdiff -u -r1.712 -r1.713 src/sys/sys/param.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/sys
Module Name:src Committed By: knakahara Date: Tue Sep 20 02:24:18 UTC 2022 Modified Files: src/sys/sys: param.h Log Message: Welcome to 9.99.100 - changed the prototype of rt_replace_ifa_matched_entries() See also the follwoing thread https://mail-index.netbsd.org/tech-kern/2022/09/15/msg028385.html Advised by kre@n.o, pgoyette@n.o, gutteridge@n.o and dholland@n.o, thanks. To generate a diff of this commit: cvs rdiff -u -r1.712 -r1.713 src/sys/sys/param.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/sys/param.h diff -u src/sys/sys/param.h:1.712 src/sys/sys/param.h:1.713 --- src/sys/sys/param.h:1.712 Mon Jul 18 04:30:30 2022 +++ src/sys/sys/param.h Tue Sep 20 02:24:18 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: param.h,v 1.712 2022/07/18 04:30:30 thorpej Exp $ */ +/* $NetBSD: param.h,v 1.713 2022/09/20 02:24:18 knakahara Exp $ */ /*- * Copyright (c) 1982, 1986, 1989, 1993 @@ -55,7 +55,7 @@ * * M = major version * m = minor version; a minor number of 99 indicates current. - * r = 0 (*) + * r = 0 (*) or patchlevel in 9.99 * p = patchlevel * * When new releases are made, src/gnu/usr.bin/groff/tmac/mdoc.local @@ -67,7 +67,7 @@ * 2.99.9 (299000900) */ -#define __NetBSD_Version__ 999009900 /* NetBSD 9.99.99 */ +#define __NetBSD_Version__ 99901 /* NetBSD 9.99.100 */ #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \ (m) * 100) + (p) * 100) <= __NetBSD_Version__)
CVS commit: src/sys
Module Name:src Committed By: knakahara Date: Tue Sep 20 02:23:38 UTC 2022 Modified Files: src/sys/net: if.c route.c route.h src/sys/netinet: in.c src/sys/netinet6: in6.c src/sys/nfs: nfs_boot.c Log Message: Remove routes on an address removal if the routes referencing to the address. Implemented by ozaki-r@n.o. A route that has a gateway is on a connected route can be invalid if the connected route is deleted, i.e., an associated address is removed. Traditionally NetBSD doesn't sweep such a route on the address removal. Sending packets over the route fails with "No route to host". Also the route holds an orphan ifaddr as rt_ifa that is destructed say by in_purgeaddr. If the same address is assgined again in such a state, there can be two different ifaddr objects with the same address. Until recently it's not a big problem because we can send packets anyway. However after MP-ification of the network stack, we can't send packets because we strictly check if rt_ifa (i.e., the (old) ifaddr) is valid. This change automatically removes such routes on a removal of an associated address to avoid keeping inconsistent routes. To generate a diff of this commit: cvs rdiff -u -r1.525 -r1.526 src/sys/net/if.c cvs rdiff -u -r1.233 -r1.234 src/sys/net/route.c cvs rdiff -u -r1.131 -r1.132 src/sys/net/route.h cvs rdiff -u -r1.242 -r1.243 src/sys/netinet/in.c cvs rdiff -u -r1.285 -r1.286 src/sys/netinet6/in6.c cvs rdiff -u -r1.88 -r1.89 src/sys/nfs/nfs_boot.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/net/if.c diff -u src/sys/net/if.c:1.525 src/sys/net/if.c:1.526 --- src/sys/net/if.c:1.525 Sat Sep 3 02:53:18 2022 +++ src/sys/net/if.c Tue Sep 20 02:23:37 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: if.c,v 1.525 2022/09/03 02:53:18 thorpej Exp $ */ +/* $NetBSD: if.c,v 1.526 2022/09/20 02:23:37 knakahara Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc. @@ -90,7 +90,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.525 2022/09/03 02:53:18 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.526 2022/09/20 02:23:37 knakahara Exp $"); #if defined(_KERNEL_OPT) #include "opt_inet.h" @@ -1479,7 +1479,7 @@ restart: /* Delete stray routes from the routing table. */ for (i = 0; i <= AF_MAX; i++) - rt_delete_matched_entries(i, if_delroute_matcher, ifp); + rt_delete_matched_entries(i, if_delroute_matcher, ifp, false); DOMAIN_FOREACH(dp) { if (dp->dom_ifdetach != NULL && ifp->if_afdata[dp->dom_family]) Index: src/sys/net/route.c diff -u src/sys/net/route.c:1.233 src/sys/net/route.c:1.234 --- src/sys/net/route.c:1.233 Mon Aug 29 23:48:18 2022 +++ src/sys/net/route.c Tue Sep 20 02:23:37 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: route.c,v 1.233 2022/08/29 23:48:18 knakahara Exp $ */ +/* $NetBSD: route.c,v 1.234 2022/09/20 02:23:37 knakahara Exp $ */ /*- * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc. @@ -97,7 +97,7 @@ #endif #include -__KERNEL_RCSID(0, "$NetBSD: route.c,v 1.233 2022/08/29 23:48:18 knakahara Exp $"); +__KERNEL_RCSID(0, "$NetBSD: route.c,v 1.234 2022/09/20 02:23:37 knakahara Exp $"); #include #ifdef RTFLUSH_DEBUG @@ -2291,7 +2291,7 @@ rt_check_reject_route(const struct rtent void rt_delete_matched_entries(sa_family_t family, int (*f)(struct rtentry *, void *), -void *v) +void *v, bool notify) { for (;;) { @@ -2308,6 +2308,7 @@ rt_delete_matched_entries(sa_family_t fa return; } rt_ref(rt); + RT_REFCNT_TRACE(rt); splx(s); RT_UNLOCK(); @@ -2316,12 +2317,16 @@ rt_delete_matched_entries(sa_family_t fa if (error == 0) { KASSERT(retrt == rt); KASSERT((retrt->rt_flags & RTF_UP) == 0); + if (notify) +rt_newmsg(RTM_DELETE, retrt); retrt->rt_ifp = NULL; rt_unref(rt); + RT_REFCNT_TRACE(rt); rt_free(retrt); } else if (error == ESRCH) { /* Someone deleted the entry already. */ rt_unref(rt); + RT_REFCNT_TRACE(rt); } else { log(LOG_ERR, "%s: unable to delete rtentry @ %p, " "error = %d\n", rt->rt_ifp->if_xname, rt, error); @@ -2338,6 +2343,53 @@ rt_walktree_locked(sa_family_t family, i return rtbl_walktree(family, f, v); } +void +rt_replace_ifa_matched_entries(sa_family_t family, +int (*f)(struct rtentry *, void *), void *v, struct ifaddr *ifa) +{ + + for (;;) { + int s; +#ifdef NET_MPSAFE + int error; +#endif + struct rtentry *rt; + + RT_RLOCK(); + s = splsoftnet(); + rt = rtbl_search_matched_entry(family, f, v); + if (rt == NULL) { + splx(s); + RT_UNLOCK(); + return; + } + rt_ref(rt); + RT_REFCNT_TRACE(rt); + splx(s); + RT_UNLOCK(); + +#ifdef NET_MPSAFE + error = rt_update_prepare(rt); + if (error == 0) { + rt_replace_ifa(rt, ifa); + rt_update_finish(rt); + rt_newmsg(RTM_CHANGE, rt); + } else { + /* + * If error != 0, the rtentry is being + * destroyed, so doing nothing
CVS commit: src/sys
Module Name:src Committed By: knakahara Date: Tue Sep 20 02:23:38 UTC 2022 Modified Files: src/sys/net: if.c route.c route.h src/sys/netinet: in.c src/sys/netinet6: in6.c src/sys/nfs: nfs_boot.c Log Message: Remove routes on an address removal if the routes referencing to the address. Implemented by ozaki-r@n.o. A route that has a gateway is on a connected route can be invalid if the connected route is deleted, i.e., an associated address is removed. Traditionally NetBSD doesn't sweep such a route on the address removal. Sending packets over the route fails with "No route to host". Also the route holds an orphan ifaddr as rt_ifa that is destructed say by in_purgeaddr. If the same address is assgined again in such a state, there can be two different ifaddr objects with the same address. Until recently it's not a big problem because we can send packets anyway. However after MP-ification of the network stack, we can't send packets because we strictly check if rt_ifa (i.e., the (old) ifaddr) is valid. This change automatically removes such routes on a removal of an associated address to avoid keeping inconsistent routes. To generate a diff of this commit: cvs rdiff -u -r1.525 -r1.526 src/sys/net/if.c cvs rdiff -u -r1.233 -r1.234 src/sys/net/route.c cvs rdiff -u -r1.131 -r1.132 src/sys/net/route.h cvs rdiff -u -r1.242 -r1.243 src/sys/netinet/in.c cvs rdiff -u -r1.285 -r1.286 src/sys/netinet6/in6.c cvs rdiff -u -r1.88 -r1.89 src/sys/nfs/nfs_boot.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/external/cddl/osnet/sys/sys
Module Name:src Committed By: mlelstv Date: Mon Sep 19 22:30:19 UTC 2022 Modified Files: src/external/cddl/osnet/sys/sys: time.h Log Message: Reference kernel-wide hz constant instead of using a private but possibly different value. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/external/cddl/osnet/sys/sys/time.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/sys/sys/time.h diff -u src/external/cddl/osnet/sys/sys/time.h:1.13 src/external/cddl/osnet/sys/sys/time.h:1.14 --- src/external/cddl/osnet/sys/sys/time.h:1.13 Sun Aug 29 08:43:12 2021 +++ src/external/cddl/osnet/sys/sys/time.h Mon Sep 19 22:30:19 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: time.h,v 1.13 2021/08/29 08:43:12 christos Exp $ */ +/* $NetBSD: time.h,v 1.14 2022/09/19 22:30:19 mlelstv Exp $ */ /*- * Copyright (c) 2007 Pawel Jakub Dawidek @@ -82,7 +82,7 @@ static inline int64_t ddi_get_lbolt64(void) { struct timespec ts; - const int hz = 100; + extern int hz; getnanouptime(); return (int64_t)(SEC_TO_TICK(ts.tv_sec) + NSEC_TO_TICK(ts.tv_nsec));
CVS commit: src/external/cddl/osnet/sys/sys
Module Name:src Committed By: mlelstv Date: Mon Sep 19 22:30:19 UTC 2022 Modified Files: src/external/cddl/osnet/sys/sys: time.h Log Message: Reference kernel-wide hz constant instead of using a private but possibly different value. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/external/cddl/osnet/sys/sys/time.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/calendar
Module Name:src Committed By: christos Date: Mon Sep 19 18:48:30 UTC 2022 Modified Files: src/usr.bin/calendar: calendar.c pathnames.h Log Message: use tradcpp To generate a diff of this commit: cvs rdiff -u -r1.53 -r1.54 src/usr.bin/calendar/calendar.c cvs rdiff -u -r1.6 -r1.7 src/usr.bin/calendar/pathnames.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/calendar/calendar.c diff -u src/usr.bin/calendar/calendar.c:1.53 src/usr.bin/calendar/calendar.c:1.54 --- src/usr.bin/calendar/calendar.c:1.53 Thu Jun 2 22:06:40 2016 +++ src/usr.bin/calendar/calendar.c Mon Sep 19 14:48:30 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: calendar.c,v 1.53 2016/06/03 02:06:40 agc Exp $ */ +/* $NetBSD: calendar.c,v 1.54 2022/09/19 18:48:30 christos Exp $ */ /* * Copyright (c) 1989, 1993, 1994 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 19 #if 0 static char sccsid[] = "@(#)calendar.c 8.4 (Berkeley) 1/7/95"; #endif -__RCSID("$NetBSD: calendar.c,v 1.53 2016/06/03 02:06:40 agc Exp $"); +__RCSID("$NetBSD: calendar.c,v 1.54 2022/09/19 18:48:30 christos Exp $"); #endif /* not lint */ #include @@ -459,7 +459,7 @@ opencal(FILE **in) err(EXIT_FAILURE, "Cannot restrict cpp"); cpp_restricted = true; - (void)execl(_PATH_CPP, "cpp", "-traditional", "-P", "-I.", + (void)execl(_PATH_CPP, "tradcpp", "-nostdinc", "-I.", "-I" _PATH_CALENDARS, NULL); err(EXIT_FAILURE, "Cannot exec `%s'", _PATH_CPP); /*NOTREACHED*/ Index: src/usr.bin/calendar/pathnames.h diff -u src/usr.bin/calendar/pathnames.h:1.6 src/usr.bin/calendar/pathnames.h:1.7 --- src/usr.bin/calendar/pathnames.h:1.6 Tue Dec 7 11:47:32 2004 +++ src/usr.bin/calendar/pathnames.h Mon Sep 19 14:48:30 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: pathnames.h,v 1.6 2004/12/07 16:47:32 jwise Exp $ */ +/* $NetBSD: pathnames.h,v 1.7 2022/09/19 18:48:30 christos Exp $ */ /* * Copyright (c) 1989, 1993 @@ -33,6 +33,6 @@ #include -#define _PATH_CPP "/usr/bin/cpp" +#define _PATH_CPP "/usr/bin/tradcpp" #define _PATH_CALENDARS "/usr/share/calendar" #define _PATH_SYSTEM_CALENDAR "/etc/calendar"
CVS commit: src/usr.bin/calendar
Module Name:src Committed By: christos Date: Mon Sep 19 18:48:30 UTC 2022 Modified Files: src/usr.bin/calendar: calendar.c pathnames.h Log Message: use tradcpp To generate a diff of this commit: cvs rdiff -u -r1.53 -r1.54 src/usr.bin/calendar/calendar.c cvs rdiff -u -r1.6 -r1.7 src/usr.bin/calendar/pathnames.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/external/mit/xorg/bin/xrdb
Module Name:src Committed By: christos Date: Mon Sep 19 18:46:06 UTC 2022 Modified Files: src/external/mit/xorg/bin/xrdb: Makefile Log Message: use tradcpp. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/external/mit/xorg/bin/xrdb/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/mit/xorg/bin/xrdb/Makefile diff -u src/external/mit/xorg/bin/xrdb/Makefile:1.8 src/external/mit/xorg/bin/xrdb/Makefile:1.9 --- src/external/mit/xorg/bin/xrdb/Makefile:1.8 Sat Apr 16 16:52:07 2016 +++ src/external/mit/xorg/bin/xrdb/Makefile Mon Sep 19 14:46:06 2022 @@ -1,10 +1,10 @@ -# $NetBSD: Makefile,v 1.8 2016/04/16 20:52:07 nakayama Exp $ +# $NetBSD: Makefile,v 1.9 2022/09/19 18:46:06 christos Exp $ .include PROG= xrdb -CPPFLAGS+=-DCPP="\"/usr/bin/cpp -traditional\"" -DHAVE_MKSTEMP # XXX +CPPFLAGS+=-DCPP="\"/usr/bin/tradcpp -nostdinc\"" -DHAVE_MKSTEMP # XXX CPPFLAGS+=-DHAVE_ASPRINTF LDADD+= -lXmuu -lXt -lSM -lICE -lXext -lX11
CVS commit: src/external/mit/xorg/bin/xrdb
Module Name:src Committed By: christos Date: Mon Sep 19 18:46:06 UTC 2022 Modified Files: src/external/mit/xorg/bin/xrdb: Makefile Log Message: use tradcpp. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/external/mit/xorg/bin/xrdb/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/aarch64/aarch64
Module Name:src Committed By: ryo Date: Mon Sep 19 17:24:23 UTC 2022 Modified Files: src/sys/arch/aarch64/aarch64: db_trace.c Log Message: Fixed stack analyzing backtrace (bt/s) correctly for nested trapframes. To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/sys/arch/aarch64/aarch64/db_trace.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/aarch64/aarch64/db_trace.c diff -u src/sys/arch/aarch64/aarch64/db_trace.c:1.19 src/sys/arch/aarch64/aarch64/db_trace.c:1.20 --- src/sys/arch/aarch64/aarch64/db_trace.c:1.19 Tue Jun 7 23:55:25 2022 +++ src/sys/arch/aarch64/aarch64/db_trace.c Mon Sep 19 17:24:23 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: db_trace.c,v 1.19 2022/06/07 23:55:25 ryo Exp $ */ +/* $NetBSD: db_trace.c,v 1.20 2022/09/19 17:24:23 ryo Exp $ */ /* * Copyright (c) 2017 Ryo Shimizu @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.19 2022/06/07 23:55:25 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.20 2022/09/19 17:24:23 ryo Exp $"); #include #include @@ -544,8 +544,8 @@ db_sp_trace(struct trapframe *tf, db_add pc = aarch64_strip_pac(tf_buf.tf_lr); if (pc == 0) break; - - pr_traceaddr("sp", sp, pc, flags, pr); + lr0 = aarch64_strip_pac(tf_buf.tf_lr); + allow_leaf_function = true; } else { db_sym_t sym;
CVS commit: src/sys/arch/aarch64/aarch64
Module Name:src Committed By: ryo Date: Mon Sep 19 17:24:23 UTC 2022 Modified Files: src/sys/arch/aarch64/aarch64: db_trace.c Log Message: Fixed stack analyzing backtrace (bt/s) correctly for nested trapframes. To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/sys/arch/aarch64/aarch64/db_trace.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/aarch64/aarch64
Module Name:src Committed By: ryo Date: Mon Sep 19 17:23:14 UTC 2022 Modified Files: src/sys/arch/aarch64/aarch64: cpuswitch.S db_interface.c Log Message: Move cpu_Debugger() into a more suitable file, from cpuswitch.S to db_interface.c. To generate a diff of this commit: cvs rdiff -u -r1.38 -r1.39 src/sys/arch/aarch64/aarch64/cpuswitch.S cvs rdiff -u -r1.18 -r1.19 src/sys/arch/aarch64/aarch64/db_interface.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/aarch64/aarch64/cpuswitch.S diff -u src/sys/arch/aarch64/aarch64/cpuswitch.S:1.38 src/sys/arch/aarch64/aarch64/cpuswitch.S:1.39 --- src/sys/arch/aarch64/aarch64/cpuswitch.S:1.38 Tue Jun 7 08:08:31 2022 +++ src/sys/arch/aarch64/aarch64/cpuswitch.S Mon Sep 19 17:23:14 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: cpuswitch.S,v 1.38 2022/06/07 08:08:31 ryo Exp $ */ +/* $NetBSD: cpuswitch.S,v 1.39 2022/09/19 17:23:14 ryo Exp $ */ /*- * Copyright (c) 2014, 2020 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ #include "opt_ddb.h" #include "opt_kasan.h" -RCSID("$NetBSD: cpuswitch.S,v 1.38 2022/06/07 08:08:31 ryo Exp $") +RCSID("$NetBSD: cpuswitch.S,v 1.39 2022/09/19 17:23:14 ryo Exp $") ARMV8_DEFINE_OPTIONS @@ -334,16 +334,6 @@ ENTRY_NP(lwp_trampoline) END(lwp_trampoline) -#ifdef DDB -ENTRY_NP(cpu_Debugger) - stp fp, lr, [sp, #-16]! - mov fp, sp - brk #0x - ldp fp, lr, [sp], #16 - ret -END(cpu_Debugger) -#endif /* DDB */ - /* * int cpu_set_onfault(struct faultbuf *fb) */ Index: src/sys/arch/aarch64/aarch64/db_interface.c diff -u src/sys/arch/aarch64/aarch64/db_interface.c:1.18 src/sys/arch/aarch64/aarch64/db_interface.c:1.19 --- src/sys/arch/aarch64/aarch64/db_interface.c:1.18 Sun May 29 16:39:22 2022 +++ src/sys/arch/aarch64/aarch64/db_interface.c Mon Sep 19 17:23:14 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: db_interface.c,v 1.18 2022/05/29 16:39:22 ryo Exp $ */ +/* $NetBSD: db_interface.c,v 1.19 2022/09/19 17:23:14 ryo Exp $ */ /* * Copyright (c) 2017 Ryo Shimizu @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.18 2022/05/29 16:39:22 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.19 2022/09/19 17:23:14 ryo Exp $"); #include #include @@ -639,3 +639,9 @@ db_ttbrdump(bool countmode, vaddr_t va, db_dump_l0table(countmode, pmap_l0table(pm), (pm == pmap_kernel()) ? 0xUL : 0, pr); } + +void +cpu_Debugger(void) +{ + __asm __volatile ("brk #0x"); +}
CVS commit: src/sys/arch/aarch64/aarch64
Module Name:src Committed By: ryo Date: Mon Sep 19 17:23:14 UTC 2022 Modified Files: src/sys/arch/aarch64/aarch64: cpuswitch.S db_interface.c Log Message: Move cpu_Debugger() into a more suitable file, from cpuswitch.S to db_interface.c. To generate a diff of this commit: cvs rdiff -u -r1.38 -r1.39 src/sys/arch/aarch64/aarch64/cpuswitch.S cvs rdiff -u -r1.18 -r1.19 src/sys/arch/aarch64/aarch64/db_interface.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/arm/sunxi
Module Name:src Committed By: bouyer Date: Mon Sep 19 11:21:36 UTC 2022 Modified Files: src/sys/arch/arm/sunxi: sunxi_can.c Log Message: Don't process RX if SUNXI_CAN_INT_DATA_OR is pending. Seems to fix occasional RX stalls To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/sunxi/sunxi_can.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/sunxi/sunxi_can.c diff -u src/sys/arch/arm/sunxi/sunxi_can.c:1.9 src/sys/arch/arm/sunxi/sunxi_can.c:1.10 --- src/sys/arch/arm/sunxi/sunxi_can.c:1.9 Sun Sep 18 15:28:01 2022 +++ src/sys/arch/arm/sunxi/sunxi_can.c Mon Sep 19 11:21:36 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_can.c,v 1.9 2022/09/18 15:28:01 thorpej Exp $ */ +/* $NetBSD: sunxi_can.c,v 1.10 2022/09/19 11:21:36 bouyer Exp $ */ /*- * Copyright (c) 2017,2018 The NetBSD Foundation, Inc. @@ -36,7 +36,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: sunxi_can.c,v 1.9 2022/09/18 15:28:01 thorpej Exp $"); +__KERNEL_RCSID(1, "$NetBSD: sunxi_can.c,v 1.10 2022/09/19 11:21:36 bouyer Exp $"); #include #include @@ -387,7 +387,8 @@ sunxi_can_intr(void *arg) if (irq & SUNXI_CAN_INT_TX_FLAG) { sunxi_can_tx_intr(sc); } - if (irq & SUNXI_CAN_INT_RX_FLAG) { + if ((irq & (SUNXI_CAN_INT_RX_FLAG | SUNXI_CAN_INT_DATA_OR)) == + SUNXI_CAN_INT_RX_FLAG) { while (sts & SUNXI_CAN_STA_RX_RDY) { sunxi_can_rx_intr(sc); sts = sunxi_can_read(sc, SUNXI_CAN_STA_REG);
CVS commit: src/sys/arch/arm/sunxi
Module Name:src Committed By: bouyer Date: Mon Sep 19 11:21:36 UTC 2022 Modified Files: src/sys/arch/arm/sunxi: sunxi_can.c Log Message: Don't process RX if SUNXI_CAN_INT_DATA_OR is pending. Seems to fix occasional RX stalls To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/sunxi/sunxi_can.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/riscv/conf
Module Name:src Committed By: skrll Date: Mon Sep 19 09:15:01 UTC 2022 Modified Files: src/sys/arch/riscv/conf: files.riscv Log Message: Sort. NFC. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/arch/riscv/conf/files.riscv Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/riscv/conf
Module Name:src Committed By: skrll Date: Mon Sep 19 09:15:01 UTC 2022 Modified Files: src/sys/arch/riscv/conf: files.riscv Log Message: Sort. NFC. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/arch/riscv/conf/files.riscv Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/riscv/conf/files.riscv diff -u src/sys/arch/riscv/conf/files.riscv:1.8 src/sys/arch/riscv/conf/files.riscv:1.9 --- src/sys/arch/riscv/conf/files.riscv:1.8 Sun Sep 11 15:31:11 2022 +++ src/sys/arch/riscv/conf/files.riscv Mon Sep 19 09:15:01 2022 @@ -1,4 +1,4 @@ -# $NetBSD: files.riscv,v 1.8 2022/09/11 15:31:11 skrll Exp $ +# $NetBSD: files.riscv,v 1.9 2022/09/19 09:15:01 skrll Exp $ # maxpartitions 16 @@ -14,27 +14,20 @@ defflag opt_ddb.h DDB_TRACE file arch/riscv/fdt/fdt_dma_machdep.c -file arch/riscv/riscv/spl.S - +file arch/riscv/riscv/autoconf.c file arch/riscv/riscv/bus_space.c file arch/riscv/riscv/bus_space_generic.S file arch/riscv/riscv/bus_space_notimpl.S - -file arch/riscv/riscv/autoconf.c +file arch/riscv/riscv/clock_machdep.c +file arch/riscv/riscv/core_machdep.c coredump file arch/riscv/riscv/cpu_subr.c file arch/riscv/riscv/db_disasm.c ddb +file arch/riscv/riscv/db_machdep.c ddb | kgdb file arch/riscv/riscv/db_trace.c ddb +file arch/riscv/riscv/exec_machdep.c file arch/riscv/riscv/fixup.c file arch/riscv/riscv/fpu.c fpe file arch/riscv/riscv/ipifuncs.c multiprocessor -file arch/riscv/riscv/stubs.c -file arch/riscv/riscv/syscall.c # syscall handler -file arch/riscv/riscv/trap.c # trap handlers - -file arch/riscv/riscv/core_machdep.c coredump -file arch/riscv/riscv/clock_machdep.c -file arch/riscv/riscv/db_machdep.c ddb | kgdb -file arch/riscv/riscv/exec_machdep.c file arch/riscv/riscv/kgdb_machdep.c kgdb file arch/riscv/riscv/kobj_machdep.c modular file arch/riscv/riscv/pmap_machdep.c @@ -43,7 +36,11 @@ file arch/riscv/riscv/procfs_machdep.c p file arch/riscv/riscv/riscv_machdep.c file arch/riscv/riscv/sig_machdep.c # signal delivery file arch/riscv/riscv/softint_machdep.c +file arch/riscv/riscv/spl.S +file arch/riscv/riscv/stubs.c +file arch/riscv/riscv/syscall.c # syscall handler file arch/riscv/riscv/sys_machdep.c +file arch/riscv/riscv/trap.c # trap handlers file arch/riscv/riscv/vm_machdep.c file dev/cons.c