Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/net/npf work around a GCC 7 vs sparc (32 bit) issue i ha...



details:   https://anonhg.NetBSD.org/src/rev/f1bb872ef56c
branches:  trunk
changeset: 449233:f1bb872ef56c
user:      mrg <mrg%NetBSD.org@localhost>
date:      Wed Feb 27 21:37:24 2019 +0000

description:
work around a GCC 7 vs sparc (32 bit) issue i haven't figured out
the real cause of yet.

mark npf_init() as non-static.  for a yet-unknown reason, when this
function is inlined by the compiler (or a human!) into the single
caller, some CPUs end up in a hung state that can't be interrupted
eventually leading to system hang.  eg:

[   8.9693040] root on hme0
[   8.9862690] nfs_boot: trying DHCP/BOOTP
xcall(cpu2,0xf0240ac8) from 0xf0241170: couldn't ping cpus: cpu1

is the symptom though sometimes nfs_boot is actually able to
complete mountroot before it hangs.


this may be a compiler bug but the symptom and the trigger are
far removed and my so-far reading of the "broken" npf_init
inlining has shown no issues, however, i haven't completed a
full scan of this asm in the past month so i'm commiting this
workaround for now.

diffstat:

 sys/net/npf/npf_os.c |  14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diffs (32 lines):

diff -r 79e4fafee3cc -r f1bb872ef56c sys/net/npf/npf_os.c
--- a/sys/net/npf/npf_os.c      Wed Feb 27 18:21:04 2019 +0000
+++ b/sys/net/npf/npf_os.c      Wed Feb 27 21:37:24 2019 +0000
@@ -33,7 +33,7 @@
 
 #ifdef _KERNEL
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: npf_os.c,v 1.10 2018/09/29 14:41:36 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: npf_os.c,v 1.11 2019/02/27 21:37:24 mrg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "pf.h"
@@ -140,7 +140,19 @@
        return 0;
 }
 
+#if 1
+/*
+ * When npf_init() is static and inlined into npf_modcmd() directly (either
+ * by the human or GCC 7), then GCC 7 on 32 bit sparc do * something wrong
+ * and CPUs hang up.  Making it not static works for some reason.
+ *
+ * Revert this when the real problem is found.
+ */
+int npf_init(void);
+int
+#else
 static int
+#endif
 npf_init(void)
 {
        npf_t *npf;



Home | Main Index | Thread Index | Old Index