[26.04_linux-nvidia-bos] MPAM update - #543
Conversation
Boro watcher review skippedThe PR watcher skips automatic boro reviews for changes with more than 50 commits. This change currently has 82 commits. To run the review anyway, ask Head: This comment is maintained by BaseOS Reviewer. It is updated when the watcher sees a newer head. |
PR Validation ReportPatchscan ✅ No Missing FixesAll cherry-picked commits checked — no missing upstream fixes found. PR Lint ❌ Errors foundDetailsChecking 82 commits...
Cherry-pick digest:
┌──────────────┬──────────────────────────────────────────────────────────────────┬────────────┬─────────┬───────────────────────────┐
│ Local │ Referenced upstream / Patch subject │ Patch-ID │ Subject │ SoB chain │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 01cb4e9840ad │ [SAUCE] arm_mpam: fix pcc channel lifetime during msc removal │ N/A │ N/A │ ltrager, ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 4ca08edbe965 │ [SAUCE] arm_mpam: scale saved mbwu state for t241-mpam-6 │ N/A │ N/A │ ltrager, ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 1e863fe085e8 │ [SAUCE] arm_mpam: apply t241-mpam-6 to 63-bit counters │ N/A │ N/A │ sdonthin, horgan, ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 13ddf9f68db5 │ [SAUCE] arm_mpam: skip nrdy values when saving mbwu state │ N/A │ N/A │ ltrager, ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 7f092997da82 │ [SAUCE] fs/resctrl: fix iommu_group reference leaks when iterati │ N/A │ N/A │ ltrager, ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ b6544b75037b │ [SAUCE] arm_mpam: initialize mbwu_state values to 0 │ N/A │ N/A │ ltrager, ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ a1100cba38da │ [SAUCE] fs/resctrl: fix redefinition of iommu helpers with confi │ N/A │ N/A │ ltrager, ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ e8f43c4fa58d │ [SAUCE] fs/resctrl: migrate iommu groups when removing resource │ N/A │ N/A │ zengheng, ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 805f2bb20ea4 │ [SAUCE] fs/resctrl: remove unused 'of' parameter from rdtgroup_m │ N/A │ N/A │ zengheng, ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ f7fb8b950d29 │ [SAUCE] fs/resctrl: fix incorrect pid parsing after iommu group │ N/A │ N/A │ zengheng, ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 219aef73af34 │ [SAUCE] arm_mpam: fix monitor capability and mbm assign for mb e │ N/A │ N/A │ fenghuay, bfigg, ltrager, │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 96a12bd7ee78 │ [SAUCE] fix mbm_l3_assign and mon_local_bytes │ N/A │ N/A │ fenghuay, bfigg, ltrager, │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 1e4bb0bdcf46 │ [SAUCE] arm_mpam: include all msc components during domain setup │ N/A │ N/A │ sdonthin, fenghuay, ltrag │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ d26b8f6979cc │ [SAUCE] resctrl: add mba max_lim sysfs and visibility from init │ N/A │ N/A │ fenghuay, ltrager, ltrage │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ ff3f3427452f │ [SAUCE] arm_mpam: resctrl: determine if any exposed counter can │ N/A │ N/A │ morse, ltrager, ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ ad925b660e44 │ [SAUCE] arm_mpam: expose the number of nrdy retries in debugfs │ N/A │ N/A │ morse, fenghuay, ltrager, │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ a6f922cd6648 │ [SAUCE] arm_mpam: add debugfs entries to show the msc/ris the dr │ N/A │ N/A │ morse, fenghuay, ltrager, │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 97c1bf33c2ab │ [SAUCE] fs/resctrl: add support for assigning iommu_groups to re │ N/A │ N/A │ morse, ltrager, ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 8c136a469370 │ [SAUCE] iommu: add helpers to get and set the qos state │ N/A │ N/A │ morse, ltrager, ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ a3fb2f109b32 │ [SAUCE] iommu/arm-smmu-v3: add mpam helpers to query and set sta │ N/A │ N/A │ morse, ltrager, ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 940fb218c304 │ [SAUCE] iommu/arm-smmu-v3: register smmu capabilities with mpam │ N/A │ N/A │ morse, fenghuay, ltrager, │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ e1f9ee5c822d │ [SAUCE] arm_mpam: allow msc to be forced to have an unknown loca │ N/A │ N/A │ morse, fenghuay, ltrager, │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 3199f1b55b01 │ [SAUCE] fs/resctrl: add this_is_not_abi mount option │ N/A │ N/A │ morse, fenghuay, ltrager, │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 314838157efe │ [SAUCE] arm_mpam: allow the maximum partid to be overridden from │ N/A │ N/A │ morse, fenghuay, ltrager, │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 56ba3887987a │ [SAUCE] fs/resctrl: avoid a race with dom_data_exit() and rmid_p │ N/A │ N/A │ morse, fenghuay, ltrager, │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ a143e2d9f81b │ [SAUCE] arm_mpam: resctrl: add kunit test for abmc/cdp interacti │ N/A │ N/A │ morse, fenghuay, ltrager, │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ c53d22622965 │ [SAUCE] arm64: mpam: add memory bandwidth usage (mbwu) documenta │ N/A │ N/A │ morse, horgan, ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ de7e9c859e5a │ [SAUCE] arm_mpam: resctrl: add resctrl_arch_cntr_read() & resctr │ N/A │ N/A │ morse, horgan, ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ d6fe836e0374 │ [SAUCE] arm_mpam: resctrl: add resctrl_arch_config_cntr() for ab │ N/A │ N/A │ morse, horgan, ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 28c18a8ff084 │ [SAUCE] arm_mpam: resctrl: pre-allocate assignable monitors │ N/A │ N/A │ morse, horgan, ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 7a7587de5b0e │ [SAUCE] arm_mpam: resctrl: pick classes for use as mbm counters │ N/A │ N/A │ morse, horgan, ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 8ef04b979b93 │ 1cfa74c683ea fs/resctrl: Document tasks file behaviour for task │ match │ match │ preserved + ltrager added │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 55a8f06d19fe │ 9a1646211f8c fs/resctrl: Document that automatic counter assignm │ match │ match │ preserved + ltrager added │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ e75f35a41c25 │ 3aec86e4ea01 fs/resctrl: Continue counter allocation after failu │ match │ match │ preserved + ltrager added │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 24a628f64aa3 │ ee3d4c81d89c fs/resctrl: Add monitor property 'mbm_cntr_assign_f │ match │ match │ preserved + ltrager added │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 558c84e35969 │ f52abe650241 fs/resctrl: Disallow the software controller when M │ match │ match │ preserved + ltrager added │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ f5472a0843a3 │ 94a1206522d1 x86,fs/resctrl: Create 'event_filter' files read on │ match │ match │ preserved + ltrager added │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ dcc333a714e2 │ 7625632fed43 fs/resctrl: Tidy up the error path in resctrl_mkdir │ match │ match │ preserved + ltrager added │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 66e804162c74 │ [SAUCE] arm_mpam: detect and enable mpam-fb pcc support │ N/A │ N/A │ przywara, ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ cfdd5b7c748d │ [SAUCE] arm_mpam: change mpam-fb error irq to use a threaded irq │ N/A │ N/A │ przywara, ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ c55d66ef0ef3 │ [SAUCE] arm_mpam: avoid msc teardown for the sw programming erro │ N/A │ N/A │ sdonthin, fenghuay, ltrag │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 78cd82f7759f │ [SAUCE] arm_mpam: add mpam-fb msc firmware access support │ N/A │ N/A │ przywara, ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 922cf3f13584 │ [SAUCE] arm_mpam: prepare mon_sel locking for mpam-fb │ N/A │ N/A │ przywara, ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 0931e0dcc8ee │ [SAUCE] arm_mpam: propagate msc access errors for interrupt cont │ N/A │ N/A │ przywara, ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ fce72dbc48e9 │ [SAUCE] arm_mpam: propagate msc access errors for mpam_reprogram │ N/A │ N/A │ przywara, ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 0e441efd579c │ 021118ce5ea9 arm_mpam: Fix MPAMCFG_MBW_PBM register setting │ match │ match │ preserved + ltrager added │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 6a927ecb038e │ [SAUCE] resctrl/mpam: reset ris by applying explicit default con │ N/A │ N/A │ sdonthin, fenghuay, ltrag │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 495047d403d2 │ [SAUCE] arm_mpam: propagate msc access errors for state saving f │ N/A │ N/A │ przywara, ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 09786fe0c199 │ [SAUCE] arm_mpam: propagate msc access errors for __ris_msmon_re │ N/A │ N/A │ przywara, ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ e5b9448f8c1e │ [SAUCE] arm_mpam: propagate msc access errors for msmon helpers │ N/A │ N/A │ przywara, ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 7443bf8fa1e1 │ [SAUCE] arm_mpam: propagate msc access errors for mbwu counters │ N/A │ N/A │ przywara, ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 9e0fd0afc87a │ [SAUCE] arm_mpam: propagate msc access errors for hw_probe funct │ N/A │ N/A │ przywara, ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 7e1ef6b68445 │ [SAUCE] resctrl/mpam: probe mpamf_mbw_idr max_lim and hardlim_rw │ N/A │ N/A │ fenghuay, ltrager, ltrage │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 67708c5ef499 │ [SAUCE] arm_mpam: let low level msc accessors return an error │ N/A │ N/A │ przywara, ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ d39607f9e9e8 │ 50a42e03cdbd arm_mpam: Update architecture version check for MPA │ match │ match │ preserved + ltrager added │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 16f3fd4bbc5e │ 67faed4ccb4f KVM: arm64: Force guest EL1 to use user-space's par │ match │ match │ preserved + ltrager added │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 577c60216823 │ [Revert] untested: arm_mpam: resctrl: pick classes for use as mb │ N/A │ N/A │ ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ bc73fff27fc2 │ [Revert] arm_mpam: resctrl: pre-allocate free running monitors │ N/A │ N/A │ ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ dd82919c2abf │ [Revert] arm_mpam: resctrl: pre-allocate assignable monitors │ N/A │ N/A │ ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 76ae65b782c6 │ [Revert] arm_mpam: resctrl: add kunit test for abmc/cdp interact │ N/A │ N/A │ ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ e37378a7fa77 │ [Revert] arm_mpam: resctrl: add resctrl_arch_config_cntr() for a │ N/A │ N/A │ ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 14f92c37ce36 │ [Revert] arm_mpam: resctrl: add resctrl_arch_rmid_read() and res │ N/A │ N/A │ ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 35f423170d06 │ [Revert] arm_mpam: resctrl: add resctrl_arch_cntr_read() & resct │ N/A │ N/A │ ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 74f3c2952e23 │ [Revert] fs/resctrl: avoid a race with dom_data_exit() and rmid_ │ N/A │ N/A │ ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 6779cceaed4a │ [Revert] arm_mpam: add debugfs entries to show the msc/ris the d │ N/A │ N/A │ ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 51c6838fbeaf │ [Revert] arm_mpam: expose the number of nrdy retries in debugfs │ N/A │ N/A │ ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ b920998e255f │ [Revert] arm_mpam: split the locking around the mon_sel register │ N/A │ N/A │ ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 7ee46e438545 │ [Revert] arm_mpam: allow the maximum partid to be overridden fro │ N/A │ N/A │ ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ ab1751f282a7 │ [Revert] arm_mpam: allow msc to be forced to have an unknown loc │ N/A │ N/A │ ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 6d100b5dc674 │ [Revert] fs/resctrl: add this_is_not_abi mount option │ N/A │ N/A │ ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 64fa409cc8ba │ [Revert] iommu/arm-smmu-v3: register smmu capabilities with mpam │ N/A │ N/A │ ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 8fceac6b2d49 │ [Revert] iommu/arm-smmu-v3: add mpam helpers to query and set st │ N/A │ N/A │ ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ c46332d8ff50 │ [Revert] iommu: add helpers to get and set the qos state │ N/A │ N/A │ ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 34a5067583a0 │ [Revert] fs/resctrl: add support for assigning iommu_groups to r │ N/A │ N/A │ ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 2affafdf2802 │ [Revert] arm_mpam: resctrl: determine if any exposed counter can │ N/A │ N/A │ ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 095e99b9f4cb │ [Revert] arm_mpam: avoid msc teardown for the sw programming err │ N/A │ N/A │ ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ f9e6a1036597 │ [Revert] arm_mpam: include all associated msc components during │ N/A │ N/A │ ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ eae554acb51a │ [Revert] resctrl/mpam: reset ris by applying explicit default co │ N/A │ N/A │ ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 0525852ee281 │ [Revert] resctrl/mpam: probe mpamf_mbw_idr max_lim and hardlim_r │ N/A │ N/A │ ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ ce370813e735 │ [Revert] resctrl: add mba max_lim sysfs and visibility from init │ N/A │ N/A │ ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ b7c92cefa609 │ [Revert] fix mbm_l3_assign and mon_local_bytes │ N/A │ N/A │ ltrager │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 09263f40ac7e │ [Revert] arm_mpam: apply t241-mpam-6 to 63-bit counters │ N/A │ N/A │ ltrager │
└──────────────┴──────────────────────────────────────────────────────────────────┴────────────┴─────────┴───────────────────────────┘
Lint results:
W: 558c84e35969 ("fs/resctrl: Disallow the software controller when "): subject 77 chars (>72)
W: f5472a0843a3 ("x86,fs/resctrl: Create 'event_filter' files read o"): subject 81 chars (>72)
PR metadata:
E: PR targets 26.04_linux-nvidia-bos but body has no https://bugs.launchpad.net/... link
|
|
@ltrager, Is it worth to revert a lot of patches which have been tested by various groups to keep pace to upstream?
|
|
Reviewed all 82 commits with Claude, one deep-dive pass per commit plus a Downstream-only — introduced by this PR1. The reverted if (ret && ctx->enable_abi_playground)
disable_abi_playground();The key is enabled before the first 2. The new mpam_set_feature(mpam_feat_mbw_part, reset_cfg);
reset_cfg->mbw_pbm = GENMASK(props->mbw_pbm_bits - 1, 0);so
Two side notes on the same commit: the 3.
4. It breaks on the first per-group failure and all three callers discard the In the MPAM-Fb v9 series — not yet in linux-next
5.
6.
The unbind gap itself is not new — In linux-next — mailing list rather than this PRBoth are reproduced faithfully, so they are not backport defects. 7. if (existing_class) {
if (class->level == 3) {
pr_debug("Existing class is L3 - L3 wins\n");
return;The first test reads 8. Indexed by CDP-shifted closid and rmid only, ignoring |
Yes, this does seem a bit risky -- and we're trading SAUCE for a-little-bit-newer SAUCE in many cases. |
|
Thanks for the review. The purpose of this PR is to bring the MPAM/resctrl patch stack in Some apparently unrelated patches are source prerequisites for a conflict-free replay of the aligned stack:
I am fine dropping this PR but it will mean the |
9ef5052 to
ab2723a
Compare
This reverts commit 0f0f62d. This commit is being reverted as part of the process in updating "T241-MPAM-6 fixes"; it is reapplied. Signed-off-by: Lee Trager <ltrager@nvidia.com>
This reverts commit 9d97d90. This commit is being reverted as part of the process in updating "ABMC v5 integration adjustments"; it is reapplied. Signed-off-by: Lee Trager <ltrager@nvidia.com>
…ity from init" This reverts commit eb2a397. This commit is being reverted as part of the process in updating "MPAM MBA MAX/HARDLIM support"; it is reapplied. Signed-off-by: Lee Trager <ltrager@nvidia.com>
…and hardlim_rw" This reverts commit 3f89f03. This commit is being reverted as part of the process in updating "MPAM MBA MAX/HARDLIM support"; it is reapplied. Signed-off-by: Lee Trager <ltrager@nvidia.com>
…efault config" This reverts commit 39c973a. This commit is being reverted as part of the process in updating "MPAM MBA MAX/HARDLIM support"; it is reapplied. Signed-off-by: Lee Trager <ltrager@nvidia.com>
…s during domain setup" This reverts commit 3ce46c5. This commit is being reverted as part of the process in updating "ABMC v5 integration adjustments"; it is reapplied. Signed-off-by: Lee Trager <ltrager@nvidia.com>
…ogramming errors" This reverts commit 7abd6df. This commit is being reverted as part of the process in updating "MPAM-Fb integration adjustments"; it is reapplied. Signed-off-by: Lee Trager <ltrager@nvidia.com>
…unter can overflow" This reverts commit 280d193. This commit is being reverted as part of the process in updating "MPAM monitoring integration refresh"; it is reapplied. Signed-off-by: Lee Trager <ltrager@nvidia.com>
…u_groups to resctrl groups" This reverts commit 69037f2. This commit is being reverted as part of the process in updating "MPAM IOMMU integration refresh"; it is reapplied. Signed-off-by: Lee Trager <ltrager@nvidia.com>
…state" This reverts commit 9f1da56. This commit is being reverted as part of the process in updating "MPAM IOMMU integration refresh"; it is reapplied. [ltrager: Resolved the drivers/iommu/iommu.c conflict by removing the current QoS helper implementation while preserving later IOMMU changes.] Signed-off-by: Lee Trager <ltrager@nvidia.com>
…ry and set state" This reverts commit f1c8da0. This commit is being reverted as part of the process in updating "MPAM IOMMU integration refresh"; it is reapplied. [ltrager: Resolved conflicts against the device-based and kdump-aware SMMU implementation by removing the current MPAM helpers while preserving later unrelated SMMU and IOMMU changes.] Signed-off-by: Lee Trager <ltrager@nvidia.com>
…ies with MPAM" This reverts commit 4bfc663. This commit is being reverted as part of the process in updating "MPAM IOMMU integration refresh"; it is reapplied. [ltrager: Resolved the SMMU probe conflict by removing only MPAM capability registration and preserving the later kdump hardware-probe path.] Signed-off-by: Lee Trager <ltrager@nvidia.com>
This reverts commit 1bf2d6c. This commit is being reverted as part of the process in updating "Legacy resctrl integration refresh"; it is reapplied. Signed-off-by: Lee Trager <ltrager@nvidia.com>
…n unknown location" This reverts commit 5ddc3a8. This commit is being reverted as part of the process in updating "Legacy MPAM integration refresh"; it is reapplied. Signed-off-by: Lee Trager <ltrager@nvidia.com>
…verridden from the command line" This reverts commit 7a882f6. This commit is being reverted as part of the process in updating "Legacy MPAM integration refresh"; it is reapplied. Signed-off-by: Lee Trager <ltrager@nvidia.com>
…_sel registers" This reverts commit 0d9b271. This commit is being reverted as part of the process in updating "arm_mpam: Add MPAM-Fb firmware support (v9)"; it is reapplied. Signed-off-by: Lee Trager <ltrager@nvidia.com>
…s in debugfs" This reverts commit 154491f. This commit is being reverted as part of the process in updating "MPAM debugfs integration refresh"; it is reapplied. Signed-off-by: Lee Trager <ltrager@nvidia.com>
…MSC/RIS the driver discovered" This reverts commit 5683679. This commit is being reverted as part of the process in updating "MPAM-Fb integration adjustments"; it is reapplied. [ltrager: Resolved the debugfs conflict by removing the original discovery tree while preserving the later force-disable debugfs feature.] Signed-off-by: Lee Trager <ltrager@nvidia.com>
…t() and rmid_ptrs[]" This reverts commit 4dee662. This commit is being reverted as part of the process in updating "Legacy resctrl integration refresh"; it is reapplied. Signed-off-by: Lee Trager <ltrager@nvidia.com>
…) & resctrl_arch_reset_cntr()" This reverts commit a639261. This commit is being reverted as part of the process in updating "arm_mpam: resctrl: Counter Assignment (ABMC) (v5)"; it is reapplied. Signed-off-by: Lee Trager <ltrager@nvidia.com>
…ABMC use ABMC, mbm_event mode, has a helper resctrl_arch_config_cntr() for changing the mapping between 'cntr_id' and a CLOSID/RMID pair. Add the helper. For MPAM this is done by updating the mon->mbwu_idx_to_mon[] array, and as usual CDP means it needs doing in three different ways. Signed-off-by: James Morse <james.morse@arm.com> Signed-off-by: Ben Horgan <ben.horgan@arm.com> Tested-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com> Tested-by: Fenghua Yu <fenghuay@nvidia.com> Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com> Reviewed-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com> Reviewed-by: Fenghua Yu <fenghuay@nvidia.com> (cherry picked from https://lore.kernel.org/r/20260707162440.12132-4-ben.horgan@arm.com) Signed-off-by: Lee Trager <ltrager@nvidia.com>
…trl_arch_reset_cntr() When used in 'mbm_event' mode, ABMC emulation, resctrl uses arch hooks to read and reset the memory bandwidth utilization (MBWU) counters. Add these. Signed-off-by: James Morse <james.morse@arm.com> Signed-off-by: Ben Horgan <ben.horgan@arm.com> Tested-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com> Tested-by: Fenghua Yu <fenghuay@nvidia.com> Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com> Reviewed-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com> Reviewed-by: Fenghua Yu <fenghuay@nvidia.com> (cherry picked from https://lore.kernel.org/r/20260707162440.12132-5-ben.horgan@arm.com) Signed-off-by: Lee Trager <ltrager@nvidia.com>
…tation Memory bandwidth monitoring make uses of MBWU monitors and is now exposed to the user via resctrl. Add some documentation so the user knows what to expect. Co-developed-by: James Morse <james.morse@arm.com> Signed-off-by: James Morse <james.morse@arm.com> Signed-off-by: Ben Horgan <ben.horgan@arm.com> Reviewed-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com> (cherry picked from https://lore.kernel.org/r/20260707162440.12132-6-ben.horgan@arm.com) Signed-off-by: Lee Trager <ltrager@nvidia.com>
…tions ABMC v5 always uses mbm_event mode. Test that the assignable counter count comes from the selected MPAM class, that CDP splits those counters, that mbm_event remains enabled when the split leaves zero counters, and that synchronization is deferred until counters are allocated. Signed-off-by: James Morse <james.morse@arm.com> (backported from commit a861a0f https://github.com/NVIDIA/NV-Kernels 24.04_linux-nvidia-6.17-next) [fenghuay: - Resolve minor conflicts in drivers/resctrl/test_mpam_resctrl.c; ] Signed-off-by: Fenghua Yu <fenghuay@nvidia.com> [ltrager: - Rewrite the ABMC/CDP test for v5 class-based counter counts and always-on mbm_event mode. ] Signed-off-by: Lee Trager <ltrager@nvidia.com> Acked-by: Jamie Nguyen <jamien@nvidia.com> Acked-by: Carol L Soto <csoto@nvidia.com> Acked-by: Seth Forshee <sforshee@nvidia.com> Acked-by: Fenghua Yu <fenghuay@nvidia.com> Acked-by: Nirmoy Das <nirmoyd@nvidia.com> Signed-off-by: Lee Trager <ltrager@nvidia.com>
…_ptrs[] On MPAM systems if an error occurs the arhictecture code will call resctrl_exit(). This calls dom_data_exit() which takes the rdrgroup_mutex and kfree()s rmid_ptrs[]. It is possible that another syscall tries to access that same array in the meantime, but is blocked on the mutex. Once dom_data_exit() completes, that syscall will see a NULL pointer. Make __rmid_entry() return NULL in this case. Neither __check_limbo() nor free_rmid() return an error, and can silently stop their work if this occurs. dom_data_init() has only just allocated the array and still holds the lock, so __rmid_entry() should never return NULL here. Signed-off-by: James Morse <james.morse@arm.com> (cherry picked from commit c1ac3a4 https://github.com/NVIDIA/NV-Kernels 24.04_linux-nvidia-6.17-next) [fenghuay: - Resolve minor conflicts in `fs/resctrl/monitor.c`; ltrager: - re-resolved against the __check_limbo() refactor from fc16126 ("x86,fs/resctrl: Prevent out-of-bounds access while offlining CPU when SNC enabled") from v6.18.39 ] Signed-off-by: Fenghua Yu <fenghuay@nvidia.com> Signed-off-by: Lee Trager <ltrager@nvidia.com> Acked-by: Jamie Nguyen <jamien@nvidia.com> Acked-by: Carol L Soto <csoto@nvidia.com> Acked-by: Seth Forshee <sforshee@nvidia.com> Acked-by: Fenghua Yu <fenghuay@nvidia.com> [ltrager: Kept the target __check_limbo() flow and applied only the rmid_ptrs lifetime checks.] Signed-off-by: Lee Trager <ltrager@nvidia.com>
…om the command line MPAMs bandwidth monitors are only available via resctrl if there are enough monitors for each combination of partid and pmg to have one. As it is unlikely anyone built that many monitors, allow the maximum partid the system will use to be set from the kernel command-line. With this, it should be possible for bandwidth monitors to be enabled by reducing the number of partid in use. Signed-off-by: James Morse <james.morse@arm.com> (cherry picked from commit f12f00e https://github.com/NVIDIA/NV-Kernels 24.04_linux-nvidia-6.17-next) [fenghuay: - Resolve minor conflicts in `drivers/resctrl/mpam_devices.c`; ] Signed-off-by: Fenghua Yu <fenghuay@nvidia.com> Signed-off-by: Lee Trager <ltrager@nvidia.com> Acked-by: Jamie Nguyen <jamien@nvidia.com> Acked-by: Carol L Soto <csoto@nvidia.com> Acked-by: Seth Forshee <sforshee@nvidia.com> Acked-by: Fenghua Yu <fenghuay@nvidia.com> Signed-off-by: Lee Trager <ltrager@nvidia.com>
Some later things in the MPAM tree enable behaviour that resctrl doesn't have upstream. To make it clear to people using the out-of-tree code that they shouldn't be relying on this in user-space, add a mount option to enable this stuff. Signed-off-by: James Morse <james.morse@arm.com> (cherry picked from commit 8bd0025 https://github.com/NVIDIA/NV-Kernels 24.04_linux-nvidia-6.17-next) [fenghuay: - Resolve minor conflicts in `fs/resctrl/rdtgroup.c`; ] Signed-off-by: Fenghua Yu <fenghuay@nvidia.com> Signed-off-by: Lee Trager <ltrager@nvidia.com> Acked-by: Jamie Nguyen <jamien@nvidia.com> Acked-by: Carol L Soto <csoto@nvidia.com> Acked-by: Seth Forshee <sforshee@nvidia.com> Acked-by: Fenghua Yu <fenghuay@nvidia.com> Signed-off-by: Lee Trager <ltrager@nvidia.com>
…cation The MPAM driver discovers which MSC control which system resources from firmware tables. The MPAM resctrl picking code then attempts to export platforms that are Xeon shaped via resctrl. Occasionally, the presence of one or more MSC prevents the platform being described as Xeon shaped, and exposed via resctrl. For example with CPU-less NUMA nodes. The additional node doensn't have an L3, so can't have domain-ids exposed for the 'MB' memory bandwidth controls. In this example, some users would prefer to control bandwidth on just the CPU nodes, instead of having nothing at all. Allow users an amount of wiggle room by allowing MSC to be forced to be treated as unknown. This effectively disables parts of the MPAM functionality. Unknown MSC are not disabled, They are still probed and contribute to the system wide properties. Suggested-by: Dave Martin <dave.martin@arm.com> Signed-off-by: James Morse <james.morse@arm.com> (cherry picked from commit 542e79e https://github.com/NVIDIA/NV-Kernels 24.04_linux-nvidia-6.17-next) Signed-off-by: Fenghua Yu <fenghuay@nvidia.com> Signed-off-by: Lee Trager <ltrager@nvidia.com> Acked-by: Jamie Nguyen <jamien@nvidia.com> Acked-by: Carol L Soto <csoto@nvidia.com> Acked-by: Seth Forshee <sforshee@nvidia.com> Acked-by: Fenghua Yu <fenghuay@nvidia.com> Signed-off-by: Lee Trager <ltrager@nvidia.com>
Traffic in the system can be tagged with a PARTID and PMG. Different requestors can support a different number of bits for these fields. Before MPAM can be used, the MPAM driver has to discover the minimum number of bits supported by any requestor, which affects the range of PARTID and PMG that can be used. Detect whether the SMMU supports MPAM, if it does provide the MPAM driver with the maximum PARTID and PMG values. Tested-by: Amit Singh Tomar <amitsinght@marvell.com> Signed-off-by: James Morse <james.morse@arm.com> (cherry picked from commit 254691a https://github.com/NVIDIA/NV-Kernels 24.04_linux-nvidia-6.17-next) [fenghuay: - Resolve minor conflicts in `drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c`; ] Signed-off-by: Fenghua Yu <fenghuay@nvidia.com> Signed-off-by: Lee Trager <ltrager@nvidia.com> Acked-by: Jamie Nguyen <jamien@nvidia.com> Acked-by: Carol L Soto <csoto@nvidia.com> Acked-by: Seth Forshee <sforshee@nvidia.com> Acked-by: Fenghua Yu <fenghuay@nvidia.com> Signed-off-by: Lee Trager <ltrager@nvidia.com>
…tate To allow an iommu_group to be moved between resctrl groups as if it were a CPU thread, the mpam driver needs to be able to set the partid and pmg for the iommu_group. Use the properties in the STE, as these only apply to one stream. The MPAM driver also needs to know the maximum partid and pmg values that the SMMU can generate. This allows it to determine the system-wide common supported range of values. Add a helper to return this id register. Tested-by: Amit Singh Tomar <amitsinght@marvell.com> Signed-off-by: James Morse <james.morse@arm.com> (cherry picked from commit 46a241f45ca9b71abf900f31a0c89fcbf24c44c4 https://git.kernel.org/pub/scm/linux/kernel/git/morse/linux.git) Signed-off-by: Lee Trager <ltrager@nvidia.com> Acked-by: Jamie Nguyen <jamien@nvidia.com> Acked-by: Carol L Soto <csoto@nvidia.com> Acked-by: Seth Forshee <sforshee@nvidia.com> Acked-by: Fenghua Yu <fenghuay@nvidia.com> [ltrager: Fixed the conflict by keeping iommu_driver_get_domain_for_dev(), the device-based MPAM callbacks for identity mappings from commit 23bcbda https://github.com/NVIDIA/NV-Kernels 24.04_linux-nvidia-6.17-next, and the kdump MPAM guard from commit 156c23e https://github.com/NVIDIA/NV-Kernels/tree/26.04_linux-nvidia-bos.] Signed-off-by: Lee Trager <ltrager@nvidia.com>
To allow an iommu_group to be moved between resctrl groups as if it were a CPU thread, the mpam driver needs to be able to set the partid and pmg for the iommu_group. Add helpers that call the iommu driver's get/set methods for these parameters. Signed-off-by: James Morse <james.morse@arm.com> (cherry picked from commit 5ee2d478b62586acf816699e3cc479f49b682a58 https://git.kernel.org/pub/scm/linux/kernel/git/morse/linux.git) Signed-off-by: Lee Trager <ltrager@nvidia.com> Acked-by: Jamie Nguyen <jamien@nvidia.com> Acked-by: Carol L Soto <csoto@nvidia.com> Acked-by: Seth Forshee <sforshee@nvidia.com> Acked-by: Fenghua Yu <fenghuay@nvidia.com> [ltrager: Fixed the conflict by keeping the later PCI reset declarations and stubs and the device-by-device QoS dispatch for identity mappings from commit 23bcbda https://github.com/NVIDIA/NV-Kernels 24.04_linux-nvidia-6.17-next.] Signed-off-by: Lee Trager <ltrager@nvidia.com>
…resctrl groups Arm's MPAM has support for assigning devices behind an IOMMU to a control or monitor group. This can be used for device-passthrough for a VM, or user-space drivers using VFIO to ensure the device is either in the same control group as the CPU threads. Alternatively, the iommu_group may be assigned to a different control group with preferential schema values. Extend the resctrl tasks file to include iommu_groups. These appear as 'iommu_group:0', where 0 is the group number that can be found from /sys/kernel/iommu_groups/. iommu_groups can be moved between resctrl groups by writing this string in the same way as tasks are moved. No state is preserved by resctrl, an iommu_group that disappears will no longer be listed as being part of a resctrl group. A new iommu_group will appear in the default group. Add helpers to list and move iommu_groups. Architecture specific helpers are used to apply the closid/rmid to the iommu_group due to the way MPAM emulates CDP. Tested-by: Amit Singh Tomar <amitsinght@marvell.com> Signed-off-by: James Morse <james.morse@arm.com> (cherry picked from commit 98b622c413ee64b8e05f93f0ff5f8cf85776afba https://git.kernel.org/pub/scm/linux/kernel/git/morse/linux.git) [ltrager: - Resolved merge conflict relating to magic numbers now defined as macros, additional log output in drivers/acpi/arm64/mpam.c - Drop drivers/acpi/arm64/mpam.c hunks — the locator parsing they amended was removed along with the dropped "arm_mpam: Parse the rest of the ACPI table" ] Signed-off-by: Lee Trager <ltrager@nvidia.com> Acked-by: Jamie Nguyen <jamien@nvidia.com> Acked-by: Carol L Soto <csoto@nvidia.com> Acked-by: Seth Forshee <sforshee@nvidia.com> Acked-by: Fenghua Yu <fenghuay@nvidia.com> Signed-off-by: Lee Trager <ltrager@nvidia.com>
…driver discovered Not all of MPAM is visible through the resctrl user-space interface. To make it easy to debug why certain devices were not exposed through resctrl, allow the properties of the devices to be read through debugfs. This adds an mpam directory to debugfs, and exposes the devices as well as the hierarchy that was built. Signed-off-by: James Morse <james.morse@arm.com> (backported from commit e8f0f21 https://github.com/NVIDIA/NV-Kernels 24.04_linux-nvidia-6.17-next) [fenghuay: - Resolve minor conflicts in `drivers/resctrl/mpam_devices.c`; ltrager: - Resolve minor conflicts in `drivers/resctrl/mpam_devices.c`; ] Signed-off-by: Fenghua Yu <fenghuay@nvidia.com> Signed-off-by: Lee Trager <ltrager@nvidia.com> Acked-by: Jamie Nguyen <jamien@nvidia.com> Acked-by: Carol L Soto <csoto@nvidia.com> Acked-by: Seth Forshee <sforshee@nvidia.com> Acked-by: Fenghua Yu <fenghuay@nvidia.com> Acked-by: Nirmoy Das <nirmoyd@nvidia.com> [ltrager: Kept the later force-disable debugfs node while restoring the updated MSC and RIS discovery hierarchy.] Signed-off-by: Lee Trager <ltrager@nvidia.com>
It's really popular to tie NRDY high, and then act surprised when the OS never reads the counters, because they aren't ready. The spec obliges hardware to clear this bit automatically before the firmware advertised timeout. To make it easier to find errant hardware, count the number of retries and expose that number in debugfs. Signed-off-by: James Morse <james.morse@arm.com> (backported from commit 4fa427c https://github.com/NVIDIA/NV-Kernels 24.04_linux-nvidia-6.17-next) [fenghuay: - Resolve minor conflicts in `drivers/resctrl/mpam_devices.c`; ] Signed-off-by: Fenghua Yu <fenghuay@nvidia.com> [ltrager: Refresh NRDY counting for the v5 propagated-error read paths.] Signed-off-by: Lee Trager <ltrager@nvidia.com> Acked-by: Jamie Nguyen <jamien@nvidia.com> Acked-by: Carol L Soto <csoto@nvidia.com> Acked-by: Seth Forshee <sforshee@nvidia.com> Acked-by: Fenghua Yu <fenghuay@nvidia.com> Acked-by: Nirmoy Das <nirmoyd@nvidia.com> Signed-off-by: Lee Trager <ltrager@nvidia.com>
…n overflow Resctrl has an overflow handler that runs on each domain every second to ensure that any overflow of the hardware counter is accounted for. MPAM can have counters as large as 63 bits, in which case there is no need to check for overflow. To allow the overflow handler to be disabled, determine if an overflow can happen. If a class is not implemented, or has the 63bit counter, it can't overflow. Signed-off-by: James Morse <james.morse@arm.com> (backported from commit 5cbe15bd6c1d393cf1ffe2b259a3be54a5345e1e https://git.kernel.org/pub/scm/linux/kernel/git/morse/linux.git) [ltrager: Minor merge conflict] Signed-off-by: Lee Trager <ltrager@nvidia.com> Acked-by: Jamie Nguyen <jamien@nvidia.com> Acked-by: Carol L Soto <csoto@nvidia.com> Acked-by: Seth Forshee <sforshee@nvidia.com> Acked-by: Fenghua Yu <fenghuay@nvidia.com> Signed-off-by: Lee Trager <ltrager@nvidia.com>
Add rdt_mb_max_lim_show() and the max_lim entry in res_common_files[].
Add mb_max_lim_init() to call resctrl_file_fflags_init("max_lim", ...)
when arch_has_mb_max_lim, and invoke it from resctrl_init() after
io_alloc_init().
(forward ported from commit be13cad https://github.com/NVIDIA/NV-Kernels 24.04_linux-nvidia-6.17-next)
[fenghuay:
- Resolve minor conflicts in `fs/resctrl/rdtgroup.c`;
ltrager:
- Call mb_max_lim_init() before resctrl_mon_init(), which 'Include all MSC
components' renamed from resctrl_l3_mon_resource_init().
]
Signed-off-by: Fenghua Yu <fenghuay@nvidia.com>
Signed-off-by: Lee Trager <ltrager@nvidia.com>
Acked-by: Jamie Nguyen <jamien@nvidia.com>
Acked-by: Carol L Soto <csoto@nvidia.com>
Acked-by: Seth Forshee <sforshee@nvidia.com>
Acked-by: Fenghua Yu <fenghuay@nvidia.com>
Signed-off-by: Lee Trager <ltrager@nvidia.com>
A single MPAM class can contain multiple MSC components, and a CPU may be associated with more than one of them. Domain create/destroy only walked the first matching component, so controls and monitors were not installed for the rest. Traffic through those omitted components then had no resctrl domain and bandwidth accounting or schemata did not apply where expected. Iterate every component associated with a CPU on online/offline and key domain lookup and allocation by component so each MSC instance gets its own resctrl domain. Signed-off-by: Shanker Donthineni <sdonthineni@nvidia.com> Signed-off-by: Fenghua Yu <fenghuay@nvidia.com> (backported from commit 46160db https://github.com/NVIDIA/NV-Kernels/tree/26.04_linux-nvidia-bos) [ltrager: - Refresh the multi-MSC and MBA-backed monitor changes for ABMC v5. - Preserve v5 per-counter assignments and targeted counter reset. - Derive num_mbm_cntrs from the monitoring class selected for each resource. - Retain downstream MB_HLIM initialization in resctrl_init(). ] Signed-off-by: Lee Trager <ltrager@nvidia.com> Acked-by: Jamie Nguyen <jamien@nvidia.com> Acked-by: Carol L Soto <csoto@nvidia.com> Acked-by: Seth Forshee <sforshee@nvidia.com> Acked-by: Fenghua Yu <fenghuay@nvidia.com> Acked-by: Nirmoy Das <nirmoyd@nvidia.com> Signed-off-by: Lee Trager <ltrager@nvidia.com>
BugLink: https://bugs.launchpad.net/bugs/2154527 Add local bytes counter in mpam_resctrl_counters[] to fix missing mbm_local_bytes monitoring on Grace. Add mon->assigned_counters check to enable mbm_L3_assignments config file on Grace. Signed-off-by: Fenghua Yu <fenghuay@nvidia.com> Acked-by: Jamie Nguyen <jamien@nvidia.com> Acked-by: Carol L Soto <csoto@nvidia.com> Signed-off-by: Brad Figg <bfigg@nvidia.com> (backported from commit 059412d https://github.com/NVIDIA/NV-Kernels/tree/26.04_linux-nvidia-bos) [ltrager: Keep ABMC v5 resource synchronization keyed to assigned MBM counters.] Signed-off-by: Lee Trager <ltrager@nvidia.com> Acked-by: Seth Forshee <sforshee@nvidia.com> Acked-by: Fenghua Yu <fenghuay@nvidia.com> Acked-by: Nirmoy Das <nirmoyd@nvidia.com> Signed-off-by: Lee Trager <ltrager@nvidia.com>
… events BugLink: https://bugs.launchpad.net/bugs/2157922 When mbm_total_bytes is exposed on MBA for memory-level MSC monitors, resctrl_arch_mon_capable() must reflect mon_capable on the backing resource, not only L3. Also gate MBM counter auto-assign and unassign on each enabled event's resource so MBA-backed mbm_total_bytes gets ABMC setup on group create and cleanup on group delete. Signed-off-by: Fenghua Yu <fenghuay@nvidia.com> Acked-by: Matthew R. Ochs <mochs@nvidia.com> Acked-by: Carol L Soto <csoto@nvidia.com> Signed-off-by: Brad Figg <bfigg@nvidia.com> (cherry picked from commit 568443a https://github.com/NVIDIA/NV-Kernels/tree/24.04_linux-nvidia-6.17-next) Signed-off-by: Lee Trager <ltrager@nvidia.com> Acked-by: Jamie Nguyen <jamien@nvidia.com> Acked-by: Seth Forshee <sforshee@nvidia.com> Acked-by: Fenghua Yu <fenghuay@nvidia.com> Signed-off-by: Lee Trager <ltrager@nvidia.com>
…p token
When the tasks interface receives an "iommu_group:id" configuration,
the original code fails to skip the PID parsing logic after processing
the IOMMU group. This causes the same token to be incorrectly passed
to kstrtoint() as a PID, resulting in -EINVAL.
Restructure the conditional logic to use explicit if-else branches,
ensuring that IOMMU group tokens are processed by rdtgroup_move_iommu()
and then skipped.
This fix also enables proper handling of mixed configurations with
multiple consecutive iommu_group:id and pid entries (e.g.,
echo "iommu_group:1,1234,iommu_group:2,5678" > tasks).
Fixes: 98b622c413ee ("fs/resctrl: Add support for assigning iommu_groups to resctrl groups")
Signed-off-by: Zeng Heng <zengheng4@huawei.com>
(cherry picked from https://lore.kernel.org/r/20260414032610.1523958-2-zengheng4@huawei.com)
Signed-off-by: Lee Trager <ltrager@nvidia.com>
…_move_iommu() The 'of' (kernfs_open_file) parameter in rdtgroup_move_iommu() is not used within the function body. Remove it to simplify the interface and eliminate the unnecessary argument passing. Signed-off-by: Zeng Heng <zengheng4@huawei.com> (cherry picked from https://lore.kernel.org/r/20260414032610.1523958-3-zengheng4@huawei.com) Signed-off-by: Lee Trager <ltrager@nvidia.com>
…e groups When deleting a control group, monitor group, or unmounting the resctrl filesystem, migrate all associated IOMMU groups to the appropriate destination: * Control group deletion: move IOMMU groups to the default group * Monitor group deletion: move IOMMU groups to the parent control group * Filesystem unmount: move all IOMMU groups to the default group Without this migration, IOMMU groups remain bound to stale PARTID/PMG values of the destroyed group, causing them to "disappear" from the resctrl interface. Add rdt_move_group_iommus() to handle this migration, mirroring the existing rdt_move_group_tasks() pattern for task migration. When deleting a control group or unmounting the resctrl file system, it is necessary to move its all iommu_groups back to the default group. When removing a monitor group, need to move its iommu_groups back to the parent control group. Otherwise, these iommu_groups remain bound to the old PARTID and PMG, and they will appear to "disappear" from the resctrl fs. Signed-off-by: Zeng Heng <zengheng4@huawei.com> (cherry picked from https://lore.kernel.org/r/20260414032610.1523958-4-zengheng4@huawei.com) Signed-off-by: Lee Trager <ltrager@nvidia.com>
…FIG_RESCTRL_IOMMU=n resctrl.h declares resctrl_arch_set_iommu_closid_rmid() and the two match helpers under #ifdef CONFIG_RESCTRL_IOMMU, with static inline stubs in the #else branch. mpam_resctrl.c defines the same functions unconditionally, handling CONFIG_RESCTRL_IOMMU=n inside the function bodies with IS_ENABLED() checks. RESCTRL_IOMMU is only selected when ARM_SMMU_V3 is enabled, so building with ARM64_MPAM_RESCTRL_FS=y and ARM_SMMU_V3=n pulls the static inline stubs into mpam_resctrl.c alongside its out-of-line definitions: drivers/resctrl/mpam_resctrl.c:388:5: error: redefinition of 'resctrl_arch_set_iommu_closid_rmid' drivers/resctrl/mpam_resctrl.c:404:6: error: redefinition of 'resctrl_arch_match_iommu_closid' drivers/resctrl/mpam_resctrl.c:421:6: error: redefinition of 'resctrl_arch_match_iommu_closid_rmid' Drop the stubs and declare the prototypes unconditionally. The definitions already handle the disabled case internally, and on architectures that never implement them every caller is behind an IS_ENABLED(CONFIG_RESCTRL_IOMMU) check, so the calls are removed as dead code. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Lee Trager <ltrager@nvidia.com> Acked-by: Jamie Nguyen <jamien@nvidia.com> Acked-by: Carol L Soto <csoto@nvidia.com> Acked-by: Seth Forshee <sforshee@nvidia.com> Acked-by: Fenghua Yu <fenghuay@nvidia.com> (cherry picked from commit 6024242 https://github.com/NVIDIA/NV-Kernels/tree/linux-nvidia-6.18-next) Signed-off-by: Lee Trager <ltrager@nvidia.com>
Initialize mwbu_arg and val in mpam_restore_mbwu_state() to zero. This ensures stack garbage is not used when checking mwbu_arg.err. While val is not currently used, __ris_msmon_read() does *m->val += now, so initialize it to ensure KMSAN does not flag it. Reported in upstream review: https://lore.kernel.org/all/673b79c0-d2e6-44a6-a1a8-a2ff92f2ff53@trager.us/ This downstream fix can be dropped once Ben Horgan's proposed change to initialize struct mon_read in mpam_restore_mbwu_state() also initializes val and is applied. See https://lore.kernel.org/r/20260710115546.29644-8-ben.horgan@arm.com Fixes: 38ca089 ("NVIDIA: SAUCE: arm_mpam: propagate MSC access errors for __ris_msmon_read()") Signed-off-by: Lee Trager <ltrager@nvidia.com> Acked-by: Jamie Nguyen <jamien@nvidia.com> Acked-by: Carol L Soto <csoto@nvidia.com> Acked-by: Seth Forshee <sforshee@nvidia.com> Acked-by: Fenghua Yu <fenghuay@nvidia.com> Acked-by: Nirmoy Das <nirmoyd@nvidia.com> (cherry picked from commit 72474d0 https://github.com/NVIDIA/NV-Kernels/tree/linux-nvidia-6.18-next) Signed-off-by: Lee Trager <ltrager@nvidia.com>
…ting groups iommu_group_get_from_kobj() returns with a reference held on group->devices_kobj, which the caller must release with iommu_group_put(). The explicit kobject_get() taken before the call only compensates for the kobject_put(&group->kobj) that iommu_group_get_from_kobj() performs internally. Neither show_rdt_iommu() nor rdt_move_group_iommus() ever calls iommu_group_put(), so each leaks one iommu_group reference per group in the kset on every invocation: every read of a tasks file for the former, and every ctrl/mon group rmdir or resctrl unmount for the latter. Since devices_kobj pins the group's kobject, leaked groups can never be freed. rdt_move_group_iommus() additionally leaks the iterator's reference on group_kobj on its error paths: kset_get_next_obj() only drops the reference on the current kobject when it is passed back as @Prev on the next call, so breaking out of the loop early leaks it. Drop the iommu_group reference at the end of each loop iteration, and drop the group_kobj reference before breaking out of the loop on error. Reported in upstream review - https://lore.kernel.org/all/c53d8057-d3c3-4000-8ce2-876385ca3f25@trager.us/ Fixes: 7b8c62d ("NVIDIA: SAUCE: fs/resctrl: Add support for assigning iommu_groups to resctrl groups") Fixes: a110864 ("NVIDIA: SAUCE: fs/resctrl: Migrate IOMMU groups when removing resource groups") Signed-off-by: Lee Trager <ltrager@nvidia.com> Acked-by: Jamie Nguyen <jamien@nvidia.com> Acked-by: Carol L Soto <csoto@nvidia.com> Acked-by: Seth Forshee <sforshee@nvidia.com> Acked-by: Fenghua Yu <fenghuay@nvidia.com> (cherry picked from commit a4d885b https://github.com/NVIDIA/NV-Kernels/tree/linux-nvidia-6.18-next) Signed-off-by: Lee Trager <ltrager@nvidia.com>
mpam_msc_read_mbwu_l() reports an unstable read by returning zero with MSMON___L_NRDY set in the output value. Hardware may also set the NRDY bit. mpam_save_mbwu_state() otherwise adds the invalid value to the saved correction. Skip updating the saved monitor state whenever NRDY is set. Reported in upstream review: https://lore.kernel.org/all/2228a2be-96b1-4c8a-9786-6ba07fd302c0@trager.us/ This downstream fix can be dropped once Ben Horgan's proposed change to use __ris_msmon_read() when saving MBWU state is applied. See https://lore.kernel.org/r/20260710115546.29644-7-ben.horgan@arm.com Fixes: ba83ae8 ("NVIDIA: SAUCE: arm_mpam: propagate MSC access errors for MBWU counters") Signed-off-by: Lee Trager <ltrager@nvidia.com> Acked-by: Nirmoy Das <nirmoyd@nvidia.com> Acked-by: Seth Forshee <sforshee@nvidia.com> (cherry picked from commit fb73228 https://github.com/ltrager/NV-Kernels/tree/linux-nvidia-6.18-next) Signed-off-by: Lee Trager <ltrager@nvidia.com>
T241-MPAM-6 causes all MBWU counter formats to count 64-byte requests instead of bytes. Commit dc48eb1 excluded the 63-bit MSMON_MBWU_LWD format while scaling the shorter counters. Systems selecting the preferred 63-bit counter consequently report bandwidth values that are 64 times too small. Apply the scale to both the sampled value and overflow correction for the 63-bit format. Unsigned arithmetic retains modulo-u64 behavior when the scaled counter range exceeds u64. Fixes: dc48eb1 ("arm_mpam: Add workaround for T241-MPAM-6") (cherry picked from https://lore.kernel.org/lkml/20240816131432.993859-1-sdonthineni@nvidia.com/) Signed-off-by: Shanker Donthineni <sdonthineni@nvidia.com> Reviewed-by: Ben Horgan <ben.horgan@arm.com> Reviewed-by: Fenghua Yu <fenghuay@nvidia.com> Tested-by: Fenghua Yu <fenghuay@nvidia.com> Signed-off-by: Ben Horgan <ben.horgan@arm.com> (cherry picked from https://lore.kernel.org/r/20260727191326.2202616-1-sdonthineni@nvidia.com) Signed-off-by: Lee Trager <ltrager@nvidia.com>
__ris_msmon_read() scales T241 MBWU counter values from 64-byte requests to bytes before adding mbwu_state->correction. The power management save path adds its raw counter value to the same correction without scaling it, mixing requests and bytes after state restoration. Apply the T241 scale after rejecting NRDY so the saved correction uses the same units as normal reads. This downstream fix can be dropped once Ben Horgan's proposed change to use __ris_msmon_read() when saving MBWU state is applied. See https://lore.kernel.org/r/20260710115546.29644-7-ben.horgan@arm.com Fixes: c31ebea ("arm_mpam: Add workaround for T241-MPAM-6") Signed-off-by: Lee Trager <ltrager@nvidia.com> Acked-by: Nirmoy Das <nirmoyd@nvidia.com> Acked-by: Seth Forshee <sforshee@nvidia.com> (cherry picked from commit cff1a2e https://github.com/ltrager/NV-Kernels/tree/linux-nvidia-6.18-next) Signed-off-by: Lee Trager <ltrager@nvidia.com>
mpam_msc_drv_remove() releases the PCC channel before unlinking the MSC from the SRCU-protected lists. If this drops the final channel reference, an existing reader can dereference the freed channel through its retained MSC. Simply moving the release after mpam_free_garbage() is insufficient. A concurrent garbage collector can claim the queued MSC and wait for the grace period while the remove caller finds an empty garbage list and releases the channel immediately. Add an optional garbage release callback and use it to drop each MSC PCC reference after the collector completes synchronize_srcu(). This also releases PCC references when mpam_disable() destroys the MSCs. Fixes: 41e7e7d ("NVIDIA: SAUCE: arm_mpam: detect and enable MPAM-Fb PCC support") Signed-off-by: Lee Trager <ltrager@nvidia.com> Acked-by: Nirmoy Das <nirmoyd@nvidia.com> Acked-by: Seth Forshee <sforshee@nvidia.com> (cherry picked from commit b7436bb https://github.com/ltrager/NV-Kernels/tree/linux-nvidia-6.18-next) Signed-off-by: Lee Trager <ltrager@nvidia.com>
4218063 to
01cb4e9
Compare
Overview
When backporting MPAM to the linux-nvidia-6.18 kernel I took the latest MPAM/resctrl patch series from LORE and Linus's tree. This left linux-nvidia-6.18-next with newer MPAM/resctrl support than 26.04_linux-nvidia-bos. This PR updates 26.04_linux-nvidia-bos MPAM/resctrl support to mirror what is in linux-nvidia-6.18-next, while retaining the required BOS-specific integration changes.
I have not yet created a bug on launchpad yet as I'd like to get feedback as to whether we want to proceed or not.
Updated Patch Series
New Patch Series
New patch series applied to resolve conflicts with updated series
Patches now sourced from Linus's tree
Reverted and Reapplied Patches
The older versions were reverted before replaying their replacements in dependency order. This avoids layering the newer series over overlapping BOS SAUCE implementations and makes the required conflict resolutions explicit.
0f0f62d1cd9262b5c4d7ec21mbm_L3_assignandmon_local_bytes9d97d90c12bc9343a4d7c69amax_limsysfs supporteb2a397ffd990375f48339ebhardlim_rw3f89f038d12e497927a4144f39c973a9670a2c2b0824b2833ce46c56e79040878d018a1f7abd6df46f5e68f7f93b2b89280d19355685a4bdf575670269037f27389137844a5cdb789f1da5623808e87d5188d3bdf1c8da0cfad398377e75e7714bfc66310af12647763ba37ethis_is_not_abimount option1bf2d6c7b57857dc56521ca05ddc3a894634a94bee05d1607a882f69a85b0694f0e9b3afmon_selregisters0d9b271e9466e5a6b275c27c154491fb081517c6383eb1fb56836799ed9ab65066184f81dom_data_exit()andrmid_ptrs[]race4dee6626ad779176563c832aa639261dd308bf6dfdc6ce01resctrl_arch_config_cntr()for ABMC77c4e9f9d6293dd88e6bf668a199cc64eb18fe2c2b28b50f2d109004824f6550788495feeaff6c2bde68a466792cdf0fTesting
Built and ran on a Vera system. Greenlit passes all MPAM tests