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.
This commit is contained in:
mrg 2019-02-27 21:37:24 +00:00
parent fee2bf6d03
commit d85c0d7f6a

View File

@ -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 @@ npf_fini(void)
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;