From nobody Mon Jul 04 18:09:34 2022 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 9EBF11C3FF17; Mon, 4 Jul 2022 18:09:36 +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 4LcDNH6Dqsz4kNW; Mon, 4 Jul 2022 18:09:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656958176; 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=bihJqDHknAJkErhXWOq9JPPHHh7iPK5E4nweENwB1hk=; b=Iw4lRZ2oc7Fa7KQMCMOVN7YyRwSQJYlxHwYia7dD4li7OV0FJcsT+Jp3hzRGqtzr29jX1p HRQU/b9rUiuix8Tvucjr5X3xCJM17rMBIgH+bfiKX2Yozp0Eu1OAo5xkB08HuQSCqhS0Uj nbaqbZgnAoiXsoIwkpTvX+Zs+0fUAzbDh+HR9aN8Z1emzRQE9XxtU5feDQH4D/4BT1irEy 0MsQZYHNgyiq7eUNdPTrMsVZ1ahxSyflZLdVeDlUa+stU4eXRX6mm/sgg5r2oyD2KJN1Xc RGB3ZaZwAd3ghmiCoj3CgzmLYj9ERikWC5l21P1Olk6CSMlpR6GP+p19KyTlvw== 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 7296A15E40; Mon, 4 Jul 2022 18:09:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 264I9YVj064655; Mon, 4 Jul 2022 18:09:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 264I9Yim064654; Mon, 4 Jul 2022 18:09:34 GMT (envelope-from git) Date: Mon, 4 Jul 2022 18:09:34 GMT Message-Id: <202207041809.264I9Yim064654@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 5c55abaf0851 - stable/13 - hwpmc: Reenable PME before reenabling counters. 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: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5c55abaf0851b3334d3c2a4b9e6cf1ededbac3c8 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656958176; 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=bihJqDHknAJkErhXWOq9JPPHHh7iPK5E4nweENwB1hk=; b=RUP9VGmOVcuCaV4iBLi2W/M7+H8yecaeArVHinaPfkwVvljzhL3nZxdB2aRg2wSlcZxWMr p+PInPRyBAFarM573LadoPaVoVd8i1/DdWCQbIdCy+ERAIoISRIFZqIoO7F1Ib8WbpQWDU SWI0xMe2U5Wa/Td2ESAtf4PBXD+qP2pJw2UoN1s+4n/m1KW5W7v2d9XdzoR0GxZDlLXwiw 7rRbk+t/lJ4gT2o/gdwLzASwKqoH7JQbrZ2bSELy575eZYgoGdsQ7kMTor9MD3i/7QJocT omaF7my8Xh/H3G4NXIcYIHKSwuZZ6jCBijHRnOzDWPnldRfnkWWihos3hKZOog== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1656958176; a=rsa-sha256; cv=none; b=nG/0QPcyYKWSeUUis5Pk1wa9B0Rfry6T+c0LU2jlJWsUB2hufCbltyhWGx0dkUC641e4mJ 7u7RcFCV82Zk7xKsg1I3A5jyivBUG/4RF3j9zZYhjlFluFddTu+yhWWf6z1Vcw81/OFKXT 3A2m/3EtDNmu3Qds+s0j/D/4LtRKYxzfIOiz6sjZ0dVXF47d4vQlniBorKJrnfxMPwnlFp ONl6e1c1Q9tc453ycS6uyVVp8M+BkdSujnv3Vcu1tR0YLFCyG6fJVnFjer24dcmSZavhya Fees2Y8/ADhhNU+Zt6Fx18F0BARymYyza2co841IeiWdjvhwOTKLBtdUEGPeXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=5c55abaf0851b3334d3c2a4b9e6cf1ededbac3c8 commit 5c55abaf0851b3334d3c2a4b9e6cf1ededbac3c8 Author: Alexander Motin AuthorDate: 2022-06-15 15:39:37 +0000 Commit: Alexander Motin CommitDate: 2022-07-04 17:48:10 +0000 hwpmc: Reenable PME before reenabling counters. Doing otherwise may lead to lost interrupts, that in combination with hardware PMCs freezing may leave them frozen forever. It may also slightly improve profiling accuracy. MFC after: 2 weeks (cherry picked from commit f9e62419f6daf226a7116be2601842f8f07b1928) --- sys/dev/hwpmc/hwpmc_core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/hwpmc/hwpmc_core.c b/sys/dev/hwpmc/hwpmc_core.c index 7c2a5bcd2a1b..692d7fcd52d9 100644 --- a/sys/dev/hwpmc/hwpmc_core.c +++ b/sys/dev/hwpmc/hwpmc_core.c @@ -1208,6 +1208,9 @@ core2_intr(struct trapframe *tf) else counter_u64_add(pmc_stats.pm_intr_ignored, 1); + if (found_interrupt) + lapic_reenable_pmc(); + /* * Reenable all non-stalled PMCs. */ @@ -1228,9 +1231,6 @@ core2_intr(struct trapframe *tf) (uintmax_t) rdmsr(IA_GLOBAL_CTRL), (uintmax_t) rdmsr(IA_GLOBAL_STATUS)); - if (found_interrupt) - lapic_reenable_pmc(); - return (found_interrupt); }