openbsd
3 years agoreset ppc_altivec if 'option ALTIVEC' is not present.
matthieu [Mon, 14 Jun 2021 06:10:44 +0000 (06:10 +0000)]
reset ppc_altivec if 'option ALTIVEC' is not present.

This makes sysctl machdep.altivec return 0 in this case, allowing
applications to select the non-altivec code path.
Issue with pixman reported by cwen@  ok jca@ gkoehler@ deraadt@

3 years agoadd a few more phys known to attach to usb ethernet
jsg [Mon, 14 Jun 2021 06:09:28 +0000 (06:09 +0000)]
add a few more phys known to attach to usb ethernet

3 years agofix whitespace
jsg [Mon, 14 Jun 2021 06:03:50 +0000 (06:03 +0000)]
fix whitespace

3 years agomention sqphy(4)
jsg [Mon, 14 Jun 2021 05:33:16 +0000 (05:33 +0000)]
mention sqphy(4)

shows up in submitted dmesgs

aue0: ELSA AG MicroLink USB2Ethernet, rev 1.10/1.01, addr 2
sqphy0 at aue0 phy 1: Seeq 80225 10/100 PHY, rev. 0

3 years agoRemove TLS1_AD_INTERNAL_ERROR from internal visibility again
tb [Mon, 14 Jun 2021 05:32:10 +0000 (05:32 +0000)]
Remove TLS1_AD_INTERNAL_ERROR from internal visibility again

With tls_server.c r1.47 this is no longer needed.

3 years agosync
deraadt [Mon, 14 Jun 2021 04:50:01 +0000 (04:50 +0000)]
sync

3 years agoUse SSL_AD_INTERNAL_ERROR
tb [Mon, 14 Jun 2021 03:53:59 +0000 (03:53 +0000)]
Use SSL_AD_INTERNAL_ERROR

One instance of TLS1_AD_* was missed and broke the tree in the recent
switch to using only one version of alert defines internally.

3 years agoAdd a few more drivers that people might need.
deraadt [Mon, 14 Jun 2021 03:50:23 +0000 (03:50 +0000)]
Add a few more drivers that people might need.
ok drahn

3 years agoadd PCITAG_NODE and PCITAG_OFFSET
deraadt [Mon, 14 Jun 2021 03:48:41 +0000 (03:48 +0000)]
add PCITAG_NODE and PCITAG_OFFSET
ok drahn

3 years agoenable nvme, a few pci devices and a bunch of usb stuff.
drahn [Mon, 14 Jun 2021 03:04:02 +0000 (03:04 +0000)]
enable nvme, a few pci devices and a bunch of usb stuff.
will cleanup later, enabling additional systems.

3 years agougly hack around broken build until people wake up.
deraadt [Mon, 14 Jun 2021 02:04:11 +0000 (02:04 +0000)]
ugly hack around broken build until people wake up.

3 years ago32-bit systems incorrectly parse the (64-bit) length of ustar extended
deraadt [Mon, 14 Jun 2021 00:36:13 +0000 (00:36 +0000)]
32-bit systems incorrectly parse the (64-bit) length of ustar extended
headers (hd->size) using a 32-bit operation.
from Samanta Navarro
ok guenther

3 years agoThere is no '!' in HiFive.
krw [Sun, 13 Jun 2021 23:53:51 +0000 (23:53 +0000)]
There is no '!' in HiFive.

Pointed out by kettenis@

3 years agofix and enable diskfmt regress test for vmd(8)
dv [Sun, 13 Jun 2021 21:43:35 +0000 (21:43 +0000)]
fix and enable diskfmt regress test for vmd(8)

Clean the rot in the diskfmt test, updating it to work with current
vmd(8) and vmctl(8). Remove the needs to qemu since vmctl can create
qcow2 images now.

Now that it's a test that doesn't need a port, enable it in the
parent Makefile.

There's still some work needed to get "make clean" properly cleaning
up after the tests.

OK ori@

3 years agoSave and restore errno around FUTEX_WAIT futex(2) operations. While there
kettenis [Sun, 13 Jun 2021 21:11:54 +0000 (21:11 +0000)]
Save and restore errno around FUTEX_WAIT futex(2) operations.  While there
remove the unused _wait() function in librthread such that we don't have to
add the save/restore sequence there.

