diff --git a/etc/changelist b/etc/changelist index 10f546b79..ad69d8bb2 100644 --- a/etc/changelist +++ b/etc/changelist @@ -1,4 +1,4 @@ -# $OpenBSD: changelist,v 1.136 2023/04/24 16:36:54 kn Exp $ +# $OpenBSD: changelist,v 1.137 2023/09/19 15:02:54 naddy Exp $ # # List of files which the security script backs up and checks # for modifications. @@ -126,8 +126,6 @@ +/etc/soii.key +/etc/spwd.db /etc/ssh/ssh_config -+/etc/ssh/ssh_host_dsa_key -/etc/ssh/ssh_host_dsa_key.pub +/etc/ssh/ssh_host_ecdsa_key /etc/ssh/ssh_host_ecdsa_key.pub +/etc/ssh/ssh_host_ed25519_key diff --git a/etc/mtree/special b/etc/mtree/special index dbe1aa759..e208ce290 100644 --- a/etc/mtree/special +++ b/etc/mtree/special @@ -1,4 +1,4 @@ -# $OpenBSD: special,v 1.128 2022/05/12 22:13:06 sthen Exp $ +# $OpenBSD: special,v 1.129 2023/09/19 15:02:55 naddy Exp $ # # Hand-crafted mtree specification for the dangerous files. # @@ -101,8 +101,6 @@ soii.key type=file mode=0600 uname=root gname=wheel optional spwd.db type=file mode=0640 uname=root gname=_shadow ssh type=dir mode=0755 uname=root gname=wheel optional ssh_config type=file mode=0644 uname=root gname=wheel -ssh_host_dsa_key type=file mode=0600 uname=root gname=wheel optional -ssh_host_dsa_key.pub type=file mode=0644 uname=root gname=wheel optional ssh_host_ecdsa_key type=file mode=0600 uname=root gname=wheel optional ssh_host_ecdsa_key.pub type=file mode=0644 uname=root gname=wheel optional ssh_host_ed25519_key type=file mode=0600 uname=root gname=wheel optional diff --git a/lib/libssl/man/SSL_CTX_set_default_passwd_cb.3 b/lib/libssl/man/SSL_CTX_set_default_passwd_cb.3 index 7ab9633f5..94b4ea543 100644 --- a/lib/libssl/man/SSL_CTX_set_default_passwd_cb.3 +++ b/lib/libssl/man/SSL_CTX_set_default_passwd_cb.3 @@ -1,8 +1,25 @@ -.\" $OpenBSD: SSL_CTX_set_default_passwd_cb.3,v 1.7 2018/04/02 02:06:14 schwarze Exp $ +.\" $OpenBSD: SSL_CTX_set_default_passwd_cb.3,v 1.9 2023/09/19 09:40:35 schwarze Exp $ .\" full merge up to: OpenSSL 9b86974e Aug 17 15:21:33 2015 -0400 -.\" selective merge up to: OpenSSL 2947af32 Nov 19 00:10:05 2016 +0100 +.\" selective merge up to: OpenSSL 18bad535 Apr 9 15:13:55 2019 +0100 .\" -.\" This file was written by Lutz Jaenicke +.\" This file is a derived work. +.\" The changes are covered by the following Copyright and license: +.\" +.\" Copyright (c) 2023 Ingo Schwarze +.\" +.\" 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. +.\" +.\" The original file was written by Lutz Jaenicke .\" and Christian Heimes . .\" Copyright (c) 2000, 2001, 2016 The OpenSSL Project. All rights reserved. .\" @@ -50,75 +67,95 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: April 2 2018 $ +.Dd $Mdocdate: September 19 2023 $ .Dt SSL_CTX_SET_DEFAULT_PASSWD_CB 3 .Os .Sh NAME .Nm SSL_CTX_set_default_passwd_cb , .Nm SSL_CTX_set_default_passwd_cb_userdata , .Nm SSL_CTX_get_default_passwd_cb , -.Nm SSL_CTX_get_default_passwd_cb_userdata , -.Nm pem_password_cb +.Nm SSL_CTX_get_default_passwd_cb_userdata .Nd set or get passwd callback for encrypted PEM file handling .Sh SYNOPSIS .In openssl/ssl.h .Ft void .Fn SSL_CTX_set_default_passwd_cb "SSL_CTX *ctx" "pem_password_cb *cb" .Ft void -.Fn SSL_CTX_set_default_passwd_cb_userdata "SSL_CTX *ctx" "void *u" +.Fn SSL_CTX_set_default_passwd_cb_userdata "SSL_CTX *ctx" "void *userdata" .Ft pem_password_cb * .Fn SSL_CTX_get_default_passwd_cb "SSL_CTX *ctx" .Ft void * .Fn SSL_CTX_get_default_passwd_cb_userdata "SSL_CTX *ctx" -.In openssl/pem.h -.Ft typedef int -.Fn pem_password_cb "char *buf" "int size" "int rwflag" "void *userdata" .Sh DESCRIPTION .Fn SSL_CTX_set_default_passwd_cb -sets the default password callback called when loading/storing a PEM -certificate with encryption. +sets the password callback for loading a certificate or private key +from encrypted PEM format. +In particular, the callback is used by +.Xr SSL_CTX_use_certificate_file 3 , +.Xr SSL_use_certificate_file 3 , +.Xr SSL_CTX_use_certificate_chain_file 3 , +.Xr SSL_use_certificate_chain_file 3 , +.Xr SSL_CTX_use_certificate_chain_mem 3 , +.Xr SSL_CTX_use_PrivateKey_file 3 , +.Xr SSL_use_PrivateKey_file 3 , +.Xr SSL_CTX_use_RSAPrivateKey_file 3 , +and +.Xr SSL_use_RSAPrivateKey_file 3 . +.Pp +The function pointer type of the +.Fa cb +argument is documented in the +.Xr pem_password_cb 3 +manual page. +If +.Fn SSL_CTX_set_default_passwd_cb +is not called on +.Fa ctx +or if it is called with a +.Fa cb +argument of +.Dv NULL , +.Xr PEM_def_callback 3 +is used instead. .Pp .Fn SSL_CTX_set_default_passwd_cb_userdata -sets a pointer to userdata -.Fa u +sets a pointer to the +.Fa userdata which will be provided to the password callback on invocation. .Pp -The -password callback -.Fa cb , -which must be provided by the application, -hands back the password to be used during decryption. -On invocation a pointer to -.Fa userdata -is provided. -The password callback must write the password into the provided buffer -.Fa buf -which is of size -.Fa size . -The actual length of the password must be returned to the calling function. -.Fa rwflag -indicates whether the callback is used for reading/decryption -.Pq Fa rwflag No = 0 -or writing/encryption -.Pq Fa rwflag No = 1 . +Since the +.Fa cb +passed to +.Fn SSL_CTX_set_default_passwd_cb +will only be used for reading and decryption and not for writing and +encryption, the library will only call it with a +.Fa verify +argument of 0. .Pp -When loading or storing private keys, a password might be supplied to protect -the private key. -The way this password can be supplied may depend on the application. -If only one private key is handled, it can be practical to have the +If an application program only needs to read and decrypt +one single private key, it can be practical to have the callback handle the password dialog interactively. -If several keys have to be handled, it can be practical to ask for the password -once, then keep it in memory and use it several times. -In the last case, the password could be stored into the +This happens by default if neither +.Fn SSL_CTX_set_default_passwd_cb +nor +.Fn SSL_CTX_set_default_passwd_cb_userdata +is called. +In that case, the library uses +.Xr PEM_def_callback 3 +with a .Fa userdata -storage and the callback only returns the password already stored. +argument of +.Dv NULL . .Pp -When asking for the password interactively, the callback can use -.Fa rwflag -to check whether an item shall be encrypted -.Pq Fa rwflag No = 1 . -In this case the password dialog may ask for the same password twice for -comparison in order to catch typos which would make decryption impossible. +If several keys have to be handled, it can be practical +to ask for the password once, for example using +.Xr UI_UTIL_read_pw_string 3 , +then keep it in memory and use it several times by passing a pointer to it to +.Fn SSL_CTX_set_default_passwd_cb_userdata . +.Xr PEM_def_callback 3 +is able to handle this case, too, so calling +.Fn SSL_CTX_set_default_passwd_cb +is not needed in this case either. .Pp Other items in PEM formatting (certificates) can also be encrypted; it is however atypical, as certificate information is considered public. @@ -137,22 +174,30 @@ or .Dv NULL if none is set. .Sh EXAMPLES -The following example returns the password provided as +The following example provides a subset of the functionality of +.Xr PEM_def_callback 3 , +except that +.Xr PEM_def_callback 3 +does not NUL-terminate and copies up to +.Fa size +rather than +.Fa size No \- 1 +bytes. +It interprets .Fa userdata -to the calling function. -The password is considered to be a -.Sq \e0 -terminated string. -If the password does not fit into the buffer, the password is truncated. +as a NUL-terminated string and copies it to the +.Fa password +buffer, truncating the copy if it does not fit. .Bd -literal -int pem_passwd_cb(char *buf, int size, int rwflag, void *password) +int +trivial_passwd_cb(char *password, int size, int verify, void *userdata) { - strncpy(buf, (char *)password, size); - buf[size - 1] = '\e0'; - return strlen(buf); + strlcpy(password, userdata, size); + return strlen(password); } .Ed .Sh SEE ALSO +.Xr pem_password_cb 3 , .Xr ssl 3 , .Xr SSL_CTX_use_certificate 3 .Sh HISTORY diff --git a/share/man/man4/ddb.4 b/share/man/man4/ddb.4 index 16c626f47..8a36dada5 100644 --- a/share/man/man4/ddb.4 +++ b/share/man/man4/ddb.4 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ddb.4,v 1.105 2022/12/22 19:53:22 kn Exp $ +.\" $OpenBSD: ddb.4,v 1.106 2023/09/19 11:36:33 claudio Exp $ .\" $NetBSD: ddb.4,v 1.5 1994/11/30 16:22:09 jtc Exp $ .\" .\" Mach Operating System @@ -25,7 +25,7 @@ .\" any improvements or extensions that they make and grant Carnegie Mellon .\" the rights to redistribute these changes. .\" -.Dd $Mdocdate: December 22 2022 $ +.Dd $Mdocdate: September 19 2023 $ .Dt DDB 4 .Os .Sh NAME @@ -771,7 +771,11 @@ Valid modifiers: Print the pagelist for this pool. .El .\" -------------------- -.It Ic show proc Op Ar addr +.It Xo +.Ic show proc +.Op Cm /t +.Op Ar addr +.Xc Prints the .Vt struct proc at @@ -779,6 +783,11 @@ at If an optional address is not specified, .Li curproc is assumed. +The +.Cm /t +modifier interprets the +.Ar addr +argument as the TID of a proc. .\" -------------------- .It Ic show registers Op Cm /u Display the register set. diff --git a/sys/ddb/db_command.c b/sys/ddb/db_command.c index fd2070b91..ca4226c51 100644 --- a/sys/ddb/db_command.c +++ b/sys/ddb/db_command.c @@ -1,4 +1,4 @@ -/* $OpenBSD: db_command.c,v 1.99 2023/07/02 19:02:27 cheloha Exp $ */ +/* $OpenBSD: db_command.c,v 1.100 2023/09/19 11:35:30 claudio Exp $ */ /* $NetBSD: db_command.c,v 1.20 1996/03/30 22:30:05 christos Exp $ */ /* @@ -541,6 +541,13 @@ db_proc_print_cmd(db_expr_t addr, int have_addr, db_expr_t count, char *modif) { if (!have_addr) addr = (db_expr_t)curproc; + if (modif[0] == 't') { + addr = (db_expr_t)tfind((pid_t)addr); + if (addr == 0) { + db_printf("not found\n"); + return; + } + } proc_printit((struct proc *)addr, modif, db_printf); } diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_display.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_display.c index 298241ac7..184a234aa 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_display.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_display.c @@ -38,6 +38,8 @@ #include #include #include +#include +#include #include #include #include @@ -493,11 +495,29 @@ bool amdgpu_display_ddc_probe(struct amdgpu_connector *amdgpu_connector, return true; } +static int amdgpu_dirtyfb(struct drm_framebuffer *fb, struct drm_file *file, + unsigned int flags, unsigned int color, + struct drm_clip_rect *clips, unsigned int num_clips) +{ + + if (file) + return -ENOSYS; + + return drm_atomic_helper_dirtyfb(fb, file, flags, color, clips, + num_clips); +} + static const struct drm_framebuffer_funcs amdgpu_fb_funcs = { .destroy = drm_gem_fb_destroy, .create_handle = drm_gem_fb_create_handle, }; +static const struct drm_framebuffer_funcs amdgpu_fb_funcs_atomic = { + .destroy = drm_gem_fb_destroy, + .create_handle = drm_gem_fb_create_handle, + .dirty = amdgpu_dirtyfb +}; + uint32_t amdgpu_display_supported_domains(struct amdgpu_device *adev, uint64_t bo_flags) { @@ -1100,7 +1120,11 @@ static int amdgpu_display_gem_fb_verify_and_init(struct drm_device *dev, if (ret) goto err; - ret = drm_framebuffer_init(dev, &rfb->base, &amdgpu_fb_funcs); + if (drm_drv_uses_atomic_modeset(dev)) + ret = drm_framebuffer_init(dev, &rfb->base, + &amdgpu_fb_funcs_atomic); + else + ret = drm_framebuffer_init(dev, &rfb->base, &amdgpu_fb_funcs); if (ret) goto err; diff --git a/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c b/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c index 3c50b3ff7..cd6e99cf7 100644 --- a/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +++ b/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c @@ -1269,6 +1269,13 @@ void handle_cursor_update(struct drm_plane *plane, attributes.rotation_angle = 0; attributes.attribute_flags.value = 0; + /* Enable cursor degamma ROM on DCN3+ for implicit sRGB degamma in DRM + * legacy gamma setup. + */ + if (crtc_state->cm_is_degamma_srgb && + adev->dm.dc->caps.color.dpp.gamma_corr) + attributes.attribute_flags.bits.ENABLE_CURSOR_DEGAMMA = 1; + attributes.pitch = afb->base.pitches[0] / afb->base.format->cpp[0]; if (crtc_state->stream) { diff --git a/sys/dev/pci/drm/amd/display/dc/core/amdgpu_dc.c b/sys/dev/pci/drm/amd/display/dc/core/amdgpu_dc.c index 674ab6d9b..16c05a24a 100644 --- a/sys/dev/pci/drm/amd/display/dc/core/amdgpu_dc.c +++ b/sys/dev/pci/drm/amd/display/dc/core/amdgpu_dc.c @@ -1977,12 +1977,12 @@ enum dc_status dc_commit_streams(struct dc *dc, } } - /* Check for case where we are going from odm 2:1 to max - * pipe scenario. For these cases, we will call - * commit_minimal_transition_state() to exit out of odm 2:1 - * first before processing new streams + /* ODM Combine 2:1 power optimization is only applied for single stream + * scenario, it uses extra pipes than needed to reduce power consumption + * We need to switch off this feature to make room for new streams. */ - if (stream_count == dc->res_pool->pipe_count) { + if (stream_count > dc->current_state->stream_count && + dc->current_state->stream_count == 1) { for (i = 0; i < dc->res_pool->pipe_count; i++) { pipe = &dc->current_state->res_ctx.pipe_ctx[i]; if (pipe->next_odm_pipe) @@ -3361,6 +3361,45 @@ void dc_dmub_update_dirty_rect(struct dc *dc, } } +static void wait_for_outstanding_hw_updates(struct dc *dc, const struct dc_state *dc_context) +{ +/* + * This function calls HWSS to wait for any potentially double buffered + * operations to complete. It should be invoked as a pre-amble prior + * to full update programming before asserting any HW locks. + */ + int pipe_idx; + int opp_inst; + int opp_count = dc->res_pool->pipe_count; + struct hubp *hubp; + int mpcc_inst; + const struct pipe_ctx *pipe_ctx; + + for (pipe_idx = 0; pipe_idx < dc->res_pool->pipe_count; pipe_idx++) { + pipe_ctx = &dc_context->res_ctx.pipe_ctx[pipe_idx]; + + if (!pipe_ctx->stream) + continue; + + if (pipe_ctx->stream_res.tg->funcs->wait_drr_doublebuffer_pending_clear) + pipe_ctx->stream_res.tg->funcs->wait_drr_doublebuffer_pending_clear(pipe_ctx->stream_res.tg); + + hubp = pipe_ctx->plane_res.hubp; + if (!hubp) + continue; + + mpcc_inst = hubp->inst; + // MPCC inst is equal to pipe index in practice + for (opp_inst = 0; opp_inst < opp_count; opp_inst++) { + if (dc->res_pool->opps[opp_inst]->mpcc_disconnect_pending[mpcc_inst]) { + dc->res_pool->mpc->funcs->wait_for_idle(dc->res_pool->mpc, mpcc_inst); + dc->res_pool->opps[opp_inst]->mpcc_disconnect_pending[mpcc_inst] = false; + break; + } + } + } +} + static void commit_planes_for_stream(struct dc *dc, struct dc_surface_update *srf_updates, int surface_count, @@ -3378,24 +3417,9 @@ static void commit_planes_for_stream(struct dc *dc, // dc->current_state anymore, so we have to cache it before we apply // the new SubVP context subvp_prev_use = false; - - dc_z10_restore(dc); - - if (update_type == UPDATE_TYPE_FULL) { - /* wait for all double-buffer activity to clear on all pipes */ - int pipe_idx; - - for (pipe_idx = 0; pipe_idx < dc->res_pool->pipe_count; pipe_idx++) { - struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[pipe_idx]; - - if (!pipe_ctx->stream) - continue; - - if (pipe_ctx->stream_res.tg->funcs->wait_drr_doublebuffer_pending_clear) - pipe_ctx->stream_res.tg->funcs->wait_drr_doublebuffer_pending_clear(pipe_ctx->stream_res.tg); - } - } + if (update_type == UPDATE_TYPE_FULL) + wait_for_outstanding_hw_updates(dc, context); if (get_seamless_boot_stream_count(context) > 0 && surface_count > 0) { /* Optimize seamless boot flag keeps clocks and watermarks high until diff --git a/sys/dev/pci/drm/amd/display/dc/dcn10/dcn10_mpc.c b/sys/dev/pci/drm/amd/display/dc/dcn10/dcn10_mpc.c index 8e9384094..f2f55565e 100644 --- a/sys/dev/pci/drm/amd/display/dc/dcn10/dcn10_mpc.c +++ b/sys/dev/pci/drm/amd/display/dc/dcn10/dcn10_mpc.c @@ -212,8 +212,9 @@ struct mpcc *mpc1_insert_plane( /* check insert_above_mpcc exist in tree->opp_list */ struct mpcc *temp_mpcc = tree->opp_list; - while (temp_mpcc && temp_mpcc->mpcc_bot != insert_above_mpcc) - temp_mpcc = temp_mpcc->mpcc_bot; + if (temp_mpcc != insert_above_mpcc) + while (temp_mpcc && temp_mpcc->mpcc_bot != insert_above_mpcc) + temp_mpcc = temp_mpcc->mpcc_bot; if (temp_mpcc == NULL) return NULL; } diff --git a/sys/dev/pci/drm/amd/display/dc/dcn20/dcn20_hwseq.c b/sys/dev/pci/drm/amd/display/dc/dcn20/dcn20_hwseq.c index 4ef632864..fbc188812 100644 --- a/sys/dev/pci/drm/amd/display/dc/dcn20/dcn20_hwseq.c +++ b/sys/dev/pci/drm/amd/display/dc/dcn20/dcn20_hwseq.c @@ -1515,17 +1515,6 @@ static void dcn20_update_dchubp_dpp( || plane_state->update_flags.bits.global_alpha_change || plane_state->update_flags.bits.per_pixel_alpha_change) { // MPCC inst is equal to pipe index in practice - int mpcc_inst = hubp->inst; - int opp_inst; - int opp_count = dc->res_pool->pipe_count; - - for (opp_inst = 0; opp_inst < opp_count; opp_inst++) { - if (dc->res_pool->opps[opp_inst]->mpcc_disconnect_pending[mpcc_inst]) { - dc->res_pool->mpc->funcs->wait_for_idle(dc->res_pool->mpc, mpcc_inst); - dc->res_pool->opps[opp_inst]->mpcc_disconnect_pending[mpcc_inst] = false; - break; - } - } hws->funcs.update_mpcc(dc, pipe_ctx); } diff --git a/sys/dev/pci/drm/amd/display/modules/freesync/freesync.c b/sys/dev/pci/drm/amd/display/modules/freesync/freesync.c index 668133d15..de9f7c410 100644 --- a/sys/dev/pci/drm/amd/display/modules/freesync/freesync.c +++ b/sys/dev/pci/drm/amd/display/modules/freesync/freesync.c @@ -338,7 +338,9 @@ static void apply_below_the_range(struct core_freesync *core_freesync, * - Delta for CEIL: delta_from_mid_point_in_us_1 * - Delta for FLOOR: delta_from_mid_point_in_us_2 */ - if ((last_render_time_in_us / mid_point_frames_ceil) < in_out_vrr->min_duration_in_us) { + if (mid_point_frames_ceil && + (last_render_time_in_us / mid_point_frames_ceil) < + in_out_vrr->min_duration_in_us) { /* Check for out of range. * If using CEIL produces a value that is out of range, * then we are forced to use FLOOR. @@ -385,8 +387,9 @@ static void apply_below_the_range(struct core_freesync *core_freesync, /* Either we've calculated the number of frames to insert, * or we need to insert min duration frames */ - if (last_render_time_in_us / frames_to_insert < - in_out_vrr->min_duration_in_us){ + if (frames_to_insert && + (last_render_time_in_us / frames_to_insert) < + in_out_vrr->min_duration_in_us){ frames_to_insert -= (frames_to_insert > 1) ? 1 : 0; } diff --git a/sys/dev/pci/drm/i915/gt/intel_engine_types.h b/sys/dev/pci/drm/i915/gt/intel_engine_types.h index 0e1f9977d..8b93cdcbd 100644 --- a/sys/dev/pci/drm/i915/gt/intel_engine_types.h +++ b/sys/dev/pci/drm/i915/gt/intel_engine_types.h @@ -56,6 +56,7 @@ struct intel_breadcrumbs; typedef u32 intel_engine_mask_t; #define ALL_ENGINES ((intel_engine_mask_t)~0ul) +#define VIRTUAL_ENGINES BIT(BITS_PER_TYPE(intel_engine_mask_t) - 1) struct intel_hw_status_page { struct list_head timelines; diff --git a/sys/dev/pci/drm/i915/gt/uc/intel_guc_submission.c b/sys/dev/pci/drm/i915/gt/uc/intel_guc_submission.c index 3a811a653..5eab9d43a 100644 --- a/sys/dev/pci/drm/i915/gt/uc/intel_guc_submission.c +++ b/sys/dev/pci/drm/i915/gt/uc/intel_guc_submission.c @@ -5121,6 +5121,11 @@ guc_create_virtual(struct intel_engine_cs **siblings, unsigned int count, ve->base.flags = I915_ENGINE_IS_VIRTUAL; +#ifdef notyet + BUILD_BUG_ON(ilog2(VIRTUAL_ENGINES) < I915_NUM_ENGINES); +#endif + ve->base.mask = VIRTUAL_ENGINES; + intel_context_init(&ve->context, &ve->base); for (n = 0; n < count; n++) { diff --git a/sys/dev/pci/drm/i915/gvt/gtt.c b/sys/dev/pci/drm/i915/gvt/gtt.c index b49d16e53..536417f20 100644 --- a/sys/dev/pci/drm/i915/gvt/gtt.c +++ b/sys/dev/pci/drm/i915/gvt/gtt.c @@ -1179,6 +1179,7 @@ static int is_2MB_gtt_possible(struct intel_vgpu *vgpu, { const struct intel_gvt_gtt_pte_ops *ops = vgpu->gvt->gtt.pte_ops; kvm_pfn_t pfn; + int ret; if (!HAS_PAGE_SIZES(vgpu->gvt->gt->i915, I915_GTT_PAGE_SIZE_2M)) return 0; @@ -1188,7 +1189,13 @@ static int is_2MB_gtt_possible(struct intel_vgpu *vgpu, pfn = gfn_to_pfn(vgpu->vfio_device.kvm, ops->get_pfn(entry)); if (is_error_noslot_pfn(pfn)) return -EINVAL; - return PageTransHuge(pfn_to_page(pfn)); + + if (!pfn_valid(pfn)) + return -EINVAL; + + ret = PageTransHuge(pfn_to_page(pfn)); + kvm_release_pfn_clean(pfn); + return ret; } static int split_2MB_gtt_entry(struct intel_vgpu *vgpu, @@ -2880,24 +2887,6 @@ void intel_vgpu_reset_ggtt(struct intel_vgpu *vgpu, bool invalidate_old) ggtt_invalidate(gvt->gt); } -/** - * intel_vgpu_reset_gtt - reset the all GTT related status - * @vgpu: a vGPU - * - * This function is called from vfio core to reset reset all - * GTT related status, including GGTT, PPGTT, scratch page. - * - */ -void intel_vgpu_reset_gtt(struct intel_vgpu *vgpu) -{ - /* Shadow pages are only created when there is no page - * table tracking data, so remove page tracking data after - * removing the shadow pages. - */ - intel_vgpu_destroy_all_ppgtt_mm(vgpu); - intel_vgpu_reset_ggtt(vgpu, true); -} - /** * intel_gvt_restore_ggtt - restore all vGPU's ggtt entries * @gvt: intel gvt device diff --git a/sys/dev/pci/drm/i915/gvt/gtt.h b/sys/dev/pci/drm/i915/gvt/gtt.h index 6dc4b00aa..2b9b0f6cd 100644 --- a/sys/dev/pci/drm/i915/gvt/gtt.h +++ b/sys/dev/pci/drm/i915/gvt/gtt.h @@ -224,7 +224,6 @@ void intel_vgpu_reset_ggtt(struct intel_vgpu *vgpu, bool invalidate_old); void intel_vgpu_invalidate_ppgtt(struct intel_vgpu *vgpu); int intel_gvt_init_gtt(struct intel_gvt *gvt); -void intel_vgpu_reset_gtt(struct intel_vgpu *vgpu); void intel_gvt_clean_gtt(struct intel_gvt *gvt); struct intel_vgpu_mm *intel_gvt_find_ppgtt_mm(struct intel_vgpu *vgpu, diff --git a/sys/dev/pci/drm/i915/i915_request.c b/sys/dev/pci/drm/i915/i915_request.c index 1e37187e8..b5c0bf163 100644 --- a/sys/dev/pci/drm/i915/i915_request.c +++ b/sys/dev/pci/drm/i915/i915_request.c @@ -141,9 +141,7 @@ static void i915_fence_release(struct dma_fence *fence) i915_sw_fence_fini(&rq->semaphore); /* - * Keep one request on each engine for reserved use under mempressure - * do not use with virtual engines as this really is only needed for - * kernel contexts. + * Keep one request on each engine for reserved use under mempressure. * * We do not hold a reference to the engine here and so have to be * very careful in what rq->engine we poke. The virtual engine is @@ -173,8 +171,7 @@ static void i915_fence_release(struct dma_fence *fence) * know that if the rq->execution_mask is a single bit, rq->engine * can be a physical engine with the exact corresponding mask. */ - if (!intel_engine_is_virtual(rq->engine) && - is_power_of_2(rq->execution_mask) && + if (is_power_of_2(rq->execution_mask) && !cmpxchg(&rq->engine->request_pool, NULL, rq)) return; diff --git a/sys/dev/pci/if_aq_pci.c b/sys/dev/pci/if_aq_pci.c index 6ad899ec1..246406c2a 100644 --- a/sys/dev/pci/if_aq_pci.c +++ b/sys/dev/pci/if_aq_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_aq_pci.c,v 1.23 2023/08/15 08:27:30 miod Exp $ */ +/* $OpenBSD: if_aq_pci.c,v 1.24 2023/09/19 14:14:35 jsg Exp $ */ /* $NetBSD: if_aq.c,v 1.27 2021/06/16 00:21:18 riastradh Exp $ */ /* @@ -2606,7 +2606,7 @@ aq_hw_init_rx_path(struct aq_softc *sc) 0, AQ2_RPF_TAG_VLAN_MASK | AQ2_RPF_TAG_UNTAG_MASK, AQ2_ART_ACTION_DROP); - for (int i = 0; i < 8; i++) { + for (i = 0; i < 8; i++) { aq2_filter_art_set(sc, AQ2_RPF_INDEX_PCP_TO_TC + i, (i << AQ2_RPF_TAG_PCP_SHIFT), AQ2_RPF_TAG_PCP_MASK, AQ2_ART_ACTION_ASSIGN_TC(i % sc->sc_nqueues)); diff --git a/sys/kern/kern_pledge.c b/sys/kern/kern_pledge.c index 8dcf97b7a..7f2446e63 100644 --- a/sys/kern/kern_pledge.c +++ b/sys/kern/kern_pledge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_pledge.c,v 1.307 2023/08/20 15:13:43 visa Exp $ */ +/* $OpenBSD: kern_pledge.c,v 1.308 2023/09/19 10:43:33 claudio Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott @@ -580,7 +580,7 @@ pledge_fail(struct proc *p, int error, uint64_t code) /* Stop threads immediately, because this process is suspect */ if (P_HASSIBLING(p)) - single_thread_set(p, SINGLE_SUSPEND, 1); + single_thread_set(p, SINGLE_UNWIND, 1); /* Send uncatchable SIGABRT for coredump */ sigabort(p); diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 4c12a49d4..ba6ae513c 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_proc.c,v 1.94 2023/01/02 23:09:48 guenther Exp $ */ +/* $OpenBSD: kern_proc.c,v 1.95 2023/09/19 11:35:30 claudio Exp $ */ /* $NetBSD: kern_proc.c,v 1.14 1996/02/09 18:59:41 christos Exp $ */ /* @@ -489,18 +489,22 @@ proc_printit(struct proc *p, const char *modif, else pst = pstat[(int)p->p_stat - 1]; - (*pr)("PROC (%s) pid=%d stat=%s\n", p->p_p->ps_comm, p->p_tid, pst); + (*pr)("PROC (%s) tid=%d pid=%d tcnt=%d stat=%s\n", p->p_p->ps_comm, + p->p_tid, p->p_p->ps_pid, p->p_p->ps_threadcnt, pst); (*pr)(" flags process=%b proc=%b\n", p->p_p->ps_flags, PS_BITS, p->p_flag, P_BITS); - (*pr)(" pri=%u, usrpri=%u, nice=%d\n", - p->p_runpri, p->p_usrpri, p->p_p->ps_nice); + (*pr)(" runpri=%u, usrpri=%u, slppri=%u, nice=%d\n", + p->p_runpri, p->p_usrpri, p->p_slppri, p->p_p->ps_nice); + (*pr)(" wchan=%p, wmesg=%s, ps_single=%p\n", + p->p_wchan, (p->p_wchan && p->p_wmesg) ? p->p_wmesg : "", + p->p_p->ps_single); (*pr)(" forw=%p, list=%p,%p\n", TAILQ_NEXT(p, p_runq), p->p_list.le_next, p->p_list.le_prev); (*pr)(" process=%p user=%p, vmspace=%p\n", p->p_p, p->p_addr, p->p_vmspace); - (*pr)(" estcpu=%u, cpticks=%d, pctcpu=%u.%u\n", - p->p_estcpu, p->p_cpticks, p->p_pctcpu / 100, p->p_pctcpu % 100); - (*pr)(" user=%u, sys=%u, intr=%u\n", + (*pr)(" estcpu=%u, cpticks=%d, pctcpu=%u.%u, " + "user=%u, sys=%u, intr=%u\n", + p->p_estcpu, p->p_cpticks, p->p_pctcpu / 100, p->p_pctcpu % 100, p->p_uticks, p->p_sticks, p->p_iticks); } #include diff --git a/sys/kern/kern_sched.c b/sys/kern/kern_sched.c index bfa26844c..72367d346 100644 --- a/sys/kern/kern_sched.c +++ b/sys/kern/kern_sched.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sched.c,v 1.91 2023/09/14 22:07:11 cheloha Exp $ */ +/* $OpenBSD: kern_sched.c,v 1.92 2023/09/19 11:31:51 claudio Exp $ */ /* * Copyright (c) 2007, 2008 Artur Grabowski * @@ -268,6 +268,7 @@ setrunqueue(struct cpu_info *ci, struct proc *p, uint8_t prio) KASSERT(ci != NULL); SCHED_ASSERT_LOCKED(); + KASSERT(p->p_wchan == NULL); p->p_cpu = ci; p->p_stat = SRUN; diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index fbc9a8184..cc6c786d2 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sig.c,v 1.317 2023/09/13 14:25:49 claudio Exp $ */ +/* $OpenBSD: kern_sig.c,v 1.318 2023/09/19 10:43:33 claudio Exp $ */ /* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */ /* @@ -1559,7 +1559,7 @@ sigexit(struct proc *p, int signum) /* if there are other threads, pause them */ if (P_HASSIBLING(p)) - single_thread_set(p, SINGLE_SUSPEND, 1); + single_thread_set(p, SINGLE_UNWIND, 1); if (coredump(p) == 0) signum |= WCOREFLAG; @@ -2059,10 +2059,10 @@ single_thread_check(struct proc *p, int deep) /* * Stop other threads in the process. The mode controls how and * where the other threads should stop: - * - SINGLE_SUSPEND: stop wherever they are, will later either be told to exit - * (by setting to SINGLE_EXIT) or be released (via single_thread_clear()) + * - SINGLE_SUSPEND: stop wherever they are, will later be released (via + * single_thread_clear()) * - SINGLE_UNWIND: just unwind to kernel boundary, will be told to exit - * or released as with SINGLE_SUSPEND + * (by setting to SINGLE_EXIT) or released as with SINGLE_SUSPEND * - SINGLE_EXIT: unwind to kernel boundary and exit */ int diff --git a/usr.bin/tmux/screen.c b/usr.bin/tmux/screen.c index 483589594..a943d20ca 100644 --- a/usr.bin/tmux/screen.c +++ b/usr.bin/tmux/screen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: screen.c,v 1.82 2023/06/26 08:14:19 nicm Exp $ */ +/* $OpenBSD: screen.c,v 1.83 2023/09/19 08:35:44 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -700,9 +700,9 @@ screen_mode_to_string(int mode) if (mode & MODE_CURSOR_VERY_VISIBLE) strlcat(tmp, "CURSOR_VERY_VISIBLE,", sizeof tmp); if (mode & MODE_MOUSE_UTF8) - strlcat(tmp, "UTF8,", sizeof tmp); + strlcat(tmp, "MOUSE_UTF8,", sizeof tmp); if (mode & MODE_MOUSE_SGR) - strlcat(tmp, "SGR,", sizeof tmp); + strlcat(tmp, "MOUSE_SGR,", sizeof tmp); if (mode & MODE_BRACKETPASTE) strlcat(tmp, "BRACKETPASTE,", sizeof tmp); if (mode & MODE_FOCUSON)