Commit Graph

287756 Commits

Author SHA1 Message Date
mrg 7e8995bcce avoid taking locks that aren't initialised.
fixes panic when typing 'reboot' at the askroot prompt.
2021-05-23 00:36:36 +00:00
nia 63a6293b40 ossaudio too I guess 2021-05-22 17:20:01 +00:00
nia 0c596382e7 doc: allege responsibility 2021-05-22 17:18:57 +00:00
thorpej e68984e5ef Be explicit about our interface attributes. 2021-05-22 16:00:42 +00:00
thorpej cbc82a1a5c Gah, fix cut-and-paste-o. 2021-05-22 15:05:36 +00:00
thorpej a9ff06c2a0 qemu_find_rootdev(): Zero the buffer that we use to fetch the Qemu
"prom" root device variable; junk past the trailing NUL would cause
the way we parse the string to fail.  Also parse rootdev= and root=
the same way ("be liberal in what you accept" approach).
2021-05-22 15:04:33 +00:00
mlelstv 0cb1e7937a Handle read-only parent devices.
Currently this only affects xbd(4). Other disk drivers succeed opening
read-only disks as read-write and only fail subsequent write requests.
2021-05-22 13:43:50 +00:00
thorpej f671c8c9dd Remove extra newline from boot messages (isa and acpi front-ends
already provide the newline).
2021-05-22 01:24:27 +00:00
jmcneill 293024b5c6 Disable ACPI support when booting big endian kernels. 2021-05-21 21:53:15 +00:00
jmcneill e6f176d843 Capture the endianness of the ELF file loaded in 'netbsd_elf_data', the
same way we do already for the class in 'netbsd_elf_class'.
2021-05-21 21:52:15 +00:00
macallan 762a14e590 add \n to attach output 2021-05-21 21:21:01 +00:00
christos 2f967ad4a3 Add missing call to libdhcp_callbacks_register(). Should stop
dhcrelay() crashing when accessing *libdhcp_callbacks.local_port.
(from mrg@)
2021-05-21 21:07:37 +00:00
macallan 16af3cfd56 don't prop_object_retain(NULL) 2021-05-21 20:42:05 +00:00
macallan d7d97abe13 fix wsdisplay attachment in the New Order Of Things 2021-05-21 20:23:35 +00:00
macallan 1988435636 use probed VRAM size to determine where to put the cursor instead of blindly
assuming 16MB
also make sure the glyph cache can't overlap with the cursor
2021-05-21 20:22:15 +00:00
hannken b3278aea3c Replace the Solaris style endian check (exactly one of
_LITTLE_ENDIAN or _BIG_ENDIAN is defined) with standard check
"#if BYTE_ORDER == BIG_ENDIAN" like we do it elseware.

Should fix PR 56191 (ZFS tests fail on sparc64)
2021-05-21 17:32:49 +00:00
nakayama fa8245150b Fix previous to use the proper version file path. 2021-05-21 11:28:11 +00:00
jmcneill 6074c4f24c whitespace cleanup 2021-05-21 09:33:27 +00:00
ryo 271142971d fix little-endian dependence 2021-05-20 22:36:08 +00:00
msaitoh d57001e171 Use uint64_t instead of bus_addr_t for the TX descriptor's buffer address.
At least, this change is required for macppc (sizeof(bus_addr_t) == 4) to
make TX work.
2021-05-20 10:39:32 +00:00
christos 1fd82bd9ab fix typo 2021-05-20 02:01:07 +00:00
msaitoh 36e69cabf7 Fix wrong calculation found by kUBSan. OK'd by jmcneill.
The output was:
    UBSan: Undefined Behavior in ../../../../arch/arm/rockchip/
    rk_cru_composite.c:86:21, unsigned integer overflow: 0 divrem 0 cannot be
    represented in type 'unsigned int'
2021-05-20 01:41:55 +00:00
msaitoh c7be9afbc5 Fix signed integer overflow found by kUBSan. OK'd by jmcneill.
The output was:
   UBSan: Undefined Behavior in ../../../../arch/arm/rockchip/rk3399_cru.c:
   284:13, signed integer overflow: 594000000 - -2086967296 cannot be
   represented in type 'int'
2021-05-20 01:07:24 +00:00
ryo 3489cf27b4 Added BUS_DMA_COHERENT flag to bus_dmamem_map() to improve stability on aarch64.
In ixgbe, TX/RX descriptor rings are configured in 16-byte units.
If BUS_DMA_COHERENT is not specified, cpu cache (writeback/invalidate)
operations by bus_dmamap_sync() in aarch64 (arm/arm32/bus_dma.c) are done per
cache line size (usually 64 bytes). As a result, adjacent descriptors conflict
with the DMA operation, resulting in unstable operation.

