diff --git a/lib/libcrypto/aes/aes.c b/lib/libcrypto/aes/aes.c index 4d040ea5f..d36a00636 100644 --- a/lib/libcrypto/aes/aes.c +++ b/lib/libcrypto/aes/aes.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aes.c,v 1.3 2024/03/30 05:14:12 joshua Exp $ */ +/* $OpenBSD: aes.c,v 1.4 2024/08/11 13:02:39 jsing Exp $ */ /* ==================================================================== * Copyright (c) 2002-2006 The OpenSSL Project. All rights reserved. * @@ -55,6 +55,8 @@ #include #include +#include "crypto_arch.h" + static const unsigned char aes_wrap_default_iv[] = { 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, }; diff --git a/lib/libcrypto/aes/aes_core.c b/lib/libcrypto/aes/aes_core.c index 335b1dba5..0472d5f4e 100644 --- a/lib/libcrypto/aes/aes_core.c +++ b/lib/libcrypto/aes/aes_core.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aes_core.c,v 1.23 2024/03/30 05:14:12 joshua Exp $ */ +/* $OpenBSD: aes_core.c,v 1.24 2024/08/11 13:02:39 jsing Exp $ */ /** * rijndael-alg-fst.c * @@ -35,6 +35,7 @@ #include #include "aes_local.h" +#include "crypto_arch.h" #include "crypto_internal.h" /* diff --git a/lib/libcrypto/arch/aarch64/crypto_arch.h b/lib/libcrypto/arch/aarch64/crypto_arch.h new file mode 100644 index 000000000..a3dd98d0c --- /dev/null +++ b/lib/libcrypto/arch/aarch64/crypto_arch.h @@ -0,0 +1,21 @@ +/* $OpenBSD: crypto_arch.h,v 1.1 2024/08/11 13:02:39 jsing Exp $ */ +/* + * Copyright (c) 2024 Joel Sing + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef HEADER_CRYPTO_ARCH_H +#define HEADER_CRYPTO_ARCH_H + +#endif diff --git a/lib/libcrypto/arch/alpha/crypto_arch.h b/lib/libcrypto/arch/alpha/crypto_arch.h new file mode 100644 index 000000000..a3dd98d0c --- /dev/null +++ b/lib/libcrypto/arch/alpha/crypto_arch.h @@ -0,0 +1,21 @@ +/* $OpenBSD: crypto_arch.h,v 1.1 2024/08/11 13:02:39 jsing Exp $ */ +/* + * Copyright (c) 2024 Joel Sing + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef HEADER_CRYPTO_ARCH_H +#define HEADER_CRYPTO_ARCH_H + +#endif diff --git a/lib/libcrypto/arch/amd64/Makefile.inc b/lib/libcrypto/arch/amd64/Makefile.inc index 0cf212b18..dd136f76a 100644 --- a/lib/libcrypto/arch/amd64/Makefile.inc +++ b/lib/libcrypto/arch/amd64/Makefile.inc @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.inc,v 1.28 2024/06/04 15:14:45 deraadt Exp $ +# $OpenBSD: Makefile.inc,v 1.29 2024/08/11 13:02:39 jsing Exp $ # amd64-specific libcrypto build rules @@ -13,11 +13,6 @@ SSLASM+= aes bsaes-x86_64 CFLAGS+= -DVPAES_ASM SSLASM+= aes vpaes-x86_64 SSLASM+= aes aesni-x86_64 -CFLAGS+= -DHAVE_AES_CBC_ENCRYPT_INTERNAL -CFLAGS+= -DHAVE_AES_SET_ENCRYPT_KEY_INTERNAL -CFLAGS+= -DHAVE_AES_SET_DECRYPT_KEY_INTERNAL -CFLAGS+= -DHAVE_AES_ENCRYPT_INTERNAL -CFLAGS+= -DHAVE_AES_DECRYPT_INTERNAL # bn CFLAGS+= -DOPENSSL_IA32_SSE2 CFLAGS+= -DRSA_ASM @@ -48,8 +43,6 @@ SSLASM+= md5 md5-x86_64 CFLAGS+= -DGHASH_ASM SSLASM+= modes ghash-x86_64 # rc4 -CFLAGS+= -DHAVE_RC4_INTERNAL -CFLAGS+= -DHAVE_RC4_SET_KEY_INTERNAL SSLASM+= rc4 rc4-x86_64 # ripemd # sha diff --git a/lib/libcrypto/arch/amd64/crypto_arch.h b/lib/libcrypto/arch/amd64/crypto_arch.h new file mode 100644 index 000000000..8e91c2552 --- /dev/null +++ b/lib/libcrypto/arch/amd64/crypto_arch.h @@ -0,0 +1,34 @@ +/* $OpenBSD: crypto_arch.h,v 1.1 2024/08/11 13:02:39 jsing Exp $ */ +/* + * Copyright (c) 2024 Joel Sing + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef HEADER_CRYPTO_ARCH_H +#define HEADER_CRYPTO_ARCH_H + +#ifndef OPENSSL_NO_ASM + +#define HAVE_AES_CBC_ENCRYPT_INTERNAL +#define HAVE_AES_SET_ENCRYPT_KEY_INTERNAL +#define HAVE_AES_SET_DECRYPT_KEY_INTERNAL +#define HAVE_AES_ENCRYPT_INTERNAL +#define HAVE_AES_DECRYPT_INTERNAL + +#define HAVE_RC4_INTERNAL +#define HAVE_RC4_SET_KEY_INTERNAL + +#endif + +#endif diff --git a/lib/libcrypto/arch/arm/Makefile.inc b/lib/libcrypto/arch/arm/Makefile.inc index 43c0589eb..b09b54a56 100644 --- a/lib/libcrypto/arch/arm/Makefile.inc +++ b/lib/libcrypto/arch/arm/Makefile.inc @@ -5,10 +5,6 @@ # aes CFLAGS+= -DAES_ASM SSLASM+= aes aes-armv4 -CFLAGS+= -DHAVE_AES_SET_ENCRYPT_KEY_INTERNAL -CFLAGS+= -DHAVE_AES_SET_DECRYPT_KEY_INTERNAL -CFLAGS+= -DHAVE_AES_ENCRYPT_INTERNAL -CFLAGS+= -DHAVE_AES_DECRYPT_INTERNAL # bn CFLAGS+= -DOPENSSL_BN_ASM_MONT SSLASM+= bn armv4-mont diff --git a/lib/libcrypto/arch/arm/crypto_arch.h b/lib/libcrypto/arch/arm/crypto_arch.h new file mode 100644 index 000000000..4276dc31e --- /dev/null +++ b/lib/libcrypto/arch/arm/crypto_arch.h @@ -0,0 +1,30 @@ +/* $OpenBSD: crypto_arch.h,v 1.1 2024/08/11 13:02:39 jsing Exp $ */ +/* + * Copyright (c) 2024 Joel Sing + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef HEADER_CRYPTO_ARCH_H +#define HEADER_CRYPTO_ARCH_H + +#ifndef OPENSSL_NO_ASM + +#define HAVE_AES_SET_ENCRYPT_KEY_INTERNAL +#define HAVE_AES_SET_DECRYPT_KEY_INTERNAL +#define HAVE_AES_ENCRYPT_INTERNAL +#define HAVE_AES_DECRYPT_INTERNAL + +#endif + +#endif diff --git a/lib/libcrypto/arch/hppa/Makefile.inc b/lib/libcrypto/arch/hppa/Makefile.inc index 9796d3a86..4e2675a60 100644 --- a/lib/libcrypto/arch/hppa/Makefile.inc +++ b/lib/libcrypto/arch/hppa/Makefile.inc @@ -1,12 +1,10 @@ -# $OpenBSD: Makefile.inc,v 1.24 2024/03/29 11:00:57 jsing Exp $ +# $OpenBSD: Makefile.inc,v 1.25 2024/08/11 13:02:39 jsing Exp $ # hppa-specific libcrypto build rules # aes CFLAGS+= -DAES_ASM SSLASM+= aes aes-parisc aes-parisc -CFLAGS+= -DHAVE_AES_ENCRYPT_INTERNAL -CFLAGS+= -DHAVE_AES_DECRYPT_INTERNAL # bn SSLASM+= bn parisc-mont parisc-mont CFLAGS+= -DOPENSSL_BN_ASM_MONT -DBN_DIV2W diff --git a/lib/libcrypto/arch/hppa/crypto_arch.h b/lib/libcrypto/arch/hppa/crypto_arch.h new file mode 100644 index 000000000..7f1fc36ca --- /dev/null +++ b/lib/libcrypto/arch/hppa/crypto_arch.h @@ -0,0 +1,28 @@ +/* $OpenBSD: crypto_arch.h,v 1.1 2024/08/11 13:02:39 jsing Exp $ */ +/* + * Copyright (c) 2024 Joel Sing + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef HEADER_CRYPTO_ARCH_H +#define HEADER_CRYPTO_ARCH_H + +#ifndef OPENSSL_NO_ASM + +#define HAVE_AES_ENCRYPT_INTERNAL +#define HAVE_AES_DECRYPT_INTERNAL + +#endif + +#endif diff --git a/lib/libcrypto/arch/i386/Makefile.inc b/lib/libcrypto/arch/i386/Makefile.inc index 37f6ba32b..eeaed44f8 100644 --- a/lib/libcrypto/arch/i386/Makefile.inc +++ b/lib/libcrypto/arch/i386/Makefile.inc @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.inc,v 1.24 2024/03/29 11:00:57 jsing Exp $ +# $OpenBSD: Makefile.inc,v 1.25 2024/08/11 13:02:39 jsing Exp $ # i386-specific libcrypto build rules @@ -11,11 +11,6 @@ SSLASM+= aes aes-586 CFLAGS+= -DVPAES_ASM SSLASM+= aes vpaes-x86 SSLASM+= aes aesni-x86 -CFLAGS+= -DHAVE_AES_CBC_ENCRYPT_INTERNAL -CFLAGS+= -DHAVE_AES_SET_ENCRYPT_KEY_INTERNAL -CFLAGS+= -DHAVE_AES_SET_DECRYPT_KEY_INTERNAL -CFLAGS+= -DHAVE_AES_ENCRYPT_INTERNAL -CFLAGS+= -DHAVE_AES_DECRYPT_INTERNAL # bn CFLAGS+= -DOPENSSL_IA32_SSE2 SSLASM+= bn bn-586 @@ -29,8 +24,6 @@ SSLASM+= md5 md5-586 CFLAGS+= -DGHASH_ASM SSLASM+= modes ghash-x86 # rc4 -CFLAGS+= -DHAVE_RC4_INTERNAL -CFLAGS+= -DHAVE_RC4_SET_KEY_INTERNAL SSLASM+= rc4 rc4-586 # sha CFLAGS+= -DSHA1_ASM diff --git a/lib/libcrypto/arch/i386/crypto_arch.h b/lib/libcrypto/arch/i386/crypto_arch.h new file mode 100644 index 000000000..8e91c2552 --- /dev/null +++ b/lib/libcrypto/arch/i386/crypto_arch.h @@ -0,0 +1,34 @@ +/* $OpenBSD: crypto_arch.h,v 1.1 2024/08/11 13:02:39 jsing Exp $ */ +/* + * Copyright (c) 2024 Joel Sing + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef HEADER_CRYPTO_ARCH_H +#define HEADER_CRYPTO_ARCH_H + +#ifndef OPENSSL_NO_ASM + +#define HAVE_AES_CBC_ENCRYPT_INTERNAL +#define HAVE_AES_SET_ENCRYPT_KEY_INTERNAL +#define HAVE_AES_SET_DECRYPT_KEY_INTERNAL +#define HAVE_AES_ENCRYPT_INTERNAL +#define HAVE_AES_DECRYPT_INTERNAL + +#define HAVE_RC4_INTERNAL +#define HAVE_RC4_SET_KEY_INTERNAL + +#endif + +#endif diff --git a/lib/libcrypto/arch/m88k/crypto_arch.h b/lib/libcrypto/arch/m88k/crypto_arch.h new file mode 100644 index 000000000..a3dd98d0c --- /dev/null +++ b/lib/libcrypto/arch/m88k/crypto_arch.h @@ -0,0 +1,21 @@ +/* $OpenBSD: crypto_arch.h,v 1.1 2024/08/11 13:02:39 jsing Exp $ */ +/* + * Copyright (c) 2024 Joel Sing + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef HEADER_CRYPTO_ARCH_H +#define HEADER_CRYPTO_ARCH_H + +#endif diff --git a/lib/libcrypto/arch/mips64/Makefile.inc b/lib/libcrypto/arch/mips64/Makefile.inc index 41d6b0e88..9e08b442a 100644 --- a/lib/libcrypto/arch/mips64/Makefile.inc +++ b/lib/libcrypto/arch/mips64/Makefile.inc @@ -1,14 +1,10 @@ -# $OpenBSD: Makefile.inc,v 1.17 2024/03/29 11:00:57 jsing Exp $ +# $OpenBSD: Makefile.inc,v 1.18 2024/08/11 13:02:39 jsing Exp $ # mips64-specific libcrypto build rules # aes CFLAGS+= -DAES_ASM SSLASM+= aes aes-mips aes-mips -CFLAGS+= -DHAVE_AES_SET_ENCRYPT_KEY_INTERNAL -CFLAGS+= -DHAVE_AES_SET_DECRYPT_KEY_INTERNAL -CFLAGS+= -DHAVE_AES_ENCRYPT_INTERNAL -CFLAGS+= -DHAVE_AES_DECRYPT_INTERNAL # bn SSLASM+= bn mips bn-mips SSLASM+= bn mips-mont mips-mont diff --git a/lib/libcrypto/arch/mips64/crypto_arch.h b/lib/libcrypto/arch/mips64/crypto_arch.h new file mode 100644 index 000000000..4276dc31e --- /dev/null +++ b/lib/libcrypto/arch/mips64/crypto_arch.h @@ -0,0 +1,30 @@ +/* $OpenBSD: crypto_arch.h,v 1.1 2024/08/11 13:02:39 jsing Exp $ */ +/* + * Copyright (c) 2024 Joel Sing + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef HEADER_CRYPTO_ARCH_H +#define HEADER_CRYPTO_ARCH_H + +#ifndef OPENSSL_NO_ASM + +#define HAVE_AES_SET_ENCRYPT_KEY_INTERNAL +#define HAVE_AES_SET_DECRYPT_KEY_INTERNAL +#define HAVE_AES_ENCRYPT_INTERNAL +#define HAVE_AES_DECRYPT_INTERNAL + +#endif + +#endif diff --git a/lib/libcrypto/arch/powerpc/crypto_arch.h b/lib/libcrypto/arch/powerpc/crypto_arch.h new file mode 100644 index 000000000..a3dd98d0c --- /dev/null +++ b/lib/libcrypto/arch/powerpc/crypto_arch.h @@ -0,0 +1,21 @@ +/* $OpenBSD: crypto_arch.h,v 1.1 2024/08/11 13:02:39 jsing Exp $ */ +/* + * Copyright (c) 2024 Joel Sing + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef HEADER_CRYPTO_ARCH_H +#define HEADER_CRYPTO_ARCH_H + +#endif diff --git a/lib/libcrypto/arch/powerpc64/crypto_arch.h b/lib/libcrypto/arch/powerpc64/crypto_arch.h new file mode 100644 index 000000000..a3dd98d0c --- /dev/null +++ b/lib/libcrypto/arch/powerpc64/crypto_arch.h @@ -0,0 +1,21 @@ +/* $OpenBSD: crypto_arch.h,v 1.1 2024/08/11 13:02:39 jsing Exp $ */ +/* + * Copyright (c) 2024 Joel Sing + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef HEADER_CRYPTO_ARCH_H +#define HEADER_CRYPTO_ARCH_H + +#endif diff --git a/lib/libcrypto/arch/riscv64/crypto_arch.h b/lib/libcrypto/arch/riscv64/crypto_arch.h new file mode 100644 index 000000000..a3dd98d0c --- /dev/null +++ b/lib/libcrypto/arch/riscv64/crypto_arch.h @@ -0,0 +1,21 @@ +/* $OpenBSD: crypto_arch.h,v 1.1 2024/08/11 13:02:39 jsing Exp $ */ +/* + * Copyright (c) 2024 Joel Sing + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef HEADER_CRYPTO_ARCH_H +#define HEADER_CRYPTO_ARCH_H + +#endif diff --git a/lib/libcrypto/arch/sh/crypto_arch.h b/lib/libcrypto/arch/sh/crypto_arch.h new file mode 100644 index 000000000..a3dd98d0c --- /dev/null +++ b/lib/libcrypto/arch/sh/crypto_arch.h @@ -0,0 +1,21 @@ +/* $OpenBSD: crypto_arch.h,v 1.1 2024/08/11 13:02:39 jsing Exp $ */ +/* + * Copyright (c) 2024 Joel Sing + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef HEADER_CRYPTO_ARCH_H +#define HEADER_CRYPTO_ARCH_H + +#endif diff --git a/lib/libcrypto/arch/sparc64/Makefile.inc b/lib/libcrypto/arch/sparc64/Makefile.inc index c4b303f44..9101d8a89 100644 --- a/lib/libcrypto/arch/sparc64/Makefile.inc +++ b/lib/libcrypto/arch/sparc64/Makefile.inc @@ -1,12 +1,10 @@ -# $OpenBSD: Makefile.inc,v 1.18 2024/03/29 11:00:57 jsing Exp $ +# $OpenBSD: Makefile.inc,v 1.19 2024/08/11 13:02:39 jsing Exp $ # sparc64-specific libcrypto build rules # aes CFLAGS+= -DAES_ASM SSLASM+= aes aes-sparcv9 aes-sparcv9 -CFLAGS+= -DHAVE_AES_ENCRYPT_INTERNAL -CFLAGS+= -DHAVE_AES_DECRYPT_INTERNAL # bn # modes CFLAGS+= -DGHASH_ASM diff --git a/lib/libcrypto/arch/sparc64/crypto_arch.h b/lib/libcrypto/arch/sparc64/crypto_arch.h new file mode 100644 index 000000000..7f1fc36ca --- /dev/null +++ b/lib/libcrypto/arch/sparc64/crypto_arch.h @@ -0,0 +1,28 @@ +/* $OpenBSD: crypto_arch.h,v 1.1 2024/08/11 13:02:39 jsing Exp $ */ +/* + * Copyright (c) 2024 Joel Sing + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef HEADER_CRYPTO_ARCH_H +#define HEADER_CRYPTO_ARCH_H + +#ifndef OPENSSL_NO_ASM + +#define HAVE_AES_ENCRYPT_INTERNAL +#define HAVE_AES_DECRYPT_INTERNAL + +#endif + +#endif diff --git a/lib/libcrypto/crypto_internal.h b/lib/libcrypto/crypto_internal.h index 8229db2d6..7676076f6 100644 --- a/lib/libcrypto/crypto_internal.h +++ b/lib/libcrypto/crypto_internal.h @@ -1,4 +1,4 @@ -/* $OpenBSD: crypto_internal.h,v 1.10 2024/04/17 14:43:37 jsing Exp $ */ +/* $OpenBSD: crypto_internal.h,v 1.11 2024/08/11 13:02:39 jsing Exp $ */ /* * Copyright (c) 2023 Joel Sing * @@ -20,6 +20,8 @@ #include #include +#include "crypto_arch.h" + #ifndef HEADER_CRYPTO_INTERNAL_H #define HEADER_CRYPTO_INTERNAL_H diff --git a/lib/libcrypto/rc4/rc4.c b/lib/libcrypto/rc4/rc4.c index 203fee499..930d0d9bb 100644 --- a/lib/libcrypto/rc4/rc4.c +++ b/lib/libcrypto/rc4/rc4.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rc4.c,v 1.11 2024/03/28 12:11:26 jsing Exp $ */ +/* $OpenBSD: rc4.c,v 1.12 2024/08/11 13:02:39 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -60,6 +60,8 @@ #include +#include "crypto_arch.h" + /* RC4 as implemented from a posting from * Newsgroups: sci.crypt * From: sterndark@netcom.com (David Sterndark) diff --git a/lib/libssl/Makefile b/lib/libssl/Makefile index 1100b99ce..652ad4238 100644 --- a/lib/libssl/Makefile +++ b/lib/libssl/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.84 2024/07/13 18:33:18 tb Exp $ +# $OpenBSD: Makefile,v 1.85 2024/08/11 13:04:46 jsing Exp $ .include .ifndef NOMAN @@ -24,6 +24,7 @@ CFLAGS+= -DTLS13_DEBUG .endif CFLAGS+= -I${.CURDIR} CFLAGS+= -I${.CURDIR}/../libcrypto +CFLAGS+= -I${.CURDIR}/../libcrypto/arch/${MACHINE_CPU} CFLAGS+= -I${.CURDIR}/../libcrypto/hidden CFLAGS+= -I${.CURDIR}/../libcrypto/bio CFLAGS+= -I${.CURDIR}/hidden diff --git a/regress/lib/libcrypto/crypto/Makefile b/regress/lib/libcrypto/crypto/Makefile index 34a4e7050..c766cd8f4 100644 --- a/regress/lib/libcrypto/crypto/Makefile +++ b/regress/lib/libcrypto/crypto/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.1 2024/04/25 14:27:29 jsing Exp $ +# $OpenBSD: Makefile,v 1.2 2024/08/11 13:05:43 jsing Exp $ PROG = crypto_test @@ -8,5 +8,6 @@ LDFLAGS+= -lcrypto CFLAGS+= -DLIBRESSL_INTERNAL CFLAGS+= -Wall -Wundef -Werror CFLAGS+= -I${.CURDIR}/../../../../lib/libcrypto +CFLAGS+= -I${.CURDIR}/../../../../lib/libcrypto/arch/${MACHINE_CPU} .include diff --git a/sbin/dhcpleased/dhcpleased.8 b/sbin/dhcpleased/dhcpleased.8 index 4b42b5639..23c6c2ffb 100644 --- a/sbin/dhcpleased/dhcpleased.8 +++ b/sbin/dhcpleased/dhcpleased.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: dhcpleased.8,v 1.6 2023/03/02 17:09:52 jmc Exp $ +.\" $OpenBSD: dhcpleased.8,v 1.7 2024/08/11 06:07:37 jmc Exp $ .\" .\" Copyright (c) 2021 Florian Obser .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: March 2 2023 $ +.Dd $Mdocdate: August 11 2024 $ .Dt DHCPLEASED 8 .Os .Sh NAME @@ -28,11 +28,16 @@ .Sh DESCRIPTION .Nm is a dynamic host configuration protocol (DHCP) daemon for clients. -It requests IP configuration information from for example those offered by -.Xr dhcpd 8 , -on interfaces with the +If an interface has the .Sy AUTOCONF4 -flag set. +flag set +(auto configuration is enabled), +.Nm +sends requests for IP configuration information from a DHCP server, +such as +.Xr dhcpd 8 , +and uses that information to configure the relevant interface. +.Pp See .Xr hostname.if 5 and @@ -41,9 +46,8 @@ on how to enable auto configuration on an interface. .Pp .Nm monitors network interface states (interface going up or down, -auto configuration enabled or disabled etc.) and sends requests +auto configuration enabled or disabled, etc.) and sends requests when necessary. -.Pp A running .Nm can be controlled with the diff --git a/sbin/slaacd/slaacd.8 b/sbin/slaacd/slaacd.8 index 4ffc3143c..e51ff5ee4 100644 --- a/sbin/slaacd/slaacd.8 +++ b/sbin/slaacd/slaacd.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: slaacd.8,v 1.12 2023/03/02 17:09:54 jmc Exp $ +.\" $OpenBSD: slaacd.8,v 1.13 2024/08/11 06:07:37 jmc Exp $ .\" .\" Copyright (c) 2017 Florian Obser .\" Copyright (c) 2016 Kenneth R Westerback @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: March 2 2023 $ +.Dd $Mdocdate: August 11 2024 $ .Dt SLAACD 8 .Os .Sh NAME @@ -28,15 +28,16 @@ .Sh DESCRIPTION .Nm is a stateless address autoconfiguration (SLAAC) daemon for clients. -It listens for IPv6 router advertisement messages, -for example those sent by -.Xr rad 8 , -on interfaces with the +If an interface has the .Sy AUTOCONF6 -flag set. +flag set +(auto configuration is enabled), .Nm -derives IPv6 addresses and default routes from received router -advertisements and installs them in the kernel. +regularly sends out requests for IPv6 router advertisement messages, +such as those sent by +.Xr rad 8 , +and uses those messages to configure the relevant interface. +.Pp See .Xr hostname.if 5 and @@ -44,10 +45,9 @@ and on how to enable auto configuration on an interface. .Pp .Nm -monitors network interface states (interface going up or down, -auto configuration enabled or disabled etc.) and sends router solicitations -when necessary. -.Pp +monitors network interface states +(interface going up or down, auto configuration enabled or disabled, etc.)\& +and sends router solicitations when necessary. A running .Nm can be controlled with the diff --git a/share/man/man4/dwxe.4 b/share/man/man4/dwxe.4 index cc92d9399..22a887fd6 100644 --- a/share/man/man4/dwxe.4 +++ b/share/man/man4/dwxe.4 @@ -1,4 +1,4 @@ -.\" $OpenBSD: dwxe.4,v 1.3 2022/03/21 14:56:16 miod Exp $ +.\" $OpenBSD: dwxe.4,v 1.4 2024/08/11 08:25:12 dtucker Exp $ .\" .\" Copyright (c) 2016 Mark Kettenis .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: March 21 2022 $ +.Dd $Mdocdate: August 11 2024 $ .Dt DWXE 4 .Os .Sh NAME @@ -28,7 +28,7 @@ The .Nm driver provides support for various Ethernet controllers based on the Allwinner EMAC. -These controllers are found on the Allwinner H3/H5/A64 SoCs. +These controllers are found on the Allwinner A64/H3/H5/H6/H616 SoCs. .Pp The .Nm diff --git a/share/man/man9/timeout.9 b/share/man/man9/timeout.9 index 61dff038e..77a7c7f49 100644 --- a/share/man/man9/timeout.9 +++ b/share/man/man9/timeout.9 @@ -1,4 +1,4 @@ -.\" $OpenBSD: timeout.9,v 1.58 2024/08/05 23:52:03 dlg Exp $ +.\" $OpenBSD: timeout.9,v 1.59 2024/08/11 00:50:38 dlg Exp $ .\" .\" Copyright (c) 2000 Artur Grabowski .\" Copyright (c) 2021, 2022 Scott Cheloha @@ -24,7 +24,7 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF .\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: August 5 2024 $ +.Dd $Mdocdate: August 11 2024 $ .Dt TIMEOUT_SET 9 .Os .Sh NAME @@ -83,12 +83,12 @@ .Ft int .Fo timeout_add_msec .Fa "struct timeout *to" -.Fa "int msecs" +.Fa "uint64_t msecs" .Fc .Ft int .Fo timeout_add_usec .Fa "struct timeout *to" -.Fa "int usecs" +.Fa "uint64_t usecs" .Fc .Ft int .Fo timeout_add_nsec diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c index 29f84dd03..de66b0a45 100644 --- a/sys/dev/acpi/acpi.c +++ b/sys/dev/acpi/acpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi.c,v 1.436 2024/07/30 19:47:06 mglocker Exp $ */ +/* $OpenBSD: acpi.c,v 1.437 2024/08/10 23:28:17 deraadt Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert * Copyright (c) 2005 Jordan Hargrave @@ -2591,8 +2591,6 @@ acpi_resume_pm(struct acpi_softc *sc, int fromstate) acpi_disable_allgpes(sc); acpi_enable_rungpes(sc); - acpi_indicator(sc, ACPI_SST_WAKING); - /* 2nd resume AML step: _WAK(fromstate) */ aml_node_setval(sc, sc->sc_wak, fromstate); diff --git a/sys/dev/acpi/acpi_x86.c b/sys/dev/acpi/acpi_x86.c index bede626c6..4eda07c8c 100644 --- a/sys/dev/acpi/acpi_x86.c +++ b/sys/dev/acpi/acpi_x86.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi_x86.c,v 1.25 2024/08/08 07:02:38 kettenis Exp $ */ +/* $OpenBSD: acpi_x86.c,v 1.29 2024/08/11 17:30:28 deraadt Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert * Copyright (c) 2005 Jordan Hargrave @@ -80,7 +80,6 @@ sleep_setstate(void *v) if (aml_node_setval(sc, sc->sc_pts, sc->sc_state) != 0) return (EINVAL); } - acpi_indicator(sc, ACPI_SST_WAKING); /* blink */ return 0; } @@ -126,6 +125,7 @@ gosleep(void *v) if (sc->sc_pmc_resume) sc->sc_pmc_resume(sc->sc_pmc_cookie); + acpi_indicator(sc, ACPI_SST_WAKING); /* blink */ return ret; } @@ -143,7 +143,6 @@ sleep_resume(void *v) if (aml_node_setval(sc, sc->sc_tts, ACPI_STATE_S0) != 0) return (EINVAL); } - acpi_indicator(sc, ACPI_SST_WAKING); /* blink */ return 0; } diff --git a/sys/dev/pci/drm/i915/i915_driver.c b/sys/dev/pci/drm/i915/i915_driver.c index df45f227f..d7d994628 100644 --- a/sys/dev/pci/drm/i915/i915_driver.c +++ b/sys/dev/pci/drm/i915/i915_driver.c @@ -2080,7 +2080,6 @@ inteldrm_doswitch(void *v) { struct inteldrm_softc *dev_priv = v; struct rasops_info *ri = &dev_priv->ro; - struct drm_device *dev = &dev_priv->drm; rasops_show_screen(ri, dev_priv->switchcookie, 0, NULL, NULL); intel_fbdev_restore_mode(dev_priv); @@ -2094,7 +2093,6 @@ inteldrm_enter_ddb(void *v, void *cookie) { struct inteldrm_softc *dev_priv = v; struct rasops_info *ri = &dev_priv->ro; - struct drm_device *dev = &dev_priv->drm; if (cookie == ri->ri_active) return; @@ -2252,11 +2250,9 @@ inteldrm_attach(struct device *parent, struct device *self, void *aux) struct drm_device *dev; struct pci_attach_args *pa = aux; const struct pci_device_id *id; - struct intel_device_info *info, *device_info; - struct intel_runtime_info *runtime; + struct intel_device_info *info; extern int vga_console_attached; int mmio_bar, mmio_size, mmio_type; - int ret; dev_priv->pa = pa; dev_priv->pc = pa->pa_pc; @@ -2309,8 +2305,10 @@ inteldrm_attach(struct device *parent, struct device *self, void *aux) /* uc_expand_default_options() with no GuC submission */ if (GRAPHICS_VER(dev_priv) >= 12 && - !IS_TIGERLAKE(dev_priv) && !IS_ROCKETLAKE(dev_priv) && - !IS_XEHPSDV(dev_priv) && !IS_PONTEVECCHIO(dev_priv)) + (INTEL_INFO(dev_priv)->platform != INTEL_TIGERLAKE) && + (INTEL_INFO(dev_priv)->platform != INTEL_ROCKETLAKE) && + (INTEL_INFO(dev_priv)->platform != INTEL_XEHPSDV) && + (INTEL_INFO(dev_priv)->platform != INTEL_PONTEVECCHIO)) dev_priv->params.enable_guc = ENABLE_GUC_LOAD_HUC; mmio_bar = (GRAPHICS_VER(dev_priv) == 2) ? 0x14 : 0x10; @@ -2394,8 +2392,10 @@ inteldrm_attach(struct device *parent, struct device *self, void *aux) void inteldrm_forcedetach(struct inteldrm_softc *dev_priv) { +#ifdef notyet struct pci_softc *psc = (struct pci_softc *)dev_priv->sc_dev.dv_parent; pcitag_t tag = dev_priv->tag; +#endif extern int vga_console_attached; if (dev_priv->primary) { @@ -2420,7 +2420,6 @@ inteldrm_attachhook(struct device *self) struct rasops_info *ri = &dev_priv->ro; struct wsemuldisplaydev_attach_args aa; const struct pci_device_id *id = dev_priv->id; - struct drm_device *dev = &dev_priv->drm; int orientation_quirk; if (inteldrm_refcnt == 0) { @@ -2629,7 +2628,6 @@ inteldrm_firmware_backlight(struct inteldrm_softc *dev_priv, void inteldrm_init_backlight(struct inteldrm_softc *dev_priv) { - struct drm_device *dev = &dev_priv->drm; struct wsdisplay_param dp; dp.param = WSDISPLAYIO_PARAM_BRIGHTNESS; diff --git a/sys/dev/pci/drm/include/linux/ioport.h b/sys/dev/pci/drm/include/linux/ioport.h index c5ebffd83..fe01660c6 100644 --- a/sys/dev/pci/drm/include/linux/ioport.h +++ b/sys/dev/pci/drm/include/linux/ioport.h @@ -10,6 +10,7 @@ struct resource { u_long start; u_long end; + const char *name; }; static inline resource_size_t @@ -22,6 +23,7 @@ resource_size(const struct resource *r) (struct resource) { \ .start = (_start), \ .end = (_start) + (_size) - 1, \ + .name = NULL, \ } #endif diff --git a/sys/dev/pci/if_igc.c b/sys/dev/pci/if_igc.c index a79daae0b..f3855873d 100644 --- a/sys/dev/pci/if_igc.c +++ b/sys/dev/pci/if_igc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_igc.c,v 1.26 2024/08/08 14:58:49 jan Exp $ */ +/* $OpenBSD: if_igc.c,v 1.27 2024/08/11 01:02:10 dlg Exp $ */ /*- * SPDX-License-Identifier: BSD-2-Clause * @@ -202,6 +202,7 @@ igc_attach(struct device *parent, struct device *self, void *aux) /* Determine hardware and mac info */ igc_identify_hardware(sc); + sc->rx_mbuf_sz = MCLBYTES; sc->num_tx_desc = IGC_DEFAULT_TXD; sc->num_rx_desc = IGC_DEFAULT_RXD; @@ -881,7 +882,6 @@ igc_init(void *arg) } igc_initialize_transmit_unit(sc); - sc->rx_mbuf_sz = MCLBYTES; /* Prepare receive descriptors and buffers. */ if (igc_setup_receive_structures(sc)) { printf("%s: Could not setup receive structures\n", @@ -1232,7 +1232,7 @@ igc_rxrinfo(struct igc_softc *sc, struct if_rxrinfo *ifri) for (i = 0; i < sc->sc_nqueues; i++) { rxr = &sc->rx_rings[i]; - ifr[n].ifr_size = MCLBYTES; + ifr[n].ifr_size = sc->rx_mbuf_sz; snprintf(ifr[n].ifr_name, sizeof(ifr[n].ifr_name), "%d", i); ifr[n].ifr_info = rxr->rx_ring; n++; @@ -1673,11 +1673,11 @@ igc_get_buf(struct igc_rxring *rxr, int i) return ENOBUFS; } - m = MCLGETL(NULL, M_DONTWAIT, sc->rx_mbuf_sz); + m = MCLGETL(NULL, M_DONTWAIT, sc->rx_mbuf_sz + ETHER_ALIGN); if (!m) return ENOBUFS; - m->m_data += (m->m_ext.ext_size - sc->rx_mbuf_sz); + m->m_data += ETHER_ALIGN; m->m_len = m->m_pkthdr.len = sc->rx_mbuf_sz; error = bus_dmamap_load_mbuf(rxr->rxdma.dma_tag, rxbuf->map, m, @@ -2159,7 +2159,7 @@ igc_allocate_receive_buffers(struct igc_rxring *rxr) rxbuf = rxr->rx_buffers; for (i = 0; i < sc->num_rx_desc; i++, rxbuf++) { error = bus_dmamap_create(rxr->rxdma.dma_tag, - MAX_JUMBO_FRAME_SIZE, IGC_MAX_SCATTER, MCLBYTES, 0, + sc->rx_mbuf_sz, 1, sc->rx_mbuf_sz, 0, BUS_DMA_NOWAIT, &rxbuf->map); if (error) { printf("%s: Unable to create RX DMA map\n", @@ -2223,7 +2223,8 @@ igc_setup_receive_ring(struct igc_rxring *rxr) rxr->next_to_check = 0; rxr->last_desc_filled = sc->num_rx_desc - 1; - if_rxr_init(&rxr->rx_ring, 2 * ((ifp->if_hardmtu / MCLBYTES) + 1), + if_rxr_init(&rxr->rx_ring, + 2 * howmany(ifp->if_hardmtu, sc->rx_mbuf_sz) + 1, sc->num_rx_desc - 1); return 0; diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index 280af8ce0..a1d145632 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_exit.c,v 1.230 2024/08/06 18:41:20 claudio Exp $ */ +/* $OpenBSD: kern_exit.c,v 1.231 2024/08/11 15:10:53 mvs Exp $ */ /* $NetBSD: kern_exit.c,v 1.39 1996/04/22 01:38:25 christos Exp $ */ /* @@ -151,6 +151,9 @@ exit1(struct proc *p, int xexit, int xsig, int flags) PS_ISPWAIT); wakeup(pr->ps_pptr); } + + /* Wait for concurrent `allprocess' loops */ + refcnt_finalize(&pr->ps_refcnt, "psdtor"); } /* unlink ourselves from the active threads */ diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index bedd7dd48..d801b2c8e 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_fork.c,v 1.261 2024/08/06 08:44:54 claudio Exp $ */ +/* $OpenBSD: kern_fork.c,v 1.262 2024/08/11 15:10:53 mvs Exp $ */ /* $NetBSD: kern_fork.c,v 1.29 1996/02/09 18:59:34 christos Exp $ */ /* @@ -178,6 +178,8 @@ thread_new(struct proc *parent, vaddr_t uaddr) void process_initialize(struct process *pr, struct proc *p) { + refcnt_init(&pr->ps_refcnt); + /* initialize the thread links */ pr->ps_mainproc = p; TAILQ_INIT(&pr->ps_threads); diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index 8a5f2852e..c000c90c6 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sysctl.c,v 1.436 2024/08/08 15:02:36 bluhm Exp $ */ +/* $OpenBSD: kern_sysctl.c,v 1.437 2024/08/11 15:10:53 mvs Exp $ */ /* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */ /*- @@ -1686,6 +1686,9 @@ sysctl_file(int *name, u_int namelen, char *where, size_t *sizep, /* not the pid we are looking for */ continue; } + + refcnt_take(&pr->ps_refcnt); + matched = 1; fdp = pr->ps_fd; if (pr->ps_textvp) @@ -1702,6 +1705,9 @@ sysctl_file(int *name, u_int namelen, char *where, size_t *sizep, FILLIT(fp, fdp, i, NULL, pr); FRELE(fp, p); } + + refcnt_rele_wake(&pr->ps_refcnt); + /* pid is unique, stop searching */ if (arg >= 0) break; @@ -1721,6 +1727,9 @@ sysctl_file(int *name, u_int namelen, char *where, size_t *sizep, /* not the uid we are looking for */ continue; } + + refcnt_take(&pr->ps_refcnt); + fdp = pr->ps_fd; if (fdp->fd_cdir) FILLIT(NULL, NULL, KERN_FILE_CDIR, fdp->fd_cdir, pr); @@ -1734,6 +1743,8 @@ sysctl_file(int *name, u_int namelen, char *where, size_t *sizep, FILLIT(fp, fdp, i, NULL, pr); FRELE(fp, p); } + + refcnt_rele_wake(&pr->ps_refcnt); } break; default: diff --git a/sys/kern/kern_timeout.c b/sys/kern/kern_timeout.c index 19d0fbae4..5a8a7e46a 100644 --- a/sys/kern/kern_timeout.c +++ b/sys/kern/kern_timeout.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_timeout.c,v 1.98 2024/08/05 23:51:11 dlg Exp $ */ +/* $OpenBSD: kern_timeout.c,v 1.99 2024/08/11 00:49:34 dlg Exp $ */ /* * Copyright (c) 2001 Thomas Nordin * Copyright (c) 2000-2001 Artur Grabowski @@ -332,18 +332,25 @@ timeout_add(struct timeout *new, int to_ticks) return ret; } +static inline int +timeout_add_ticks(struct timeout *to, uint64_t to_ticks, int notzero) +{ + if (to_ticks > INT_MAX) + to_ticks = INT_MAX; + else if (to_ticks == 0 && notzero) + to_ticks = 1; + + return timeout_add(to, (int)to_ticks); +} + int timeout_add_tv(struct timeout *to, const struct timeval *tv) { uint64_t to_ticks; to_ticks = (uint64_t)hz * tv->tv_sec + tv->tv_usec / tick; - if (to_ticks > INT_MAX) - to_ticks = INT_MAX; - if (to_ticks == 0 && tv->tv_usec > 0) - to_ticks = 1; - return timeout_add(to, (int)to_ticks); + return timeout_add_ticks(to, to_ticks, tv->tv_usec > 0); } int @@ -352,37 +359,28 @@ timeout_add_sec(struct timeout *to, int secs) uint64_t to_ticks; to_ticks = (uint64_t)hz * secs; - if (to_ticks > INT_MAX) - to_ticks = INT_MAX; - if (to_ticks == 0) - to_ticks = 1; - return timeout_add(to, (int)to_ticks); + return timeout_add_ticks(to, to_ticks, 1); } int -timeout_add_msec(struct timeout *to, int msecs) +timeout_add_msec(struct timeout *to, uint64_t msecs) { uint64_t to_ticks; - to_ticks = (uint64_t)msecs * 1000 / tick; - if (to_ticks > INT_MAX) - to_ticks = INT_MAX; - if (to_ticks == 0 && msecs > 0) - to_ticks = 1; + to_ticks = msecs * 1000 / tick; - return timeout_add(to, (int)to_ticks); + return timeout_add_ticks(to, to_ticks, msecs > 0); } int -timeout_add_usec(struct timeout *to, int usecs) +timeout_add_usec(struct timeout *to, uint64_t usecs) { - int to_ticks = usecs / tick; + uint64_t to_ticks; - if (to_ticks == 0 && usecs > 0) - to_ticks = 1; + to_ticks = usecs / tick; - return timeout_add(to, to_ticks); + return timeout_add_ticks(to, to_ticks, usecs > 0); } int @@ -391,12 +389,8 @@ timeout_add_nsec(struct timeout *to, uint64_t nsecs) uint64_t to_ticks; to_ticks = nsecs / (tick * 1000); - if (to_ticks > INT_MAX) - to_ticks = INT_MAX; - if (to_ticks == 0 && nsecs > 0) - to_ticks = 1; - return timeout_add(to, (int)to_ticks); + return timeout_add_ticks(to, to_ticks, nsecs > 0); } int diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 83e5c133d..ce7c8e5a7 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_socket.c,v 1.342 2024/08/06 20:14:56 mvs Exp $ */ +/* $OpenBSD: uipc_socket.c,v 1.343 2024/08/11 00:19:00 jsg Exp $ */ /* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */ /* @@ -1581,7 +1581,7 @@ sotask(void *arg) int sockstream = (so->so_proto->pr_flags & PR_WANTRCVD); /* - * sblock() on `so_rcv' protects sockets from beind unspliced + * sblock() on `so_rcv' protects sockets from being unspliced * for UDP case. TCP sockets still rely on solock(). */ diff --git a/sys/sys/proc.h b/sys/sys/proc.h index e0f6aa0cb..01eb58bb3 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -1,4 +1,4 @@ -/* $OpenBSD: proc.h,v 1.367 2024/08/06 08:44:54 claudio Exp $ */ +/* $OpenBSD: proc.h,v 1.369 2024/08/11 21:07:05 mvs Exp $ */ /* $NetBSD: proc.h,v 1.44 1996/04/22 01:23:21 christos Exp $ */ /*- @@ -50,6 +50,7 @@ #include /* For struct rusage */ #include /* For struct rwlock */ #include /* For struct sigio */ +#include /* For struct refcnt */ #ifdef _KERNEL #include @@ -142,6 +143,8 @@ struct pinsyscall { * T itimer_mtx */ struct process { + struct refcnt ps_refcnt; + /* * ps_mainproc is the original thread in the process. * It's only still special for the handling of diff --git a/sys/sys/timeout.h b/sys/sys/timeout.h index 903877d4f..e4eb5b79a 100644 --- a/sys/sys/timeout.h +++ b/sys/sys/timeout.h @@ -1,4 +1,4 @@ -/* $OpenBSD: timeout.h,v 1.49 2024/08/05 23:51:11 dlg Exp $ */ +/* $OpenBSD: timeout.h,v 1.50 2024/08/11 00:49:34 dlg Exp $ */ /* * Copyright (c) 2000-2001 Artur Grabowski * All rights reserved. @@ -108,8 +108,8 @@ void timeout_set_proc(struct timeout *, void (*)(void *), void *); int timeout_add(struct timeout *, int); int timeout_add_tv(struct timeout *, const struct timeval *); int timeout_add_sec(struct timeout *, int); -int timeout_add_msec(struct timeout *, int); -int timeout_add_usec(struct timeout *, int); +int timeout_add_msec(struct timeout *, uint64_t); +int timeout_add_usec(struct timeout *, uint64_t); int timeout_add_nsec(struct timeout *, uint64_t); int timeout_abs_ts(struct timeout *, const struct timespec *); diff --git a/usr.bin/awk/awk.1 b/usr.bin/awk/awk.1 index 33f21d86a..9fa1b4b5d 100644 --- a/usr.bin/awk/awk.1 +++ b/usr.bin/awk/awk.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: awk.1,v 1.69 2024/07/30 13:55:11 jmc Exp $ +.\" $OpenBSD: awk.1,v 1.70 2024/08/11 18:24:43 schwarze Exp $ .\" .\" Copyright (C) Lucent Technologies 1997 .\" All Rights Reserved @@ -22,7 +22,7 @@ .\" ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF .\" THIS SOFTWARE. .\" -.Dd $Mdocdate: July 30 2024 $ +.Dd $Mdocdate: August 11 2024 $ .Dt AWK 1 .Os .Sh NAME @@ -1041,11 +1041,6 @@ and .Fn srand has been changed to support non-deterministic random numbers. .Pp -In -.Ev LC_CTYPE Ns Li =POSIX -mode, treating non-ASCII input bytes as non-letter characters rather -than as input encoding errors intentionally violates the specification. -.Pp The flags .Op Fl \&dV , .Op Fl -csv , diff --git a/usr.bin/rpcinfo/rpcinfo.c b/usr.bin/rpcinfo/rpcinfo.c index 9b48a2108..22ae0746f 100644 --- a/usr.bin/rpcinfo/rpcinfo.c +++ b/usr.bin/rpcinfo/rpcinfo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rpcinfo.c,v 1.16 2023/03/08 04:43:12 guenther Exp $ */ +/* $OpenBSD: rpcinfo.c,v 1.17 2024/08/11 11:56:08 florian Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc.