From nobody Sat Aug 19 00:35:57 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RSKXs453Rz4fyRL; Sat, 19 Aug 2023 00:35:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RSKXs3S6wz3FYv; Sat, 19 Aug 2023 00:35:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692405357; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=khTtSBBXFiSZkarHKC03AIy5mDMtW0T8yGezViVivfs=; b=EWgZEfVt+LfPgN6Tnp8zXHHJYGBU7yOi/pZV8aDWCSJ/OwXzfCywD/F+Zc1aGt3G8N40vo JXEFRCfLNYMfedYwPMQhmMHeOmTVl6IM+wFkZPGs3K7JbU/EQCePwlTJczxALPb0A4cdYo n3qndVew8adQxCiuEii1HTBzR6Ec4m9FzzfgTOe3e8n3ixbApzYGG4p11oefT41hOFfoLX AyZZeyjNmdX/xVbGRdh/78vxs5b5HaQeNbTHf2qN7apzSuK8xH0+m00L3Iiu4UQ102BJ7J 47eG2LzcAak6zb7JGDu9pkAQFUldVWwo7ldkmlACLP290VFYcau0D0TMbfjT8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692405357; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=khTtSBBXFiSZkarHKC03AIy5mDMtW0T8yGezViVivfs=; b=tZdeeWfgQtcuK9hbvcDOBTrZ/8T3lLT82FdQZu5UfyuUMvG2ULi0oroBH/xU/Qd249tpii +SEWGv31QV95qos3nU6TL7PrwwIB01uaQpWflrkiXrlv//XqkvJ1av8IYWs4oyuR0i6Vcq Cqr4CMnGGiAZ5GtuOrRCNcE38HNAEa4uob7FZa/r8hYutrgG5vg84m4WAlpr/2VjL00qsn RLoHQXBUFc8RJEOOAan9BDts4DV3SpBd57ky0gagJ5nnelaYswr61HFGMPPMaPw0uUyR0e 2uD8Awl+rMcAXH59ja7efA4RiH8E0ySKGYPMV8tPHOdTzyVmSMDaOgNuhIYX/Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1692405357; a=rsa-sha256; cv=none; b=RXOlf92Iy82UA7aiaArQ5ACp3H2p7HQJSqkKbigvu7nGGRM0cBUU3VZtHfaO980n5GEnfj +qSNmmBQQ9TfnJKZTba9UiKSanr/z+lI+sNrzzYq3DDN1AJqeYgZn/wHP4lt9IZ5RulFGe pzKqLWM0FtECFN/vE9DHnFkQpPjuD7MO6zWHiJFNR2r85nP2rd4WDcQsPeP6sSglxMFLhJ rxodVCbjV/9cK1ZTEHZ0OpSwzjWWnKd00uobvLSSkCKr061XONTT1sqcqYFGN2CFQ+7Mq2 Wn7af/uP4tbLBiMPHsyYJ+SDp1ys85aqPt6t5KSNcZgRl/iQAneNW8bhWJXLJw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4RSKXs2HcXzd0C; Sat, 19 Aug 2023 00:35:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37J0ZvjE050615; Sat, 19 Aug 2023 00:35:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37J0Zv3B050612; Sat, 19 Aug 2023 00:35:57 GMT (envelope-from git) Date: Sat, 19 Aug 2023 00:35:57 GMT Message-Id: <202308190035.37J0Zv3B050612@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 8fe73008036b - stable/13 - tc_fill_vdso_timehands32(): fix List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8fe73008036b0770e3d0a5b41e9b845feb46bdf1 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8fe73008036b0770e3d0a5b41e9b845feb46bdf1 commit 8fe73008036b0770e3d0a5b41e9b845feb46bdf1 Author: Konstantin Belousov AuthorDate: 2023-08-12 19:51:37 +0000 Commit: Konstantin Belousov CommitDate: 2023-08-19 00:35:29 +0000 tc_fill_vdso_timehands32(): fix PR: 273085 (cherry picked from commit 93626d54370292b09cd0ca604b144737109e9071) --- sys/dev/acpica/acpi_hpet.c | 3 ++- sys/x86/include/vdso.h | 7 ++++++- sys/x86/x86/pvclock.c | 2 +- sys/x86/x86/tsc.c | 3 ++- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/sys/dev/acpica/acpi_hpet.c b/sys/dev/acpica/acpi_hpet.c index e35e3808a980..e6f83512feed 100644 --- a/sys/dev/acpica/acpi_hpet.c +++ b/sys/dev/acpica/acpi_hpet.c @@ -173,7 +173,8 @@ hpet_vdso_timehands32(struct vdso_timehands32 *vdso_th32, vdso_th32->th_algo = VDSO_TH_ALGO_X86_HPET; vdso_th32->th_x86_shift = 0; vdso_th32->th_x86_hpet_idx = device_get_unit(sc->dev); - vdso_th32->th_x86_pvc_last_systime = 0; + vdso_th32->th_x86_pvc_last_systime[0] = 0; + vdso_th32->th_x86_pvc_last_systime[1] = 0; vdso_th32->th_x86_pvc_stable_mask = 0; bzero(vdso_th32->th_res, sizeof(vdso_th32->th_res)); return (sc->mmap_allow != 0); diff --git a/sys/x86/include/vdso.h b/sys/x86/include/vdso.h index 546a92a47301..be90e26702f7 100644 --- a/sys/x86/include/vdso.h +++ b/sys/x86/include/vdso.h @@ -49,7 +49,12 @@ #ifdef _KERNEL #ifdef COMPAT_FREEBSD32 -#define VDSO_TIMEHANDS_MD32 VDSO_TIMEHANDS_MD +#define VDSO_TIMEHANDS_MD32 \ + uint32_t th_x86_shift; \ + uint32_t th_x86_hpet_idx; \ + uint32_t th_x86_pvc_last_systime[2];\ + uint8_t th_x86_pvc_stable_mask; \ + uint8_t th_res[15]; #endif #endif diff --git a/sys/x86/x86/pvclock.c b/sys/x86/x86/pvclock.c index 3da3373bb2ee..9d8ac99f5a8a 100644 --- a/sys/x86/x86/pvclock.c +++ b/sys/x86/x86/pvclock.c @@ -253,7 +253,7 @@ pvclock_tc_vdso_timehands32(struct vdso_timehands32 *vdso_th, vdso_th->th_algo = VDSO_TH_ALGO_X86_PVCLK; vdso_th->th_x86_shift = 0; vdso_th->th_x86_hpet_idx = 0; - vdso_th->th_x86_pvc_last_systime = + *(uint64_t *)&vdso_th->th_x86_pvc_last_systime[0] = atomic_load_acq_64(&pvclock_last_systime); vdso_th->th_x86_pvc_stable_mask = !pvc->vdso_force_unstable && pvc->stable_flag_supported ? PVCLOCK_FLAG_TSC_STABLE : 0; diff --git a/sys/x86/x86/tsc.c b/sys/x86/x86/tsc.c index 94305dfdc82f..4eab4dc1692b 100644 --- a/sys/x86/x86/tsc.c +++ b/sys/x86/x86/tsc.c @@ -967,7 +967,8 @@ x86_tsc_vdso_timehands32(struct vdso_timehands32 *vdso_th32, vdso_th32->th_algo = VDSO_TH_ALGO_X86_TSC; vdso_th32->th_x86_shift = (int)(intptr_t)tc->tc_priv; vdso_th32->th_x86_hpet_idx = 0xffffffff; - vdso_th32->th_x86_pvc_last_systime = 0; + vdso_th32->th_x86_pvc_last_systime[0] = 0; + vdso_th32->th_x86_pvc_last_systime[1] = 0; vdso_th32->th_x86_pvc_stable_mask = 0; bzero(vdso_th32->th_res, sizeof(vdso_th32->th_res)); return (1);