Fixed building Python as a race with another thread unlocking a futex(2)
would make futex(2) set errno to EAGAIN which would confuse Python in
beleiving that readdir(2) failed instead of reaching the end of the
directory.

Spotted and tested by tb@
ok bluhm@

3 years agoAdd support for sfuart(4) as a console.
kettenis [Sun, 13 Jun 2021 16:27:15 +0000 (16:27 +0000)]
Add support for sfuart(4) as a console.

ok drahn@

3 years agoAdd SSL_AD_MISSING_EXTENSION.
jsing [Sun, 13 Jun 2021 15:51:10 +0000 (15:51 +0000)]
Add SSL_AD_MISSING_EXTENSION.

This is an alert that was added in TLSv1.3 - we already use it internally,
but did not provide the SSL_AD_* define previously.

ok tb@

3 years agoDefine SSL_AD_* as actual values.
jsing [Sun, 13 Jun 2021 15:47:11 +0000 (15:47 +0000)]
Define SSL_AD_* as actual values.

Rather than having SSL_AD_* as defines that refer to SSL3_AD_* or
TLS1_AD_*, just give them actual values directly since it is more readable
and the indirection provides no value. Place SSL3_AD_* and TLS1_AD_* under
#ifndef LIBRESSL_INTERNAL to prevent further usage.

ok tb@

3 years agoRemove tls1_alert_code().
jsing [Sun, 13 Jun 2021 15:34:41 +0000 (15:34 +0000)]
Remove tls1_alert_code().

After running the preprocessor, this function becomes:

  switch (code) {
  case 0:
   return (0);
  case 10:
   return (10);
  case 20:
   return (20);
  ...
  }

Its intended purpose was to prevent SSLv3 alerts being sent from TLS code,
however now that we've removed "no_certificate" from LibreSSL's reach, it
no longer does anything useful.

ok tb@

3 years agoHave gedit() and gsetpid() both return CMD_CLEAN if no data has
krw [Sun, 13 Jun 2021 15:32:36 +0000 (15:32 +0000)]
Have gedit() and gsetpid() both return CMD_CLEAN if no data has
changed, thus keeping the modified indicator correct and avoiding
early bailout when editing a gpt partition w/o changing the type.

3 years agoPlace obsolete alerts under #ifndef LIBRESSL_INTERNAL.
jsing [Sun, 13 Jun 2021 15:29:54 +0000 (15:29 +0000)]
Place obsolete alerts under #ifndef LIBRESSL_INTERNAL.

ok tb@

3 years agoRemove references to obsolete alerts.
jsing [Sun, 13 Jun 2021 15:29:19 +0000 (15:29 +0000)]
Remove references to obsolete alerts.

The "no_certificate" alert only existed in SSLv3, while the
"decryption_failed" and "export_restriction" alerts were removed in
TLSv1.1.

ok tb@

3 years agoTweak gsetpid() to restore partition info in case of an error,
krw [Sun, 13 Jun 2021 14:39:05 +0000 (14:39 +0000)]
Tweak gsetpid() to restore partition info in case of an error,
and mark the partition dirty only if something changed.

More aligned with gedit() and safer when invoked directly from
Xsetpid().

3 years agoUUID_STR_LEN+1 is less mysterious than '37'.
krw [Sun, 13 Jun 2021 14:14:56 +0000 (14:14 +0000)]
UUID_STR_LEN+1 is less mysterious than '37'.

3 years agoDon't ignore a GPT that claims the last usable LBA is located
krw [Sun, 13 Jun 2021 13:48:00 +0000 (13:48 +0000)]
Don't ignore a GPT that claims the last usable LBA is located
past the address where alternate partition entries would be
written.

Just adjust the GPT header value (gh_lba_end) to the highest safe
value and carry on.

Issue encountered in the wild by mlarkin@ while accessing some
disk images.

ok deraadt@

3 years agoFix lba_start >= lba_end debug message.
krw [Sun, 13 Jun 2021 13:24:45 +0000 (13:24 +0000)]
Fix lba_start >= lba_end debug message.

