From nobody Wed Jun 15 15:48:45 2022 X-Original-To: dev-commits-src-main@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 A5A52857566; Wed, 15 Jun 2022 15:48:45 +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 4LNV8Y3x21z4p6M; Wed, 15 Jun 2022 15:48:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655308125; 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=rdaMNQrlnzuW+RwTs3zH31wiy+xPDIOSJG0P7DEzoRo=; b=UNTHsugkEusQovnLi/HrJWY+nM4zicerVA5ZNSVY2cg9Ycl3eRKZhmvHv4JKWquaLu+2UI N8DHkcdR7lx6DRZg8xgBbQlX6t5NoFVIR3csnw+PPQgmLg9c39JvyY+MX4a5AVg6vj4ys6 Esxo6guD8OW04ChYINSlktrH5Ard78LbKf6ZDB7p0+slwMTAtYP6Jvk2YjDfbrc/vFDzkw wmivEla2fPkvnVU+5cOR71Xi5kL2zr4W9U6D/9WHBQWrpCjOg5lTZ4++lTLVZBORAsJwSC IiSIA9zguj8LfXU9t5eyhCt7+dCnBeI+fI/z1OkCvdYQk1HL39d8Vm0ULBs7MA== 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 40442213BB; Wed, 15 Jun 2022 15:48:45 +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 25FFmj6h098713; Wed, 15 Jun 2022 15:48:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25FFmjsE098712; Wed, 15 Jun 2022 15:48:45 GMT (envelope-from git) Date: Wed, 15 Jun 2022 15:48:45 GMT Message-Id: <202206151548.25FFmjsE098712@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: f9e62419f6da - main - hwpmc: Reenable PME before reenabling counters. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: f9e62419f6daf226a7116be2601842f8f07b1928 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655308125; 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=rdaMNQrlnzuW+RwTs3zH31wiy+xPDIOSJG0P7DEzoRo=; b=jcnuJFge0pE2Hawxe+dOTKc0voRNaXnwTbh/x+9nqilD0v68uXOTF3wIxbksYYA1Apr+vg 0SlicZPrl/hK06Cf7GW8JoUScnQ/88PU3EYDL31fDPIoUQZJgWS95sr1V5Zv0VKQOlN/HT 7rnk0YZYK1/uDDzZhGjAW/MEEtMx+jc1bnyRpaj/o5M3utKHkzGZxkyUUfyY1jDLY3RS/e /fhVbqqUnpFBVcXJdhZpo3Ifnkw2kc1C8at7mQyNDF+K9acfDC3DPjNFOuvl2zeFNYFUDz mg01cbWH4JiQjlPSrC4UWBba61o0Mvbb3yLozSKmMg0sr+RQY76+QauPj63zhA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1655308125; a=rsa-sha256; cv=none; b=x75nzwG5HjzUSTfFbk8C3qcHdXIpyZR1sohpQokMY9bwaEodD+RZX5H0PaD6x7hbbKERRW m230WT+VLjpED58qIn1J1bV9ycnl7siwdDM1BHJcQ7Hgxa2yKr7Y8qiJ8hucRXs0w8FTJb SQzp6lqMgfsp36cZVhipnES89w6r2i6cRKL0pf6IebecY11xzh82jbuzwggu9cRRGdzbfm H01IJHCGHWKvci9rurMOk3lI6iGjGSrfRMI8ECIfT4pd6OZwMirSHgxirf78Gj1TgnLboB S5XduOIsUUB3mUNmbb2p4WbpZRYdpjOH0eo+Us+OoJ0eK59IZwjy86fGH6zqrg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=f9e62419f6daf226a7116be2601842f8f07b1928 commit f9e62419f6daf226a7116be2601842f8f07b1928 Author: Alexander Motin AuthorDate: 2022-06-15 15:39:37 +0000 Commit: Alexander Motin CommitDate: 2022-06-15 15:48:38 +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 --- 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 8575abdea214..7ec22c36019c 100644 --- a/sys/dev/hwpmc/hwpmc_core.c +++ b/sys/dev/hwpmc/hwpmc_core.c @@ -1204,6 +1204,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. */ @@ -1224,9 +1227,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); }