To avoid this, descriptors area should be mapped as non-cache with BUS_DMA_COHERENT.


thanks to msaitoh@ for his help in debugging.
2021-05-20 01:02:42 +00:00
kre 8a7b619378 With the (very) recent changes to printf(1), a numeric conversion from data
of the form '+1 (two (or more) characters after the quote) will now generate
an error message, and cause printf(1) to exit(1) when it is done.

Adapt the test cases which use that data form to handle that.
2021-05-19 22:45:49 +00:00
kre e95234e270 Handle the (very) recent change to printf(1) - when writing to a closed
stdout printf(1) now issues an error message, hence stderr in such cases
should not be empty, rather than should be empty.   Adapt to that.
2021-05-19 22:43:18 +00:00
kre 108061b040 Changes for POSIX conformance.
1.  exit(1) with an error message on stderr if an I/O error occurs.
1a. To work properly when built into /bin/sh sprinkle clearerr() at
    appropriate places.

2.  Verify that when a 'X data value is used with one of the numeric
    conversions, that nothing follows the 'X'.   It used to be unclear
    in the standard whether this was required or not, it is clear that
    with numeric conversions the entire data value must be used, or an
    error must result.   But with string conversions, that isn't the case
    and unused parts are simply ignored.   This one is a numeric conversion
    with a string value, so which applies?   The standard used to contain
    an example of '+3 being converted, producing the same as '+ ignoring
    the '3' with no mention of any error, so that's the approach we adopted,
    The forthcoming version now explicitly states that an error would also
    be generated from that case, as the '3' was not used by the numeric
    conversion.

2a. We support those conversions with floating as well as integer conversions,
    as the standard used to suggest that was required (but it makes no sense,
    the values are always integers, printing them in a floating format is
    dumb).  The standard has been revised to make it clear that only the
    integer numeric conversions %d %u %x (etc) are supposed to handle the 'X
    form of data value.   We still allow it with the floating formats as an
    extension, for backward compat, just in case someone (other than the ATF
    tests) is using it.   It might go away.

2b. These formats are sypposed to convert 'X where 'X' is a character
    (perhaps multibyte encoded) in the current LC_CTYPE locale category.
    We don't handle that, only 1 byte characters are handled currently.
    However the framework is now there to allow code to (one hopes, easily)
    be added to handle multi-byte locales.   (Note that for the purposes of
    #2 above, 'X' must be a single character, not a single byte.)
2021-05-19 22:41:19 +00:00
kre 6db93d573b Don't describe "%%: in the format as a format conversion, it isn't,
it is an escaped literal '%' character.   None of what applies to
format conversions applies to this.
2021-05-19 22:29:18 +00:00
kre 392642ae5f Fix a truly embarrassing quoting screwup. There is an explanation as
to why this didn't cause any failures, but I won't go into it here.
This was detected by the about to be committed printf changes.

While here also correct a couple of minor comment layout issues.
2021-05-19 22:20:34 +00:00
kre 3f34d02d9d Catch up with /bin/sh built-in echo ... if a write error occurs,
don't just exit(1), write an error message to stderr as well
(required for POSIX conformance).
2021-05-19 22:12:36 +00:00
nia d57305d011 fix syntax 2021-05-19 16:06:13 +00:00
skrll 2263656e9b Make even more pmap agnostic 2021-05-19 12:16:01 +00:00
skrll 057d89de8f Reduce characters to print in db_pte_print and unwrap some short lines. 2021-05-19 11:54:17 +00:00
rillig 3112350466 if_lagg: fix format string incompatibility
In struct ifnet, the member if_mtu has type uint64_t, which differs from
struct ifreq, where the member ifru_mtu has type int.
2021-05-19 10:20:50 +00:00
msaitoh 5d51444764 No functional change:
- Add NetBSD RCS IDs.
 - KNF.
2021-05-19 08:19:20 +00:00
rillig 06dbbe5487 if_lagg: fix Clang build
Clang is stricter than GCC when it comes to nonliteral format strings.

sys/net/lagg/if_lagg.c:2372:12: error:
    format string is not a string literal [-Werror,-Wformat-nonliteral]
2021-05-19 06:13:08 +00:00
yamaguchi 353f49b857 Added a kernel option to change the number of processing packets
at one pppoeintr()
2021-05-19 03:44:46 +00:00
yamaguchi a98c13e644 Added a limitation of the number of processing packets
because a enqueuing process can not add packets over IFQ_MAXLEN

and removed reschedule at pppoeintr()
because it also scheduled at enqueuing process.
2021-05-19 03:35:27 +00:00
yamaguchi 8539c94ed7 Make functions that use for logging MP-safe
There is no change in behavior.
2021-05-19 02:14:19 +00:00
yamaguchi 8bd40ada6c Added clear of dns addresses when IPCP is closed 2021-05-19 02:07:20 +00:00
yamaguchi 1c8972237f Added logs on dropping IPCP and IPv6CP packets 2021-05-19 02:02:46 +00:00
yamaguchi 99e663ae82 remove a wrong ntohs().
The variable is already host-byte-order.
2021-05-19 01:54:09 +00:00
yamaguchi 070cb7ea5c Added a log about rejection of IPCP address option 2021-05-19 01:42:35 +00:00
kre e177ba5371 Fix a bug in the built-in echo in /bin/sh reported in private mail by
Oguz <oguzismailuysal@gmail.com>

If echo detects an I/O error, it does exit(1) (that's fine) but then
the next echo also does exit(1) even without any errors of its own,
and every following echo writing to stdout does the same thing.

eg:

echo foo >&- ; echo $?; echo $?; ( echo $( echo $?; echo $?) ; echo $? )
1
1
1 1
1

The first echo writes nothing (stdout is closed) but does exit(1).
The second echo writes "1" (correct, the exit status of the previous
echo) and should exit(0) - but doesn't.  This pattern continues...

While here, conform to the POSIX requirement on echo (and many other
standard utilities, but definitely not all) that when the utility
does exit(>0) a message must be written to stderr (and vice versa
in many cases).   Our echo (as shown above) did the exit(1) part
when it detected the I/O error, but no message is sent to stderr.
Fix that while we're here.

Similar changes are required for /bin/echo (coming soon), and
/usr/bin/printf (which is also the sh builtin printf) - except
currently that one kind of conforms, as it ignores errors writing
to stdout (as do large numbers of other utilities).  For many
programs that's kind of acceptable, but where the sole purpose of
the program is to write to stdout, it really isn't.   Also to be
fixed soon.
2021-05-18 21:39:06 +00:00
kre 78eadc76d4 Add two new sub-tests to the echo test case of the t_builtins shell ATF test.
The first verifies that echo exits >0 when it encounters an I/O error on
its output (this part would have succeeded for a long time).  It also
verifies the POSIX requirement that when most standard utilities (or
perhaps many rather than most) exit(>0) they must write a message to stderr.
Our sh's built in echo did not do that (nor does /bin/echo but that's not
relevant here).

The second demonstrates (on an unfixed built-in echo) a bug reported in
private e-mail by Oguz <oguzismailuysal@gmail.com> where once an instance of
the built-in echo has detected an I/O error, all later invocations of
the built-in echo, with no I/O errors of their own, also exit(1) (the error
status on stdout is not cleared, each echo sees the "I/O error occurred" and
does exit(1)).

In this second sub-test, the "2>&-" on the first echo command is simply
an artifact caused by the test harness - the "check" function verifies
that exit((>0) requires a message on stderr (and vice versa), but that
only applies to most (or many) utilities, echo is one, but sh is not.
In the second test, the exit status comes from sh - sh is permitted to
write to stderr (via the echo command it runs in this case) and still
exit(0).   But the check function in the test does not understand that
subtlety.   So, we simply suppress the stderr message by closing stderr
(the first of these two new sub-tests has verified that the message exists)..
2021-05-18 21:37:56 +00:00
christos 407a19b76a restore -iremap functionality which was omitted by a merge botch, and then
remove as unused later.
2021-05-18 21:34:03 +00:00
dholland c736b6a748 Remove some unused variables, found by gcc -Wall. 2021-05-18 20:34:20 +00:00
dholland 562b6c7f9a Print ptrdiff_t with %td, not %d. Appeared in passing in PR 56188. 2021-05-18 20:32:18 +00:00
sjg 13862ba5e3 Do not trust that /nonexistent does not exist
Use /nonexistent.${.MAKE.PID} to avoid failure when
/nonexistent actually exists.
2021-05-18 17:05:45 +00:00
tsutsui 68603c0b6a Consistently use #define<tab> here. 2021-05-18 15:21:41 +00:00