3 years agoBack off a couple of the more paranoid checks while spoofing GPT
krw [Sun, 13 Jun 2021 13:17:59 +0000 (13:17 +0000)]
Back off a couple of the more paranoid checks while spoofing GPT
partitions into the disklabel.

First, since the alt header is never accessed there is no need to
worry about it being inaccessible.

Second, the GPT header claiming to cover more sectors than the
device has is no reason to ignore all the partitions. The
partition actually present could still be useful.

Issues encountered in the wild by mlarkin@ while accessing some
disk images.

ok deraadt@

3 years agoregen
jsg [Sun, 13 Jun 2021 12:43:53 +0000 (12:43 +0000)]
regen

3 years agoadd hifive unmatched ids
jsg [Sun, 13 Jun 2021 12:43:15 +0000 (12:43 +0000)]
add hifive unmatched ids
ok deraadt@ kettenis@

3 years agoClean this up a bit. Use register names that match the documentation, and
kettenis [Sun, 13 Jun 2021 09:19:14 +0000 (09:19 +0000)]
Clean this up a bit.  Use register names that match the documentation, and
fix some register number.  Drop reading the Interrupt Pending register
in the interrupt handler as this was actually reading the Interrupt Enable
register and the bits that were checked were always true.  Fix bogus
code in sfuartcnputc() and simplyfy sfuartcngetc().  Throw in some
style fixes for good measure.

3 years agorefer to the correct domain for sdhc spec
jsg [Sun, 13 Jun 2021 06:57:51 +0000 (06:57 +0000)]
refer to the correct domain for sdhc spec
from fkr

3 years agoadd arch to Dt line;
jmc [Sun, 13 Jun 2021 06:17:15 +0000 (06:17 +0000)]
add arch to Dt line;

3 years agoadd SiFive FU740-C000 to SoC list
jsg [Sun, 13 Jun 2021 03:16:22 +0000 (03:16 +0000)]
add SiFive FU740-C000 to SoC list

3 years agoMatch sifive,fu740-c000-gem so that device is detected on Unmatched.
drahn [Sun, 13 Jun 2021 02:56:48 +0000 (02:56 +0000)]
Match sifive,fu740-c000-gem so that device is detected on Unmatched.
pointed out by jsg@

3 years agoadd sfuart(4)
jsg [Sun, 13 Jun 2021 02:45:23 +0000 (02:45 +0000)]
add sfuart(4)

3 years agocad(4) appears to be working on Unmatched.
drahn [Sun, 13 Jun 2021 00:46:27 +0000 (00:46 +0000)]
cad(4) appears to be working on Unmatched.

3 years agoSerial driver for SiFive Unmatched (U74) based on dev/fdt/amluart.c
drahn [Sat, 12 Jun 2021 23:58:24 +0000 (23:58 +0000)]
Serial driver for SiFive Unmatched (U74) based on dev/fdt/amluart.c
console input and output working, userland input and output at least
partially working.
'commit that driver, further improvements can happen in-tree' deraadt@

3 years agoadd dwpcie(4) to riscv64 section
jsg [Sat, 12 Jun 2021 22:49:34 +0000 (22:49 +0000)]
add dwpcie(4) to riscv64 section

3 years agoOoops. Managed to typo 'gh' instead of 'gp' when copying
krw [Sat, 12 Jun 2021 20:16:26 +0000 (20:16 +0000)]
Ooops. Managed to typo 'gh' instead of 'gp' when copying
code from GPT_init() into init_gh().

3 years agoRecognize "HiFive! FSBL" and "HiFive! BBL" GPT partitions.
krw [Sat, 12 Jun 2021 18:35:37 +0000 (18:35 +0000)]
Recognize "HiFive! FSBL" and "HiFive! BBL" GPT partitions.

Seen on SiFive Unmatched stock image provided by mlarkin@.

3 years agoAbstract init_gh() and init_gp() from GPT_init().
krw [Sat, 12 Jun 2021 17:49:00 +0000 (17:49 +0000)]
Abstract init_gh() and init_gp() from GPT_init().

Restore original gh/gp if initialization fails.

No other functional change.

3 years agoGPT_get_header() and GPT_get_partition_table() are only used
krw [Sat, 12 Jun 2021 17:19:13 +0000 (17:19 +0000)]
GPT_get_header() and GPT_get_partition_table() are only used
in gpt.c. Move declarations and rename to get_header() and
get_partition_table().

No functional change.

3 years agospace between macro args and punctuation;
jmc [Sat, 12 Jun 2021 17:04:41 +0000 (17:04 +0000)]
space between macro args and punctuation;

3 years agospace between macro args and punctuation;
jmc [Sat, 12 Jun 2021 16:59:53 +0000 (16:59 +0000)]
space between macro args and punctuation;

3 years agoremove incorrect CAVEATS section;
jmc [Sat, 12 Jun 2021 16:53:28 +0000 (16:53 +0000)]
remove incorrect CAVEATS section;
from miod; ok millert

while here, knock out an instance of ".Tn"

3 years agoEnable dwpcie(4) and add support for the PCIe host bridge found on the
kettenis [Sat, 12 Jun 2021 16:30:16 +0000 (16:30 +0000)]
Enable dwpcie(4) and add support for the PCIe host bridge found on the
SiFive FU740 SoC.

ok drahn@

3 years agoWhen initializing a GPT always create an EFI SYS partition if the
krw [Sat, 12 Jun 2021 14:28:30 +0000 (14:28 +0000)]
When initializing a GPT always create an EFI SYS partition if the
'-b' option is specified. GPT is no longer a __i386__/__amd64__
thing.

ok kettenis@

3 years agoCreate add_partition() and use in GPT_init() to initialize GPT
krw [Sat, 12 Jun 2021 14:10:01 +0000 (14:10 +0000)]
Create add_partition() and use in GPT_init() to initialize GPT
with EFI SYS and OpenBSD partitions. Replaces some barbarian
direct whacking of GPT.

ok kettenis@

3 years agoExercise resetting of expired and unexpired timers.
visa [Sat, 12 Jun 2021 13:30:14 +0000 (13:30 +0000)]
Exercise resetting of expired and unexpired timers.

3 years agoRestrict MSI override to i386 and amd64. On other architectures we can
kettenis [Sat, 12 Jun 2021 13:08:30 +0000 (13:08 +0000)]
Restrict MSI override to i386 and amd64.  On other architectures we can
trust the flag set by the PCI host bridge driver and there are cases
where it isn't set because MSIs aren't implemented (for example on riscv64).

ok patrick@, sf@

3 years agoRFC 4507bis can refer to various RFCs but this instance is about
tb [Sat, 12 Jun 2021 11:02:20 +0000 (11:02 +0000)]
RFC 4507bis can refer to various RFCs but this instance is about
RFC 5077. Note that session resumption via session tickets is
only for TLSv1.2 and earlier.

prompted by a question by/ok jmc

3 years agoEnable code to read MAC address from the device tree on FDT platforms.
kettenis [Sat, 12 Jun 2021 09:26:47 +0000 (09:26 +0000)]
Enable code to read MAC address from the device tree on FDT platforms.

ok deraadt@, gkoehler@

3 years agospace between rfc and number;
jmc [Sat, 12 Jun 2021 06:39:17 +0000 (06:39 +0000)]
space between rfc and number;

3 years agoUse a new variable 'gpbytes' rather than 'sizeof(gp)' to control
krw [Sat, 12 Jun 2021 00:47:29 +0000 (00:47 +0000)]
Use a new variable 'gpbytes' rather than 'sizeof(gp)' to control
the number of bytes of partition entries to write to disk.

Set gpbytes to 'sizeof(gp)' so no functional change for now.

3 years agoOops. Restore error message when no free space found.
krw [Fri, 11 Jun 2021 23:49:49 +0000 (23:49 +0000)]
Oops. Restore error message when no free space found.

3 years agovmd(8): deduplicate vioblk command logic
dv [Fri, 11 Jun 2021 21:46:00 +0000 (21:46 +0000)]
vmd(8): deduplicate vioblk command logic

No need for each case in the switch block to have the same logic
for updating the used ring and writing the state back to the guest.
Move it outside the switch. No functional change.

ok mlarkin@

3 years agoAdd local function lba_free() to find the bounds of the largest
krw [Fri, 11 Jun 2021 20:28:12 +0000 (20:28 +0000)]
Add local function lba_free() to find the bounds of the largest
chunk of free space in a GPT. Steal logic from
GPT_get_lba_start().

No intentional functional change.

3 years agospace between RFC and number;
jmc [Fri, 11 Jun 2021 19:45:21 +0000 (19:45 +0000)]
space between RFC and number;

3 years agospace between RFC and number;
jmc [Fri, 11 Jun 2021 19:41:39 +0000 (19:41 +0000)]
space between RFC and number;

3 years agoremove netbsd specific LIBRARY section; ok jca
jmc [Fri, 11 Jun 2021 19:36:00 +0000 (19:36 +0000)]
remove netbsd specific LIBRARY section; ok jca

3 years agoOnly use SSL_AD_* internally.
jsing [Fri, 11 Jun 2021 17:29:48 +0000 (17:29 +0000)]
Only use SSL_AD_* internally.

Due to hysterical raisins there are three different types of defines for
alerts. SSL3_AD_* are from SSLv3, TLS1_AD_* are from TLSv1.0 onwards and
SSL_AD_* currently map to either an SSL3_AD_* or TLS1_AD_* define.

Currently, all three of these are used in various places - switch to using
just SSL_AD_* values internally, as a first step in cleaning this up.

ok tb@

3 years agosetitimer(2): don't round up it_value
cheloha [Fri, 11 Jun 2021 16:36:34 +0000 (16:36 +0000)]
setitimer(2): don't round up it_value

We can reduce latency for the first expiration of a timer if we don't
round it_value up to the minimum interval (1 tick).

While we're at it, we may as well consolidate all input validation and
adjustment into a single itimerfix() call.  There are no other callers
in the kernel (nor should there be), so remove the prototype from
sys/time.h.

Discussion: https://marc.info/?l=openbsd-tech&m=162084338005502&w=2

Tested by weerd@ and claudio@.

probably ok claudio@

3 years agoAdd local functions edit() and setpid().
krw [Fri, 11 Jun 2021 16:22:46 +0000 (16:22 +0000)]
Add local functions edit() and setpid().

Reduce Xedit()/Xsetpid() to parsing the partition number and
invoking [g]edit()/[g]setpid() appropriately.

No intentional functional change.

3 years agorecognise ALC897
jsg [Fri, 11 Jun 2021 15:50:43 +0000 (15:50 +0000)]
recognise ALC897

3 years agoenable snooping on Z590 HDA
jsg [Fri, 11 Jun 2021 15:46:09 +0000 (15:46 +0000)]
enable snooping on Z590 HDA

from Ashton Fagg

3 years agoregen
jsg [Fri, 11 Jun 2021 15:43:22 +0000 (15:43 +0000)]
regen

3 years agoadd a HDA device found in a Z590 machine
jsg [Fri, 11 Jun 2021 15:42:36 +0000 (15:42 +0000)]
add a HDA device found in a Z590 machine

from Ashton Fagg

3 years agoadd AES-GCM constants from RFC 7714 for SRTP
landry [Fri, 11 Jun 2021 15:28:13 +0000 (15:28 +0000)]
add AES-GCM constants from RFC 7714 for SRTP

SRTP_AEAD_AES_128_GCM/SRTP_AEAD_AES_256_GCM can be used as DTLS-SRTP
protection profiles - seen with an update of telephony/baresip i'm
working on.

adapted from openssl commit 43e5faa2539ae8aae6ef55be2239b9b1a77fea45

ok tb@ jsing@

3 years agoTake a bit more obvious care in gedit() to restore original
krw [Fri, 11 Jun 2021 14:02:22 +0000 (14:02 +0000)]
Take a bit more obvious care in gedit() to restore original
partition information when one of the modification steps (e.g.
setting the partition type via gsetpid()) fails.

3 years agoRevert previous change in ikev2_cp_fixaddr().
tobhe [Fri, 11 Jun 2021 13:11:20 +0000 (13:11 +0000)]
Revert previous change in ikev2_cp_fixaddr().
Fixes a regression found by landry@.

ok patrick@

