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.
account the trailing NUL on each name. Some other similar instances of
this idiom already account for this.
(In preparation to factor out this idiom into its own function.)
matches the internal CTL* chars.
The earlier fixes handled CTL* char values in var expansions,
but not in various other places they can occur (positional
parameters, $@ $* -- even potentially $0 and ~ expansions,
as well as byte strings generated from a \u in a $'' string).
These should all be correctly handled now. There is a new
ISCTL() macro to make the test, rather than using the old
BASESYNTAX[c]==CCTL form (which us still a viable alternative)
as the new way allows compiler optimisations, and less mem
references, so it should be smaller and faster.
Also, be sure in all cases to remove any CTLESC (or other)
CTL* chars from all strings before they are made available
for any external use (there was one case missed - which didn't
matter when we weren't bothering to escape the CTL* chars at
all.)
XXX pullup-8 (will need to be via a patch) along with the Feb 4 fixes.
In the function the routing table could be accessed without any locks, which was
unsafe. Actually, on netbsd-7, a kernel panic happened(*). The situation of
locking hasn't changed since netbsd-7 so we still need to hold the big locks on
-current (and netbsd-8) too.
Note that if NET_MPSAFE is enabled, the routing table is protected by its own
lock and we don't need the locks.
Reported and tested on netbsd-7 by sborrill@
(*) http://mail-index.netbsd.org/tech-net/2018/11/08/msg007153.html
- Reorder it, to match the CPU encoding. This is the universal order,
also used by Qemu. Drop the seg_to_nvmm[] tables.
- Compress it. This divides its size by two.
- Rename some of its fields, to better match the x86 spec. Also, take S
out of Type, this was a NetBSD-ism that was likely confusing to other
people.
DESCRIPTION
static inline int
MMD_INDIRECT(struct mii_softc *sc, uint16_t daddr, uint16_t regnum):
Setup MMD device address and register number. It also setup
address incrementation function.
static inline int
MMD_INDIRECT_READ(struct mii_softc *sc, uint16_t daddr, uint16_t regnum,
uint16_t *valp)):
Do MMD_INDIRECT() and then read the register.
static inline int
MMD_INDIRECT_WRITE(struct mii_softc *sc, uint16_t daddr, uint16_t regnum,
uint16_t val):
Do MMD_INDIRECT() and then write the register.
RETURN VALUE
Retruns 0 on success. Non-zero vaule on failure.
Note that old PHYs have no indirect access registers. Accessing such
devices with these functions cause timeout and return non-zero value
(e.g. ETIMEDOUT).
EXAMPLE
Read MMD Auto negotiation device's EEE advertisement register,
drop 100BASE-TX support and write it.
uint16_t eeadvert;
/* Post increment is not required */
MMD_INDIRECT_READ(sc, MDIO_MMD_AN | MMDACR_FN_DATA,
MDIO_AN_EEEADVERT, &eeadvert);
eeadvert &= ~AN_EEEADVERT_100_TX;
/*
* MMD device address and the register number are already set, so it's
* enough to read MII_MMDACR.
*/
PHY_WRITE(sc. MII_MMDACR, eeadvert);