sync with OpenBSD -current

This commit is contained in:
purplerain 2024-02-24 21:16:08 +00:00
parent aee4243932
commit 951aae1a1a
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
39 changed files with 531 additions and 183 deletions

View file

@ -1,4 +1,4 @@
/* $OpenBSD: cpu.c,v 1.181 2024/02/18 05:42:50 guenther Exp $ */
/* $OpenBSD: cpu.c,v 1.182 2024/02/24 17:00:05 deraadt Exp $ */
/* $NetBSD: cpu.c,v 1.1 2003/04/26 18:39:26 fvdl Exp $ */
/*-
@ -1260,7 +1260,7 @@ cpu_fix_msrs(struct cpu_info *ci)
#ifndef SMALL_KERNEL
if (ci->ci_feature_sefflags_edx & SEFF0EDX_IBT) {
msr = rdmsr(MSR_S_CET);
wrmsr(MSR_S_CET, msr | MSR_CET_ENDBR_EN);
wrmsr(MSR_S_CET, (msr & ~MSR_CET_NO_TRACK_EN) | MSR_CET_ENDBR_EN);
lcr4(rcr4() | CR4_CET);
}
#endif

View file

@ -1,4 +1,4 @@
/* $OpenBSD: qwx.c,v 1.51 2024/02/22 21:21:35 stsp Exp $ */
/* $OpenBSD: qwx.c,v 1.52 2024/02/24 15:21:39 cheloha Exp $ */
/*
* Copyright 2023 Stefan Sperling <stsp@openbsd.org>
@ -23155,7 +23155,7 @@ qwx_dp_rx_tid_del_func(struct qwx_dp *dp, void *ctx,
struct qwx_softc *sc = dp->sc;
struct dp_rx_tid *rx_tid = ctx;
struct dp_reo_cache_flush_elem *elem, *tmp;
time_t now;
uint64_t now;
if (status == HAL_REO_CMD_DRAIN) {
goto free_desc;
@ -23170,7 +23170,7 @@ qwx_dp_rx_tid_del_func(struct qwx_dp *dp, void *ctx,
if (!elem)
goto free_desc;
now = gettime();
now = getnsecuptime();
elem->ts = now;
memcpy(&elem->data, rx_tid, sizeof(*rx_tid));
@ -23188,7 +23188,7 @@ qwx_dp_rx_tid_del_func(struct qwx_dp *dp, void *ctx,
/* Flush and invalidate aged REO desc from HW cache */
TAILQ_FOREACH_SAFE(elem, &dp->reo_cmd_cache_flush_list, entry, tmp) {
if (dp->reo_cmd_cache_flush_count > DP_REO_DESC_FREE_THRESHOLD ||
now < elem->ts + DP_REO_DESC_FREE_TIMEOUT_MS) {
now >= elem->ts + MSEC_TO_NSEC(DP_REO_DESC_FREE_TIMEOUT_MS)) {
TAILQ_REMOVE(&dp->reo_cmd_cache_flush_list, elem, entry);
dp->reo_cmd_cache_flush_count--;
#ifdef notyet

View file

@ -1,4 +1,4 @@
/* $OpenBSD: qwxvar.h,v 1.22 2024/02/22 09:08:08 stsp Exp $ */
/* $OpenBSD: qwxvar.h,v 1.23 2024/02/24 15:21:39 cheloha Exp $ */
/*
* Copyright (c) 2018-2019 The Linux Foundation.
@ -1041,7 +1041,7 @@ struct dp_rx_tid {
struct dp_reo_cache_flush_elem {
TAILQ_ENTRY(dp_reo_cache_flush_elem) entry;
struct dp_rx_tid data;
unsigned long ts;
uint64_t ts;
};
TAILQ_HEAD(dp_reo_cmd_cache_flush_head, dp_reo_cache_flush_elem);