3 years agoDrop received packets unless IFF_RUNNING is set. When hvn(4) attaches
patrick [Fri, 11 Jun 2021 12:47:15 +0000 (12:47 +0000)]
Drop received packets unless IFF_RUNNING is set.  When hvn(4) attaches
it sends commands and waits for replies to come back in.  The receive
pipe seems to contain both command completions and data packets.  When
waiting for command completion during hvn(4) attach, it's possible for
packets to show up as well.  We shouldn't call if_input() if hvn(4) is
not set up, so drop them when we're not running.

ok mikeb@

3 years agoStore the device tree node in the pcitag_t like we do on powerpc64 andi
kettenis [Fri, 11 Jun 2021 12:23:52 +0000 (12:23 +0000)]
Store the device tree node in the pcitag_t like we do on powerpc64 andi
sparc64.  For now, do this only for aplpcie(4) as we only need this
functionality for Apple Silicon systems.

ok patrick@

3 years agosync cert.pem with Mozilla's CA list generated from certdata.txt
sthen [Fri, 11 Jun 2021 11:40:35 +0000 (11:40 +0000)]
sync cert.pem with Mozilla's CA list generated from certdata.txt
(certificates with the "server auth" trust purpose permitted).
ok tb@

-AC Camerfirma S.A.
-  /C=EU/L=Madrid (see current address at www.camerfirma.com/address)/serialNumber=A82743287/O=AC Camerfirma S.A./CN=Chambers of Commerce Root - 2008
-  /C=EU/L=Madrid (see current address at www.camerfirma.com/address)/serialNumber=A82743287/O=AC Camerfirma S.A./CN=Global Chambersign Root - 2008
-

 FNMT-RCM
   /C=ES/O=FNMT-RCM/OU=AC RAIZ FNMT-RCM
+  /C=ES/O=FNMT-RCM/OU=Ceres/2.5.4.97=VATES-Q2826004J/CN=AC RAIZ FNMT-RCM SERVIDORES SEGUROS

-GeoTrust Inc.
-  /C=US/O=GeoTrust Inc./CN=GeoTrust Global CA
-  /C=US/O=GeoTrust Inc./OU=(c) 2007 GeoTrust Inc. - For authorized use only/CN=GeoTrust Primary Certification Authority - G2
-

 GlobalSign nv-sa
+  /C=BE/O=GlobalSign nv-sa/CN=GlobalSign Root E46
+  /C=BE/O=GlobalSign nv-sa/CN=GlobalSign Root R46
   /C=BE/O=GlobalSign nv-sa/OU=Root CA/CN=GlobalSign Root CA

 Staat der Nederlanden
   /C=NL/O=Staat der Nederlanden/CN=Staat der Nederlanden EV Root CA
-  /C=NL/O=Staat der Nederlanden/CN=Staat der Nederlanden Root CA - G3

 Unizeto Technologies S.A.
   /C=PL/O=Unizeto Technologies S.A./OU=Certum Certification Authority/CN=Certum Trusted Network CA
+  /C=PL/O=Unizeto Technologies S.A./OU=Certum Certification Authority/CN=Certum Trusted Network CA 2
-
-VeriSign, Inc.
-  /C=US/O=VeriSign, Inc./OU=VeriSign Trust Network/OU=(c) 2008 VeriSign, Inc. - For authorized use only/CN=VeriSign Universal Root Certification Authority

(Note, "Staat der Nederlanden Root CA - G3" was changed to email trust only,
so is removed from this due to it only listing "server auth" purposes).

3 years agoSSL3_AD_ILLEGAL_PARAMETER is not a valid SSLerror() reason code.
jsing [Fri, 11 Jun 2021 11:29:44 +0000 (11:29 +0000)]
SSL3_AD_ILLEGAL_PARAMETER is not a valid SSLerror() reason code.

Use SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER instead.

ok tb@

3 years agoIndent all labels with a single space.
jsing [Fri, 11 Jun 2021 11:13:53 +0000 (11:13 +0000)]
Indent all labels with a single space.

This ensures that diff reports the correct function prototype.

Prompted by tb@

3 years agoAdjust futex regress test since futex(2) now returns -1 on error and sets
kettenis [Fri, 11 Jun 2021 10:30:36 +0000 (10:30 +0000)]
Adjust futex regress test since futex(2) now returns -1 on error and sets
errno like any normal syscall.

