From nobody Sat May 6 17:49:51 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 4QDFSJ0gcyz49syV; Sat, 6 May 2023 17:49:52 +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 4QDFSH5XgRz3GSb; Sat, 6 May 2023 17:49:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683395391; 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=UPKqcP6mgdY0vdEGK3iOOM21zT4qO7fYbIySkRGQkKU=; b=yLioIo+0iWn/ThZC+1JmMxpgWJ3II5KSZj33DQ+OPMUZpY4/LW5KzSB9KWNrC9C0ZfBS0V hSVEgm8gRhIcbd+DmN3uPFehYln0CH14Syg3GDPhfvwHMjUJZRx0nzdsxiMhs995W2ZM6m unrCNSlD/dPmRGAGOmgyB9rQBu7ngiHrRI72mgO/EQsZXiPRDck7owwrun0GQylaxpzk83 5R8TNUFQ9qG56OsWlV8NHwAaF4t38r9A6jdP7gnnpcr3EPJd3S5q4JePGFTjd8O8FyKYNV U3UnZRlbb07PLJeahK1/BrUTKiMS7bVQMXb5GSE0jGizcqYjlSCuMcNJaLNoHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683395391; 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=UPKqcP6mgdY0vdEGK3iOOM21zT4qO7fYbIySkRGQkKU=; b=NZqIFH9igTOFpIT1KWhgTPd4vScpGd0Pb7NdF/vIsVlpC2YQL+nT5Uc0i8LGCri8qB11nF PhCmrbDZ1RVvWaSBk0FCQi1+IL5RfTHAzKzdP16FZmxzHbUj3GGVgPrVGfvj80xmI2x6/r 5CvInk4Mb0KBKwDB6TScIxLNMaUIcxMtHs0OaOyX1VgXNh/ch1NL5eWIiQTY5y1Muo/WTg fIivHYOJrVv21CqNzS/YpZ/4DhyAyPMX6c3uiNSUO8MKDUJwJDmYFlRM1sUbhd4+pmgoUa BHcMmeELvCvppp58vYrhotS1JdCMghoSDtn8HUIhzSW8YK8URhizBv0br/SRDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683395391; a=rsa-sha256; cv=none; b=lhUtS3vyOIDGO6mKuGsXyvALDZwIuPPT6wecr6RsmzPfZoK65Pkp1kB6qNuCv+Zt+ccTKL X9riQ2d9e/X41vjBw24x/tXbAQH+pkYjiuR2MyaWe3NIjPyKThaW8+Zld3IOhCfFvZNydn 4ceANeFfDFU0gQk7pREbZ/rjYYSdcRdZOSTW1WtxJfoRVUig2G9XKDbTnJLtoOR4iUE4ha ZFh+hDwNy05yZAytLyTfdnTma68RA6TQf0S47FlQPQokm5psXZHzhIWuGpJRwCgvYiuM9E ALoS/vjp1GFsUvdjmmECby8Y9APc3/1ndBJ4jx9sdSo2Vcp9G6Ii+/95CuLb9g== 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 4QDFSH496rzlwZ; Sat, 6 May 2023 17:49:51 +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 346Hnpjj018063; Sat, 6 May 2023 17:49:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 346HnpM2018062; Sat, 6 May 2023 17:49:51 GMT (envelope-from git) Date: Sat, 6 May 2023 17:49:51 GMT Message-Id: <202305061749.346HnpM2018062@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: fa88954fd8f1 - main - hwpmc: remove stub pmd_switch_{in,out} methods 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: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fa88954fd8f16ef60084a73d446a23e791ed22e5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=fa88954fd8f16ef60084a73d446a23e791ed22e5 commit fa88954fd8f16ef60084a73d446a23e791ed22e5 Author: Mitchell Horne AuthorDate: 2023-05-05 21:59:41 +0000 Commit: Mitchell Horne CommitDate: 2023-05-06 17:49:19 +0000 hwpmc: remove stub pmd_switch_{in,out} methods Most platforms (non-x86) don't require these methods and implement stub versions. If we initialize the pmc_mdep structure to always point to the generic versions, then we can purge the duplicate stubs. Reviewed by: jkoshy MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39913 --- sys/dev/hwpmc/hwpmc_arm64.c | 24 ++---------------------- sys/dev/hwpmc/hwpmc_armv7.c | 24 ++---------------------- sys/dev/hwpmc/hwpmc_mod.c | 7 ++++--- sys/dev/hwpmc/hwpmc_powerpc.c | 17 ----------------- 4 files changed, 8 insertions(+), 64 deletions(-) diff --git a/sys/dev/hwpmc/hwpmc_arm64.c b/sys/dev/hwpmc/hwpmc_arm64.c index baf05e52b42a..e3fefc96ff8f 100644 --- a/sys/dev/hwpmc/hwpmc_arm64.c +++ b/sys/dev/hwpmc/hwpmc_arm64.c @@ -448,23 +448,6 @@ arm64_get_config(int cpu, int ri, struct pmc **ppm) return (0); } -/* - * XXX don't know what we should do here. - */ -static int -arm64_switch_in(struct pmc_cpu *pc, struct pmc_process *pp) -{ - - return (0); -} - -static int -arm64_switch_out(struct pmc_cpu *pc, struct pmc_process *pp) -{ - - return (0); -} - static int arm64_pcpu_init(struct pmc_mdep *md, int cpu) { @@ -614,11 +597,8 @@ pmc_arm64_initialize(void) pcd->pcd_stop_pmc = arm64_stop_pmc; pcd->pcd_write_pmc = arm64_write_pmc; - pmc_mdep->pmd_intr = arm64_intr; - pmc_mdep->pmd_switch_in = arm64_switch_in; - pmc_mdep->pmd_switch_out = arm64_switch_out; - - pmc_mdep->pmd_npmc += arm64_npmcs; + pmc_mdep->pmd_intr = arm64_intr; + pmc_mdep->pmd_npmc += arm64_npmcs; #ifdef DEV_ACPI if (pmc_cmn600_nclasses() > 0) diff --git a/sys/dev/hwpmc/hwpmc_armv7.c b/sys/dev/hwpmc/hwpmc_armv7.c index 34f3fd009c9d..526f9c59b4c8 100644 --- a/sys/dev/hwpmc/hwpmc_armv7.c +++ b/sys/dev/hwpmc/hwpmc_armv7.c @@ -416,23 +416,6 @@ armv7_get_config(int cpu, int ri, struct pmc **ppm) return 0; } -/* - * XXX don't know what we should do here. - */ -static int -armv7_switch_in(struct pmc_cpu *pc, struct pmc_process *pp) -{ - - return 0; -} - -static int -armv7_switch_out(struct pmc_cpu *pc, struct pmc_process *pp) -{ - - return 0; -} - static int armv7_pcpu_init(struct pmc_mdep *md, int cpu) { @@ -551,11 +534,8 @@ pmc_armv7_initialize(void) pcd->pcd_stop_pmc = armv7_stop_pmc; pcd->pcd_write_pmc = armv7_write_pmc; - pmc_mdep->pmd_intr = armv7_intr; - pmc_mdep->pmd_switch_in = armv7_switch_in; - pmc_mdep->pmd_switch_out = armv7_switch_out; - - pmc_mdep->pmd_npmc += armv7_npmcs; + pmc_mdep->pmd_intr = armv7_intr; + pmc_mdep->pmd_npmc += armv7_npmcs; return (pmc_mdep); } diff --git a/sys/dev/hwpmc/hwpmc_mod.c b/sys/dev/hwpmc/hwpmc_mod.c index d5de1874c59b..fd90e62e3f2c 100644 --- a/sys/dev/hwpmc/hwpmc_mod.c +++ b/sys/dev/hwpmc/hwpmc_mod.c @@ -5453,6 +5453,10 @@ pmc_mdep_alloc(int nclasses) sizeof(struct pmc_classdep), M_PMC, M_WAITOK|M_ZERO); md->pmd_nclass = n; + /* Default methods */ + md->pmd_switch_in = generic_switch_in; + md->pmd_switch_out = generic_switch_out; + /* Add base class. */ pmc_soft_initialize(md); return md; @@ -5490,9 +5494,6 @@ pmc_generic_cpu_initialize(void) md->pmd_cputype = PMC_CPU_GENERIC; - md->pmd_switch_in = generic_switch_in; - md->pmd_switch_out = generic_switch_out; - return (md); } diff --git a/sys/dev/hwpmc/hwpmc_powerpc.c b/sys/dev/hwpmc/hwpmc_powerpc.c index 3d65d8753fcb..e2ce979d0ba8 100644 --- a/sys/dev/hwpmc/hwpmc_powerpc.c +++ b/sys/dev/hwpmc/hwpmc_powerpc.c @@ -105,20 +105,6 @@ pmc_save_kernel_callchain(uintptr_t *cc, int maxsamples, return (frames); } -static int -powerpc_switch_in(struct pmc_cpu *pc, struct pmc_process *pp) -{ - - return (0); -} - -static int -powerpc_switch_out(struct pmc_cpu *pc, struct pmc_process *pp) -{ - - return (0); -} - int powerpc_describe(int cpu, int ri, struct pmc_info *pi, struct pmc **ppmc) { @@ -564,9 +550,6 @@ pmc_md_initialize(void) vers = mfpvr() >> 16; - pmc_mdep->pmd_switch_in = powerpc_switch_in; - pmc_mdep->pmd_switch_out = powerpc_switch_out; - switch (vers) { case MPC7447A: case MPC7448: