Commit Graph

281601 Commits

Author SHA1 Message Date
martin
8f65adda90 When MD code requests a reserved area (at the start of the disk)
make sure to properly account for the "lost" space during all calculations
and especially when expanding the main partition to fill the disk.

Avoid using the global "pm" or a passed device descriptons when we are
passing disk limits explicitly anyway.

Simplify/fix a few rounding calculations.
2020-10-09 18:33:00 +00:00
mgorny
3a2c6ec6be Add tests for x87 FPU registers
Reviewed by kamil
2020-10-09 17:43:30 +00:00
mgorny
431834add9 Rename MM_REG macro to ST_MAN, and cover fpr/xstate with it
Rename the MM_REG macro to ST_MAN, to make it clearer that it gets
mantissa of ST registers which overlaps with MM registers but can be
also used to read ST registers (to be used in the next commit).  Extend
it to cover the difference between GETFPREGS and GETXSTATE,
and therefore avoid additional condition on i386.

Reviewed by kamil.
2020-10-09 17:43:07 +00:00
riastradh
a6e2e59435 Reword advice about when not to use membar_exit.
With help from skrll and pgoyette.

While here, change the example so it doesn't violate the advice just
given.  Still not a great example -- abusing UINT_MAX for a reference
count is kinda sketchy, but it'll serve for now.
2020-10-09 17:36:16 +00:00
macallan
252d2a5c18 build ppc_video.c etc. on hppa 2020-10-09 17:01:29 +00:00
nia
c32467e149 tty_43: Check a bitset from userspace is valid before shifting it
Passing a negative value to these legacy compat ioctls results in
left shift on a negative value which is undefined behaviour and results
in the tty (at least, possibly other things) locking up.

The argument to the ioctl should always be > 0. Return EINVAL otherwise.

While here, adjustments to code style to match current guidelines.

Found by UBSan.

Reported-by: syzbot+39cd551a05298b222756@syzkaller.appspotmail.com
2020-10-09 10:41:53 +00:00
nia
ad11505eeb tty: Avoid undefined behaviour (left shift of 1 by 31 places overflows int)
The valid sizes of the tty input and output queues (according to the man page)
are between 1024 and 65536 and input values are converted to a power of two.

The check on the validity of the range is done after the input values are
converted, however, which means that a hostile program can attempt to set
the queue size to a negative value, and cause integer overflow before
the range is validated.

Detected by UBSan

Reported-by: syzbot+521b73969fd233c49e58@syzkaller.appspotmail.com
2020-10-09 09:03:55 +00:00
kardel
75839df013 PR kern/55705:
don't attempt to sleep for negative time, we are late anyway - avoids DIAGNOSTIC panic
2020-10-09 08:18:01 +00:00
roy
db66d588fe carp: Remove media, software should use link status.
carp literally has no media just like ppp, vlan, etc.
2020-10-09 08:10:41 +00:00
rillig
245b875e3f make(1): add test for parsing the :? variable modifier 2020-10-09 07:03:20 +00:00
rillig
6fe1271163 make(1): use consistent order in .OODATE in test archive.mk 2020-10-09 06:44:42 +00:00
mrg
c4f3171f96 switch powerpc, sh3, vax and m68k to GCC 9. that's everyone.
thanks espcially to rin@ for testing and fixing issues.
2020-10-09 05:41:16 +00:00
macallan
b329d54d54 set list for hppa 2020-10-09 04:32:58 +00:00
macallan
06b5bd8add build some potentially useful drivers on hppa 2020-10-09 04:28:38 +00:00
macallan
7995230b1d build Xorg server on hppa 2020-10-09 04:19:43 +00:00
gutteridge
ed20d0c0a0 options.4: add a basic entry for the CNMAGIC option 2020-10-09 01:49:53 +00:00
tnn
f4e80fd638 rk3399_pcie: do reset timing according to PCI Express Base Specification
Don't do link training or configuration space accesses within the time
allowed by the standard for the downstream card to come out of reset
after deasserting PERST#.

This fixes detection issues seen with a dual port wm(4) NIC,
an ASMedia SATA card and also Pericom bridges (but they need more work
to be useful).
2020-10-08 22:14:00 +00:00
nisimura
8b9659189f add DM9000A register definitions 2020-10-08 21:00:25 +00:00
rillig
3c13422802 make(1): remove test misc.mk from Makefile 2020-10-08 19:11:35 +00:00
rillig
92250d426d make(1): move test for .CURDIR from misc.mk to varname-dot-curname.mk 2020-10-08 19:09:08 +00:00
rillig
aad4a70ef3 make(1): make individual targets in test archive.mk visible
This test still fails on FreeBSD, printing the "ar cru, ranlib" lines
twice, and I don't know why.

To get more insights into the inner details, without activating the full
-dA logging, split the output into paragraphs, one per target.

This change reveals another interesting detail: Dependencies without any
commands (in this case create-archive) don't inherit the commands from
.USEBEFORE and .USE sources.
2020-10-08 18:37:26 +00:00
rillig
d19aea7aed make(1): fix test opt-debug-jobs on non-native platforms 2020-10-08 17:54:20 +00:00
jakllsch
690eb549db openssl: Define OPENSSL_NO_EC_NISTP_64_GCC_128 for Alpha too
The ecp_nistp521.c code depends on doing unaligned 64-bit accesses,
which the NetBSD/alpha kernel doesn't like to trap and emulate.

fixes PR lib/55701
2020-10-08 16:00:09 +00:00
skrll
45faa84740 Mark US/Pacific-New obsolete 2020-10-08 14:22:21 +00:00
skrll
5602c37d49 %#jx vs %jx consistency in UVMHIST_LOG 2020-10-08 14:02:40 +00:00
kre
e10e0d0745 tzdata 2020b: the ancient systemv and pacificnew zone files are gone,
as is the yearistype.sh script (2020b zic, if/when that gets included
in NetBSD won't support it).,
2020-10-08 13:44:36 +00:00
he
d41493b19e Bump MAXDSIZ from 1536 to 1836.
1836 is 2048-128(MAXTSIZ)-64(MAXSSIZ).
Gives us a fighting chance to build rust natively.
OK'ed by skrll@
2020-10-08 12:49:06 +00:00
nisimura
077f381d0c improve register descriptions 2020-10-08 11:29:04 +00:00
rin
5b350e8062 PR kern/45117
Work around regression introduced in rev 1.92:

http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/kern/kern_cpu.c#rev1.92

by which ``cpuctl offline n'' became broken on architectures without
__HAVE_INTR_CONTROL (i.e., everything other than alpha and x86);
cpu_setintr() always fails on these archs, and we had neglected
return value from that function until rev 1.91.

XXX
As martin pointed out in the PR, I'm not sure whether fix in rev 1.92
itself is correct or not. Insert XXX comment referring the PR there....
2020-10-08 09:16:13 +00:00
rin
c4b815a64a Apply hack for GDB 8.3 on arm to GDB 11.
XXX
Not tested as GDB 11 does not build for arm at the moment.

Note that dist/gdb/dwarf2foo.c was renamed to dist/gdb/dwarf2/foo.c.
2020-10-08 08:32:57 +00:00
rin
75fa0b3cd9 GCC 9.3 miscompiles dwarf2{expr,loc}.c with -O2 for earmv5hf{,eb}
(-O1 is fine). This is a new regression introduced in GCC9.

For everyone's safety, extend -O0 hack to dwarf2{expr,loc}.c for
all arm variants with GCC >= 8.
2020-10-08 08:31:37 +00:00
kre
5d87541b7e Note update to tzdata 2020b 2020-10-08 04:30:04 +00:00
kre
2e991c1622 Merge tzdata2020b 2020-10-08 04:28:00 +00:00
kre
b3ad27c8c8 Import tzdata2020b from ftp://ftp.iana.org/tz/releases/tzdata2020b.tar.gz
Summary of changes in tzdata2020b (2020-10-06 18:35:04 -0700):

     Revised predictions for Morocco's changes starting in 2023.
     Canada's Yukon changes to -07 on 2020-11-01, not 2020-03-08.
     Macquarie Island has stayed in sync with Tasmania since 2011.
     Casey, Antarctica is at +08 in winter and +11 in summer.
2020-10-08 04:27:22 +00:00
wiz
02e7ed576c expat-2.2.10 out. 2020-10-07 19:53:32 +00:00
christos
0540874be3 - for readability when the exponent < 10 don't prefix it with 0x (from kre)
- fix usage
- merge printing code.
2020-10-07 19:48:29 +00:00
nat
2a8f90dce2 Eddie Van Halen, co-founder of Van Halen dies. 2020-10-07 19:06:50 +00:00
chs
27a227d509 Add a new, more aggressive allocator for uvm_pglistalloc() to allocate
contiguous physical pages, and try this new allocator if the existing
one fails.  The existing contig allocator only tries to allocate pages
that are already free, which works fine shortly after boot but rarely
works after the system has been up for a while.  The new allocator uses
the pagedaemon to evict pages from memory in the hope that this will
free up a range of pages that satisfies the constraits of the request.
This should help with things like plugging in a USB device, which often
fails for some USB controllers because they can't get contigous memory.
2020-10-07 17:51:50 +00:00
jmcneill
4f6c4ce2f4 Only touch PMC registers if Performance Monitor Extensions are present. 2020-10-07 16:03:10 +00:00
thorpej
0595de54a5 - qemu_hardclock(): fix check for spurious hardclock call.
- qemu_clock_init(): Initialize qemu_nsec_per_tick *after* adjusting hz.
  Error pointed out by Jonathan Kollasch.
2020-10-07 14:07:42 +00:00
rin
dbe4bf45a3 PR port-alpha/54307
GCC 9.3 seems to be able to compile rtree.c with -O2:

- No new regressions in ATF.
- System survives over a night, at least, under heavy loads.

On the other hand, unfortunately, GCC 9.3 still miscompiles tcache.c
with -O2 or -O1. For example, even ``gcc -g hello.c'' fails with ICE
if tcache.c is compiled with -O[12] in libc.
2020-10-07 07:35:28 +00:00
skrll
7cbf2902dd Comment nit 2020-10-07 07:31:47 +00:00
roy
b4de43c2d1 net80211: Initialise the interface with a decent link state.
Link state transitions to UP when a node is joined and DOWN when left.
This means that with the interface UP, the link state could be UNKNOWN
for a while, implying it can be used in BSS mode.
Which is of course false.

Add a function to set an initial link state based on the operating mode.
Also call this when the operating mode changes.

Basically in BSS and MONITOR it starts off down.
BSS will transition UP and DOWN as before, MONITOR will stay down.
IBSS, AHDEMO and HOSTAP will remain as link unknown because the state is
..... unknown.
2020-10-06 23:51:05 +00:00
kamil
933fb81256 Replace local patches adding NetBSD/aarch64 support with the upstream one
Cherry-pick:

From c0b313441717b65569edb01bf9984d2066d899de Mon Sep 17 00:00:00 2001
From: Nick Clifton <nickc@redhat.com>
Date: Mon, 5 Oct 2020 14:56:42 +0100
Subject: [PATCH] Add NetBSD AArch64 Little Endian and Big Endian BFD support.

bfd      * config.bfd (aarch64-*-netbsd*, aarch64_be-*-netbsd*): Add target.
2020-10-06 23:28:13 +00:00
kamil
c19751a211 Undo local patches
They are no longer needed (and are wrong).
2020-10-06 23:14:47 +00:00
kamil
6a134d1bf9 Remove NFC local delta 2020-10-06 22:17:42 +00:00
kamil
33673ac57c Fix typo
Remove delta with upstream.
2020-10-06 22:14:41 +00:00
kamil
cc2fb38879 Replace local patch with fix from upstream
Cherry-pick:

From e2a2a24a8e78427ff8667d625f5befbe88c328bb Mon Sep 17 00:00:00 2001
From: Kamil Rytarowski <n54@gmx.com>
Date: Wed, 23 Sep 2020 04:20:05 +0200
Subject: [PATCH] Preinitialize the sockaddr_un variable to zero

Don't pass random sun_len for the BSD's,
zero the whole structure as recommended for portability.

Reported by Coverity.

gdbsupport/ChangeLog:

	* agent.cc (gdb_connect_sync_socket): Preinitialize addr with zeros.
2020-10-06 22:04:09 +00:00
kamil
95bfe6ceb7 Undo local NFC patch 2020-10-06 21:54:01 +00:00
rillig
2df1e5fef3 make(1): remove incomplete fallback implementation of strftime
The function strftime is available since C89.  Any environments older
than that are not supported anymore.
2020-10-06 21:51:33 +00:00