ok mpi@, bluhm@

3 years agoSince futex(2) can fail, it needs a full syscall stub. This should fixes
kettenis [Fri, 11 Jun 2021 10:29:33 +0000 (10:29 +0000)]
Since futex(2) can fail, it needs a full syscall stub.  This should fixes
issues on powerpc64 and sparc64.

Note that this makes the lib/libpthread/errno test fail since that test
detects that we are touching errno now.  This will be addressed in a
future diff as it is not entirely clear whether the test is correct.

ok mpi@, bluhm@

3 years agolimit workaround for AMD errata 400 to family 0fh and 10h
jsg [Fri, 11 Jun 2021 05:33:16 +0000 (05:33 +0000)]
limit workaround for AMD errata 400 to family 0fh and 10h

AMD errata 400
"APIC Timer Interrupt Does Not Occur in Processor C-States"
is only mentioned in the revision guides for family 0fh and 10h
but we were checking for and disabling C1E on >= family 0fh.

Since family 16h all the bits of the Interrupt Pending MSR the
workaround uses are documented as read as zero.  So this didn't cause
any problems on real hardware but did on EPYC based AWS t3a instances
according to Ilya Voronin who sent an initial patch to not attempt the
workaround on family 17h.

Tested on non-virtualised EPYC 7702P 17-31-00 by Hrvoje Popovski and
Ryzen 5 2600X 17-08-02 by myself.
ok mlarkin@

3 years agoSort ID->pledge name translation in the same order as the manual page
deraadt [Fri, 11 Jun 2021 04:44:25 +0000 (04:44 +0000)]
Sort ID->pledge name translation in the same order as the manual page
(which are idiomatically sorted rather than numerically), so that ps(1)
"-o pledge" is easier to understand.
from Josh Rickmar
ok semarie kn dv

3 years agoRemember to lock kqueue mutex in filt_timermodify().
visa [Fri, 11 Jun 2021 04:29:54 +0000 (04:29 +0000)]
Remember to lock kqueue mutex in filt_timermodify().

Reported-by: syzbot+c2aba7645a218ce03027@syzkaller.appspotmail.com
3 years agoNo need to parse partition number more than necessary. Just pass
krw [Fri, 11 Jun 2021 00:14:50 +0000 (00:14 +0000)]
No need to parse partition number more than necessary. Just pass
a parsed number to the helper functions gedit() and gsetpid().

No functional change.

3 years agoMinor mandoc -Tlint fixes
jca [Thu, 10 Jun 2021 23:44:28 +0000 (23:44 +0000)]
Minor mandoc -Tlint fixes

ok mortimer@

3 years agoIndentation
jca [Thu, 10 Jun 2021 23:44:05 +0000 (23:44 +0000)]
Indentation

ok mortimer@

3 years agoNo RCS IDs in shlib_version files
jca [Thu, 10 Jun 2021 23:43:45 +0000 (23:43 +0000)]
No RCS IDs in shlib_version files

ok mortimer@

3 years agoMove libexecinfo regress tests under regress/gnu/lib
jca [Thu, 10 Jun 2021 23:40:46 +0000 (23:40 +0000)]
Move libexecinfo regress tests under regress/gnu/lib

Discussed with mortimer@ and bluhm@

3 years agoAnother hand rolled partition number parsing bites the dust.
krw [Thu, 10 Jun 2021 22:27:37 +0000 (22:27 +0000)]
Another hand rolled partition number parsing bites the dust.

3 years agoOops. Forgot to commit the version bump.
krw [Thu, 10 Jun 2021 22:17:58 +0000 (22:17 +0000)]
Oops. Forgot to commit the version bump.

3 years agoMissed an occurance of hand rolled partition number parsing.
krw [Thu, 10 Jun 2021 21:28:43 +0000 (21:28 +0000)]
Missed an occurance of hand rolled partition number parsing.

No intentional funtional change.

3 years agoFix readrec's definition of a record
millert [Thu, 10 Jun 2021 21:01:43 +0000 (21:01 +0000)]
Fix readrec's definition of a record
It is not sufficient to check for the EOF flag on a stream.
From https://github.com/onetrueawk/awk/pull/117

3 years agovmctl(8)/vmd(8): communicate TERMINATE_VM_EVENT imsgs on vm stop.
dv [Thu, 10 Jun 2021 19:50:05 +0000 (19:50 +0000)]
vmctl(8)/vmd(8): communicate TERMINATE_VM_EVENT imsgs on vm stop.

Instead of translating imsg types, update vmclt(8) to handle receiving
IMSG_VMDOP_TERMINATE_VM_EVENT messages on vm termination.

This finishes the work previously committed for supporting multiple
waiters or the cancellation of a client waiting on a vm shutdown.
vmd no longer needs to translate an IMSG_VMDOP_TERMINATE_VM_RESPONSE
into an *_EVENT.

ok mlarkin@

3 years agoAbstract repeated parsing of partition numbers into parsepn() to
krw [Thu, 10 Jun 2021 18:41:52 +0000 (18:41 +0000)]
Abstract repeated parsing of partition numbers into parsepn() to
simplify the code.

No intentional funtional change.

3 years agoSync efid_io() with the recent improvements kettenis@ made to
krw [Thu, 10 Jun 2021 18:06:35 +0000 (18:06 +0000)]
Sync efid_io() with the recent improvements kettenis@ made to
arm64 efid_io().

ok kettenis@

3 years agoSync efid_io() with the recent improvements kettenis@ made to
krw [Thu, 10 Jun 2021 18:05:20 +0000 (18:05 +0000)]
Sync efid_io() with the recent improvements kettenis@ made to
arm64 efid_io().

ok kettenis@

3 years agoLocal functions don't need to be in .h files, nor do they need the
krw [Thu, 10 Jun 2021 16:09:17 +0000 (16:09 +0000)]
Local functions don't need to be in .h files, nor do they need the
all caps prefixes.

No functional change.

3 years agoShift zeroing of gpt header and partition table to top of
krw [Thu, 10 Jun 2021 15:30:49 +0000 (15:30 +0000)]
Shift zeroing of gpt header and partition table to top of
MBR_init() from middle of MBR partition flag tweaking.

No functional change.

3 years agoToss in 'const' for the parameters to string_to_utf16le() and
krw [Thu, 10 Jun 2021 15:21:19 +0000 (15:21 +0000)]
Toss in 'const' for the parameters to string_to_utf16le() and
utf16le_to_string().

No functional change.

3 years agoSerialize internals of kqueue with a mutex
visa [Thu, 10 Jun 2021 15:10:56 +0000 (15:10 +0000)]
Serialize internals of kqueue with a mutex

Extend struct kqueue with a mutex and use it to serializes the internals
of each kqueue instance. This should make possible to call kqueue's
system call interface without the kernel lock. The event source facing
side of kqueue should now be MP-safe, too, as long as the event source
itself is MP-safe.

msleep() with PCATCH still requires the kernel lock. To manage with
this, kqueue_scan() locks the kernel temporarily for the section that
may sleep.

As a consequence of the kqueue mutex, knote_acquire() can lose a wakeup
when klist_invalidate() calls it. To preserve proper nesting of mutexes,
knote_acquire() has to release the kqueue mutex before it unlocks klist.
This early unlocking of the mutex lets badly timed wakeups go unnoticed.
However, the system should not hang because the sleep has a timeout.

Tested by gnezdo@ and mpi@

OK mpi@

3 years ago'i' is a silly name for a daddr_t variable, and could be needed
krw [Thu, 10 Jun 2021 15:09:16 +0000 (15:09 +0000)]
'i' is a silly name for a daddr_t variable, and could be needed
for a future 'for'. Use 'daddr' instead.

No functional change.

3 years agoRename vars 'oldpart' to 'oldgg' when storing 'gg' value, and
krw [Thu, 10 Jun 2021 15:01:34 +0000 (15:01 +0000)]
Rename vars 'oldpart' to 'oldgg' when storing 'gg' value, and
'oldpp' when storing 'pp' value.

A bit easier to read. No functional change.

3 years agoNuke extraneous blank line.
krw [Thu, 10 Jun 2021 14:53:27 +0000 (14:53 +0000)]
Nuke extraneous blank line.