Wire the new PMU layer into hwpmc_mod.c:
- PMC_OP_PMCGROUPCREATE / GROUPADD / GROUPCOMMIT / GROUPRELEASE handlers that drive pmu_group_*.
- Deferred allocate path: when PMC_F_GROUP_DEFER is set, build a pmu_event via pmu_group_on_allocate and assign a unique per-owner deferred handle (struct pmc::pm_handle, value in PMC_HANDLE_DEFERRED_{BASE,MAX}). Userland receives pm_handle as the pmcid; the kernel keeps pm_id at PMC_ROW_UNASSIGNED until the group assigner rewrites it with the real HW row. pmc_find_pmc / pmc_find_pmc_descriptor_in_process now match against pm_handle so userland keeps working with the original pmcid even after the assigner rewrites pm_id.
- Lazy attach assignment: pmc_attach_one_process runs pmu_assign_group against the target proc the first time a sibling of a committed-but-unassigned group is attached, so subsequent siblings see a valid ri. The PMCSTART / PMCSTOP / GETCAPS KASSERTs that previously compared pmcid to pm_id now compare to pm_handle (no semantic change for non-deferred PMCs since pm_handle == pm_id at allocation).
- Process-exit drain: pmc_process_exit invokes pmu_pp_release_all before freeing pp. This severs every pmu_group still hooked off pp and tears down the per-pp rotation kthread, which itself holds pp as its arg. Without this, releasing a group after the target process exited would walk a freed pp and panic LIST_REMOVE with "Bad link prev->next != elm".
- pmu_group_on_release is wired into pmc_release_pmc_descriptor and removes the pmu_event from the group TAILQ before freeing it, so a later sibling release does not walk a freed pe.
- PMC_F_GROUP_MUX commit fallback: pmu_group_commit accepts groups with nevents > slots when MUX is requested and the multiplex layer time-slices them.
- Lock shims for hwpmc_pmu.c. The new PMU layer needs to assert that pmc_sx is held exclusive and to drop/re-acquire it around the rotation kthread's tsleep. Rather than expose pmc_sx as a global symbol to a separate translation unit, hwpmc_mod.c provides hwpmc_pmu_sx_xlock / _xunlock / _assert_xlocked / _sleep wrappers and hwpmc_pmu.c calls those. These shims, like the group entry points, resolve to the PMU layer only on architectures that build it; on others hwpmc_mod.c simply never calls them.
Sponsored by: AMD
Signed-off-by: Raghavendra K T <raghavendra.kt@amd.com>