From nobody Fri Jun 09 19:58:16 2023 X-Original-To: dev-commits-src-branches@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 4QdBhn30XMz4cKYf; Fri, 9 Jun 2023 19:58:17 +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 4QdBhn0Z71z4K00; Fri, 9 Jun 2023 19:58:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340697; 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=57K2Q0nJBznRys36w9mU+2dThMXFWxPFmSSClL7DgFo=; b=ZHeL0EXzO6RbUkAVjZB45/TTNCyVoKtjMGVTfe/iFKCCVTPsaeM4PTT+bfEjt6waZtoOqk gQkOpEjxysRoM6RbC1GD45vXV05qbhLeOk0rNbvvZj+JWfN/iBLWB5zv345LoyMRCld1/X 29EJ9Y01Nd97sNOrrdcV/fbxhovvHhwRd3FT1T1R18Y+wfDeAC2oQL8inQytxhoV7+W8QU X8KhWl1xLVA7IdAMP0g6myBCobZ71vb6bbQIlxAHflSkQswhIGakfDENYYGeadVN4HnKow A6CQChmyQwgAYy3fHDl/NPmMLz2rMw4vah/WEIDyMP0e0gzlPmXywNFmY9FqBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686340697; 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=57K2Q0nJBznRys36w9mU+2dThMXFWxPFmSSClL7DgFo=; b=OIkxbZwVspZ7v1CyOWzGfn+UjMbpF0Nx/xUBteC8dvoGH5C6ERRN245WsIB54hJDKGMXlF hFBpv3WgIP7n0ObFP6mp5cvj7P1Rg44sT3GevdgtIbPa0/Eq+9lDH16vIun9XzrOoYaTzl +BvVe+vxOfZ4eq13YRDSaliEzf284rV9bGiQuTQ9NvxXZfCsW0R4p6B0fIH+AX5tuIUhbm tSGiOFrFg0O2TNcQd5IMrdoHrShWF/1VbDD1kVc/aT/V2KHF4G23U+vDLV0BXZ5HWANb+V XDVDOE84U94Yr34EEkzBMfLTHT/Z84diHdGFfuPPzdPNEfL3gLY3CwgjoKcHDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686340697; a=rsa-sha256; cv=none; b=jvnE5m+v8XbHvGP75SZwD+2LE/bSj3hmVMbXhWaIKL/BNQtyCpGokry7i1Ek6ny8m0qU/W AJr7LKlDtAXYGbbftcEh0swDJqAJaCGic9Q3FxnDp+yAdTTJ0ri51SPeKzHdMxOnfk5K5p MWaVVObLRpdKVAKqdC0qrmlXcwIFMBijFqpurMQ9k+1bvX4OvSyIvU7fDMC/CWM+ViazZe Rkfnh+QWmDbH4h6lPHPB0jBaqvXwOgwyCrXrq+Gr9VARE1R3hnpmIFSZJL1mBlNqwjQbqc jfHB+pjhQO/RHtVlbPQC/iibVrQkvk0fBPn/0hB+wlcbngJ+q87rEG1qPy+u0w== 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 4QdBhm6lgCznW3; Fri, 9 Jun 2023 19:58:16 +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 359JwGma072321; Fri, 9 Jun 2023 19:58:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 359JwGRx072320; Fri, 9 Jun 2023 19:58:16 GMT (envelope-from git) Date: Fri, 9 Jun 2023 19:58:16 GMT Message-Id: <202306091958.359JwGRx072320@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 406f97fa59d7 - stable/13 - hwpmc: remove stub pmd_switch_{in,out} methods List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 406f97fa59d73cd8242100fcfa79f35e5b494c1d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=406f97fa59d73cd8242100fcfa79f35e5b494c1d commit 406f97fa59d73cd8242100fcfa79f35e5b494c1d Author: Mitchell Horne AuthorDate: 2023-05-05 21:59:41 +0000 Commit: Mitchell Horne CommitDate: 2023-06-09 19:48:06 +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 (cherry picked from commit fa88954fd8f16ef60084a73d446a23e791ed22e5) --- 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 36524072d50c..049294b43f9c 100644 --- a/sys/dev/hwpmc/hwpmc_arm64.c +++ b/sys/dev/hwpmc/hwpmc_arm64.c @@ -442,23 +442,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) { @@ -598,11 +581,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; return (pmc_mdep); } diff --git a/sys/dev/hwpmc/hwpmc_armv7.c b/sys/dev/hwpmc/hwpmc_armv7.c index 052b97f35586..26fa6a88b98f 100644 --- a/sys/dev/hwpmc/hwpmc_armv7.c +++ b/sys/dev/hwpmc/hwpmc_armv7.c @@ -407,23 +407,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) { @@ -542,11 +525,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 1ff427a1e965..571b403538ed 100644 --- a/sys/dev/hwpmc/hwpmc_mod.c +++ b/sys/dev/hwpmc/hwpmc_mod.c @@ -5455,6 +5455,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; @@ -5492,9 +5496,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 e8f6f536e471..364e66f77870 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) { @@ -553,9 +539,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: