diff --git a/lib/libcrypto/ex_data.c b/lib/libcrypto/ex_data.c index b1e391366..0a9c59121 100644 --- a/lib/libcrypto/ex_data.c +++ b/lib/libcrypto/ex_data.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_data.c,v 1.20 2018/03/17 16:20:01 beck Exp $ */ +/* $OpenBSD: ex_data.c,v 1.21 2023/06/16 11:20:01 tb Exp $ */ /* * Overhaul notes; @@ -320,7 +320,7 @@ def_get_class(int class_index) gen = malloc(sizeof(EX_CLASS_ITEM)); if (gen) { gen->class_index = class_index; - gen->meth_num = 0; + gen->meth_num = 1; gen->meth = sk_CRYPTO_EX_DATA_FUNCS_new_null(); if (!gen->meth) free(gen); diff --git a/lib/libcrypto/objects/obj_xref.h b/lib/libcrypto/objects/obj_xref.h index 1003030fc..bff8c6857 100644 --- a/lib/libcrypto/objects/obj_xref.h +++ b/lib/libcrypto/objects/obj_xref.h @@ -1,4 +1,4 @@ -/* $OpenBSD: obj_xref.h,v 1.6 2023/06/15 16:59:54 tb Exp $ */ +/* $OpenBSD: obj_xref.h,v 1.7 2023/06/15 17:58:27 tb Exp $ */ /* AUTOGENERATED BY objxref.pl, DO NOT EDIT */ __BEGIN_HIDDEN_DECLS @@ -55,6 +55,10 @@ static const nid_triple sigoid_srt[] = {NID_dhSinglePass_cofactorDH_sha256kdf_scheme, NID_sha256, NID_dh_cofactor_kdf}, {NID_dhSinglePass_cofactorDH_sha384kdf_scheme, NID_sha384, NID_dh_cofactor_kdf}, {NID_dhSinglePass_cofactorDH_sha512kdf_scheme, NID_sha512, NID_dh_cofactor_kdf}, + {NID_RSA_SHA3_224, NID_sha3_224, NID_rsaEncryption}, + {NID_RSA_SHA3_256, NID_sha3_256, NID_rsaEncryption}, + {NID_RSA_SHA3_384, NID_sha3_384, NID_rsaEncryption}, + {NID_RSA_SHA3_512, NID_sha3_512, NID_rsaEncryption}, }; static const nid_triple * const sigoid_srt_xref[] = @@ -102,6 +106,10 @@ static const nid_triple * const sigoid_srt_xref[] = &sigoid_srt[28], &sigoid_srt[30], &sigoid_srt[31], + &sigoid_srt[43], + &sigoid_srt[44], + &sigoid_srt[45], + &sigoid_srt[46], }; __END_HIDDEN_DECLS diff --git a/lib/libcrypto/objects/obj_xref.txt b/lib/libcrypto/objects/obj_xref.txt index 955977fc2..712b21a08 100644 --- a/lib/libcrypto/objects/obj_xref.txt +++ b/lib/libcrypto/objects/obj_xref.txt @@ -15,6 +15,10 @@ sha512WithRSAEncryption sha512 rsaEncryption sha224WithRSAEncryption sha224 rsaEncryption mdc2WithRSA mdc2 rsaEncryption ripemd160WithRSA ripemd160 rsaEncryption +RSA_SHA3_224 sha3_224 rsaEncryption +RSA_SHA3_256 sha3_256 rsaEncryption +RSA_SHA3_384 sha3_384 rsaEncryption +RSA_SHA3_512 sha3_512 rsaEncryption # For PSS the digest algorithm can vary and depends on the included # AlgorithmIdentifier. rsassaPss undef rsaEncryption diff --git a/lib/libcrypto/x509/x509type.c b/lib/libcrypto/x509/x509type.c index ebc02c592..5da808cd0 100644 --- a/lib/libcrypto/x509/x509type.c +++ b/lib/libcrypto/x509/x509type.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509type.c,v 1.18 2023/02/16 08:38:17 tb Exp $ */ +/* $OpenBSD: x509type.c,v 1.19 2023/06/15 18:30:09 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -89,6 +89,9 @@ X509_certificate_type(const X509 *x, const EVP_PKEY *pkey) case EVP_PKEY_EC: ret = EVP_PK_EC|EVP_PKT_SIGN|EVP_PKT_EXCH; break; + case EVP_PKEY_ED25519: + ret = EVP_PKT_SIGN; + break; case EVP_PKEY_DH: ret = EVP_PK_DH|EVP_PKT_EXCH; break; diff --git a/regress/usr.sbin/bgpd/unittests/rde_community_test.c b/regress/usr.sbin/bgpd/unittests/rde_community_test.c index 38c2a8a50..4b4457158 100644 --- a/regress/usr.sbin/bgpd/unittests/rde_community_test.c +++ b/regress/usr.sbin/bgpd/unittests/rde_community_test.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde_community_test.c,v 1.6 2023/01/30 17:02:48 claudio Exp $ */ +/* $OpenBSD: rde_community_test.c,v 1.7 2023/06/17 08:01:22 claudio Exp $ */ /* * Copyright (c) 2019 Claudio Jeker @@ -161,7 +161,7 @@ test_filter(size_t num, struct testfilter *f) if (f->next != 0) { if (community_count(&comm, COMMUNITY_TYPE_EXT) != f->next - 1) { - printf("Test %zu: community_count unexpected " + printf("Test %zu: ext community_count unexpected " "return %d != %d\n", num, r, f->next - 1); return -1; } @@ -170,7 +170,7 @@ test_filter(size_t num, struct testfilter *f) if (f->nlarge != 0) { if (community_count(&comm, COMMUNITY_TYPE_LARGE) != f->nlarge - 1) { - printf("Test %zu: community_count unexpected " + printf("Test %zu: large community_count unexpected " "return %d != %d\n", num, r, f->nlarge - 1); return -1; } diff --git a/regress/usr.sbin/bgpd/unittests/rde_community_test.h b/regress/usr.sbin/bgpd/unittests/rde_community_test.h index 2d2439a0e..00368912f 100644 --- a/regress/usr.sbin/bgpd/unittests/rde_community_test.h +++ b/regress/usr.sbin/bgpd/unittests/rde_community_test.h @@ -502,6 +502,22 @@ struct community filters[] = { .data2 = 196618, .data3 = EXT_COMMUNITY_TRANS_TWO_AS << 8 | 0x02, }, + { /* 42 */ + .flags = COMMUNITY_TYPE_EXT | (COMMUNITY_ANY << 24), + }, + { /* 43 */ + .flags = COMMUNITY_TYPE_EXT | (COMMUNITY_ANY << 8), + .data3 = (-1 << 8) | 0x02, + }, + { /* 44 */ + .flags = COMMUNITY_TYPE_EXT | (COMMUNITY_ANY << 8), + .data3 = EXT_COMMUNITY_TRANS_FOUR_AS << 8 | 0x02, + }, + { /* 45 */ + .flags = COMMUNITY_TYPE_EXT | (COMMUNITY_ANY << 16), + .data3 = EXT_COMMUNITY_TRANS_FOUR_AS << 8 | 0x02, + .data1 = 196618, + }, }; struct testfilter { @@ -514,12 +530,6 @@ struct testfilter { int nlarge; struct rde_peer *peer; } testfilters[] = { - { - .in = { 38, -1 }, - .match = 30, - .mout = 1, - .peer = &peer, - }, { .in = { 1, 2, -1 }, .match = 1, @@ -952,5 +962,54 @@ struct testfilter { .mout = 1, .peer = &peer_r4, }, + { + .in = { 38, -1 }, + .match = 30, + .mout = 1, + .peer = &peer, + }, + { /* 70 */ + .in = { 38, 39, 40, -1 }, + .match = 42, + .mout = 1, + .delete = 42, + .next = 0 + 1, + .peer = &peer, + }, + { + .in = { 38, 39, 40, -1 }, + .match = 43, + .mout = 1, + .delete = 43, + .next = 0 + 1, + .peer = &peer, + }, + { + .in = { 39, 40, -1 }, + .match = 44, + .mout = 1, + .delete = 44, + .next = 0 + 1, + .peer = &peer, + }, + { + .in = { 38, -1 }, + .match = 44, + .mout = 0, + .peer = &peer, + }, + { + .in = { 40, -1 }, + .match = 45, + .mout = 1, + .delete = 45, + .next = 0 + 1, + .peer = &peer, + }, + { /* 75 */ + .in = { 38, 39, 41, -1 }, + .match = 45, + .mout = 0, + .peer = &peer, + }, }; - diff --git a/sbin/iked/iked.h b/sbin/iked/iked.h index f429d5542..84999630d 100644 --- a/sbin/iked/iked.h +++ b/sbin/iked/iked.h @@ -1,4 +1,4 @@ -/* $OpenBSD: iked.h,v 1.216 2023/06/13 12:34:12 tb Exp $ */ +/* $OpenBSD: iked.h,v 1.217 2023/06/16 10:28:43 tb Exp $ */ /* * Copyright (c) 2019 Tobias Heider @@ -1250,8 +1250,6 @@ struct in6_addr * prefixlen2mask6(uint8_t, uint32_t *); uint32_t prefixlen2mask(uint8_t); -const char * - print_host(struct sockaddr *, char *, size_t); const char * print_addr(void *); char *get_string(uint8_t *, size_t); diff --git a/sbin/iked/util.c b/sbin/iked/util.c index 9f827b1c8..586233abe 100644 --- a/sbin/iked/util.c +++ b/sbin/iked/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.41 2023/06/13 12:34:12 tb Exp $ */ +/* $OpenBSD: util.c,v 1.42 2023/06/16 10:28:43 tb Exp $ */ /* * Copyright (c) 2010-2013 Reyk Floeter @@ -636,19 +636,20 @@ prefixlen2mask6(uint8_t prefixlen, uint32_t *mask) } const char * -print_host(struct sockaddr *sa, char *buf, size_t len) +print_addr(void *addr) { - static char sbuf[IKED_CYCLE_BUFFERS][NI_MAXHOST + 7]; - static int idx = 0; - char pbuf[7]; - in_port_t port; + static char sbuf[IKED_CYCLE_BUFFERS][NI_MAXHOST + 7]; + static int idx; + struct sockaddr *sa = addr; + char *buf; + size_t len; + char pbuf[7]; + in_port_t port; - if (buf == NULL) { - buf = sbuf[idx]; - len = sizeof(sbuf[idx]); - if (++idx >= IKED_CYCLE_BUFFERS) - idx = 0; - } + buf = sbuf[idx]; + len = sizeof(sbuf[idx]); + if (++idx >= IKED_CYCLE_BUFFERS) + idx = 0; if (sa->sa_family == AF_UNSPEC) { strlcpy(buf, "any", len); @@ -669,12 +670,6 @@ print_host(struct sockaddr *sa, char *buf, size_t len) return (buf); } -const char * -print_addr(void *addr) -{ - return print_host(addr, NULL, 0); -} - char * get_string(uint8_t *ptr, size_t len) { diff --git a/sys/arch/amd64/amd64/cpu.c b/sys/arch/amd64/amd64/cpu.c index 6da2a660c..0bc736741 100644 --- a/sys/arch/amd64/amd64/cpu.c +++ b/sys/arch/amd64/amd64/cpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.c,v 1.168 2023/04/24 09:04:03 dv Exp $ */ +/* $OpenBSD: cpu.c,v 1.169 2023/06/15 22:18:06 cheloha Exp $ */ /* $NetBSD: cpu.c,v 1.1 2003/04/26 18:39:26 fvdl Exp $ */ /*- @@ -664,6 +664,7 @@ cpu_attach(struct device *parent, struct device *self, void *aux) #if defined(MULTIPROCESSOR) cpu_intr_init(ci); cpu_start_secondary(ci); + clockqueue_init(&ci->ci_queue); sched_init_cpu(ci); ncpus++; if (ci->ci_flags & CPUF_PRESENT) { diff --git a/sys/arch/arm/arm/cpu.c b/sys/arch/arm/arm/cpu.c index b4bfa586b..e2cfdc80f 100644 --- a/sys/arch/arm/arm/cpu.c +++ b/sys/arch/arm/arm/cpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.c,v 1.57 2022/03/12 14:40:41 mpi Exp $ */ +/* $OpenBSD: cpu.c,v 1.58 2023/06/15 22:18:06 cheloha Exp $ */ /* $NetBSD: cpu.c,v 1.56 2004/04/14 04:01:49 bsh Exp $ */ @@ -391,6 +391,7 @@ cpu_attach(struct device *parent, struct device *dev, void *aux) "cpu-release-addr", 0); } + clockqueue_init(&ci->ci_queue); sched_init_cpu(ci); if (cpu_hatch_secondary(ci, spinup_method, spinup_data)) { atomic_setbits_int(&ci->ci_flags, CPUF_IDENTIFY); diff --git a/sys/arch/arm64/arm64/cpu.c b/sys/arch/arm64/arm64/cpu.c index 4f8f74990..ae6bb2072 100644 --- a/sys/arch/arm64/arm64/cpu.c +++ b/sys/arch/arm64/arm64/cpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.c,v 1.94 2023/06/11 21:42:01 kettenis Exp $ */ +/* $OpenBSD: cpu.c,v 1.95 2023/06/15 22:18:07 cheloha Exp $ */ /* * Copyright (c) 2016 Dale Rahn @@ -875,6 +875,7 @@ cpu_attach(struct device *parent, struct device *dev, void *aux) "cpu-release-addr", 0); } + clockqueue_init(&ci->ci_queue); sched_init_cpu(ci); if (cpu_start_secondary(ci, spinup_method, spinup_data)) { atomic_setbits_int(&ci->ci_flags, CPUF_IDENTIFY); diff --git a/sys/arch/arm64/arm64/db_trace.c b/sys/arch/arm64/arm64/db_trace.c index f0c0bd5b0..0fcfa138f 100644 --- a/sys/arch/arm64/arm64/db_trace.c +++ b/sys/arch/arm64/arm64/db_trace.c @@ -1,4 +1,4 @@ -/* $OpenBSD: db_trace.c,v 1.14 2023/04/26 16:53:58 claudio Exp $ */ +/* $OpenBSD: db_trace.c,v 1.15 2023/06/17 08:13:56 kettenis Exp $ */ /* $NetBSD: db_trace.c,v 1.8 2003/01/17 22:28:48 thorpej Exp $ */ /* @@ -49,18 +49,6 @@ db_regs_t ddb_regs; #define INKERNEL(va) (((vaddr_t)(va)) & (1ULL << 63)) -#ifndef __clang__ -/* - * Clang uses a different stack frame, which looks like the following. - * - * return link value [fp, #+4] - * return fp value [fp] <- fp points to here - * - */ -#define FR_RFP (0x0) -#define FR_RLV (0x4) -#endif /* !__clang__ */ - void db_stack_trace_print(db_expr_t addr, int have_addr, db_expr_t count, char *modif, int (*pr)(const char *, ...)) @@ -98,7 +86,7 @@ db_stack_trace_print(db_expr_t addr, int have_addr, db_expr_t count, lastlr = p->p_addr->u_pcb.pcb_tf->tf_elr; } else { sp = addr; - db_read_bytes(sp+16, sizeof(vaddr_t), + db_read_bytes(sp, sizeof(vaddr_t), (char *)&frame); db_read_bytes(sp + 8, sizeof(vaddr_t), (char *)&lr); diff --git a/sys/arch/i386/i386/cpu.c b/sys/arch/i386/i386/cpu.c index 1baf2c7f9..c0b989e0d 100644 --- a/sys/arch/i386/i386/cpu.c +++ b/sys/arch/i386/i386/cpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.c,v 1.111 2023/01/30 10:49:04 jsg Exp $ */ +/* $OpenBSD: cpu.c,v 1.112 2023/06/15 22:18:07 cheloha Exp $ */ /* $NetBSD: cpu.c,v 1.1.2.7 2000/06/26 02:04:05 sommerfeld Exp $ */ /*- @@ -360,6 +360,7 @@ cpu_attach(struct device *parent, struct device *self, void *aux) #endif cpu_tsx_disable(ci); identifycpu(ci); + clockqueue_init(&ci->ci_queue); sched_init_cpu(ci); ci->ci_next = cpu_info_list->ci_next; cpu_info_list->ci_next = ci; diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_acpi.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_acpi.c index 31fc24dee..cddd11bcf 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_acpi.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_acpi.c @@ -1096,6 +1096,9 @@ bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev) (pm_suspend_target_state != PM_SUSPEND_TO_IDLE)) return false; + if (adev->asic_type < CHIP_RAVEN) + return false; + /* * If ACPI_FADT_LOW_POWER_S0 is not set in the FADT, it is generally * risky to do any special firmware-related preparations for entering diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c index d54444f92..ec52c815d 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c @@ -2409,8 +2409,10 @@ static int amdgpu_pmops_suspend(struct device *dev) if (amdgpu_acpi_is_s0ix_active(adev)) adev->in_s0ix = true; - else + else if (amdgpu_acpi_is_s3_active(adev)) adev->in_s3 = true; + if (!adev->in_s0ix && !adev->in_s3) + return 0; return amdgpu_device_suspend(drm_dev, true); } @@ -2431,6 +2433,9 @@ static int amdgpu_pmops_resume(struct device *dev) struct amdgpu_device *adev = drm_to_adev(drm_dev); int r; + if (!adev->in_s0ix && !adev->in_s3) + return 0; + /* Avoids registers access if device is physically gone */ if (!pci_device_is_present(adev->pdev)) adev->no_hw_access = true; diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_mes.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_mes.c index 9bbd7cd61..ce199de94 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_mes.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_mes.c @@ -1328,12 +1328,9 @@ int amdgpu_mes_self_test(struct amdgpu_device *adev) struct amdgpu_mes_ctx_data ctx_data = {0}; struct amdgpu_ring *added_rings[AMDGPU_MES_CTX_MAX_RINGS] = { NULL }; int gang_ids[3] = {0}; - int queue_types[][2] = { { AMDGPU_RING_TYPE_GFX, - AMDGPU_MES_CTX_MAX_GFX_RINGS}, - { AMDGPU_RING_TYPE_COMPUTE, - AMDGPU_MES_CTX_MAX_COMPUTE_RINGS}, - { AMDGPU_RING_TYPE_SDMA, - AMDGPU_MES_CTX_MAX_SDMA_RINGS } }; + int queue_types[][2] = { { AMDGPU_RING_TYPE_GFX, 1 }, + { AMDGPU_RING_TYPE_COMPUTE, 1 }, + { AMDGPU_RING_TYPE_SDMA, 1} }; int i, r, pasid, k = 0; pasid = amdgpu_pasid_alloc(16); diff --git a/sys/dev/pci/drm/amd/amdgpu/mes_v11_0.c b/sys/dev/pci/drm/amd/amdgpu/mes_v11_0.c index d1004f77b..9bb117812 100644 --- a/sys/dev/pci/drm/amd/amdgpu/mes_v11_0.c +++ b/sys/dev/pci/drm/amd/amdgpu/mes_v11_0.c @@ -390,6 +390,7 @@ static int mes_v11_0_set_hw_resources(struct amdgpu_mes *mes) mes_set_hw_res_pkt.disable_reset = 1; mes_set_hw_res_pkt.disable_mes_log = 1; mes_set_hw_res_pkt.use_different_vmid_compute = 1; + mes_set_hw_res_pkt.enable_reg_active_poll = 1; mes_set_hw_res_pkt.oversubscription_timer = 50; return mes_v11_0_submit_pkt_and_poll_completion(mes, diff --git a/sys/dev/pci/drm/amd/display/dc/core/dc_link.c b/sys/dev/pci/drm/amd/display/dc/core/dc_link.c index 5f285c5ea..13598a2af 100644 --- a/sys/dev/pci/drm/amd/display/dc/core/dc_link.c +++ b/sys/dev/pci/drm/amd/display/dc/core/dc_link.c @@ -1634,14 +1634,18 @@ static bool dc_link_construct_legacy(struct dc_link *link, link->irq_source_hpd = DC_IRQ_SOURCE_INVALID; switch (link->dc->config.allow_edp_hotplug_detection) { - case 1: // only the 1st eDP handles hotplug + case HPD_EN_FOR_ALL_EDP: + link->irq_source_hpd_rx = + dal_irq_get_rx_source(link->hpd_gpio); + break; + case HPD_EN_FOR_PRIMARY_EDP_ONLY: if (link->link_index == 0) link->irq_source_hpd_rx = dal_irq_get_rx_source(link->hpd_gpio); else link->irq_source_hpd = DC_IRQ_SOURCE_INVALID; break; - case 2: // only the 2nd eDP handles hotplug + case HPD_EN_FOR_SECONDARY_EDP_ONLY: if (link->link_index == 1) link->irq_source_hpd_rx = dal_irq_get_rx_source(link->hpd_gpio); @@ -1649,6 +1653,7 @@ static bool dc_link_construct_legacy(struct dc_link *link, link->irq_source_hpd = DC_IRQ_SOURCE_INVALID; break; default: + link->irq_source_hpd = DC_IRQ_SOURCE_INVALID; break; } } diff --git a/sys/dev/pci/drm/amd/display/dc/dc_types.h b/sys/dev/pci/drm/amd/display/dc/dc_types.h index ad9041472..6050a3469 100644 --- a/sys/dev/pci/drm/amd/display/dc/dc_types.h +++ b/sys/dev/pci/drm/amd/display/dc/dc_types.h @@ -993,4 +993,10 @@ struct display_endpoint_id { enum display_endpoint_type ep_type; }; +enum dc_hpd_enable_select { + HPD_EN_FOR_ALL_EDP = 0, + HPD_EN_FOR_PRIMARY_EDP_ONLY, + HPD_EN_FOR_SECONDARY_EDP_ONLY, +}; + #endif /* DC_TYPES_H_ */ diff --git a/sys/dev/pci/drm/amd/include/mes_v11_api_def.h b/sys/dev/pci/drm/amd/include/mes_v11_api_def.h index 7e85cdc5b..dc694cb24 100644 --- a/sys/dev/pci/drm/amd/include/mes_v11_api_def.h +++ b/sys/dev/pci/drm/amd/include/mes_v11_api_def.h @@ -222,7 +222,11 @@ union MESAPI_SET_HW_RESOURCES { uint32_t apply_grbm_remote_register_dummy_read_wa : 1; uint32_t second_gfx_pipe_enabled : 1; uint32_t enable_level_process_quantum_check : 1; - uint32_t reserved : 25; + uint32_t legacy_sch_mode : 1; + uint32_t disable_add_queue_wptr_mc_addr : 1; + uint32_t enable_mes_event_int_logging : 1; + uint32_t enable_reg_active_poll : 1; + uint32_t reserved : 21; }; uint32_t uint32_t_all; }; diff --git a/sys/dev/pci/drm/amd/pm/amdgpu_pm.c b/sys/dev/pci/drm/amd/pm/amdgpu_pm.c index 393d79acf..ef5f21e3f 100644 --- a/sys/dev/pci/drm/amd/pm/amdgpu_pm.c +++ b/sys/dev/pci/drm/amd/pm/amdgpu_pm.c @@ -871,13 +871,11 @@ static ssize_t amdgpu_get_pp_od_clk_voltage(struct device *dev, } if (ret == -ENOENT) { size = amdgpu_dpm_print_clock_levels(adev, OD_SCLK, buf); - if (size > 0) { - size += amdgpu_dpm_print_clock_levels(adev, OD_MCLK, buf + size); - size += amdgpu_dpm_print_clock_levels(adev, OD_VDDC_CURVE, buf + size); - size += amdgpu_dpm_print_clock_levels(adev, OD_VDDGFX_OFFSET, buf + size); - size += amdgpu_dpm_print_clock_levels(adev, OD_RANGE, buf + size); - size += amdgpu_dpm_print_clock_levels(adev, OD_CCLK, buf + size); - } + size += amdgpu_dpm_print_clock_levels(adev, OD_MCLK, buf + size); + size += amdgpu_dpm_print_clock_levels(adev, OD_VDDC_CURVE, buf + size); + size += amdgpu_dpm_print_clock_levels(adev, OD_VDDGFX_OFFSET, buf + size); + size += amdgpu_dpm_print_clock_levels(adev, OD_RANGE, buf + size); + size += amdgpu_dpm_print_clock_levels(adev, OD_CCLK, buf + size); } if (size == 0) diff --git a/sys/dev/pci/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c b/sys/dev/pci/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c index 2bb5c3872..57579f5e0 100644 --- a/sys/dev/pci/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c +++ b/sys/dev/pci/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c @@ -125,6 +125,7 @@ static struct cmn2asic_msg_mapping smu_v13_0_7_message_map[SMU_MSG_MAX_COUNT] = MSG_MAP(ArmD3, PPSMC_MSG_ArmD3, 0), MSG_MAP(AllowGpo, PPSMC_MSG_SetGpoAllow, 0), MSG_MAP(GetPptLimit, PPSMC_MSG_GetPptLimit, 0), + MSG_MAP(NotifyPowerSource, PPSMC_MSG_NotifyPowerSource, 0), }; static struct cmn2asic_mapping smu_v13_0_7_clk_map[SMU_CLK_COUNT] = { diff --git a/sys/dev/pci/drm/radeon/radeon_irq_kms.c b/sys/dev/pci/drm/radeon/radeon_irq_kms.c index 8121903fa..5ff826f02 100644 --- a/sys/dev/pci/drm/radeon/radeon_irq_kms.c +++ b/sys/dev/pci/drm/radeon/radeon_irq_kms.c @@ -103,6 +103,16 @@ static void radeon_hotplug_work_func(struct work_struct *work) static void radeon_dp_work_func(struct work_struct *work) { + struct radeon_device *rdev = container_of(work, struct radeon_device, + dp_work); + struct drm_device *dev = rdev->ddev; + struct drm_mode_config *mode_config = &dev->mode_config; + struct drm_connector *connector; + + mutex_lock(&mode_config->mutex); + list_for_each_entry(connector, &mode_config->connector_list, head) + radeon_connector_hotplug(connector); + mutex_unlock(&mode_config->mutex); } /** diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index 2d67ea9e1..7a2aee10a 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: init_main.c,v 1.320 2023/01/01 07:00:51 jsg Exp $ */ +/* $OpenBSD: init_main.c,v 1.321 2023/06/15 22:18:06 cheloha Exp $ */ /* $NetBSD: init_main.c,v 1.84.4.1 1996/06/02 09:08:06 mrg Exp $ */ /* @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include @@ -314,6 +315,7 @@ main(void *framep) /* Initialize run queues */ sched_init_runqueues(); sleep_queue_init(); + clockqueue_init(&curcpu()->ci_queue); sched_init_cpu(curcpu()); p->p_cpu->ci_randseed = (arc4random() & 0x7fffffff) + 1; diff --git a/sys/kern/kern_clockintr.c b/sys/kern/kern_clockintr.c index 2732e0f95..bcd583c19 100644 --- a/sys/kern/kern_clockintr.c +++ b/sys/kern/kern_clockintr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_clockintr.c,v 1.21 2023/04/23 00:08:36 cheloha Exp $ */ +/* $OpenBSD: kern_clockintr.c,v 1.22 2023/06/15 22:18:06 cheloha Exp $ */ /* * Copyright (c) 2003 Dale Rahn * Copyright (c) 2020 Mark Kettenis @@ -66,7 +66,6 @@ void clockintr_schedule(struct clockintr *, uint64_t); void clockintr_schedule_locked(struct clockintr *, uint64_t); void clockintr_statclock(struct clockintr *, void *); void clockintr_statvar_init(int, uint32_t *, uint32_t *, uint32_t *); -void clockqueue_init(struct clockintr_queue *); uint64_t clockqueue_next(const struct clockintr_queue *); void clockqueue_reset_intrclock(struct clockintr_queue *); uint64_t nsec_advance(uint64_t *, uint64_t, uint64_t); @@ -114,7 +113,6 @@ clockintr_cpu_init(const struct intrclock *ic) KASSERT(ISSET(clockintr_flags, CL_INIT)); - clockqueue_init(cq); if (ic != NULL && !ISSET(cq->cq_flags, CQ_INTRCLOCK)) { cq->cq_intrclock = *ic; SET(cq->cq_flags, CQ_INTRCLOCK); diff --git a/sys/msdosfs/msdosfs_fat.c b/sys/msdosfs/msdosfs_fat.c index d31abf7d1..0b28222da 100644 --- a/sys/msdosfs/msdosfs_fat.c +++ b/sys/msdosfs/msdosfs_fat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: msdosfs_fat.c,v 1.35 2023/04/30 17:16:36 sf Exp $ */ +/* $OpenBSD: msdosfs_fat.c,v 1.36 2023/06/16 08:42:08 sf Exp $ */ /* $NetBSD: msdosfs_fat.c,v 1.26 1997/10/17 11:24:02 ws Exp $ */ /*- @@ -411,7 +411,7 @@ usemap_alloc(struct msdosfsmount *pmp, uint32_t cn) { KASSERT(cn <= pmp->pm_maxcluster); - pmp->pm_inusemap[cn / N_INUSEBITS] |= 1 << (cn % N_INUSEBITS); + pmp->pm_inusemap[cn / N_INUSEBITS] |= 1U << (cn % N_INUSEBITS); pmp->pm_freeclustercount--; } @@ -421,7 +421,7 @@ usemap_free(struct msdosfsmount *pmp, uint32_t cn) KASSERT(cn <= pmp->pm_maxcluster); pmp->pm_freeclustercount++; - pmp->pm_inusemap[cn / N_INUSEBITS] &= ~(1 << (cn % N_INUSEBITS)); + pmp->pm_inusemap[cn / N_INUSEBITS] &= ~(1U << (cn % N_INUSEBITS)); } int @@ -652,7 +652,7 @@ chainlength(struct msdosfsmount *pmp, uint32_t start, uint32_t count) idx = start / N_INUSEBITS; start %= N_INUSEBITS; map = pmp->pm_inusemap[idx]; - map &= ~((1 << start) - 1); + map &= ~((1U << start) - 1); if (map) { len = ffs(map) - 1 - start; len = MIN(len, count); @@ -759,7 +759,7 @@ clusteralloc(struct msdosfsmount *pmp, uint32_t start, uint32_t count, for (cn = newst; cn <= pmp->pm_maxcluster;) { idx = cn / N_INUSEBITS; map = pmp->pm_inusemap[idx]; - map |= (1 << (cn % N_INUSEBITS)) - 1; + map |= (1U << (cn % N_INUSEBITS)) - 1; if (map != (u_int)-1) { cn = idx * N_INUSEBITS + ffs(map^(u_int)-1) - 1; if ((l = chainlength(pmp, cn, count)) >= count) @@ -776,7 +776,7 @@ clusteralloc(struct msdosfsmount *pmp, uint32_t start, uint32_t count, for (cn = 0; cn < newst;) { idx = cn / N_INUSEBITS; map = pmp->pm_inusemap[idx]; - map |= (1 << (cn % N_INUSEBITS)) - 1; + map |= (1U << (cn % N_INUSEBITS)) - 1; if (map != (u_int)-1) { cn = idx * N_INUSEBITS + ffs(map^(u_int)-1) - 1; if ((l = chainlength(pmp, cn, count)) >= count) diff --git a/sys/netinet6/ip6_forward.c b/sys/netinet6/ip6_forward.c index 85a7e9134..db68b32ec 100644 --- a/sys/netinet6/ip6_forward.c +++ b/sys/netinet6/ip6_forward.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_forward.c,v 1.110 2023/06/01 09:05:33 jan Exp $ */ +/* $OpenBSD: ip6_forward.c,v 1.111 2023/06/16 19:18:56 bluhm Exp $ */ /* $KAME: ip6_forward.c,v 1.75 2001/06/29 12:42:13 jinmei Exp $ */ /* @@ -321,35 +321,30 @@ reroute: error = tcp_if_output_tso(ifp, &m, sin6tosa(sin6), rt, IFCAP_TSOv6, ifp->if_mtu); + if (error) + ip6stat_inc(ip6s_cantforward); + else if (m == NULL) + ip6stat_inc(ip6s_forward); if (error || m == NULL) - goto freecopy; + goto senderr; /* Check the size after pf_test to give pf a chance to refragment. */ - if (m->m_pkthdr.len > ifp->if_mtu) { - if (mcopy) - icmp6_error(mcopy, ICMP6_PACKET_TOO_BIG, 0, - ifp->if_mtu); - m_freem(m); - goto out; + if (m->m_pkthdr.len <= ifp->if_mtu) { + in6_proto_cksum_out(m, ifp); + error = ifp->if_output(ifp, m, sin6tosa(sin6), rt); + if (error) + ip6stat_inc(ip6s_cantforward); + else + ip6stat_inc(ip6s_forward); + goto senderr; } - in6_proto_cksum_out(m, ifp); - error = ifp->if_output(ifp, m, sin6tosa(sin6), rt); - if (error) { - ip6stat_inc(ip6s_cantforward); - } else { - ip6stat_inc(ip6s_forward); - if (type) - ip6stat_inc(ip6s_redirectsent); - else { - if (mcopy) - goto freecopy; - } - } + if (mcopy != NULL) + icmp6_error(mcopy, ICMP6_PACKET_TOO_BIG, 0, ifp->if_mtu); + m_freem(m); + goto out; -#if NPF > 0 || defined(IPSEC) senderr: -#endif if (mcopy == NULL) goto out; @@ -357,6 +352,7 @@ senderr: case 0: if (type == ND_REDIRECT) { icmp6_redirect_output(mcopy, rt); + ip6stat_inc(ip6s_redirectsent); goto out; } goto freecopy; diff --git a/sys/sys/clockintr.h b/sys/sys/clockintr.h index 06f7493a5..6bd3d34e9 100644 --- a/sys/sys/clockintr.h +++ b/sys/sys/clockintr.h @@ -1,4 +1,4 @@ -/* $OpenBSD: clockintr.h,v 1.7 2023/04/20 14:51:28 cheloha Exp $ */ +/* $OpenBSD: clockintr.h,v 1.8 2023/06/15 22:18:06 cheloha Exp $ */ /* * Copyright (c) 2020-2022 Scott Cheloha * @@ -129,6 +129,7 @@ void clockintr_trigger(void); * Kernel API */ +void clockqueue_init(struct clockintr_queue *); int sysctl_clockintr(int *, u_int, void *, size_t *, void *, size_t); #endif /* _KERNEL */ diff --git a/usr.sbin/bgpd/rde_community.c b/usr.sbin/bgpd/rde_community.c index 746076d27..f148045f7 100644 --- a/usr.sbin/bgpd/rde_community.c +++ b/usr.sbin/bgpd/rde_community.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde_community.c,v 1.11 2023/01/30 16:51:34 claudio Exp $ */ +/* $OpenBSD: rde_community.c,v 1.12 2023/06/17 08:05:48 claudio Exp $ */ /* * Copyright (c) 2019 Claudio Jeker @@ -97,6 +97,16 @@ fc2c(struct community *fc, struct rde_peer *peer, struct community *c, type = (int32_t)fc->data3 >> 8; subtype = fc->data3 & 0xff; + if ((fc->flags >> 24 & 0xff) == COMMUNITY_ANY) { + /* special case for 'ext-community * *' */ + if (m == NULL) + return -1; + m->data1 = 0; + m->data2 = 0; + m->data3 = 0; + return 0; + } + if (type == -1) { /* special case for 'ext-community rt *' */ if ((fc->flags >> 8 & 0xff) != COMMUNITY_ANY || @@ -149,10 +159,11 @@ fc2c(struct community *fc, struct rde_peer *peer, struct community *c, return 0; } - if (m) { - m->data1 = 0; - m->data2 = 0; - } + /* this is for 'ext-community subtype *' */ + if (m == NULL) + return -1; + m->data1 = 0; + m->data2 = 0; return 0; default: fatalx("%s: unknown type %d", __func__, (uint8_t)c->flags); diff --git a/usr.sbin/config/scan.l b/usr.sbin/config/scan.l index 6768b7c0d..f1369a0a9 100644 --- a/usr.sbin/config/scan.l +++ b/usr.sbin/config/scan.l @@ -1,5 +1,5 @@ %{ -/* $OpenBSD: scan.l,v 1.24 2017/07/09 14:04:50 espie Exp $ */ +/* $OpenBSD: scan.l,v 1.25 2023/06/16 16:14:34 tb Exp $ */ /* $NetBSD: scan.l,v 1.13 1997/02/02 21:12:37 thorpej Exp $ */ /* @@ -178,8 +178,7 @@ rmoptions return RMOPTIONS; * Open the "main" file (conffile). */ int -firstfile(fname) - const char *fname; +firstfile(const char *fname) { if ((yyin = fopen(fname, "r")) == NULL) @@ -197,9 +196,7 @@ firstfile(fname) * If ateof == 0 then nothing is inserted. */ int -include(fname, ateof) - const char *fname; - int ateof; +include(const char *fname, int ateof) { FILE *fp; struct incl *in; diff --git a/usr.sbin/pkg_add/OpenBSD/Getopt.pm b/usr.sbin/pkg_add/OpenBSD/Getopt.pm index eedb555df..dd363fb71 100644 --- a/usr.sbin/pkg_add/OpenBSD/Getopt.pm +++ b/usr.sbin/pkg_add/OpenBSD/Getopt.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Getopt.pm,v 1.16 2023/06/13 09:07:17 espie Exp $ +# $OpenBSD: Getopt.pm,v 1.17 2023/06/16 06:44:14 espie Exp $ # # Copyright (c) 2006 Marc Espie # @@ -45,9 +45,8 @@ sub handle_option($opt, $hash, @params) } } -sub getopts($args, $hash) +sub getopts($args, $hash = {}) { - $hash = {} unless defined $hash; local @EXPORT; while ($_ = shift @ARGV) { diff --git a/usr.sbin/pkg_add/OpenBSD/PkgCheck.pm b/usr.sbin/pkg_add/OpenBSD/PkgCheck.pm index 3868172ce..a46563478 100644 --- a/usr.sbin/pkg_add/OpenBSD/PkgCheck.pm +++ b/usr.sbin/pkg_add/OpenBSD/PkgCheck.pm @@ -1,7 +1,7 @@ #! /usr/bin/perl # ex:ts=8 sw=4: -# $OpenBSD: PkgCheck.pm,v 1.79 2023/06/13 09:07:17 espie Exp $ +# $OpenBSD: PkgCheck.pm,v 1.81 2023/06/16 10:38:29 espie Exp $ # # Copyright (c) 2003-2014 Marc Espie # @@ -213,7 +213,7 @@ sub basic_check($self, $state) { $self->SUPER::basic_check($state); my $name = $state->destdir($self->fullname); - for my $file (OpenBSD::Paths::man_cruft()) { + for my $file (OpenBSD::Paths->man_cruft) { $state->{known}{$name}{$file} = 1; } return 1; @@ -521,7 +521,7 @@ sub run_command($self) $self->{params} = []; } -sub result($self) +sub show_results($self) { while (@{$self->{params}} > 0) { $self->run_command; @@ -919,12 +919,12 @@ sub locate_unknown($self, $state) $locator->add_param($p); }); } - $locator->result($state); + $locator->show_results; } sub fill_localbase($self, $state, $base) { - for my $file (OpenBSD::Paths::man_cruft()) { + for my $file (OpenBSD::Paths->man_cruft) { $state->{known}{$base."/man"}{$file} = 1; } $state->{known}{$base."/info"}{'dir'} = 1; diff --git a/usr.sbin/pkg_add/OpenBSD/PkgDelete.pm b/usr.sbin/pkg_add/OpenBSD/PkgDelete.pm index 91a7a8d8d..10a23cae8 100644 --- a/usr.sbin/pkg_add/OpenBSD/PkgDelete.pm +++ b/usr.sbin/pkg_add/OpenBSD/PkgDelete.pm @@ -1,6 +1,6 @@ #!/usr/bin/perl # ex:ts=8 sw=4: -# $OpenBSD: PkgDelete.pm,v 1.49 2023/06/13 09:07:17 espie Exp $ +# $OpenBSD: PkgDelete.pm,v 1.50 2023/06/16 10:08:17 espie Exp $ # # Copyright (c) 2003-2010 Marc Espie # @@ -170,7 +170,7 @@ sub create_locations($state, @l) my $inst = $state->repo->installed; my $result = []; for my $name (@l) { - my $l = $inst->find($name, $state->{arch}); + my $l = $inst->find($name); if (!defined $l) { $state->errsay("Can't find #1 in installed packages", $name); diff --git a/usr.sbin/rpki-client/cms.c b/usr.sbin/rpki-client/cms.c index e78d2fb53..3fa595926 100644 --- a/usr.sbin/rpki-client/cms.c +++ b/usr.sbin/rpki-client/cms.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cms.c,v 1.35 2023/06/12 18:22:02 job Exp $ */ +/* $OpenBSD: cms.c,v 1.36 2023/06/17 04:46:11 job Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons * @@ -225,6 +225,9 @@ cms_parse_validate_internal(X509 **xp, const char *fn, const unsigned char *der, if (has_bst) warnx("%s: unsupported CMS signing-time attribute", fn); + if (!has_st) + warnx("%s: missing CMS signing-time attribute", fn); + if (CMS_unsigned_get_attr_count(si) != -1) { cryptowarnx("%s: RFC 6488: CMS has unsignedAttrs", fn); goto out; diff --git a/usr.sbin/smtpd/smtpd.h b/usr.sbin/smtpd/smtpd.h index 397f3df57..a253e74e2 100644 --- a/usr.sbin/smtpd/smtpd.h +++ b/usr.sbin/smtpd/smtpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: smtpd.h,v 1.676 2023/05/31 16:51:46 op Exp $ */ +/* $OpenBSD: smtpd.h,v 1.677 2023/06/17 08:32:48 op Exp $ */ /* * Copyright (c) 2008 Gilles Chehade @@ -55,7 +55,7 @@ #define SMTPD_QUEUE_EXPIRY (4 * 24 * 60 * 60) #define SMTPD_SOCKET "/var/run/smtpd.sock" #define SMTPD_NAME "OpenSMTPD" -#define SMTPD_VERSION "7.0.0" +#define SMTPD_VERSION "7.3.0" #define SMTPD_SESSION_TIMEOUT 300 #define SMTPD_BACKLOG 5