From 6577812340cb3de449cd6454f08127907619859a Mon Sep 17 00:00:00 2001 From: Konstantin Demin Date: Tue, 10 Dec 2024 00:17:37 +0300 Subject: [PATCH] release 6.12.4 (preliminary) --- debian/bin/genpatch-pfkernel | 2 +- debian/bin/refine-configs | 2 +- debian/changelog | 12 + debian/config/amd64/config.cloud | 21 +- debian/config/amd64/config.mobile | 119 ++++--- debian/config/amd64/config.vm | 36 +- debian/config/config | 72 +++- debian/libcpupower1.symbols | 1 + .../all/disable-some-marvell-phys.patch | 10 +- ...ftdep-declarations-for-hard-coded-cr.patch | 4 +- .../kbuild-fix-recordmcount-dependency.patch | 2 +- ...efine-_fortify_source-as-2-not-empty.patch | 2 +- ...cflags-through-to-libbpf-build-again.patch | 2 +- ...uired-for-drm-and-kms-on-r600-onward.patch | 2 +- ...-clean-cflags-and-ldflags-for-fixdep.patch | 8 +- ...ix-missing-ldflags-for-some-programs.patch | 2 +- ...ortify_source_2_for_non_debug_builds.patch | 2 +- ...d-fix-libunwind-feature-detection-on.patch | 2 +- ...nprivileged-CLONE_NEWUSER-by-default.patch | 6 +- ...rt-symbols-needed-by-android-drivers.patch | 10 +- ...n-use-of-fanotify_access_permissions.patch | 2 +- ...p-allow-overriding-hostcc-and-hostld.patch | 10 +- debian/patches/debian/gitignore.patch | 6 +- ...-module.lds-under-arch-directory-too.patch | 12 +- ...ing-source-filenames-from-executable.patch | 4 +- ...compiler-version-comparison-optional.patch | 2 +- .../tools-perf-install-python-bindings.patch | 2 +- ...tools-perf-perf-read-vdso-in-libexec.patch | 2 +- ...rnel-config-option-to-lock-down-when.patch | 6 +- ...ecure_boot-flag-to-indicate-secure-b.patch | 10 +- ...e-kernel-if-booted-in-secure-boot-mo.patch | 22 +- ...rther-restriction-of-perf_event_open.patch | 6 +- ...ig-option-to-exclude-igpu-by-default.patch | 6 +- ...ption-to-exclude-integrated-gpu-only.patch | 12 +- ...make-x32-syscall-support-conditional.patch | 4 +- ...ail-the-kernel-build-on-fatal-errors.patch | 2 +- ...ix-the-energy-pkg-event-for-AMD-CPUs.patch | 144 -------- ...den-app-limited-rate-sample-detectio.patch | 4 +- ...hrink-delivered_mstamp-first_tx_msta.patch | 2 +- ...napshot-packets-in-flight-at-transmi.patch | 6 +- ...ount-packets-lost-over-TCP-rate-samp.patch | 4 +- ...xport-FLAG_ECE-in-rate_sample.is_ece.patch | 4 +- ...ntroduce-ca_ops-skb_marked_lost-CC-m.patch | 4 +- ...djust-skb-tx.in_flight-upon-merge-in.patch | 2 +- ...djust-skb-tx.in_flight-upon-split-in.patch | 4 +- ...ca-opts-flag-TCP_CONG_WANTS_CE_EVENT.patch | 6 +- ...alize-TSO-sizing-in-TCP-CC-module-AP.patch | 4 +- ..._ack_mode-1-skip-rwin-check-in-tcp_f.patch | 6 +- ...ecord-app-limited-status-of-TLP-repa.patch | 2 +- ...nform-CC-module-of-losses-repaired-b.patch | 4 +- ...ntroduce-is_acking_tlp_retrans_seq-i.patch | 4 +- ...r-route-feature-RTAX_FEATURE_ECN_LOW.patch | 4 +- ...pdate-TCP-bbr-congestion-control-mod.patch | 6 +- ...nsure-ECN-enabled-BBR-flows-set-ECT-.patch | 2 +- ...OPT_ECN_LOW-in-tcp_info-tcpi_options.patch | 4 +- ...tso_segs-and-skb_marked_lost-to-bpf_.patch | 6 +- ...ntsync-Introduce-NTSYNC_IOC_WAIT_ANY.patch | 6 +- ...ntsync-Introduce-NTSYNC_IOC_WAIT_ALL.patch | 20 +- ...nc-Introduce-NTSYNC_IOC_CREATE_MUTEX.patch | 10 +- ...sync-Introduce-NTSYNC_IOC_MUTEX_KILL.patch | 6 +- ...nc-Introduce-NTSYNC_IOC_CREATE_EVENT.patch | 6 +- ...013-ntsync-Introduce-alertable-waits.patch | 18 +- ...-maintainers-Add-an-entry-for-ntsync.patch | 2 +- ...nc-mark-driver-as-broken-to-prevent-.patch | 2 +- ...2-net-enable-fraglist-GRO-by-default.patch | 24 -- ..._F_GSO_FRAGLIST-from-NETIF_F_GSO_SOF.patch | 129 ------- ...raysky-s-more-ISA-levels-and-uarches.patch | 40 +-- ...raysky-s-more-ISA-levels-and-uarches.patch | 60 ---- ...-CONFIG_OPTIMIZE_FOR_PERFORMANCE_O3.patch} | 6 +- ...ONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3.patch | 13 + ...Prevent-generating-avx2-and-avx512-.patch} | 2 +- ...ONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3.patch | 11 - ...st-KBUILD_CFLAGS-fno-tree-vectorize.patch} | 2 +- ...-GCC-SMS-based-modulo-scheduling-fl.patch} | 14 +- ...te-add-quirk-for-Ryzen-3000-series-p.patch | 8 +- ...te-Export-symbols-for-changing-modes.patch | 88 ----- ...md-pstate-Fix-non-kerneldoc-comment.patch} | 4 +- ...e-Rename-MSR-and-shared-memory-spec.patch} | 4 +- ...te-ut-Add-test-case-for-mode-switche.patch | 77 ----- ...te-Catch-failures-for-amd_pstate_epp.patch | 60 ---- ...e-Use-amd_pstate_update_min_max_lim.patch} | 4 +- ...te-Drop-needless-EPP-initialization.patch} | 4 +- ..._get_highest_perf-from-amd.c-to-cppc.patch | 67 ---- ...-return-code-for-inline-functions-in.patch | 95 ----- ...te-Remove-the-redundant-verify-funct.patch | 54 +++ ...e-Set-the-initial-min_freq-to-lowes.patch} | 85 +++-- ...md_get_highest_perf-to-amd_get_boost.patch | 162 --------- ...C-Drop-check-for-non-zero-perf-ratio.patch | 35 -- ...e-Call-amd_pstate_register-in-amd_p.patch} | 2 +- ...-debug-messages-in-amd_set_max_freq_.patch | 44 --- ...e-Call-amd_pstate_set_driver-in-amd.patch} | 2 +- ...e-Remove-the-switch-case-in-amd_pst.patch} | 2 +- ...d_get_highest_perf-out-of-amd-pstate.patch | 138 -------- ...e-Remove-the-redundant-amd_pstate_s.patch} | 2 +- ...referred-cores-in-amd_get_boost_rati.patch | 251 -------------- ...te-Merge-amd_pstate_highest_perf_set.patch | 169 --------- ...e-ut-Add-fix-for-min-freq-unit-test.patch} | 2 +- ...-to-amd-pstate-by-default-on-some-S.patch} | 2 +- ...te-Optimize-amd_pstate_update_limits.patch | 42 --- ...te-Add-documentation-for-amd_pstate_.patch | 29 -- ...te-Rename-functions-that-enable-CPPC.patch | 121 +++++++ ...issing-documentation-for-amd_pstate_.patch | 42 --- ...te-Do-not-attempt-to-clear-MSR_AMD_C.patch | 30 ++ ...te-Call-cppc_set_epp_perf-in-the-ree.patch | 39 +++ ...te-Align-offline-flow-of-shared-memo.patch | 25 ++ ...te-ut-Fix-an-Uninitialized-variables.patch | 24 -- ...Rename-X86_FEATURE_FAST_CPPC-to-have.patch | 60 ++++ ...llback-to-update-the-min_freq_req-fr.patch | 115 ------- ...Add-feature-bits-for-AMD-heterogeneo.patch | 43 +++ ...D_ASYM_PACKING-for-PKG-Domain-on-AMD.patch | 32 ++ ...te-Cleanup-the-old-min_freq-qos-requ.patch | 103 ------ ...-CPU-type-to-struct-cpuinfo_topology.patch | 187 ++++++++++ ...te-Use-nominal-perf-for-limits-when-.patch | 57 --- ...rogeneous-core-topology-for-identify.patch | 71 ++++ ...e-Push-adjust_perf-vfunc-init-into-.patch} | 8 +- ...te-Move-registration-after-static-fu.patch | 47 +++ ...te-Convert-the-amd_pstate_get-set_ep.patch | 152 ++++++++ ...update-setting-the-minimum-frequency.patch | 228 ------------ ...te-Move-the-invocation-of-amd_pstate.patch | 38 ++ ...te-Refactor-amd_pstate_epp_reenable-.patch | 82 +++++ ...te-Remove-the-cppc_state-check-in-of.patch | 43 +++ ...te-Merge-amd_pstate_epp_cpu_offline-.patch | 56 +++ ...te-Add-trace-event-for-EPP-perf-upda.patch | 132 +++++++ ...md-pstate-convert-mutex-use-to-guard.patch | 123 +++++++ ...tate-Drop-cached-epp_policy-variable.patch | 52 +++ ...te-Use-FIELD_PREP-and-FIELD_GET-macr.patch | 117 +++++++ ...te-Store-the-boost-numerator-as-high.patch | 103 ++++++ ...ove-arch_init_invariance_cppc-call-l.patch | 183 ---------- ...te-Use-boost-numerator-for-upper-bou.patch | 45 +++ ...te-Only-update-the-cached-value-in-m.patch | 36 ++ ...te-store-all-values-in-cpudata-struc.patch | 134 ++++++++ ...te-Change-amd_pstate_update_perf-to-.patch | 69 ++++ ...-amd-pstate-Move-limit-updating-code.patch | 85 +++++ ...te-Cache-EPP-value-and-use-that-ever.patch | 233 +++++++++++++ ...te-Always-write-EPP-value-when-updat.patch | 182 ++++++++++ ...te-Check-if-CPPC-request-has-changed.patch | 158 +++++++++ ...te-Drop-ret-variable-from-amd_pstate.patch | 42 +++ ...te-Set-different-default-EPP-policy-.patch | 58 ++++ ...tplug-support-for-a-PMU-with-a-scope.patch | 321 ----------------- ...ve-the-pmu-allocation-out-of-CPU-hot.patch | 87 +++++ ...0002-perf-Add-PERF_EV_CAP_READ_SCOPE.patch | 71 ---- ...6-rapl-Clean-up-cpumask-and-hotplug.patch} | 56 ++- ...-cstate-Clean-up-cpumask-and-hotplug.patch | 286 --------------- ...move-the-unused-get_rapl_pmu_cpumask.patch | 40 +++ ...n-up-cpumask-and-hotplug-for-perfmon.patch | 188 ---------- ...-Introduce-topology_logical_core_id.patch} | 18 +- ...lean-up-cpumask-and-hotplug-for-perf.patch | 238 ------------- ...-Remove-the-cpu_to_rapl_pmu-function.patch | 69 ++++ ...ve-the-pmu-allocation-out-of-CPU-hot.patch | 84 ----- ...-x86-rapl-Rename-rapl_pmu-variables.patch} | 70 ++-- ...-rapl-Make-rapl_model-struct-global.patch} | 17 +- ...-arguments-to-the-init-and-cleanup-.patch} | 67 ++-- ...ix-the-energy-pkg-event-for-AMD-CPUs.patch | 101 ------ ...ify-the-generic-variable-names-to-_.patch} | 80 +++-- ...-Remove-the-cpu_to_rapl_pmu-function.patch | 87 ----- ...emove-the-global-variable-rapl_msrs.patch} | 19 +- ...e-the-cntr_mask-to-rapl_pmus-struct.patch} | 30 +- ...-core-energy-counter-support-for-AM.patch} | 203 +++++------ ...2-fix-clang-built-kernel-not-booting.patch | 21 ++ ...cpuidle-menu-Remove-iowait-influence.patch | 31 +- ...puidle-Prefer-teo-over-menu-governor.patch | 2 +- ...q-schedutil-Linear-iowait-boost-step.patch | 39 --- ...req-schedutil-iowait-boost-cap-sysfs.patch | 106 ------ ...pufreq-schedutil-Remove-iowait-boost.patch | 325 ------------------ ...req-intel_pstate-Remove-iowait-boost.patch | 113 ------ ...q-Remove-SCHED_CPUFREQ_IOWAIT-update.patch | 42 --- ...ng-Do-not-set-iowait-before-sleeping.patch | 55 --- ...c-simplify-code-for-handling-fewer-t.patch | 2 +- ...2c-access-32-bit-arguments-as-32-bit.patch | 2 +- ...c-eliminate-jump-table-and-excessive.patch | 2 +- ...fault-to-maximum-amount-of-ASLR-bits.patch | 4 +- ...02-cpufreq-Remove-LATENCY_MULTIPLIER.patch | 112 ------ ...skip-simpledrm-if-nvidia-drm.modese.patch} | 0 ...fo-to-WARN_ON_ONCE-on-failed-callbac.patch | 26 -- ...-add-stripe-entries-for-NOCOW-writes.patch | 32 -- ...se-pidfd_get_task-instead-of-pidfd_g.patch | 50 --- ...per-process-KSM-control-via-syscalls.patch | 25 +- .../0001-xfs-fix-chown-with-rt-quota.patch | 178 ++++++++++ .../0001-zstd-import-upstream-v1.5.6.patch | 90 ++--- ...efactor-intentional-wrap-around-test.patch | 2 +- ...-amd_3d_vcache-Add-AMD-3D-V-Cache-op.patch | 266 ++++++++++++++ ...-amd_3d_vcache-Add-sysfs-ABI-documen.patch | 55 +++ .../binder/0001-binder-turn-into-module.patch | 27 +- ...cept-in-LIFO-order-for-cache-efficie.patch | 2 +- ...re-Enable-stateless-firmware-loading.patch | 2 +- .../0003-locking-rwsem-spin-faster.patch | 6 +- ...netfilter-nf_tables-fullcone-support.patch | 8 +- ...-netfilter-add-xt_FLOWOFFLOAD-target.patch | 2 +- ...-to-skip-tcp-collapse-processing-whe.patch | 12 +- ...errides-for-missing-ACS-capabilities.patch | 4 +- ...001-extcon-Add-driver-for-Steam-Deck.patch | 6 +- ...d-driver-for-Steam-Deck-s-EC-sensors.patch | 8 +- ...hwmon-Add-support-for-max-battery-le.patch | 2 +- ...mdeck-Add-support-for-Steam-Deck-LED.patch | 4 +- ...d-Add-MFD-core-driver-for-Steam-Deck.patch | 6 +- ...pose-controller-board-power-in-sysfs.patch | 2 +- ...move-GCC-minimal-function-alignment.patch} | 8 +- ...cheduler-tunable-latencies-to-unsca.patch} | 4 +- ...yield_type-sysctl-to-reduce-or-disa.patch} | 6 +- ...eadline-Increase-write-priority-to-.patch} | 4 +- ...eadline-Disable-front_merges-by-def.patch} | 4 +- ...rq_affinity-to-force-complete-I-O-r.patch} | 4 +- ...t-wbt_default_latency_nsec-to-2msec.patch} | 4 +- ...d-500Hz-timer-interrupt-kernel-conf.patch} | 4 +- ...he_pressure-50-decreases-the-rate-a.patch} | 4 +- ...mm-Raise-max_map_count-default-value.patch | 48 +++ ...mscan-Set-minimum-amount-of-swapping.patch | 4 +- ...ogroup-Add-kernel-parameter-and-conf.patch | 10 +- ...unes-ondemand-and-conservative-gover.patch | 4 +- ...ig.debug-disable-default-SYMBOLIC_ER.patch | 4 +- ...etlocalversion-remove-tag-for-git-re.patch | 4 +- ...etlocalversion-Move-localversion-fil.patch | 4 +- ...-drm-amd-amdgpu-add-pipe1-hardware-s.patch | 38 -- ...01-futex-improve-user-space-accesses.patch | 162 +++++++++ .../sauce/0001-ZEN-Add-VHBA-driver.patch | 6 +- ...002-vhba-Fix-compat-with-kernel-6.11.patch | 2 +- ...d-Intel-remapped-NVMe-device-support.patch | 2 +- ...N-Disable-stack-conservation-for-GCC.patch | 4 +- ...5-ZEN-Initialize-ata-before-graphics.patch | 6 +- ...v-use-call_rcu-when-detaching-client.patch | 2 +- ...ve-schedutil-dependency-on-Intel-AMD.patch | 2 +- ...el-pstate-Implement-enable-parameter.patch | 6 +- ...m-Allow-override-of-min_power_limit-.patch | 12 +- ...t-default-max-map-count-to-INT_MAX-5.patch | 29 -- ...d-early-when-nothing-s-waiting-for-.patch} | 24 +- ...011-ZEN-INTERACTIVE-Base-config-item.patch | 4 +- ...Use-BFQ-as-the-elevator-for-SQ-devic.patch | 4 +- ...Use-Kyber-as-the-elevator-for-MQ-dev.patch | 4 +- ...Enable-background-reclaim-of-hugepag.patch | 6 +- ...ACTIVE-Tune-EEVDF-for-interactivity.patch} | 8 +- ...Tune-mgLRU-to-protect-cache-used-in-.patch | 41 --- ...une-ondemand-governor-for-interacti.patch} | 10 +- ...E-mm-Disable-unevictable-compaction.patch} | 8 +- ...m-Disable-watermark-boosting-by-def.patch} | 10 +- ...mm-Disable-proactive-compaction-by-d.patch | 38 -- ...m-Lower-the-non-hugetlbpage-pageblo.patch} | 6 +- ...m-crypt-Disable-workqueues-for-cryp.patch} | 6 +- ...E-mm-swap-Disable-swap-in-readahead.patch} | 10 +- ...CTIVE-Document-PDS-BMQ-configuration.patch | 23 ++ ...-Disable-staggered-spinup-by-default.patch | 32 ++ .../sauce/0024-ZEN-Update-VHBA-driver.patch | 19 - debian/patches/series | 182 +++++----- debian/rules.d/certs/Makefile | 2 +- debian/rules.d/scripts/Makefile | 1 + debian/templates/image.postrm.in | 1 + 245 files changed, 4680 insertions(+), 5758 deletions(-) delete mode 100644 debian/patches/krd/1001-Revert-perf-x86-rapl-Fix-the-energy-pkg-event-for-AMD-CPUs.patch delete mode 100644 debian/patches/misc-openwrt/0002-net-enable-fraglist-GRO-by-default.patch delete mode 100644 debian/patches/misc-openwrt/0003-net-remove-NETIF_F_GSO_FRAGLIST-from-NETIF_F_GSO_SOF.patch delete mode 100644 debian/patches/mixed-arch/0002-ZEN-Fixup-graysky-s-more-ISA-levels-and-uarches.patch rename debian/patches/mixed-arch/{0003-ZEN-Restore-CONFIG_OPTIMIZE_FOR_PERFORMANCE_O3.patch => 0002-ZEN-Restore-CONFIG_OPTIMIZE_FOR_PERFORMANCE_O3.patch} (86%) create mode 100644 debian/patches/mixed-arch/0003-krd-adjust-CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3.patch rename debian/patches/mixed-arch/{0005-XANMOD-x86-build-Prevent-generating-avx2-and-avx512-.patch => 0004-XANMOD-x86-build-Prevent-generating-avx2-and-avx512-.patch} (96%) delete mode 100644 debian/patches/mixed-arch/0004-krd-adjust-CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3.patch rename debian/patches/mixed-arch/{0006-krd-adjust-KBUILD_CFLAGS-fno-tree-vectorize.patch => 0005-krd-adjust-KBUILD_CFLAGS-fno-tree-vectorize.patch} (94%) rename debian/patches/{patchset-xanmod/xanmod/0001-XANMOD-kbuild-Add-GCC-SMS-based-modulo-scheduling-fl.patch => mixed-arch/0006-XANMOD-kbuild-Add-GCC-SMS-based-modulo-scheduling-fl.patch} (67%) delete mode 100644 debian/patches/patchset-pf/amd-pstate/0002-cpufreq-amd-pstate-Export-symbols-for-changing-modes.patch rename debian/patches/patchset-pf/amd-pstate/{0016-cpufreq-amd-pstate-Fix-non-kerneldoc-comment.patch => 0002-cpufreq-amd-pstate-Fix-non-kerneldoc-comment.patch} (85%) rename debian/patches/patchset-pf/amd-pstate/{0018-cpufreq-amd-pstate-Rename-MSR-and-shared-memory-spec.patch => 0003-cpufreq-amd-pstate-Rename-MSR-and-shared-memory-spec.patch} (96%) delete mode 100644 debian/patches/patchset-pf/amd-pstate/0003-cpufreq-amd-pstate-ut-Add-test-case-for-mode-switche.patch delete mode 100644 debian/patches/patchset-pf/amd-pstate/0004-cpufreq-amd-pstate-Catch-failures-for-amd_pstate_epp.patch rename debian/patches/patchset-pf/amd-pstate/{0024-cpufreq-amd-pstate-Use-amd_pstate_update_min_max_lim.patch => 0004-cpufreq-amd-pstate-Use-amd_pstate_update_min_max_lim.patch} (93%) rename debian/patches/patchset-pf/amd-pstate/{0025-cpufreq-amd-pstate-Drop-needless-EPP-initialization.patch => 0005-cpufreq-amd-pstate-Drop-needless-EPP-initialization.patch} (87%) delete mode 100644 debian/patches/patchset-pf/amd-pstate/0005-x86-amd-Move-amd_get_highest_perf-from-amd.c-to-cppc.patch delete mode 100644 debian/patches/patchset-pf/amd-pstate/0006-ACPI-CPPC-Adjust-return-code-for-inline-functions-in.patch create mode 100644 debian/patches/patchset-pf/amd-pstate/0006-cpufreq-amd-pstate-Remove-the-redundant-verify-funct.patch rename debian/patches/patchset-pf/amd-pstate/{0020-cpufreq-amd-pstate-Set-the-initial-min_freq-to-lowes.patch => 0007-cpufreq-amd-pstate-Set-the-initial-min_freq-to-lowes.patch} (50%) delete mode 100644 debian/patches/patchset-pf/amd-pstate/0007-x86-amd-Rename-amd_get_highest_perf-to-amd_get_boost.patch delete mode 100644 debian/patches/patchset-pf/amd-pstate/0008-ACPI-CPPC-Drop-check-for-non-zero-perf-ratio.patch rename debian/patches/patchset-pf/amd-pstate/{0027-cpufreq-amd-pstate-Call-amd_pstate_register-in-amd_p.patch => 0008-cpufreq-amd-pstate-Call-amd_pstate_register-in-amd_p.patch} (95%) delete mode 100644 debian/patches/patchset-pf/amd-pstate/0009-ACPI-CPPC-Adjust-debug-messages-in-amd_set_max_freq_.patch rename debian/patches/patchset-pf/amd-pstate/{0028-cpufreq-amd-pstate-Call-amd_pstate_set_driver-in-amd.patch => 0009-cpufreq-amd-pstate-Call-amd_pstate_set_driver-in-amd.patch} (97%) rename debian/patches/patchset-pf/amd-pstate/{0029-cpufreq-amd-pstate-Remove-the-switch-case-in-amd_pst.patch => 0010-cpufreq-amd-pstate-Remove-the-switch-case-in-amd_pst.patch} (94%) delete mode 100644 debian/patches/patchset-pf/amd-pstate/0010-x86-amd-Move-amd_get_highest_perf-out-of-amd-pstate.patch rename debian/patches/patchset-pf/amd-pstate/{0030-cpufreq-amd-pstate-Remove-the-redundant-amd_pstate_s.patch => 0011-cpufreq-amd-pstate-Remove-the-redundant-amd_pstate_s.patch} (95%) delete mode 100644 debian/patches/patchset-pf/amd-pstate/0011-x86-amd-Detect-preferred-cores-in-amd_get_boost_rati.patch delete mode 100644 debian/patches/patchset-pf/amd-pstate/0012-cpufreq-amd-pstate-Merge-amd_pstate_highest_perf_set.patch rename debian/patches/patchset-pf/amd-pstate/{0031-cpufreq-amd-pstate-ut-Add-fix-for-min-freq-unit-test.patch => 0012-cpufreq-amd-pstate-ut-Add-fix-for-min-freq-unit-test.patch} (95%) rename debian/patches/patchset-pf/amd-pstate/{0033-amd-pstate-Switch-to-amd-pstate-by-default-on-some-S.patch => 0013-amd-pstate-Switch-to-amd-pstate-by-default-on-some-S.patch} (96%) delete mode 100644 debian/patches/patchset-pf/amd-pstate/0013-cpufreq-amd-pstate-Optimize-amd_pstate_update_limits.patch delete mode 100644 debian/patches/patchset-pf/amd-pstate/0014-cpufreq-amd-pstate-Add-documentation-for-amd_pstate_.patch create mode 100644 debian/patches/patchset-pf/amd-pstate/0014-cpufreq-amd-pstate-Rename-functions-that-enable-CPPC.patch delete mode 100644 debian/patches/patchset-pf/amd-pstate/0015-amd-pstate-Add-missing-documentation-for-amd_pstate_.patch create mode 100644 debian/patches/patchset-pf/amd-pstate/0015-cpufreq-amd-pstate-Do-not-attempt-to-clear-MSR_AMD_C.patch create mode 100644 debian/patches/patchset-pf/amd-pstate/0016-cpufreq-amd-pstate-Call-cppc_set_epp_perf-in-the-ree.patch create mode 100644 debian/patches/patchset-pf/amd-pstate/0017-cpufreq-amd-pstate-Align-offline-flow-of-shared-memo.patch delete mode 100644 debian/patches/patchset-pf/amd-pstate/0017-cpufreq-amd-pstate-ut-Fix-an-Uninitialized-variables.patch create mode 100644 debian/patches/patchset-pf/amd-pstate/0018-x86-cpufeatures-Rename-X86_FEATURE_FAST_CPPC-to-have.patch delete mode 100644 debian/patches/patchset-pf/amd-pstate/0019-cpufreq-Add-a-callback-to-update-the-min_freq_req-fr.patch create mode 100644 debian/patches/patchset-pf/amd-pstate/0019-x86-cpufeatures-Add-feature-bits-for-AMD-heterogeneo.patch create mode 100644 debian/patches/patchset-pf/amd-pstate/0020-x86-cpu-Enable-SD_ASYM_PACKING-for-PKG-Domain-on-AMD.patch delete mode 100644 debian/patches/patchset-pf/amd-pstate/0021-cpufreq-amd-pstate-Cleanup-the-old-min_freq-qos-requ.patch create mode 100644 debian/patches/patchset-pf/amd-pstate/0021-x86-cpu-Add-CPU-type-to-struct-cpuinfo_topology.patch delete mode 100644 debian/patches/patchset-pf/amd-pstate/0022-cpufreq-amd-pstate-Use-nominal-perf-for-limits-when-.patch create mode 100644 debian/patches/patchset-pf/amd-pstate/0022-x86-amd-Use-heterogeneous-core-topology-for-identify.patch rename debian/patches/patchset-pf/amd-pstate/{0034-cpufreq-amd-pstate-Push-adjust_perf-vfunc-init-into-.patch => 0023-cpufreq-amd-pstate-Push-adjust_perf-vfunc-init-into-.patch} (81%) create mode 100644 debian/patches/patchset-pf/amd-pstate/0024-cpufreq-amd-pstate-Move-registration-after-static-fu.patch create mode 100644 debian/patches/patchset-pf/amd-pstate/0025-cpufreq-amd-pstate-Convert-the-amd_pstate_get-set_ep.patch delete mode 100644 debian/patches/patchset-pf/amd-pstate/0026-amd-pstate-6.11-update-setting-the-minimum-frequency.patch create mode 100644 debian/patches/patchset-pf/amd-pstate/0026-cpufreq-amd-pstate-Move-the-invocation-of-amd_pstate.patch create mode 100644 debian/patches/patchset-pf/amd-pstate/0027-cpufreq-amd-pstate-Refactor-amd_pstate_epp_reenable-.patch create mode 100644 debian/patches/patchset-pf/amd-pstate/0028-cpufreq-amd-pstate-Remove-the-cppc_state-check-in-of.patch create mode 100644 debian/patches/patchset-pf/amd-pstate/0029-cpufreq-amd-pstate-Merge-amd_pstate_epp_cpu_offline-.patch create mode 100644 debian/patches/patchset-pf/amd-pstate/0030-cpufreq-amd-pstate-Add-trace-event-for-EPP-perf-upda.patch create mode 100644 debian/patches/patchset-pf/amd-pstate/0031-cpufreq-amd-pstate-convert-mutex-use-to-guard.patch create mode 100644 debian/patches/patchset-pf/amd-pstate/0032-cpufreq-amd-pstate-Drop-cached-epp_policy-variable.patch create mode 100644 debian/patches/patchset-pf/amd-pstate/0033-cpufreq-amd-pstate-Use-FIELD_PREP-and-FIELD_GET-macr.patch create mode 100644 debian/patches/patchset-pf/amd-pstate/0034-cpufreq-amd-pstate-Store-the-boost-numerator-as-high.patch delete mode 100644 debian/patches/patchset-pf/amd-pstate/0035-ACPI-processor-Move-arch_init_invariance_cppc-call-l.patch create mode 100644 debian/patches/patchset-pf/amd-pstate/0035-cpufreq-amd-pstate-Use-boost-numerator-for-upper-bou.patch create mode 100644 debian/patches/patchset-pf/amd-pstate/0036-cpufreq-amd-pstate-Only-update-the-cached-value-in-m.patch create mode 100644 debian/patches/patchset-pf/amd-pstate/0037-cpufreq-amd-pstate-store-all-values-in-cpudata-struc.patch create mode 100644 debian/patches/patchset-pf/amd-pstate/0038-cpufreq-amd-pstate-Change-amd_pstate_update_perf-to-.patch create mode 100644 debian/patches/patchset-pf/amd-pstate/0039-cpufreq-amd-pstate-Move-limit-updating-code.patch create mode 100644 debian/patches/patchset-pf/amd-pstate/0040-cpufreq-amd-pstate-Cache-EPP-value-and-use-that-ever.patch create mode 100644 debian/patches/patchset-pf/amd-pstate/0041-cpufreq-amd-pstate-Always-write-EPP-value-when-updat.patch create mode 100644 debian/patches/patchset-pf/amd-pstate/0042-cpufreq-amd-pstate-Check-if-CPPC-request-has-changed.patch create mode 100644 debian/patches/patchset-pf/amd-pstate/0043-cpufreq-amd-pstate-Drop-ret-variable-from-amd_pstate.patch create mode 100644 debian/patches/patchset-pf/amd-pstate/0044-cpufreq-amd-pstate-Set-different-default-EPP-policy-.patch delete mode 100644 debian/patches/patchset-pf/amd-rapl/0001-perf-Generic-hotplug-support-for-a-PMU-with-a-scope.patch create mode 100644 debian/patches/patchset-pf/amd-rapl/0001-perf-x86-rapl-Move-the-pmu-allocation-out-of-CPU-hot.patch delete mode 100644 debian/patches/patchset-pf/amd-rapl/0002-perf-Add-PERF_EV_CAP_READ_SCOPE.patch rename debian/patches/patchset-pf/amd-rapl/{0007-perf-x86-rapl-Clean-up-cpumask-and-hotplug.patch => 0002-perf-x86-rapl-Clean-up-cpumask-and-hotplug.patch} (71%) delete mode 100644 debian/patches/patchset-pf/amd-rapl/0003-perf-x86-intel-cstate-Clean-up-cpumask-and-hotplug.patch create mode 100644 debian/patches/patchset-pf/amd-rapl/0003-perf-x86-rapl-Remove-the-unused-get_rapl_pmu_cpumask.patch delete mode 100644 debian/patches/patchset-pf/amd-rapl/0004-iommu-vt-d-Clean-up-cpumask-and-hotplug-for-perfmon.patch rename debian/patches/patchset-pf/amd-rapl/{0009-x86-topology-Introduce-topology_logical_core_id.patch => 0004-x86-topology-Introduce-topology_logical_core_id.patch} (84%) delete mode 100644 debian/patches/patchset-pf/amd-rapl/0005-dmaengine-idxd-Clean-up-cpumask-and-hotplug-for-perf.patch create mode 100644 debian/patches/patchset-pf/amd-rapl/0005-perf-x86-rapl-Remove-the-cpu_to_rapl_pmu-function.patch delete mode 100644 debian/patches/patchset-pf/amd-rapl/0006-perf-x86-rapl-Move-the-pmu-allocation-out-of-CPU-hot.patch rename debian/patches/patchset-pf/amd-rapl/{0011-perf-x86-rapl-Rename-rapl_pmu-variables.patch => 0006-perf-x86-rapl-Rename-rapl_pmu-variables.patch} (80%) rename debian/patches/patchset-pf/amd-rapl/{0012-perf-x86-rapl-Make-rapl_model-struct-global.patch => 0007-perf-x86-rapl-Make-rapl_model-struct-global.patch} (77%) rename debian/patches/patchset-pf/amd-rapl/{0013-perf-x86-rapl-Add-arguments-to-the-cleanup-and-init-.patch => 0008-perf-x86-rapl-Add-arguments-to-the-init-and-cleanup-.patch} (51%) delete mode 100644 debian/patches/patchset-pf/amd-rapl/0008-perf-x86-rapl-Fix-the-energy-pkg-event-for-AMD-CPUs.patch rename debian/patches/patchset-pf/amd-rapl/{0014-perf-x86-rapl-Modify-the-generic-variable-names-to-_.patch => 0009-perf-x86-rapl-Modify-the-generic-variable-names-to-_.patch} (83%) delete mode 100644 debian/patches/patchset-pf/amd-rapl/0010-perf-x86-rapl-Remove-the-cpu_to_rapl_pmu-function.patch rename debian/patches/patchset-pf/amd-rapl/{0015-perf-x86-rapl-Remove-the-global-variable-rapl_msrs.patch => 0010-perf-x86-rapl-Remove-the-global-variable-rapl_msrs.patch} (70%) rename debian/patches/patchset-pf/amd-rapl/{0016-perf-x86-rapl-Move-the-cntr_mask-to-rapl_pmus-struct.patch => 0011-perf-x86-rapl-Move-the-cntr_mask-to-rapl_pmus-struct.patch} (69%) rename debian/patches/patchset-pf/amd-rapl/{0017-perf-x86-rapl-Add-per-core-energy-counter-support-fo.patch => 0012-perf-x86-rapl-Add-core-energy-counter-support-for-AM.patch} (65%) create mode 100644 debian/patches/patchset-pf/amd-rapl/0013-amd-rapl-6.12-fix-clang-built-kernel-not-booting.patch delete mode 100644 debian/patches/patchset-pf/cpuidle/0003-TEST-cpufreq-schedutil-Linear-iowait-boost-step.patch delete mode 100644 debian/patches/patchset-pf/cpuidle/0004-TEST-cpufreq-schedutil-iowait-boost-cap-sysfs.patch delete mode 100644 debian/patches/patchset-pf/cpuidle/0005-cpufreq-schedutil-Remove-iowait-boost.patch delete mode 100644 debian/patches/patchset-pf/cpuidle/0006-cpufreq-intel_pstate-Remove-iowait-boost.patch delete mode 100644 debian/patches/patchset-pf/cpuidle/0007-cpufreq-Remove-SCHED_CPUFREQ_IOWAIT-update.patch delete mode 100644 debian/patches/patchset-pf/cpuidle/0008-io_uring-Do-not-set-iowait-before-sleeping.patch delete mode 100644 debian/patches/patchset-pf/fixes/0002-cpufreq-Remove-LATENCY_MULTIPLIER.patch rename debian/patches/patchset-pf/fixes/{0003-drivers-firmware-skip-simpledrm-if-nvidia-drm.modese.patch => 0002-drivers-firmware-skip-simpledrm-if-nvidia-drm.modese.patch} (100%) delete mode 100644 debian/patches/patchset-pf/fixes/0004-nfsd-add-more-info-to-WARN_ON_ONCE-on-failed-callbac.patch delete mode 100644 debian/patches/patchset-pf/fixes/0005-btrfs-also-add-stripe-entries-for-NOCOW-writes.patch delete mode 100644 debian/patches/patchset-pf/ksm/0002-mm-process_ksm-use-pidfd_get_task-instead-of-pidfd_g.patch rename debian/patches/patchset-pf/{ksm => pksm}/0001-mm-expose-per-process-KSM-control-via-syscalls.patch (96%) create mode 100644 debian/patches/patchset-pf/xfs/0001-xfs-fix-chown-with-rt-quota.patch create mode 100644 debian/patches/patchset-xanmod/amd/0001-platform-x86-amd-amd_3d_vcache-Add-AMD-3D-V-Cache-op.patch create mode 100644 debian/patches/patchset-xanmod/amd/0002-platform-x86-amd-amd_3d_vcache-Add-sysfs-ABI-documen.patch rename debian/patches/patchset-xanmod/xanmod/{0002-kbuild-Remove-GCC-minimal-function-alignment.patch => 0001-kbuild-Remove-GCC-minimal-function-alignment.patch} (92%) rename debian/patches/patchset-xanmod/xanmod/{0003-XANMOD-fair-Set-scheduler-tunable-latencies-to-unsca.patch => 0002-XANMOD-fair-Set-scheduler-tunable-latencies-to-unsca.patch} (81%) rename debian/patches/patchset-xanmod/xanmod/{0004-XANMOD-sched-Add-yield_type-sysctl-to-reduce-or-disa.patch => 0003-XANMOD-sched-Add-yield_type-sysctl-to-reduce-or-disa.patch} (89%) rename debian/patches/patchset-xanmod/xanmod/{0005-XANMOD-block-mq-deadline-Increase-write-priority-to-.patch => 0004-XANMOD-block-mq-deadline-Increase-write-priority-to-.patch} (91%) rename debian/patches/patchset-xanmod/xanmod/{0006-XANMOD-block-mq-deadline-Disable-front_merges-by-def.patch => 0005-XANMOD-block-mq-deadline-Disable-front_merges-by-def.patch} (83%) rename debian/patches/patchset-xanmod/xanmod/{0007-XANMOD-block-Set-rq_affinity-to-force-complete-I-O-r.patch => 0006-XANMOD-block-Set-rq_affinity-to-force-complete-I-O-r.patch} (84%) rename debian/patches/patchset-xanmod/xanmod/{0008-XANMOD-blk-wbt-Set-wbt_default_latency_nsec-to-2msec.patch => 0007-XANMOD-blk-wbt-Set-wbt_default_latency_nsec-to-2msec.patch} (84%) rename debian/patches/patchset-xanmod/xanmod/{0009-XANMOD-kconfig-add-500Hz-timer-interrupt-kernel-conf.patch => 0008-XANMOD-kconfig-add-500Hz-timer-interrupt-kernel-conf.patch} (87%) rename debian/patches/patchset-xanmod/xanmod/{0010-XANMOD-dcache-cache_pressure-50-decreases-the-rate-a.patch => 0009-XANMOD-dcache-cache_pressure-50-decreases-the-rate-a.patch} (82%) create mode 100644 debian/patches/patchset-xanmod/xanmod/0010-XANMOD-mm-Raise-max_map_count-default-value.patch delete mode 100644 debian/patches/patchset-zen/fixes/0001-Partially-revert-drm-amd-amdgpu-add-pipe1-hardware-s.patch create mode 100644 debian/patches/patchset-zen/fixes/0001-futex-improve-user-space-accesses.patch delete mode 100644 debian/patches/patchset-zen/sauce/0010-ZEN-Set-default-max-map-count-to-INT_MAX-5.patch rename debian/patches/patchset-zen/sauce/{0025-ZEN-mm-Stop-kswapd-early-when-nothing-s-waiting-for-.patch => 0010-ZEN-mm-Stop-kswapd-early-when-nothing-s-waiting-for-.patch} (90%) rename debian/patches/patchset-zen/sauce/{0016-ZEN-INTERACTIVE-Tune-EEVDF-for-interactivity.patch => 0015-ZEN-INTERACTIVE-Tune-EEVDF-for-interactivity.patch} (93%) delete mode 100644 debian/patches/patchset-zen/sauce/0015-ZEN-INTERACTIVE-Tune-mgLRU-to-protect-cache-used-in-.patch rename debian/patches/patchset-zen/sauce/{0017-ZEN-INTERACTIVE-Tune-ondemand-governor-for-interacti.patch => 0016-ZEN-INTERACTIVE-Tune-ondemand-governor-for-interacti.patch} (92%) rename debian/patches/patchset-zen/sauce/{0018-ZEN-INTERACTIVE-mm-Disable-unevictable-compaction.patch => 0017-ZEN-INTERACTIVE-mm-Disable-unevictable-compaction.patch} (79%) rename debian/patches/patchset-zen/sauce/{0020-ZEN-INTERACTIVE-mm-Disable-watermark-boosting-by-def.patch => 0018-ZEN-INTERACTIVE-mm-Disable-watermark-boosting-by-def.patch} (88%) delete mode 100644 debian/patches/patchset-zen/sauce/0019-ZEN-INTERACTIVE-mm-Disable-proactive-compaction-by-d.patch rename debian/patches/patchset-zen/sauce/{0021-ZEN-INTERACTIVE-mm-Lower-the-non-hugetlbpage-pageblo.patch => 0019-ZEN-INTERACTIVE-mm-Lower-the-non-hugetlbpage-pageblo.patch} (93%) rename debian/patches/patchset-zen/sauce/{0022-ZEN-INTERACTIVE-dm-crypt-Disable-workqueues-for-cryp.patch => 0020-ZEN-INTERACTIVE-dm-crypt-Disable-workqueues-for-cryp.patch} (88%) rename debian/patches/patchset-zen/sauce/{0023-ZEN-INTERACTIVE-mm-swap-Disable-swap-in-readahead.patch => 0021-ZEN-INTERACTIVE-mm-swap-Disable-swap-in-readahead.patch} (83%) create mode 100644 debian/patches/patchset-zen/sauce/0022-ZEN-INTERACTIVE-Document-PDS-BMQ-configuration.patch create mode 100644 debian/patches/patchset-zen/sauce/0023-ZEN-ahci-Disable-staggered-spinup-by-default.patch delete mode 100644 debian/patches/patchset-zen/sauce/0024-ZEN-Update-VHBA-driver.patch diff --git a/debian/bin/genpatch-pfkernel b/debian/bin/genpatch-pfkernel index b8b8591..ee762b8 100755 --- a/debian/bin/genpatch-pfkernel +++ b/debian/bin/genpatch-pfkernel @@ -7,7 +7,7 @@ w=$(git rev-parse --path-format=absolute --show-toplevel) ; : "${w:?}" ; cd "$w" dst='debian/patches/pf-tmp' src='../linux-extras' -branches='amd-pstate amd-rapl cpu cpuidle crypto fixes ksm zstd' +branches='amd-pstate amd-rapl cpuidle crypto fixes kbuild pksm xfs zstd' if [ -d "${dst}" ] ; then rm -rf "${dst}" ; fi mkdir -p "${dst}" diff --git a/debian/bin/refine-configs b/debian/bin/refine-configs index 4193d46..d739a90 100755 --- a/debian/bin/refine-configs +++ b/debian/bin/refine-configs @@ -44,7 +44,7 @@ for c in ${configs} ; do f="debian/build/$c" cp -f "$f" "${src_dir}/.config" - env -C "${src_dir}" make "-j${nproc}" olddefconfig + env -C "${src_dir}" make "-j${nproc}" oldconfig cp -f "${src_dir}/.config" "$f" done diff --git a/debian/changelog b/debian/changelog index b248e8e..42545d5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,15 @@ +linux (6.12.4-1) sid; urgency=medium + + * Sync with Debian. + * New upstream release: https://kernelnewbies.org/Linux_6.12 + * New upstream stable update: + https://www.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.12.1 + https://www.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.12.2 + https://www.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.12.3 + https://www.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.12.4 + + -- Konstantin Demin Mon, 09 Dec 2024 22:08:34 +0300 + linux (6.11.11-1) sid; urgency=medium * New upstream stable update: diff --git a/debian/config/amd64/config.cloud b/debian/config/amd64/config.cloud index 4e48ab0..3c19084 100644 --- a/debian/config/amd64/config.cloud +++ b/debian/config/amd64/config.cloud @@ -28,7 +28,6 @@ CONFIG_NR_CPUS=512 # CONFIG_X86_MCE_INJECT is not set CONFIG_X86_5LEVEL=y # CONFIG_AMD_NUMA is not set -# CONFIG_NUMA_EMU is not set CONFIG_NODES_SHIFT=10 # CONFIG_X86_PMEM_LEGACY is not set # CONFIG_X86_CHECK_BIOS_CORRUPTION is not set @@ -352,6 +351,11 @@ CONFIG_CXL_BUS=y # CONFIG_XILINX_DMA is not set # CONFIG_XILINX_XDMA is not set +## +## file: drivers/dma/amd/Kconfig +## +# CONFIG_AMD_QDMA is not set + ## ## file: drivers/dma/dw/Kconfig ## @@ -1682,6 +1686,7 @@ CONFIG_SCSI_MPI3MR=m ## # CONFIG_THERMAL_STATISTICS is not set # CONFIG_THERMAL_DEBUGFS is not set +# CONFIG_THERMAL_CORE_TESTING is not set # CONFIG_THERMAL_GOV_BANG_BANG is not set ## @@ -2140,14 +2145,6 @@ CONFIG_PREEMPT_NONE=y ## # CONFIG_SWIOTLB_DYNAMIC is not set -## -## file: kernel/module/Kconfig -## -## choice: Module compression mode -CONFIG_MODULE_COMPRESS_NONE=y -# CONFIG_MODULE_COMPRESS_XZ is not set -## end choice - ## ## file: kernel/power/Kconfig ## @@ -2205,6 +2202,7 @@ CONFIG_PANIC_TIMEOUT=5 # CONFIG_ZSWAP is not set CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE=y # CONFIG_HWPOISON_INJECT is not set +# CONFIG_NUMA_EMU is not set ## ## file: mm/Kconfig.debug @@ -2460,6 +2458,11 @@ CONFIG_HYPERV_VSOCKETS=m # CONFIG_LIST_HARDENED is not set # CONFIG_BUG_ON_DATA_CORRUPTION is not set +## +## file: security/ipe/Kconfig +## +CONFIG_IPE_PROP_DM_VERITY_SIGNATURE=y + ## ## file: security/keys/Kconfig ## diff --git a/debian/config/amd64/config.mobile b/debian/config/amd64/config.mobile index e35bab8..d20ad5c 100644 --- a/debian/config/amd64/config.mobile +++ b/debian/config/amd64/config.mobile @@ -19,7 +19,6 @@ CONFIG_X86_MCE_INJECT=m CONFIG_X86_16BIT=y # CONFIG_X86_5LEVEL is not set CONFIG_AMD_NUMA=y -CONFIG_NUMA_EMU=y CONFIG_NODES_SHIFT=6 CONFIG_X86_PMEM_LEGACY=y CONFIG_X86_CHECK_BIOS_CORRUPTION=y @@ -343,6 +342,7 @@ CONFIG_BT_HCIUART_RTL=y CONFIG_BT_HCIUART_QCA=y CONFIG_BT_HCIUART_AG6XX=y CONFIG_BT_HCIUART_MRVL=y +CONFIG_BT_HCIUART_AML=y CONFIG_BT_HCIBCM203X=m CONFIG_BT_HCIBCM4377=m CONFIG_BT_HCIBPA10X=m @@ -579,6 +579,11 @@ CONFIG_XILINX_DMA=m CONFIG_XILINX_XDMA=m CONFIG_XILINX_ZYNQMP_DPDMA=m +## +## file: drivers/dma/amd/Kconfig +## +CONFIG_AMD_QDMA=m + ## ## file: drivers/dma/dw/Kconfig ## @@ -654,6 +659,7 @@ CONFIG_EXTCON_GPIO=m CONFIG_EXTCON_INTEL_INT3496=m CONFIG_EXTCON_INTEL_CHT_WC=m CONFIG_EXTCON_INTEL_MRFLD=m +CONFIG_EXTCON_LC824206XA=m CONFIG_EXTCON_MAX14577=m CONFIG_EXTCON_MAX3355=m CONFIG_EXTCON_MAX77693=m @@ -766,6 +772,7 @@ CONFIG_GPIO_PCA9570=m CONFIG_GPIO_PCF857X=m CONFIG_GPIO_TPIC2810=m CONFIG_GPIO_ADP5520=m +CONFIG_GPIO_ADP5585=m CONFIG_GPIO_ARIZONA=m CONFIG_GPIO_BD71815=m CONFIG_GPIO_BD71828=m @@ -830,6 +837,7 @@ CONFIG_GPIO_VIRTUSER=m ## CONFIG_DRM=y # CONFIG_DRM_DEBUG_MM is not set +# CONFIG_DRM_PANIC is not set # CONFIG_DRM_DEBUG_DP_MST_TOPOLOGY_REFS is not set # CONFIG_DRM_DEBUG_MODESET_LOCK is not set CONFIG_DRM_FBDEV_EMULATION=y @@ -1036,6 +1044,7 @@ CONFIG_DRM_PANEL_BOE_BF060Y8M_AJ0=m CONFIG_DRM_PANEL_BOE_HIMAX8279D=m CONFIG_DRM_PANEL_BOE_TH101MB31UIG002_28A=m CONFIG_DRM_PANEL_BOE_TV101WUM_NL6=m +CONFIG_DRM_PANEL_BOE_TV101WUM_LL2=m CONFIG_DRM_PANEL_EBBG_FT8719=m CONFIG_DRM_PANEL_ELIDA_KD35T133=m CONFIG_DRM_PANEL_FEIXIN_K101_IM2BA02=m @@ -1273,6 +1282,7 @@ CONFIG_HID_GFRM=m CONFIG_HID_GLORIOUS=m CONFIG_HID_HOLTEK=m CONFIG_HOLTEK_FF=y +CONFIG_HID_GOODIX_SPI=m CONFIG_HID_GOOGLE_STADIA_FF=m CONFIG_HID_VIVALDI=m CONFIG_HID_GT683R=m @@ -1718,7 +1728,6 @@ CONFIG_INTEL_TH_PTI=m ## CONFIG_I2C=y CONFIG_ACPI_I2C_OPREGION=y -CONFIG_I2C_COMPAT=y CONFIG_I2C_CHARDEV=m CONFIG_I2C_MUX=m CONFIG_I2C_ATR=m @@ -1765,6 +1774,7 @@ CONFIG_I2C_VIAPRO=m CONFIG_I2C_ZHAOXIN=m CONFIG_I2C_SCMI=m CONFIG_I2C_CBUS_GPIO=m +CONFIG_I2C_DESIGNWARE_CORE=y CONFIG_I2C_DESIGNWARE_SLAVE=y CONFIG_I2C_DESIGNWARE_PLATFORM=y CONFIG_I2C_DESIGNWARE_BAYTRAIL=y @@ -1772,6 +1782,7 @@ CONFIG_I2C_DESIGNWARE_PCI=m CONFIG_I2C_EMEV2=m CONFIG_I2C_GPIO=m # CONFIG_I2C_GPIO_FAULT_INJECTOR is not set +CONFIG_I2C_KEBA=m CONFIG_I2C_KEMPLD=m CONFIG_I2C_OCORES=m CONFIG_I2C_PCA_PLATFORM=m @@ -1805,6 +1816,7 @@ CONFIG_I2C_MUX_PINCTRL=m CONFIG_I2C_MUX_REG=m CONFIG_I2C_DEMUX_PINCTRL=m CONFIG_I2C_MUX_MLXCPLD=m +CONFIG_I2C_MUX_MULE=m ## ## file: drivers/i3c/Kconfig @@ -1908,7 +1920,6 @@ CONFIG_KEYBOARD_MATRIX=m CONFIG_KEYBOARD_LM8323=m CONFIG_KEYBOARD_LM8333=m CONFIG_KEYBOARD_MAX7359=m -CONFIG_KEYBOARD_MCS=m CONFIG_KEYBOARD_MPR121=m CONFIG_KEYBOARD_NEWTON=m CONFIG_KEYBOARD_OPENCORES=m @@ -2092,7 +2103,6 @@ CONFIG_INPUT_TOUCHSCREEN=y # CONFIG_TOUCHSCREEN_CY8CTMA140 is not set # CONFIG_TOUCHSCREEN_CY8CTMG110 is not set # CONFIG_TOUCHSCREEN_CYTTSP_CORE is not set -# CONFIG_TOUCHSCREEN_CYTTSP4_CORE is not set # CONFIG_TOUCHSCREEN_CYTTSP5 is not set # CONFIG_TOUCHSCREEN_DA9034 is not set # CONFIG_TOUCHSCREEN_DA9052 is not set @@ -2119,7 +2129,6 @@ CONFIG_INPUT_TOUCHSCREEN=y # CONFIG_TOUCHSCREEN_WACOM_W8001 is not set # CONFIG_TOUCHSCREEN_WACOM_I2C is not set # CONFIG_TOUCHSCREEN_MAX11801 is not set -# CONFIG_TOUCHSCREEN_MCS5000 is not set # CONFIG_TOUCHSCREEN_MMS114 is not set # CONFIG_TOUCHSCREEN_MELFAS_MIP4 is not set # CONFIG_TOUCHSCREEN_MSG2638 is not set @@ -2292,6 +2301,7 @@ CONFIG_LEDS_MENF21BMC=m CONFIG_LEDS_IS31FL319X=m CONFIG_LEDS_IS31FL32XX=m CONFIG_LEDS_BLINKM=m +CONFIG_LEDS_BLINKM_MULTICOLOR=y CONFIG_LEDS_MLXCPLD=m CONFIG_LEDS_MLXREG=m CONFIG_LEDS_USER=m @@ -2429,6 +2439,11 @@ CONFIG_CEC_CH7322=m ## CONFIG_CEC_SECO=m +## +## file: drivers/media/cec/usb/extron-da-hd-4k-plus/Kconfig +## +CONFIG_USB_EXTRON_DA_HD_4K_PLUS_CEC=m + ## ## file: drivers/media/cec/usb/pulse8/Kconfig ## @@ -2739,6 +2754,7 @@ CONFIG_MEMSTICK_REALTEK_USB=m ## ## file: drivers/mfd/Kconfig ## +CONFIG_MFD_ADP5585=m CONFIG_MFD_ACT8945A=m CONFIG_MFD_AS3711=y CONFIG_MFD_SMPRO=m @@ -2900,6 +2916,7 @@ CONFIG_AD525X_DPOT_I2C=m CONFIG_AD525X_DPOT_SPI=m CONFIG_IBM_ASM=m CONFIG_PHANTOM=m +CONFIG_RPMB=m CONFIG_TIFM_CORE=m CONFIG_TIFM_7XX1=m CONFIG_ICS932S401=m @@ -3366,6 +3383,7 @@ CONFIG_DNET=m CONFIG_JME=m CONFIG_FEALNX=m CONFIG_ETHOC=m +CONFIG_OA_TC6=m ## ## file: drivers/net/ethernet/3com/Kconfig @@ -3675,6 +3693,7 @@ CONFIG_MLX5_MACSEC=y CONFIG_MLX5_EN_IPSEC=y CONFIG_MLX5_EN_TLS=y CONFIG_MLX5_SW_STEERING=y +CONFIG_MLX5_HW_STEERING=y CONFIG_MLX5_SF=y CONFIG_MLX5_DPLL=m @@ -3717,6 +3736,16 @@ CONFIG_ENC28J60=m CONFIG_ENCX24J600=m CONFIG_LAN743X=m +## +## file: drivers/net/ethernet/microchip/fdma/Kconfig +## +CONFIG_FDMA=y + +## +## file: drivers/net/ethernet/microchip/lan865x/Kconfig +## +CONFIG_LAN865X=m + ## ## file: drivers/net/ethernet/microchip/lan966x/Kconfig ## @@ -3830,6 +3859,7 @@ CONFIG_8139TOO_TUNE_TWISTER=y CONFIG_8139TOO_8129=y # CONFIG_8139_OLD_RX_RESET is not set CONFIG_R8169=m +CONFIG_RTASE=m ## ## file: drivers/net/ethernet/renesas/Kconfig @@ -4648,6 +4678,7 @@ CONFIG_RTW89=m CONFIG_RTW89_8851BE=m CONFIG_RTW89_8852AE=m CONFIG_RTW89_8852BE=m +CONFIG_RTW89_8852BTE=m CONFIG_RTW89_8852CE=m CONFIG_RTW89_8922AE=m CONFIG_RTW89_DEBUGMSG=y @@ -4878,6 +4909,7 @@ CONFIG_NVMEM_U_BOOT_ENV=m ## CONFIG_NVMEM_LAYOUT_SL28_VPD=m CONFIG_NVMEM_LAYOUT_ONIE_TLV=m +CONFIG_NVMEM_LAYOUT_U_BOOT_ENV=m ## ## file: drivers/of/Kconfig @@ -5167,6 +5199,7 @@ CONFIG_SEL3350_PLATFORM=m ## file: drivers/platform/x86/amd/Kconfig ## CONFIG_AMD_HSMP=m +CONFIG_AMD_3D_VCACHE=m CONFIG_AMD_WBRF=y ## @@ -5435,6 +5468,7 @@ CONFIG_PTP_1588_CLOCK_OCP=m ## CONFIG_PWM=y # CONFIG_PWM_DEBUG is not set +CONFIG_PWM_ADP5585=m CONFIG_PWM_ATMEL_HLCDC_PWM=m CONFIG_PWM_ATMEL_TCB=m CONFIG_PWM_CLK=m @@ -5731,6 +5765,7 @@ CONFIG_RTC_DRV_RV3028=m CONFIG_RTC_DRV_RV3032=m CONFIG_RTC_DRV_RV8803=m CONFIG_RTC_DRV_S5M=m +CONFIG_RTC_DRV_SD2405AL=m CONFIG_RTC_DRV_SD3078=m CONFIG_RTC_DRV_M41T93=m CONFIG_RTC_DRV_M41T94=m @@ -5966,11 +6001,6 @@ CONFIG_GREYBUS_SPI=m CONFIG_GREYBUS_UART=m CONFIG_GREYBUS_USB=m -## -## file: drivers/staging/ks7010/Kconfig -## -CONFIG_KS7010=m - ## ## file: drivers/staging/media/Kconfig ## @@ -6077,6 +6107,7 @@ CONFIG_REMOTE_TARGET=m ## CONFIG_THERMAL_STATISTICS=y CONFIG_THERMAL_DEBUGFS=y +CONFIG_THERMAL_CORE_TESTING=m CONFIG_THERMAL_OF=y ## choice: Default Thermal governor # CONFIG_THERMAL_DEFAULT_GOV_BANG_BANG is not set @@ -6458,6 +6489,7 @@ CONFIG_USB_HSIC_USB4604=m CONFIG_USB_LINK_LAYER_TEST=m CONFIG_USB_CHAOSKEY=m CONFIG_USB_ONBOARD_DEV=m +CONFIG_USB_ONBOARD_DEV_USB5744=y ## ## file: drivers/usb/misc/sisusbvga/Kconfig @@ -7156,6 +7188,7 @@ CONFIG_CIFS_DEBUG=y CONFIG_CIFS_DFS_UPCALL=y CONFIG_CIFS_SWN_UPCALL=y CONFIG_CIFS_FSCACHE=y +# CONFIG_CIFS_COMPRESSION is not set ## ## file: fs/sysv/Kconfig @@ -7236,15 +7269,6 @@ CONFIG_SCHED_CORE=y CONFIG_SWIOTLB_DYNAMIC=y # CONFIG_DMA_RESTRICTED_POOL is not set -## -## file: kernel/module/Kconfig -## -## choice: Module compression mode -# CONFIG_MODULE_COMPRESS_NONE is not set -CONFIG_MODULE_COMPRESS_XZ=y -## end choice -# CONFIG_MODULE_DECOMPRESS is not set - ## ## file: kernel/power/Kconfig ## @@ -7313,6 +7337,7 @@ CONFIG_TEST_DHRY=m # CONFIG_LKDTM is not set # CONFIG_TEST_MIN_HEAP is not set # CONFIG_TEST_DIV64 is not set +# CONFIG_TEST_MULDIV64 is not set # CONFIG_BACKTRACE_SELF_TEST is not set # CONFIG_TEST_REF_TRACKER is not set # CONFIG_RBTREE_TEST is not set @@ -7387,6 +7412,7 @@ CONFIG_ZBUD=y CONFIG_Z3FOLD_DEPRECATED=m # CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE is not set CONFIG_HWPOISON_INJECT=m +CONFIG_NUMA_EMU=y ## ## file: mm/Kconfig.debug @@ -7439,6 +7465,7 @@ CONFIG_6LOWPAN_GHC_EXT_HDR_ROUTE=m CONFIG_NET_9P=m CONFIG_NET_9P_FD=m CONFIG_NET_9P_VIRTIO=m +CONFIG_NET_9P_USBG=y # CONFIG_NET_9P_DEBUG is not set ## @@ -7487,11 +7514,6 @@ CONFIG_BT_BNEP=m CONFIG_BT_BNEP_MC_FILTER=y CONFIG_BT_BNEP_PROTO_FILTER=y -## -## file: net/bluetooth/cmtp/Kconfig -## -CONFIG_BT_CMTP=m - ## ## file: net/bluetooth/hidp/Kconfig ## @@ -7784,6 +7806,12 @@ CONFIG_INTEGRITY_PLATFORM_KEYRING=y CONFIG_INTEGRITY_MACHINE_KEYRING=y # CONFIG_INTEGRITY_CA_MACHINE_KEYRING is not set +## +## file: security/ipe/Kconfig +## +CONFIG_IPE_POLICY_SIG_SECONDARY_KEYRING=y +CONFIG_IPE_POLICY_SIG_PLATFORM_KEYRING=y + ## ## file: security/keys/Kconfig ## @@ -7819,10 +7847,10 @@ CONFIG_SND_MAX_CARDS=32 # CONFIG_SND_SUPPORT_OLD_API is not set CONFIG_SND_PROC_FS=y CONFIG_SND_VERBOSE_PROCFS=y -# CONFIG_SND_VERBOSE_PRINTK is not set CONFIG_SND_CTL_FAST_LOOKUP=y # CONFIG_SND_DEBUG is not set CONFIG_SND_CTL_INPUT_VALIDATION=y +CONFIG_SND_UTIMER=y ## ## file: sound/core/seq/Kconfig @@ -8020,6 +8048,7 @@ CONFIG_SND_AMD_ASOC_ACP63=m CONFIG_SND_AMD_ASOC_ACP70=m CONFIG_SND_SOC_AMD_LEGACY_MACH=m CONFIG_SND_SOC_AMD_SOF_MACH=m +CONFIG_SND_SOC_AMD_SOF_SDW_MACH=m ## ## file: sound/soc/atmel/Kconfig @@ -8245,6 +8274,7 @@ CONFIG_SND_SOC_WSA884X=m CONFIG_SND_SOC_ZL38060=m CONFIG_SND_SOC_MAX9759=m CONFIG_SND_SOC_MT6351=m +CONFIG_SND_SOC_MT6357=m CONFIG_SND_SOC_MT6358=m CONFIG_SND_SOC_MT6660=m CONFIG_SND_SOC_NAU8315=m @@ -8318,16 +8348,6 @@ CONFIG_SND_SOC_INTEL_SST_TOPLEVEL=y CONFIG_SND_SOC_INTEL_CATPT=m CONFIG_SND_SST_ATOM_HIFI2_PLATFORM_PCI=m CONFIG_SND_SST_ATOM_HIFI2_PLATFORM_ACPI=m -CONFIG_SND_SOC_INTEL_SKYLAKE=m -CONFIG_SND_SOC_INTEL_SKL=m -CONFIG_SND_SOC_INTEL_APL=m -CONFIG_SND_SOC_INTEL_KBL=m -CONFIG_SND_SOC_INTEL_GLK=m -CONFIG_SND_SOC_INTEL_CNL=m -CONFIG_SND_SOC_INTEL_CFL=m -CONFIG_SND_SOC_INTEL_CML_H=m -CONFIG_SND_SOC_INTEL_CML_LP=m -CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC=y CONFIG_SND_SOC_INTEL_AVS=m ## @@ -8371,17 +8391,7 @@ CONFIG_SND_SOC_INTEL_BYT_CHT_CX2072X_MACH=m CONFIG_SND_SOC_INTEL_BYT_CHT_DA7213_MACH=m CONFIG_SND_SOC_INTEL_BYT_CHT_ES8316_MACH=m CONFIG_SND_SOC_INTEL_BYT_CHT_NOCODEC_MACH=m -CONFIG_SND_SOC_INTEL_SKL_RT286_MACH=m -CONFIG_SND_SOC_INTEL_SKL_NAU88L25_SSM4567_MACH=m -CONFIG_SND_SOC_INTEL_SKL_NAU88L25_MAX98357A_MACH=m -CONFIG_SND_SOC_INTEL_BXT_DA7219_MAX98357A_MACH=m -CONFIG_SND_SOC_INTEL_BXT_RT298_MACH=m CONFIG_SND_SOC_INTEL_SOF_WM8804_MACH=m -CONFIG_SND_SOC_INTEL_KBL_RT5663_MAX98927_MACH=m -CONFIG_SND_SOC_INTEL_KBL_RT5663_RT5514_MAX98927_MACH=m -CONFIG_SND_SOC_INTEL_KBL_DA7219_MAX98357A_MACH=m -CONFIG_SND_SOC_INTEL_KBL_DA7219_MAX98927_MACH=m -CONFIG_SND_SOC_INTEL_KBL_RT5660_MACH=m CONFIG_SND_SOC_INTEL_GLK_DA7219_MAX98357A_MACH=m CONFIG_SND_SOC_INTEL_GLK_RT5682_MAX98357A_MACH=m CONFIG_SND_SOC_INTEL_SKL_HDA_DSP_GENERIC_MACH=m @@ -8420,6 +8430,7 @@ CONFIG_SND_SOC_SOF_AMD_VANGOGH=m CONFIG_SND_SOC_SOF_AMD_REMBRANDT=m CONFIG_SND_SOC_SOF_AMD_SOUNDWIRE=m CONFIG_SND_SOC_SOF_AMD_ACP63=m +CONFIG_SND_SOC_SOF_AMD_ACP70=m ## ## file: sound/soc/sof/intel/Kconfig @@ -8442,6 +8453,7 @@ CONFIG_SND_SOC_SOF_ELKHARTLAKE=m CONFIG_SND_SOC_SOF_ALDERLAKE=m CONFIG_SND_SOC_SOF_METEORLAKE=m CONFIG_SND_SOC_SOF_LUNARLAKE=m +CONFIG_SND_SOC_SOF_PANTHERLAKE=m CONFIG_SND_SOC_SOF_HDA_LINK=y CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC=y CONFIG_SND_SOC_SOF_INTEL_SOUNDWIRE=m @@ -8506,6 +8518,7 @@ CONFIG_AC97_BUS=m CONFIG_ACPI_ADXL=y CONFIG_ACPI_NHLT=y CONFIG_ACPI_PLATFORM_PROFILE=m +CONFIG_AMD_ATL_PRM=y CONFIG_ASN1_ENCODER=m CONFIG_ASYNC_MEMCPY=m CONFIG_ASYNC_PQ=m @@ -8552,7 +8565,6 @@ CONFIG_BT_MTK=m CONFIG_BT_QCA=m CONFIG_BT_RTL=m CONFIG_CAN_RX_OFFLOAD=y -CONFIG_CAPI_TRACE=y CONFIG_CARL9170_WPC=y CONFIG_CB710_DEBUG_ASSUMPTIONS=y CONFIG_CEC_CORE=m @@ -8607,6 +8619,7 @@ CONFIG_DRM_VRAM_HELPER=m CONFIG_DTC=y CONFIG_FB_BACKLIGHT=m CONFIG_FB_DMAMEM_HELPERS=y +CONFIG_FB_DMAMEM_HELPERS_DEFERRED=y CONFIG_FUN_CORE=m CONFIG_FW_ATTR_CLASS=m CONFIG_FW_CS_DSP=m @@ -8636,7 +8649,6 @@ CONFIG_HWMON_VID=m CONFIG_HZ=100 CONFIG_I2C_BOARDINFO=y CONFIG_I2C_CCGX_UCSI=m -CONFIG_I2C_DESIGNWARE_CORE=y CONFIG_I2C_HID_CORE=m CONFIG_I2C_I801_MUX=y CONFIG_IGC_LEDS=y @@ -8660,7 +8672,6 @@ CONFIG_IRQCHIP=y CONFIG_IRQ_SIM=y CONFIG_ISA_BUS_API=y CONFIG_ISDN_CAPI=y -CONFIG_ISDN_CAPI_MIDDLEWARE=y CONFIG_IWLEGACY=m CONFIG_IWLWIFI_LEDS=y CONFIG_IWLWIFI_OPMODE_MODULAR=y @@ -8763,6 +8774,7 @@ CONFIG_OF_MDIO=m CONFIG_OF_NUMA=y CONFIG_OF_RESERVED_MEM=y CONFIG_OF_RESOLVE=y +CONFIG_OPEN_ALLIANCE_HELPERS=y CONFIG_P54_LEDS=y CONFIG_PAGE_IDLE_FLAG=y CONFIG_PARPORT_NOT_PC=y @@ -8861,6 +8873,7 @@ CONFIG_RTW88_USB=m CONFIG_RTW89_8851B=m CONFIG_RTW89_8852A=m CONFIG_RTW89_8852B=m +CONFIG_RTW89_8852BT=m CONFIG_RTW89_8852B_COMMON=m CONFIG_RTW89_8852C=m CONFIG_RTW89_8922A=m @@ -8925,6 +8938,7 @@ CONFIG_SND_SEQ_VIRMIDI=m CONFIG_SND_SIMPLE_CARD_UTILS=m CONFIG_SND_SOC_AC97_BUS=y CONFIG_SND_SOC_ACPI=m +CONFIG_SND_SOC_ACPI_AMD_MATCH=m CONFIG_SND_SOC_ACPI_INTEL_MATCH=m CONFIG_SND_SOC_ADAU1372=m CONFIG_SND_SOC_ADAU1761=m @@ -8957,20 +8971,14 @@ CONFIG_SND_SOC_ES83XX_DSM_COMMON=m CONFIG_SND_SOC_FSL_UTILS=m CONFIG_SND_SOC_GENERIC_DMAENGINE_PCM=y CONFIG_SND_SOC_HDAC_HDA=m -CONFIG_SND_SOC_HDAC_HDMI=m CONFIG_SND_SOC_HDMI_CODEC=m CONFIG_SND_SOC_I2C_AND_SPI=m -CONFIG_SND_SOC_INTEL_DA7219_MAX98357A_GENERIC=m CONFIG_SND_SOC_INTEL_HDA_DSP_COMMON=m -CONFIG_SND_SOC_INTEL_SKYLAKE_COMMON=m -CONFIG_SND_SOC_INTEL_SKYLAKE_FAMILY=m -CONFIG_SND_SOC_INTEL_SKYLAKE_SSP_CLK=m CONFIG_SND_SOC_INTEL_SOF_BOARD_HELPERS=m CONFIG_SND_SOC_INTEL_SOF_CIRRUS_COMMON=m CONFIG_SND_SOC_INTEL_SOF_MAXIM_COMMON=m CONFIG_SND_SOC_INTEL_SOF_NUVOTON_COMMON=m CONFIG_SND_SOC_INTEL_SOF_REALTEK_COMMON=m -CONFIG_SND_SOC_INTEL_SST=m CONFIG_SND_SOC_LPASS_MACRO_COMMON=m CONFIG_SND_SOC_MAX98373=m CONFIG_SND_SOC_NAU8825=m @@ -8991,7 +8999,6 @@ CONFIG_SND_SOC_RT274=m CONFIG_SND_SOC_RT286=m CONFIG_SND_SOC_RT298=m CONFIG_SND_SOC_RT5514=m -CONFIG_SND_SOC_RT5514_SPI=m CONFIG_SND_SOC_RT5645=m CONFIG_SND_SOC_RT5651=m CONFIG_SND_SOC_RT5660=m @@ -9005,6 +9012,7 @@ CONFIG_SND_SOC_RT5682_I2C=m CONFIG_SND_SOC_RT700=m CONFIG_SND_SOC_RT711=m CONFIG_SND_SOC_RT715=m +CONFIG_SND_SOC_SDW_UTILS=m CONFIG_SND_SOC_SIGMADSP=m CONFIG_SND_SOC_SIGMADSP_I2C=m CONFIG_SND_SOC_SIGMADSP_REGMAP=m @@ -9029,6 +9037,7 @@ CONFIG_SND_SOC_SOF_INTEL_HIFI_EP_IPC=m CONFIG_SND_SOC_SOF_INTEL_ICL=m CONFIG_SND_SOC_SOF_INTEL_LNL=m CONFIG_SND_SOC_SOF_INTEL_MTL=m +CONFIG_SND_SOC_SOF_INTEL_PTL=m CONFIG_SND_SOC_SOF_INTEL_SKL=m CONFIG_SND_SOC_SOF_INTEL_SOUNDWIRE_LINK_BASELINE=m CONFIG_SND_SOC_SOF_INTEL_TGL=m diff --git a/debian/config/amd64/config.vm b/debian/config/amd64/config.vm index 123958b..16a2510 100644 --- a/debian/config/amd64/config.vm +++ b/debian/config/amd64/config.vm @@ -32,7 +32,6 @@ CONFIG_NR_CPUS=16 # CONFIG_X86_MCE_INJECT is not set # CONFIG_X86_5LEVEL is not set CONFIG_AMD_NUMA=y -CONFIG_NUMA_EMU=y CONFIG_NODES_SHIFT=6 # CONFIG_X86_PMEM_LEGACY is not set # CONFIG_X86_CHECK_BIOS_CORRUPTION is not set @@ -409,6 +408,11 @@ CONFIG_PM_DEVFREQ_EVENT=y # CONFIG_XILINX_DMA is not set # CONFIG_XILINX_XDMA is not set +## +## file: drivers/dma/amd/Kconfig +## +# CONFIG_AMD_QDMA is not set + ## ## file: drivers/dma/dw/Kconfig ## @@ -480,6 +484,7 @@ CONFIG_EXTCON=y # CONFIG_EXTCON_FSA9480 is not set CONFIG_EXTCON_GPIO=m # CONFIG_EXTCON_INTEL_INT3496 is not set +# CONFIG_EXTCON_LC824206XA is not set # CONFIG_EXTCON_MAX3355 is not set # CONFIG_EXTCON_PTN5150 is not set # CONFIG_EXTCON_RT8973A is not set @@ -568,6 +573,7 @@ CONFIG_GPIO_SIM=m ## CONFIG_DRM=y # CONFIG_DRM_DEBUG_MM is not set +# CONFIG_DRM_PANIC is not set # CONFIG_DRM_DEBUG_DP_MST_TOPOLOGY_REFS is not set # CONFIG_DRM_DEBUG_MODESET_LOCK is not set CONFIG_DRM_FBDEV_EMULATION=y @@ -1104,7 +1110,6 @@ CONFIG_SENSORS_PMBUS=m ## CONFIG_I2C=y CONFIG_ACPI_I2C_OPREGION=y -CONFIG_I2C_COMPAT=y CONFIG_I2C_CHARDEV=m CONFIG_I2C_MUX=m # CONFIG_I2C_HELPER_AUTO is not set @@ -1147,8 +1152,7 @@ CONFIG_I2C_PIIX4=m CONFIG_I2C_ZHAOXIN=m CONFIG_I2C_SCMI=m # CONFIG_I2C_CBUS_GPIO is not set -# CONFIG_I2C_DESIGNWARE_PLATFORM is not set -# CONFIG_I2C_DESIGNWARE_PCI is not set +# CONFIG_I2C_DESIGNWARE_CORE is not set # CONFIG_I2C_EMEV2 is not set CONFIG_I2C_GPIO=m # CONFIG_I2C_GPIO_FAULT_INJECTOR is not set @@ -1332,7 +1336,6 @@ CONFIG_KEYBOARD_GPIO_POLLED=m # CONFIG_KEYBOARD_MATRIX is not set # CONFIG_KEYBOARD_LM8333 is not set # CONFIG_KEYBOARD_MAX7359 is not set -# CONFIG_KEYBOARD_MCS is not set # CONFIG_KEYBOARD_MPR121 is not set # CONFIG_KEYBOARD_NEWTON is not set # CONFIG_KEYBOARD_OPENCORES is not set @@ -1458,7 +1461,6 @@ CONFIG_INPUT_TOUCHSCREEN=y # CONFIG_TOUCHSCREEN_CY8CTMA140 is not set # CONFIG_TOUCHSCREEN_CY8CTMG110 is not set # CONFIG_TOUCHSCREEN_CYTTSP_CORE is not set -# CONFIG_TOUCHSCREEN_CYTTSP4_CORE is not set # CONFIG_TOUCHSCREEN_CYTTSP5 is not set # CONFIG_TOUCHSCREEN_DYNAPRO is not set # CONFIG_TOUCHSCREEN_HAMPSHIRE is not set @@ -1481,7 +1483,6 @@ CONFIG_INPUT_TOUCHSCREEN=y # CONFIG_TOUCHSCREEN_WACOM_W8001 is not set # CONFIG_TOUCHSCREEN_WACOM_I2C is not set # CONFIG_TOUCHSCREEN_MAX11801 is not set -# CONFIG_TOUCHSCREEN_MCS5000 is not set # CONFIG_TOUCHSCREEN_MMS114 is not set # CONFIG_TOUCHSCREEN_MELFAS_MIP4 is not set # CONFIG_TOUCHSCREEN_MSG2638 is not set @@ -2489,6 +2490,7 @@ CONFIG_MSI_WMI_PLATFORM=m # CONFIG_TOSHIBA_WMI is not set # CONFIG_ACPI_CMPC is not set # CONFIG_TOPSTAR_LAPTOP is not set +CONFIG_SERIAL_MULTI_INSTANTIATE=m # CONFIG_MLX_PLATFORM is not set # CONFIG_INSPUR_PLATFORM_PROFILE is not set # CONFIG_LENOVO_WMI_CAMERA is not set @@ -2501,6 +2503,7 @@ CONFIG_MSI_WMI_PLATFORM=m ## file: drivers/platform/x86/amd/Kconfig ## # CONFIG_AMD_HSMP is not set +# CONFIG_AMD_3D_VCACHE is not set # CONFIG_AMD_WBRF is not set ## @@ -2706,6 +2709,7 @@ CONFIG_RTC_DRV_MAX31335=m # CONFIG_RTC_DRV_RV3028 is not set # CONFIG_RTC_DRV_RV3032 is not set # CONFIG_RTC_DRV_RV8803 is not set +# CONFIG_RTC_DRV_SD2405AL is not set # CONFIG_RTC_DRV_SD3078 is not set # CONFIG_RTC_DRV_DS3232 is not set # CONFIG_RTC_DRV_PCF2127 is not set @@ -2859,6 +2863,7 @@ CONFIG_REMOTE_TARGET=m ## # CONFIG_THERMAL_STATISTICS is not set CONFIG_THERMAL_DEBUGFS=y +# CONFIG_THERMAL_CORE_TESTING is not set # CONFIG_THERMAL_HWMON is not set # CONFIG_THERMAL_GOV_BANG_BANG is not set CONFIG_DEVFREQ_THERMAL=y @@ -3177,7 +3182,6 @@ CONFIG_SNET_VDPA=m CONFIG_FB_CIRRUS=m CONFIG_FB_UVESA=m # CONFIG_FB_VIA is not set -# CONFIG_FB_VOODOO1 is not set # CONFIG_FB_SMSCUFX is not set # CONFIG_FB_UDL is not set CONFIG_FB_GOLDFISH=m @@ -3534,6 +3538,7 @@ CONFIG_CIFS_DFS_UPCALL=y CONFIG_CIFS_SWN_UPCALL=y # CONFIG_CIFS_SMB_DIRECT is not set CONFIG_CIFS_FSCACHE=y +# CONFIG_CIFS_COMPRESSION is not set ## ## file: fs/sysv/Kconfig @@ -3596,15 +3601,6 @@ CONFIG_PREEMPT_VOLUNTARY=y ## # CONFIG_SWIOTLB_DYNAMIC is not set -## -## file: kernel/module/Kconfig -## -## choice: Module compression mode -# CONFIG_MODULE_COMPRESS_NONE is not set -CONFIG_MODULE_COMPRESS_XZ=y -## end choice -# CONFIG_MODULE_DECOMPRESS is not set - ## ## file: kernel/power/Kconfig ## @@ -3700,6 +3696,7 @@ CONFIG_ZBUD=y CONFIG_Z3FOLD_DEPRECATED=m CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE=y # CONFIG_HWPOISON_INJECT is not set +CONFIG_NUMA_EMU=y ## ## file: mm/Kconfig.debug @@ -4008,6 +4005,11 @@ CONFIG_HYPERV_VSOCKETS=m # CONFIG_LIST_HARDENED is not set # CONFIG_BUG_ON_DATA_CORRUPTION is not set +## +## file: security/ipe/Kconfig +## +CONFIG_IPE_PROP_DM_VERITY_SIGNATURE=y + ## ## file: security/keys/Kconfig ## diff --git a/debian/config/config b/debian/config/config index 37ab0f6..c69ed46 100644 --- a/debian/config/config +++ b/debian/config/config @@ -92,9 +92,17 @@ CONFIG_MITIGATION_PAGE_TABLE_ISOLATION=y # CONFIG_MITIGATION_IBPB_ENTRY is not set # CONFIG_MITIGATION_IBRS_ENTRY is not set # CONFIG_MITIGATION_SLS is not set -# CONFIG_MITIGATION_GDS_FORCE is not set +# CONFIG_MITIGATION_GDS is not set # CONFIG_MITIGATION_RFDS is not set # CONFIG_MITIGATION_SPECTRE_BHI is not set +# CONFIG_MITIGATION_MDS is not set +# CONFIG_MITIGATION_TAA is not set +# CONFIG_MITIGATION_MMIO_STALE_DATA is not set +# CONFIG_MITIGATION_L1TF is not set +# CONFIG_MITIGATION_SPECTRE_V1 is not set +# CONFIG_MITIGATION_SPECTRE_V2 is not set +# CONFIG_MITIGATION_SRBDS is not set +# CONFIG_MITIGATION_SSB is not set CONFIG_PCI_MMCONFIG=y # CONFIG_PCI_CNB20LE_QUIRK is not set # CONFIG_ISA_BUS is not set @@ -531,12 +539,19 @@ CONFIG_BLK_DEV_NULL_BLK=m ## file: drivers/block/zram/Kconfig ## CONFIG_ZRAM=m +CONFIG_ZRAM_BACKEND_LZ4=y +CONFIG_ZRAM_BACKEND_LZ4HC=y +CONFIG_ZRAM_BACKEND_ZSTD=y +CONFIG_ZRAM_BACKEND_DEFLATE=y +CONFIG_ZRAM_BACKEND_842=y +CONFIG_ZRAM_BACKEND_LZO=y ## choice: Default zram compressor # CONFIG_ZRAM_DEF_COMP_LZORLE is not set -CONFIG_ZRAM_DEF_COMP_ZSTD=y -# CONFIG_ZRAM_DEF_COMP_LZ4 is not set # CONFIG_ZRAM_DEF_COMP_LZO is not set +# CONFIG_ZRAM_DEF_COMP_LZ4 is not set # CONFIG_ZRAM_DEF_COMP_LZ4HC is not set +CONFIG_ZRAM_DEF_COMP_ZSTD=y +# CONFIG_ZRAM_DEF_COMP_DEFLATE is not set # CONFIG_ZRAM_DEF_COMP_842 is not set ## end choice CONFIG_ZRAM_WRITEBACK=y @@ -1566,6 +1581,7 @@ CONFIG_FB_EFI=y # CONFIG_FB_NEOMAGIC is not set # CONFIG_FB_KYRO is not set # CONFIG_FB_3DFX is not set +# CONFIG_FB_VOODOO1 is not set # CONFIG_FB_VT8623 is not set # CONFIG_FB_TRIDENT is not set # CONFIG_FB_ARK is not set @@ -1667,6 +1683,7 @@ CONFIG_HUGETLBFS=y # CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP_DEFAULT_ON is not set CONFIG_MISC_FILESYSTEMS=y CONFIG_NETWORK_FILESYSTEMS=y +# CONFIG_NFS_LOCALIO is not set ## ## file: fs/Kconfig.binfmt @@ -1731,6 +1748,7 @@ CONFIG_EROFS_FS=m CONFIG_EROFS_FS_XATTR=y CONFIG_EROFS_FS_POSIX_ACL=y CONFIG_EROFS_FS_SECURITY=y +CONFIG_EROFS_FS_BACKED_BY_FILE=y CONFIG_EROFS_FS_ZIP=y CONFIG_EROFS_FS_ZIP_LZMA=y CONFIG_EROFS_FS_ZIP_DEFLATE=y @@ -2025,6 +2043,7 @@ CONFIG_CGROUP_RDMA=y CONFIG_CGROUP_FREEZER=y CONFIG_CGROUP_HUGETLB=y CONFIG_CPUSETS=y +# CONFIG_CPUSETS_V1 is not set CONFIG_PROC_PID_CPUSET=y CONFIG_CGROUP_DEVICE=y CONFIG_CGROUP_CPUACCT=y @@ -2101,8 +2120,10 @@ CONFIG_PROFILING=y ## ## choice: Preemption Model # CONFIG_PREEMPT is not set +# CONFIG_PREEMPT_RT is not set ## end choice # CONFIG_PREEMPT_DYNAMIC is not set +CONFIG_SCHED_CLASS_EXT=y ## ## file: kernel/bpf/Kconfig @@ -2149,7 +2170,7 @@ CONFIG_MODVERSIONS=y CONFIG_MODULE_SIG=y # CONFIG_MODULE_SIG_FORCE is not set CONFIG_MODULE_SIG_ALL=y -## choice: Which hash algorithm should modules be signed with? +## choice: Hash algorithm to sign modules # CONFIG_MODULE_SIG_SHA1 is not set CONFIG_MODULE_SIG_SHA256=y # CONFIG_MODULE_SIG_SHA384 is not set @@ -2158,10 +2179,14 @@ CONFIG_MODULE_SIG_SHA256=y # CONFIG_MODULE_SIG_SHA3_384 is not set # CONFIG_MODULE_SIG_SHA3_512 is not set ## end choice -## choice: Module compression mode +CONFIG_MODULE_COMPRESS=y +## choice: Module compression type # CONFIG_MODULE_COMPRESS_GZIP is not set +CONFIG_MODULE_COMPRESS_XZ=y # CONFIG_MODULE_COMPRESS_ZSTD is not set ## end choice +CONFIG_MODULE_COMPRESS_ALL=y +CONFIG_MODULE_DECOMPRESS=y # CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS is not set CONFIG_MODPROBE_PATH="/sbin/modprobe" # CONFIG_TRIM_UNUSED_KSYMS is not set @@ -2325,6 +2350,7 @@ CONFIG_DEBUG_SECTION_MISMATCH=y CONFIG_SECTION_MISMATCH_WARN_ONLY=y # CONFIG_DEBUG_FORCE_FUNCTION_ALIGN_64B is not set CONFIG_VMLINUX_MAP=y +CONFIG_BUILTIN_MODULE_RANGES=y # CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set CONFIG_MAGIC_SYSRQ=y CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0x1 @@ -2457,7 +2483,9 @@ CONFIG_XZ_DEC_X86=y # CONFIG_XZ_DEC_POWERPC is not set # CONFIG_XZ_DEC_ARM is not set # CONFIG_XZ_DEC_ARMTHUMB is not set +# CONFIG_XZ_DEC_ARM64 is not set # CONFIG_XZ_DEC_SPARC is not set +# CONFIG_XZ_DEC_RISCV is not set CONFIG_XZ_DEC_MICROLZMA=y # CONFIG_XZ_DEC_TEST is not set @@ -3152,7 +3180,7 @@ CONFIG_FORTIFY_SOURCE=y # CONFIG_DEFAULT_SECURITY_SELINUX is not set CONFIG_DEFAULT_SECURITY_DAC=y ## end choice -CONFIG_LSM="landlock,lockdown,yama,loadpin,safesetid,integrity,apparmor,selinux,smack,tomoyo,bpf" +CONFIG_LSM="landlock,lockdown,yama,loadpin,safesetid,integrity,apparmor,selinux,smack,tomoyo,bpf,ipe" ## ## file: security/Kconfig.hardening @@ -3195,6 +3223,15 @@ CONFIG_EVM_ATTR_FSUUID=y ## # CONFIG_IMA is not set +## +## file: security/ipe/Kconfig +## +CONFIG_SECURITY_IPE=y +CONFIG_IPE_BOOT_POLICY="" +CONFIG_IPE_PROP_DM_VERITY=y +CONFIG_IPE_PROP_FS_VERITY=y +CONFIG_IPE_PROP_FS_VERITY_BUILTIN_SIG=y + ## ## file: security/keys/Kconfig ## @@ -3310,6 +3347,7 @@ CONFIG_ARCH_HAS_DEBUG_VIRTUAL=y CONFIG_ARCH_HAS_DEBUG_VM_PGTABLE=y CONFIG_ARCH_HAS_DEBUG_WX=y CONFIG_ARCH_HAS_DEVMEM_IS_ALLOWED=y +CONFIG_ARCH_HAS_DMA_OPS=y CONFIG_ARCH_HAS_ELFCORE_COMPAT=y CONFIG_ARCH_HAS_ELF_RANDOMIZE=y CONFIG_ARCH_HAS_FAST_MULTIPLIER=y @@ -3339,6 +3377,7 @@ CONFIG_ARCH_HAS_SYSCALL_WRAPPER=y CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE=y CONFIG_ARCH_HAS_UBSAN=y CONFIG_ARCH_HAS_ZONE_DMA_SET=y +CONFIG_ARCH_HAVE_EXTRA_ELF_NOTES=y CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y CONFIG_ARCH_HIBERNATION_HEADER=y CONFIG_ARCH_HIBERNATION_POSSIBLE=y @@ -3351,6 +3390,7 @@ CONFIG_ARCH_MMAP_RND_BITS_MAX=32 CONFIG_ARCH_MMAP_RND_BITS_MIN=28 CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=16 CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8 +CONFIG_ARCH_PKEY_BITS=4 CONFIG_ARCH_PROC_KCORE_TEXT=y CONFIG_ARCH_SPARSEMEM_DEFAULT=y CONFIG_ARCH_SPARSEMEM_ENABLE=y @@ -3361,6 +3401,7 @@ CONFIG_ARCH_SUPPORTS_CFI_CLANG=y CONFIG_ARCH_SUPPORTS_CRASH_DUMP=y CONFIG_ARCH_SUPPORTS_CRASH_HOTPLUG=y CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y +CONFIG_ARCH_SUPPORTS_HUGE_PFNMAP=y CONFIG_ARCH_SUPPORTS_INT128=y CONFIG_ARCH_SUPPORTS_KEXEC=y CONFIG_ARCH_SUPPORTS_KEXEC_BZIMAGE_VERIFY_SIG=y @@ -3376,10 +3417,13 @@ CONFIG_ARCH_SUPPORTS_MEMORY_FAILURE=y CONFIG_ARCH_SUPPORTS_NUMA_BALANCING=y CONFIG_ARCH_SUPPORTS_PAGE_TABLE_CHECK=y CONFIG_ARCH_SUPPORTS_PER_VMA_LOCK=y +CONFIG_ARCH_SUPPORTS_PMD_PFNMAP=y +CONFIG_ARCH_SUPPORTS_PUD_PFNMAP=y +CONFIG_ARCH_SUPPORTS_RT=y CONFIG_ARCH_SUPPORTS_UPROBES=y CONFIG_ARCH_SUSPEND_POSSIBLE=y CONFIG_ARCH_USES_HIGH_VMA_FLAGS=y -CONFIG_ARCH_USES_PG_UNCACHED=y +CONFIG_ARCH_USES_PG_ARCH_2=y CONFIG_ARCH_USE_BUILTIN_BSWAP=y CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y CONFIG_ARCH_USE_MEMREMAP_PROT=y @@ -3525,7 +3569,7 @@ CONFIG_DMA_ACPI=y CONFIG_DMA_COHERENT_POOL=y CONFIG_DMA_ENGINE=y CONFIG_DMA_NEED_SYNC=y -CONFIG_DMA_OPS=y +CONFIG_DMA_OPS_HELPERS=y CONFIG_DMA_SHARED_BUFFER=y CONFIG_DMI_SCAN_MACHINE_NON_EFI_FALLBACK=y CONFIG_DM_BIO_PRISON=m @@ -3554,6 +3598,7 @@ CONFIG_EVENT_TRACING=y CONFIG_EXCLUSIVE_SYSTEM_RAM=y CONFIG_EXECMEM=y CONFIG_EXPORTFS=y +CONFIG_EXT_GROUP_SCHED=y CONFIG_FAT_FS=m CONFIG_FB_CFB_COPYAREA=y CONFIG_FB_CFB_FILLRECT=y @@ -3632,6 +3677,7 @@ CONFIG_GET_FREE_REGION=y CONFIG_GLOB=y CONFIG_GOOGLE_MEMCONSOLE=m CONFIG_GRACE_PERIOD=m +CONFIG_GROUP_SCHED_WEIGHT=y CONFIG_GRO_CELLS=y CONFIG_GUEST_PERF_EVENTS=y CONFIG_HARDIRQS_SW_RESEND=y @@ -3780,7 +3826,6 @@ CONFIG_HAVE_UID16=y CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y CONFIG_HAVE_USER_RETURN_NOTIFIER=y CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y -CONFIG_HAVE_ZSMALLOC=y CONFIG_HIBERNATE_CALLBACKS=y CONFIG_HIBERNATION_DEF_COMP="lzo" CONFIG_HMEM_REPORTING=y @@ -3795,6 +3840,7 @@ CONFIG_HOTPLUG_SPLIT_STARTUP=y CONFIG_HPET_EMULATE_RTC=y CONFIG_HUGETLB_PAGE=y CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP=y +CONFIG_HUGETLB_PMD_PAGE_TABLE_SHARING=y CONFIG_HVC_DRIVER=y CONFIG_IA32_FEAT_CTL=y CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000 @@ -3863,6 +3909,7 @@ CONFIG_KVM_GENERIC_PRIVATE_MEM=y CONFIG_KVM_MMIO=y CONFIG_KVM_PRIVATE_MEM=y CONFIG_KVM_VFIO=y +CONFIG_KVM_X86=m CONFIG_KVM_XFER_TO_GUEST_WORK=y CONFIG_LD_IS_BFD=y CONFIG_LD_ORPHAN_WARN=y @@ -3916,6 +3963,7 @@ CONFIG_NETFILTER_SKIP_EGRESS=y CONFIG_NETFILTER_SYNPROXY=m CONFIG_NETPOLL=y CONFIG_NET_DEVLINK=y +CONFIG_NET_DEVMEM=y CONFIG_NET_EGRESS=y CONFIG_NET_HANDSHAKE=y CONFIG_NET_INGRESS=y @@ -3963,6 +4011,7 @@ CONFIG_NR_CPUS_DEFAULT=64 CONFIG_NR_CPUS_RANGE_BEGIN=2 CONFIG_NR_CPUS_RANGE_END=512 CONFIG_NUMA_KEEP_MEMINFO=y +CONFIG_NUMA_MEMBLKS=y CONFIG_NVDIMM_KEYS=y CONFIG_NVME_CORE=m CONFIG_NVME_FABRICS=m @@ -4021,6 +4070,8 @@ CONFIG_RPMSG=m CONFIG_RTC_LIB=y CONFIG_RTC_MC146818_LIB=y CONFIG_RT_MUTEXES=y +CONFIG_RUSTC_LLVM_VERSION=0 +CONFIG_RUSTC_VERSION=0 CONFIG_RWSEM_SPIN_ON_OWNER=y CONFIG_SATA_HOST=y CONFIG_SBITMAP=y @@ -4050,7 +4101,8 @@ CONFIG_SOFTIRQ_ON_OWN_STACK=y CONFIG_SPARSEMEM=y CONFIG_SPARSEMEM_EXTREME=y CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y -CONFIG_SPLIT_PTLOCK_CPUS=4 +CONFIG_SPLIT_PMD_PTLOCKS=y +CONFIG_SPLIT_PTE_PTLOCKS=y CONFIG_SQUASHFS_DECOMP_MULTI=y CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU=y CONFIG_SQUASHFS_DECOMP_SINGLE=y diff --git a/debian/libcpupower1.symbols b/debian/libcpupower1.symbols index adbdbeb..26e5e82 100644 --- a/debian/libcpupower1.symbols +++ b/debian/libcpupower1.symbols @@ -36,6 +36,7 @@ libcpupower.so.1 libcpupower1 #MINVER# cpuidle_state_disable@Base 4.7~rc2-1~exp1 cpuidle_state_latency@Base 4.7~rc2-1~exp1 cpuidle_state_name@Base 4.7~rc2-1~exp1 + cpuidle_state_residency@Base 6.12~rc2-1~exp1 cpuidle_state_time@Base 4.7~rc2-1~exp1 cpuidle_state_usage@Base 4.7~rc2-1~exp1 cpupower_is_cpu_online@Base 4.7~rc2-1~exp1 diff --git a/debian/patches/bugfix/all/disable-some-marvell-phys.patch b/debian/patches/bugfix/all/disable-some-marvell-phys.patch index 80a1d58..57f27e7 100644 --- a/debian/patches/bugfix/all/disable-some-marvell-phys.patch +++ b/debian/patches/bugfix/all/disable-some-marvell-phys.patch @@ -42,7 +42,7 @@ correctness. static int m88e1540_get_fld(struct phy_device *phydev, u8 *msecs) { -@@ -3790,6 +3794,7 @@ static struct phy_driver marvell_drivers +@@ -3792,6 +3796,7 @@ static struct phy_driver marvell_drivers .led_hw_control_set = m88e1318_led_hw_control_set, .led_hw_control_get = m88e1318_led_hw_control_get, }, @@ -50,7 +50,7 @@ correctness. { .phy_id = MARVELL_PHY_ID_88E1145, .phy_id_mask = MARVELL_PHY_ID_MASK, -@@ -3813,6 +3818,8 @@ static struct phy_driver marvell_drivers +@@ -3815,6 +3820,8 @@ static struct phy_driver marvell_drivers .cable_test_start = m88e1111_vct_cable_test_start, .cable_test_get_status = m88e1111_vct_cable_test_get_status, }, @@ -59,7 +59,7 @@ correctness. { .phy_id = MARVELL_PHY_ID_88E1149R, .phy_id_mask = MARVELL_PHY_ID_MASK, -@@ -3831,6 +3838,8 @@ static struct phy_driver marvell_drivers +@@ -3833,6 +3840,8 @@ static struct phy_driver marvell_drivers .get_strings = marvell_get_strings, .get_stats = marvell_get_stats, }, @@ -68,7 +68,7 @@ correctness. { .phy_id = MARVELL_PHY_ID_88E1240, .phy_id_mask = MARVELL_PHY_ID_MASK, -@@ -3851,6 +3860,7 @@ static struct phy_driver marvell_drivers +@@ -3853,6 +3862,7 @@ static struct phy_driver marvell_drivers .get_tunable = m88e1011_get_tunable, .set_tunable = m88e1011_set_tunable, }, @@ -76,7 +76,7 @@ correctness. { .phy_id = MARVELL_PHY_ID_88E1116R, .phy_id_mask = MARVELL_PHY_ID_MASK, -@@ -4139,9 +4149,9 @@ static struct mdio_device_id __maybe_unu +@@ -4141,9 +4151,9 @@ static struct mdio_device_id __maybe_unu { MARVELL_PHY_ID_88E1111_FINISAR, MARVELL_PHY_ID_MASK }, { MARVELL_PHY_ID_88E1118, MARVELL_PHY_ID_MASK }, { MARVELL_PHY_ID_88E1121R, MARVELL_PHY_ID_MASK }, diff --git a/debian/patches/bugfix/all/fs-add-module_softdep-declarations-for-hard-coded-cr.patch b/debian/patches/bugfix/all/fs-add-module_softdep-declarations-for-hard-coded-cr.patch index ab53304..5efba01 100644 --- a/debian/patches/bugfix/all/fs-add-module_softdep-declarations-for-hard-coded-cr.patch +++ b/debian/patches/bugfix/all/fs-add-module_softdep-declarations-for-hard-coded-cr.patch @@ -39,7 +39,7 @@ Signed-off-by: Ben Hutchings module_exit(ext4_exit_fs) --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c -@@ -3194,6 +3194,7 @@ static void __exit journal_exit(void) +@@ -3181,6 +3181,7 @@ static void __exit journal_exit(void) MODULE_DESCRIPTION("Generic filesystem journal-writing module"); MODULE_LICENSE("GPL"); @@ -49,7 +49,7 @@ Signed-off-by: Ben Hutchings --- a/fs/nfsd/nfsctl.c +++ b/fs/nfsd/nfsctl.c -@@ -2352,5 +2352,8 @@ static void __exit exit_nfsd(void) +@@ -2384,5 +2384,8 @@ static void __exit exit_nfsd(void) MODULE_AUTHOR("Olaf Kirch "); MODULE_DESCRIPTION("In-kernel NFS server"); MODULE_LICENSE("GPL"); diff --git a/debian/patches/bugfix/all/kbuild-fix-recordmcount-dependency.patch b/debian/patches/bugfix/all/kbuild-fix-recordmcount-dependency.patch index 8f9c21f..c9f7169 100644 --- a/debian/patches/bugfix/all/kbuild-fix-recordmcount-dependency.patch +++ b/debian/patches/bugfix/all/kbuild-fix-recordmcount-dependency.patch @@ -9,7 +9,7 @@ sources. --- a/scripts/Makefile.build +++ b/scripts/Makefile.build -@@ -210,6 +210,11 @@ cmd_record_mcount = $(if $(findstring $( +@@ -195,6 +195,11 @@ cmd_record_mcount = $(if $(findstring $( $(sub_cmd_record_mcount)) endif # CONFIG_FTRACE_MCOUNT_USE_RECORDMCOUNT diff --git a/debian/patches/bugfix/all/libapi-define-_fortify_source-as-2-not-empty.patch b/debian/patches/bugfix/all/libapi-define-_fortify_source-as-2-not-empty.patch index add06fb..e50d716 100644 --- a/debian/patches/bugfix/all/libapi-define-_fortify_source-as-2-not-empty.patch +++ b/debian/patches/bugfix/all/libapi-define-_fortify_source-as-2-not-empty.patch @@ -7,7 +7,7 @@ Signed-off-by: Ben Hutchings --- --- a/tools/lib/api/Makefile +++ b/tools/lib/api/Makefile -@@ -39,7 +39,7 @@ endif +@@ -35,7 +35,7 @@ ifeq ($(DEBUG),0) endif ifeq ($(DEBUG),0) diff --git a/debian/patches/bugfix/all/perf-tools-pass-extra_cflags-through-to-libbpf-build-again.patch b/debian/patches/bugfix/all/perf-tools-pass-extra_cflags-through-to-libbpf-build-again.patch index 3153c71..97905b6 100644 --- a/debian/patches/bugfix/all/perf-tools-pass-extra_cflags-through-to-libbpf-build-again.patch +++ b/debian/patches/bugfix/all/perf-tools-pass-extra_cflags-through-to-libbpf-build-again.patch @@ -16,7 +16,7 @@ Signed-off-by: Ben Hutchings --- --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf -@@ -951,7 +951,7 @@ $(LIBAPI)-clean: +@@ -953,7 +953,7 @@ $(LIBAPI)-clean: $(LIBBPF): FORCE | $(LIBBPF_OUTPUT) $(Q)$(MAKE) -C $(LIBBPF_DIR) FEATURES_DUMP=$(FEATURE_DUMP_EXPORT) \ O= OUTPUT=$(LIBBPF_OUTPUT)/ DESTDIR=$(LIBBPF_DESTDIR) prefix= subdir= \ diff --git a/debian/patches/bugfix/all/radeon-amdgpu-firmware-is-required-for-drm-and-kms-on-r600-onward.patch b/debian/patches/bugfix/all/radeon-amdgpu-firmware-is-required-for-drm-and-kms-on-r600-onward.patch index 9f4d914..67d2e3b 100644 --- a/debian/patches/bugfix/all/radeon-amdgpu-firmware-is-required-for-drm-and-kms-on-r600-onward.patch +++ b/debian/patches/bugfix/all/radeon-amdgpu-firmware-is-required-for-drm-and-kms-on-r600-onward.patch @@ -73,7 +73,7 @@ of the patch static int radeon_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) { -@@ -295,6 +319,12 @@ static int radeon_pci_probe(struct pci_d +@@ -296,6 +320,12 @@ static int radeon_pci_probe(struct pci_d if (vga_switcheroo_client_probe_defer(pdev)) return -EPROBE_DEFER; diff --git a/debian/patches/bugfix/all/revert-tools-build-clean-cflags-and-ldflags-for-fixdep.patch b/debian/patches/bugfix/all/revert-tools-build-clean-cflags-and-ldflags-for-fixdep.patch index c9c6c5d..a004da8 100644 --- a/debian/patches/bugfix/all/revert-tools-build-clean-cflags-and-ldflags-for-fixdep.patch +++ b/debian/patches/bugfix/all/revert-tools-build-clean-cflags-and-ldflags-for-fixdep.patch @@ -10,12 +10,12 @@ Signed-off-by: Ben Hutchings --- --- a/tools/build/Makefile.include +++ b/tools/build/Makefile.include -@@ -2,7 +2,7 @@ - build := -f $(srctree)/tools/build/Makefile.build dir=. obj +@@ -12,7 +12,7 @@ else + endif fixdep: -- $(Q)$(MAKE) -C $(srctree)/tools/build CFLAGS= LDFLAGS= $(OUTPUT)fixdep -+ $(Q)$(MAKE) -C $(srctree)/tools/build $(OUTPUT)fixdep +- $(SILENT_MAKE) -C $(srctree)/tools/build CFLAGS= LDFLAGS= $(OUTPUT)fixdep ++ $(SILENT_MAKE) -C $(srctree)/tools/build $(OUTPUT)fixdep fixdep-clean: $(Q)$(MAKE) -C $(srctree)/tools/build clean diff --git a/debian/patches/bugfix/all/tools-perf-fix-missing-ldflags-for-some-programs.patch b/debian/patches/bugfix/all/tools-perf-fix-missing-ldflags-for-some-programs.patch index a39f5db..245cdc2 100644 --- a/debian/patches/bugfix/all/tools-perf-fix-missing-ldflags-for-some-programs.patch +++ b/debian/patches/bugfix/all/tools-perf-fix-missing-ldflags-for-some-programs.patch @@ -6,7 +6,7 @@ Signed-off-by: Ben Hutchings --- --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf -@@ -925,7 +925,7 @@ $(OUTPUT)dlfilters/%.o: dlfilters/%.c in +@@ -927,7 +927,7 @@ $(OUTPUT)dlfilters/%.o: dlfilters/%.c in .SECONDARY: $(DLFILTERS:.so=.o) $(OUTPUT)dlfilters/%.so: $(OUTPUT)dlfilters/%.o diff --git a/debian/patches/bugfix/all/tools_lib_symbol_use_d_fortify_source_2_for_non_debug_builds.patch b/debian/patches/bugfix/all/tools_lib_symbol_use_d_fortify_source_2_for_non_debug_builds.patch index 94a5584..c3e3817 100644 --- a/debian/patches/bugfix/all/tools_lib_symbol_use_d_fortify_source_2_for_non_debug_builds.patch +++ b/debian/patches/bugfix/all/tools_lib_symbol_use_d_fortify_source_2_for_non_debug_builds.patch @@ -16,7 +16,7 @@ Acked-by: Ian Rogers --- a/tools/lib/symbol/Makefile +++ b/tools/lib/symbol/Makefile -@@ -39,7 +39,7 @@ endif +@@ -35,7 +35,7 @@ ifeq ($(DEBUG),0) endif ifeq ($(DEBUG),0) diff --git a/debian/patches/bugfix/x86/revert-perf-build-fix-libunwind-feature-detection-on.patch b/debian/patches/bugfix/x86/revert-perf-build-fix-libunwind-feature-detection-on.patch index 414df10..2e75004 100644 --- a/debian/patches/bugfix/x86/revert-perf-build-fix-libunwind-feature-detection-on.patch +++ b/debian/patches/bugfix/x86/revert-perf-build-fix-libunwind-feature-detection-on.patch @@ -11,7 +11,7 @@ It broke feature detection that was working just fine for us. --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config -@@ -61,7 +61,7 @@ ifeq ($(SRCARCH),x86) +@@ -56,7 +56,7 @@ ifeq ($(SRCARCH),x86) LIBUNWIND_LIBS = -lunwind-x86_64 -lunwind -llzma $(call detected,CONFIG_X86_64) else diff --git a/debian/patches/debian/add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by-default.patch b/debian/patches/debian/add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by-default.patch index 1d70505..3b75384 100644 --- a/debian/patches/debian/add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by-default.patch +++ b/debian/patches/debian/add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by-default.patch @@ -21,7 +21,7 @@ Signed-off-by: Serge Hallyn --- a/kernel/fork.c +++ b/kernel/fork.c -@@ -119,6 +119,12 @@ +@@ -120,6 +120,12 @@ #include @@ -34,7 +34,7 @@ Signed-off-by: Serge Hallyn /* * Minimum number of threads to boot the kernel */ -@@ -2156,6 +2162,10 @@ __latent_entropy struct task_struct *cop +@@ -2158,6 +2164,10 @@ __latent_entropy struct task_struct *cop if ((clone_flags & (CLONE_NEWUSER|CLONE_FS)) == (CLONE_NEWUSER|CLONE_FS)) return ERR_PTR(-EINVAL); @@ -45,7 +45,7 @@ Signed-off-by: Serge Hallyn /* * Thread groups must share signals as well, and detached threads * can only be started up within the thread group. -@@ -3305,6 +3315,12 @@ int ksys_unshare(unsigned long unshare_f +@@ -3311,6 +3321,12 @@ int ksys_unshare(unsigned long unshare_f if (unshare_flags & CLONE_NEWNS) unshare_flags |= CLONE_FS; diff --git a/debian/patches/debian/export-symbols-needed-by-android-drivers.patch b/debian/patches/debian/export-symbols-needed-by-android-drivers.patch index 002470f..255d526 100644 --- a/debian/patches/debian/export-symbols-needed-by-android-drivers.patch +++ b/debian/patches/debian/export-symbols-needed-by-android-drivers.patch @@ -82,7 +82,7 @@ Export the currently un-exported symbols it depends on. * task_work_cancel_match - cancel a pending work added by task_work_add() --- a/mm/memory.c +++ b/mm/memory.c -@@ -1934,6 +1934,7 @@ void zap_page_range_single(struct vm_are +@@ -1937,6 +1937,7 @@ void zap_page_range_single(struct vm_are tlb_finish_mmu(&tlb); hugetlb_zap_end(vma, details); } @@ -92,7 +92,7 @@ Export the currently un-exported symbols it depends on. * zap_vma_ptes - remove ptes mapping the vma --- a/security/security.c +++ b/security/security.c -@@ -893,6 +893,7 @@ int security_binder_set_context_mgr(cons +@@ -997,6 +997,7 @@ int security_binder_set_context_mgr(cons { return call_int_hook(binder_set_context_mgr, mgr); } @@ -100,7 +100,7 @@ Export the currently un-exported symbols it depends on. /** * security_binder_transaction() - Check if a binder transaction is allowed -@@ -908,6 +909,7 @@ int security_binder_transaction(const st +@@ -1012,6 +1013,7 @@ int security_binder_transaction(const st { return call_int_hook(binder_transaction, from, to); } @@ -108,7 +108,7 @@ Export the currently un-exported symbols it depends on. /** * security_binder_transfer_binder() - Check if a binder transfer is allowed -@@ -923,6 +925,7 @@ int security_binder_transfer_binder(cons +@@ -1027,6 +1029,7 @@ int security_binder_transfer_binder(cons { return call_int_hook(binder_transfer_binder, from, to); } @@ -116,7 +116,7 @@ Export the currently un-exported symbols it depends on. /** * security_binder_transfer_file() - Check if a binder file xfer is allowed -@@ -939,6 +942,7 @@ int security_binder_transfer_file(const +@@ -1043,6 +1046,7 @@ int security_binder_transfer_file(const { return call_int_hook(binder_transfer_file, from, to, file); } diff --git a/debian/patches/debian/fanotify-taint-on-use-of-fanotify_access_permissions.patch b/debian/patches/debian/fanotify-taint-on-use-of-fanotify_access_permissions.patch index 7150da4..f102cfa 100644 --- a/debian/patches/debian/fanotify-taint-on-use-of-fanotify_access_permissions.patch +++ b/debian/patches/debian/fanotify-taint-on-use-of-fanotify_access_permissions.patch @@ -25,5 +25,5 @@ actually used. +#endif + f = fdget(fanotify_fd); - if (unlikely(!f.file)) + if (unlikely(!fd_file(f))) return -EBADF; diff --git a/debian/patches/debian/fixdep-allow-overriding-hostcc-and-hostld.patch b/debian/patches/debian/fixdep-allow-overriding-hostcc-and-hostld.patch index 1ca6b11..efc4320 100644 --- a/debian/patches/debian/fixdep-allow-overriding-hostcc-and-hostld.patch +++ b/debian/patches/debian/fixdep-allow-overriding-hostcc-and-hostld.patch @@ -12,13 +12,13 @@ override HOSTCC and HOSTLD for fixdep only. --- --- a/tools/build/Makefile.include +++ b/tools/build/Makefile.include -@@ -2,7 +2,10 @@ - build := -f $(srctree)/tools/build/Makefile.build dir=. obj +@@ -12,7 +12,10 @@ else + endif fixdep: -- $(Q)$(MAKE) -C $(srctree)/tools/build $(OUTPUT)fixdep -+ $(Q)$(MAKE) -C $(srctree)/tools/build \ -+ $(if $(REALHOSTCC),HOSTCC=$(REALHOSTCC) HOSTCFLAGS=) \ +- $(SILENT_MAKE) -C $(srctree)/tools/build $(OUTPUT)fixdep ++ $(SILENT_MAKE) -C $(srctree)/tools/build \ ++ $(if $(REALHOSTCC),HOSTCC=$(REALHOSTCC) KBUILD_HOSTCFLAGS=) \ + $(if $(REALHOSTLD),HOSTLD=$(REALHOSTLD) KBUILD_HOSTLDFLAGS=) \ + $(OUTPUT)fixdep diff --git a/debian/patches/debian/gitignore.patch b/debian/patches/debian/gitignore.patch index 7d46715..9409e9c 100644 --- a/debian/patches/debian/gitignore.patch +++ b/debian/patches/debian/gitignore.patch @@ -10,7 +10,7 @@ Forwarded: not-needed --- a/.gitignore +++ b/.gitignore -@@ -78,11 +78,6 @@ modules.order +@@ -79,11 +79,6 @@ modules.order /rpmbuild/ # @@ -22,7 +22,7 @@ Forwarded: not-needed # Snap directory (make snap-pkg) # /snap/ -@@ -99,19 +94,6 @@ modules.order +@@ -100,19 +95,6 @@ modules.order /pacman/ # @@ -42,7 +42,7 @@ Forwarded: not-needed # Generated include files # /include/config/ -@@ -176,3 +158,10 @@ sphinx_*/ +@@ -177,3 +159,10 @@ sphinx_*/ # Rust analyzer configuration /rust-project.json diff --git a/debian/patches/debian/kbuild-look-for-module.lds-under-arch-directory-too.patch b/debian/patches/debian/kbuild-look-for-module.lds-under-arch-directory-too.patch index d2b9390..9f550a1 100644 --- a/debian/patches/debian/kbuild-look-for-module.lds-under-arch-directory-too.patch +++ b/debian/patches/debian/kbuild-look-for-module.lds-under-arch-directory-too.patch @@ -27,14 +27,14 @@ rules.real and change Makefile.modfinal to look for it in both places. --- a/scripts/Makefile.modfinal +++ b/scripts/Makefile.modfinal -@@ -30,11 +30,13 @@ quiet_cmd_cc_o_c = CC [M] $@ - %.mod.o: %.mod.c FORCE +@@ -33,11 +33,13 @@ quiet_cmd_cc_o_c = CC [M] $@ + $(extmod_prefix).module-common.o: $(srctree)/scripts/module-common.c FORCE $(call if_changed_dep,cc_o_c) +ARCH_MODULE_LDS := $(word 1,$(wildcard scripts/module.lds arch/$(SRCARCH)/module.lds)) + quiet_cmd_ld_ko_o = LD [M] $@ - cmd_ld_ko_o += \ + cmd_ld_ko_o = \ $(LD) -r $(KBUILD_LDFLAGS) \ $(KBUILD_LDFLAGS_MODULE) $(LDFLAGS_MODULE) \ - -T scripts/module.lds -o $@ $(filter %.o, $^) @@ -42,12 +42,12 @@ rules.real and change Makefile.modfinal to look for it in both places. quiet_cmd_btf_ko = BTF [M] $@ cmd_btf_ko = \ -@@ -54,7 +56,7 @@ if_changed_except = $(if $(call newer_pr +@@ -57,7 +59,7 @@ if_changed_except = $(if $(call newer_pr printf '%s\n' 'savedcmd_$@ := $(make-cmd)' > $(dot-target).cmd, @:) # Re-generate module BTFs if either module's .ko or vmlinux changed --%.ko: %.o %.mod.o scripts/module.lds $(and $(CONFIG_DEBUG_INFO_BTF_MODULES),$(KBUILD_BUILTIN),vmlinux) FORCE -+%.ko: %.o %.mod.o $(ARCH_MODULE_LDS) $(and $(CONFIG_DEBUG_INFO_BTF_MODULES),$(KBUILD_BUILTIN),vmlinux) FORCE +-%.ko: %.o %.mod.o $(extmod_prefix).module-common.o scripts/module.lds $(and $(CONFIG_DEBUG_INFO_BTF_MODULES),$(KBUILD_BUILTIN),vmlinux) FORCE ++%.ko: %.o %.mod.o $(extmod_prefix).module-common.o $(ARCH_MODULE_LDS) $(and $(CONFIG_DEBUG_INFO_BTF_MODULES),$(KBUILD_BUILTIN),vmlinux) FORCE +$(call if_changed_except,ld_ko_o,vmlinux) ifdef CONFIG_DEBUG_INFO_BTF_MODULES +$(if $(newer-prereqs),$(call cmd,btf_ko)) diff --git a/debian/patches/debian/linux-perf-remove-remaining-source-filenames-from-executable.patch b/debian/patches/debian/linux-perf-remove-remaining-source-filenames-from-executable.patch index b9bc801..ed19024 100644 --- a/debian/patches/debian/linux-perf-remove-remaining-source-filenames-from-executable.patch +++ b/debian/patches/debian/linux-perf-remove-remaining-source-filenames-from-executable.patch @@ -15,7 +15,7 @@ to the installed location. --- --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c -@@ -655,10 +655,12 @@ static int report__browse_hists(struct r +@@ -662,10 +662,12 @@ static int report__browse_hists(struct r path = system_path(TIPDIR); if (perf_tip(&help, path) || help == NULL) { @@ -41,7 +41,7 @@ to the installed location. perf-test-y += workloads/ --- a/tools/perf/Build +++ b/tools/perf/Build -@@ -51,7 +51,7 @@ CFLAGS_perf.o += -DPERF_HTM +@@ -52,7 +52,7 @@ CFLAGS_perf.o += -DPERF_HTM -DPREFIX="BUILD_STR($(prefix_SQ))" CFLAGS_builtin-trace.o += -DSTRACE_GROUPS_DIR="BUILD_STR($(STRACE_GROUPS_DIR_SQ))" CFLAGS_builtin-report.o += -DTIPDIR="BUILD_STR($(tipdir_SQ))" diff --git a/debian/patches/debian/makefile-make-compiler-version-comparison-optional.patch b/debian/patches/debian/makefile-make-compiler-version-comparison-optional.patch index e2969b6..c754e7f 100644 --- a/debian/patches/debian/makefile-make-compiler-version-comparison-optional.patch +++ b/debian/patches/debian/makefile-make-compiler-version-comparison-optional.patch @@ -20,7 +20,7 @@ is non-empty. --- --- a/Makefile +++ b/Makefile -@@ -1807,7 +1807,7 @@ PHONY += prepare +@@ -1817,7 +1817,7 @@ PHONY += prepare # now expand this into a simple variable to reduce the cost of shell evaluations prepare: CC_VERSION_TEXT := $(CC_VERSION_TEXT) prepare: diff --git a/debian/patches/debian/tools-perf-install-python-bindings.patch b/debian/patches/debian/tools-perf-install-python-bindings.patch index bd00a09..7d5ba0b 100644 --- a/debian/patches/debian/tools-perf-install-python-bindings.patch +++ b/debian/patches/debian/tools-perf-install-python-bindings.patch @@ -10,7 +10,7 @@ Forwarded: not-needed --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf -@@ -1149,7 +1149,7 @@ install-bin: install-tools install-tests +@@ -1153,7 +1153,7 @@ install-bin: install-tools install-tests install: install-bin try-install-man install-python_ext: diff --git a/debian/patches/debian/tools-perf-perf-read-vdso-in-libexec.patch b/debian/patches/debian/tools-perf-perf-read-vdso-in-libexec.patch index 3420f46..55f758a 100644 --- a/debian/patches/debian/tools-perf-perf-read-vdso-in-libexec.patch +++ b/debian/patches/debian/tools-perf-perf-read-vdso-in-libexec.patch @@ -4,7 +4,7 @@ Subject: linux-tools: Install perf-read-vdso{,x}32 in directory under /usr/lib --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf -@@ -1073,21 +1073,21 @@ install-tools: all install-gtk +@@ -1075,21 +1075,21 @@ install-tools: all install-gtk $(LN) '$(DESTDIR_SQ)$(bindir_SQ)/perf' '$(DESTDIR_SQ)$(bindir_SQ)/trace'; \ $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(includedir_SQ)/perf'; \ $(INSTALL) -m 644 include/perf/perf_dlfilter.h -t '$(DESTDIR_SQ)$(includedir_SQ)/perf' diff --git a/debian/patches/features/all/lockdown/arm64-add-kernel-config-option-to-lock-down-when.patch b/debian/patches/features/all/lockdown/arm64-add-kernel-config-option-to-lock-down-when.patch index 2836779..61b7040 100644 --- a/debian/patches/features/all/lockdown/arm64-add-kernel-config-option-to-lock-down-when.patch +++ b/debian/patches/features/all/lockdown/arm64-add-kernel-config-option-to-lock-down-when.patch @@ -141,10 +141,10 @@ arm-init to efi-init common for all arch") renamed arm-init.c to efi-init.c] --- a/include/linux/efi.h +++ b/include/linux/efi.h -@@ -766,7 +766,8 @@ extern void efi_mem_reserve(phys_addr_t +@@ -764,7 +764,8 @@ extern int efi_mem_desc_lookup(u64 phys_ + extern int __efi_mem_desc_lookup(u64 phys_addr, efi_memory_desc_t *out_md); + extern void efi_mem_reserve(phys_addr_t addr, u64 size); extern int efi_mem_reserve_persistent(phys_addr_t addr, u64 size); - extern void efi_initialize_iomem_resources(struct resource *code_resource, - struct resource *data_resource, struct resource *bss_resource); -extern u64 efi_get_fdt_params(struct efi_memory_map_data *data); +extern u64 efi_get_fdt_params(struct efi_memory_map_data *data, + u32 *secure_boot); diff --git a/debian/patches/features/all/lockdown/efi-add-an-efi_secure_boot-flag-to-indicate-secure-b.patch b/debian/patches/features/all/lockdown/efi-add-an-efi_secure_boot-flag-to-indicate-secure-b.patch index 491639c..252c6ba 100644 --- a/debian/patches/features/all/lockdown/efi-add-an-efi_secure_boot-flag-to-indicate-secure-b.patch +++ b/debian/patches/features/all/lockdown/efi-add-an-efi_secure_boot-flag-to-indicate-secure-b.patch @@ -31,7 +31,7 @@ cc: linux-efi@vger.kernel.org --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c -@@ -1065,19 +1065,7 @@ void __init setup_arch(char **cmdline_p) +@@ -1070,19 +1070,7 @@ void __init setup_arch(char **cmdline_p) /* Allocate bigger log buffer */ setup_log_buf(1); @@ -106,7 +106,7 @@ cc: linux-efi@vger.kernel.org +} --- a/include/linux/efi.h +++ b/include/linux/efi.h -@@ -877,6 +877,14 @@ static inline int efi_range_is_wc(unsign +@@ -875,6 +875,14 @@ static inline int efi_range_is_wc(unsign #define EFI_MEM_ATTR 10 /* Did firmware publish an EFI_MEMORY_ATTRIBUTES table? */ #define EFI_MEM_NO_SOFT_RESERVE 11 /* Is the kernel configured to ignore soft reservations? */ #define EFI_PRESERVE_BS_REGIONS 12 /* Are EFI boot-services memory segments available? */ @@ -121,7 +121,7 @@ cc: linux-efi@vger.kernel.org #ifdef CONFIG_EFI /* -@@ -901,6 +909,7 @@ static inline bool efi_rt_services_suppo +@@ -899,6 +907,7 @@ static inline bool efi_rt_services_suppo return (efi.runtime_supported_mask & mask) == mask; } extern void efi_find_mirror(void); @@ -129,7 +129,7 @@ cc: linux-efi@vger.kernel.org #else static inline bool efi_enabled(int feature) { -@@ -920,6 +929,7 @@ static inline bool efi_rt_services_suppo +@@ -918,6 +927,7 @@ static inline bool efi_rt_services_suppo } static inline void efi_find_mirror(void) {} @@ -137,7 +137,7 @@ cc: linux-efi@vger.kernel.org #endif extern int efi_status_to_err(efi_status_t status); -@@ -1138,13 +1148,6 @@ static inline bool efi_runtime_disabled( +@@ -1136,13 +1146,6 @@ static inline bool efi_runtime_disabled( extern void efi_call_virt_check_flags(unsigned long flags, const void *caller); extern unsigned long efi_call_virt_save_flags(void); diff --git a/debian/patches/features/all/lockdown/efi-lock-down-the-kernel-if-booted-in-secure-boot-mo.patch b/debian/patches/features/all/lockdown/efi-lock-down-the-kernel-if-booted-in-secure-boot-mo.patch index 918b409..6fff3f8 100644 --- a/debian/patches/features/all/lockdown/efi-lock-down-the-kernel-if-booted-in-secure-boot-mo.patch +++ b/debian/patches/features/all/lockdown/efi-lock-down-the-kernel-if-booted-in-secure-boot-mo.patch @@ -35,7 +35,7 @@ Signed-off-by: Salvatore Bonaccorso reserve_ibft_region(); x86_init.resources.dmi_setup(); -@@ -1065,8 +1067,6 @@ void __init setup_arch(char **cmdline_p) +@@ -1070,8 +1072,6 @@ void __init setup_arch(char **cmdline_p) /* Allocate bigger log buffer */ setup_log_buf(1); @@ -67,26 +67,26 @@ Signed-off-by: Salvatore Bonaccorso default: --- a/include/linux/security.h +++ b/include/linux/security.h -@@ -509,6 +509,7 @@ int security_inode_getsecctx(struct inod +@@ -522,6 +522,7 @@ int security_inode_notifysecctx(struct i + int security_inode_setsecctx(struct dentry *dentry, void *ctx, u32 ctxlen); + int security_inode_getsecctx(struct inode *inode, void **ctx, u32 *ctxlen); int security_locked_down(enum lockdown_reason what); ++int lock_kernel_down(const char *where, enum lockdown_reason level); int lsm_fill_user_ctx(struct lsm_ctx __user *uctx, u32 *uctx_len, void *val, size_t val_len, u64 id, u64 flags); -+int lock_kernel_down(const char *where, enum lockdown_reason level); - #else /* CONFIG_SECURITY */ - - static inline int call_blocking_lsm_notifier(enum lsm_event event, void *data) -@@ -1483,6 +1484,11 @@ static inline int lsm_fill_user_ctx(stru + int security_bdev_alloc(struct block_device *bdev); +@@ -1504,6 +1505,11 @@ static inline int security_locked_down(e { - return -EOPNOTSUPP; + return 0; } +static inline int +lock_kernel_down(const char *where, enum lockdown_reason level) +{ + return -EOPNOTSUPP; +} - #endif /* CONFIG_SECURITY */ - - #if defined(CONFIG_SECURITY) && defined(CONFIG_WATCH_QUEUE) + static inline int lsm_fill_user_ctx(struct lsm_ctx __user *uctx, + u32 *uctx_len, void *val, size_t val_len, + u64 id, u64 flags) --- a/security/lockdown/Kconfig +++ b/security/lockdown/Kconfig @@ -45,3 +45,18 @@ config LOCK_DOWN_KERNEL_FORCE_CONFIDENTI diff --git a/debian/patches/features/all/security-perf-allow-further-restriction-of-perf_event_open.patch b/debian/patches/features/all/security-perf-allow-further-restriction-of-perf_event_open.patch index 34a408d..5aeae30 100644 --- a/debian/patches/features/all/security-perf-allow-further-restriction-of-perf_event_open.patch +++ b/debian/patches/features/all/security-perf-allow-further-restriction-of-perf_event_open.patch @@ -22,7 +22,7 @@ Signed-off-by: Ben Hutchings --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h -@@ -1589,6 +1589,11 @@ int perf_cpu_time_max_percent_handler(co +@@ -1617,6 +1617,11 @@ int perf_cpu_time_max_percent_handler(co int perf_event_max_stack_handler(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos); @@ -36,7 +36,7 @@ Signed-off-by: Ben Hutchings --- a/kernel/events/core.c +++ b/kernel/events/core.c -@@ -419,8 +419,13 @@ static struct kmem_cache *perf_event_cac +@@ -449,8 +449,13 @@ static struct kmem_cache *perf_event_cac * 0 - disallow raw tracepoint access for unpriv * 1 - disallow cpu events for unpriv * 2 - disallow kernel profiling for unpriv @@ -50,7 +50,7 @@ Signed-off-by: Ben Hutchings /* Minimum for 512 kiB + 1 user control page */ int sysctl_perf_event_mlock __read_mostly = 512 + (PAGE_SIZE / 1024); /* 'free' kiB per user */ -@@ -12506,6 +12511,9 @@ SYSCALL_DEFINE5(perf_event_open, +@@ -12681,6 +12686,9 @@ SYSCALL_DEFINE5(perf_event_open, if (err) return err; diff --git a/debian/patches/features/x86/intel-iommu-add-kconfig-option-to-exclude-igpu-by-default.patch b/debian/patches/features/x86/intel-iommu-add-kconfig-option-to-exclude-igpu-by-default.patch index 0e5cc5d..06a26f8 100644 --- a/debian/patches/features/x86/intel-iommu-add-kconfig-option-to-exclude-igpu-by-default.patch +++ b/debian/patches/features/x86/intel-iommu-add-kconfig-option-to-exclude-igpu-by-default.patch @@ -15,7 +15,7 @@ Signed-off-by: Ben Hutchings --- --- a/drivers/iommu/intel/Kconfig +++ b/drivers/iommu/intel/Kconfig -@@ -57,13 +57,24 @@ config INTEL_IOMMU_SVM +@@ -56,13 +56,24 @@ config INTEL_IOMMU_SVM to access DMA resources through process address space by means of a Process Address Space ID (PASID). @@ -48,7 +48,7 @@ Signed-off-by: Ben Hutchings def_bool y --- a/drivers/iommu/intel/iommu.c +++ b/drivers/iommu/intel/iommu.c -@@ -214,13 +214,13 @@ static LIST_HEAD(dmar_satc_units); +@@ -205,13 +205,13 @@ static LIST_HEAD(dmar_satc_units); static void intel_iommu_domain_free(struct iommu_domain *domain); @@ -64,7 +64,7 @@ Signed-off-by: Ben Hutchings static int intel_iommu_superpage = 1; static int iommu_identity_mapping; static int iommu_skip_te_disable; -@@ -259,6 +259,7 @@ static int __init intel_iommu_setup(char +@@ -250,6 +250,7 @@ static int __init intel_iommu_setup(char while (*str) { if (!strncmp(str, "on", 2)) { dmar_disabled = 0; diff --git a/debian/patches/features/x86/intel-iommu-add-option-to-exclude-integrated-gpu-only.patch b/debian/patches/features/x86/intel-iommu-add-option-to-exclude-integrated-gpu-only.patch index 9979abd..987845f 100644 --- a/debian/patches/features/x86/intel-iommu-add-option-to-exclude-integrated-gpu-only.patch +++ b/debian/patches/features/x86/intel-iommu-add-option-to-exclude-integrated-gpu-only.patch @@ -22,7 +22,7 @@ Signed-off-by: Ben Hutchings --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt -@@ -2201,6 +2201,8 @@ +@@ -2218,6 +2218,8 @@ bypassed by not enabling DMAR with this option. In this case, gfx device will use physical address for DMA. @@ -43,7 +43,7 @@ Signed-off-by: Ben Hutchings #define IS_USB_DEVICE(pdev) ((pdev->class >> 8) == PCI_CLASS_SERIAL_USB) #define IS_ISA_DEVICE(pdev) ((pdev->class >> 8) == PCI_CLASS_BRIDGE_ISA) #define IS_AZALIA(pdev) ((pdev)->vendor == 0x8086 && (pdev)->device == 0x3a3e) -@@ -217,12 +220,14 @@ int intel_iommu_sm = IS_ENABLED(CONFIG_I +@@ -208,12 +211,14 @@ int intel_iommu_sm = IS_ENABLED(CONFIG_I int intel_iommu_enabled = 0; EXPORT_SYMBOL_GPL(intel_iommu_enabled); @@ -58,7 +58,7 @@ Signed-off-by: Ben Hutchings const struct iommu_ops intel_iommu_ops; static const struct iommu_dirty_ops intel_dirty_ops; -@@ -262,6 +267,9 @@ static int __init intel_iommu_setup(char +@@ -253,6 +258,9 @@ static int __init intel_iommu_setup(char } else if (!strncmp(str, "igfx_off", 8)) { disable_igfx_iommu = 1; pr_info("Disable GFX device mapping\n"); @@ -68,7 +68,7 @@ Signed-off-by: Ben Hutchings } else if (!strncmp(str, "forcedac", 8)) { pr_warn("intel_iommu=forcedac deprecated; use iommu.forcedac instead\n"); iommu_dma_forcedac = true; -@@ -2168,6 +2176,9 @@ static int device_def_domain_type(struct +@@ -2046,6 +2054,9 @@ static int device_def_domain_type(struct if ((iommu_identity_mapping & IDENTMAP_AZALIA) && IS_AZALIA(pdev)) return IOMMU_DOMAIN_IDENTITY; @@ -78,7 +78,7 @@ Signed-off-by: Ben Hutchings } return 0; -@@ -2468,6 +2479,9 @@ static int __init init_dmars(void) +@@ -2344,6 +2355,9 @@ static int __init init_dmars(void) iommu_set_root_entry(iommu); } @@ -87,4 +87,4 @@ Signed-off-by: Ben Hutchings + check_tylersburg_isoch(); - ret = si_domain_init(hw_pass_through); + /* diff --git a/debian/patches/features/x86/x86-make-x32-syscall-support-conditional.patch b/debian/patches/features/x86/x86-make-x32-syscall-support-conditional.patch index a092aae..5ec2377 100644 --- a/debian/patches/features/x86/x86-make-x32-syscall-support-conditional.patch +++ b/debian/patches/features/x86/x86-make-x32-syscall-support-conditional.patch @@ -29,7 +29,7 @@ Signed-off-by: Ben Hutchings --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt -@@ -6578,6 +6578,10 @@ +@@ -6641,6 +6641,10 @@ later by a loaded module cannot be set this way. Example: sysctl.vm.swappiness=40 @@ -42,7 +42,7 @@ Signed-off-by: Ben Hutchings Ignore sysrq setting - this boot parameter will --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig -@@ -3069,6 +3069,14 @@ config COMPAT_32 +@@ -3164,6 +3164,14 @@ config COMPAT_32 select HAVE_UID16 select OLD_SIGSUSPEND3 diff --git a/debian/patches/krd/0001-Revert-objtool-dont-fail-the-kernel-build-on-fatal-errors.patch b/debian/patches/krd/0001-Revert-objtool-dont-fail-the-kernel-build-on-fatal-errors.patch index 30a817b..d36cde4 100644 --- a/debian/patches/krd/0001-Revert-objtool-dont-fail-the-kernel-build-on-fatal-errors.patch +++ b/debian/patches/krd/0001-Revert-objtool-dont-fail-the-kernel-build-on-fatal-errors.patch @@ -30,7 +30,7 @@ this reverts following commit: --- a/tools/objtool/check.c +++ b/tools/objtool/check.c -@@ -4872,10 +4872,14 @@ int check(struct objtool_file *file) +@@ -4922,10 +4922,14 @@ int check(struct objtool_file *file) } out: diff --git a/debian/patches/krd/1001-Revert-perf-x86-rapl-Fix-the-energy-pkg-event-for-AMD-CPUs.patch b/debian/patches/krd/1001-Revert-perf-x86-rapl-Fix-the-energy-pkg-event-for-AMD-CPUs.patch deleted file mode 100644 index 28bf8cd..0000000 --- a/debian/patches/krd/1001-Revert-perf-x86-rapl-Fix-the-energy-pkg-event-for-AMD-CPUs.patch +++ /dev/null @@ -1,144 +0,0 @@ -this reverts following commit: - - From: Dhananjay Ugwekar - Date: Tue, 30 Jul 2024 04:49:18 +0000 - Subject: perf/x86/rapl: Fix the energy-pkg event for AMD CPUs - - commit 8d72eba1cf8cecd76a2b4c1dd7673c2dc775f514 upstream. - - After commit: - - 63edbaa48a57 ("x86/cpu/topology: Add support for the AMD 0x80000026 leaf") - - ... on AMD processors that support extended CPUID leaf 0x80000026, the - topology_die_cpumask() and topology_logical_die_id() macros no longer - return the package cpumask and package ID, instead they return the CCD - (Core Complex Die) mask and ID respectively. - - This leads to the energy-pkg event scope to be modified to CCD instead of package. - - So, change the PMU scope for AMD and Hygon back to package. - - On a 12 CCD 1 Package AMD Zen4 Genoa machine: - - Before: - - $ cat /sys/devices/power/cpumask - 0,8,16,24,32,40,48,56,64,72,80,88. - - The expected cpumask here is supposed to be just "0", as it is a package - scope event, only one CPU will be collecting the event for all the CPUs in - the package. - - After: - - $ cat /sys/devices/power/cpumask - 0 - - [ mingo: Cleaned up the changelog ] - - Signed-off-by: Dhananjay Ugwekar - Signed-off-by: Ingo Molnar - Reviewed-by: Kan Liang - Link: https://lore.kernel.org/r/20240904100934.3260-1-Dhananjay.Ugwekar@amd.com - Signed-off-by: Greg Kroah-Hartman - ---- a/arch/x86/events/rapl.c -+++ b/arch/x86/events/rapl.c -@@ -103,19 +103,6 @@ static struct perf_pmu_events_attr event - .event_str = str, \ - }; - --/* -- * RAPL Package energy counter scope: -- * 1. AMD/HYGON platforms have a per-PKG package energy counter -- * 2. For Intel platforms -- * 2.1. CLX-AP is multi-die and its RAPL MSRs are die-scope -- * 2.2. Other Intel platforms are single die systems so the scope can be -- * considered as either pkg-scope or die-scope, and we are considering -- * them as die-scope. -- */ --#define rapl_pmu_is_pkg_scope() \ -- (boot_cpu_data.x86_vendor == X86_VENDOR_AMD || \ -- boot_cpu_data.x86_vendor == X86_VENDOR_HYGON) -- - struct rapl_pmu { - raw_spinlock_t lock; - int n_active; -@@ -153,25 +140,9 @@ static unsigned int rapl_cntr_mask; - static u64 rapl_timer_ms; - static struct perf_msr *rapl_msrs; - --/* -- * Helper functions to get the correct topology macros according to the -- * RAPL PMU scope. -- */ --static inline unsigned int get_rapl_pmu_idx(int cpu) --{ -- return rapl_pmu_is_pkg_scope() ? topology_logical_package_id(cpu) : -- topology_logical_die_id(cpu); --} -- --static inline const struct cpumask *get_rapl_pmu_cpumask(int cpu) --{ -- return rapl_pmu_is_pkg_scope() ? topology_core_cpumask(cpu) : -- topology_die_cpumask(cpu); --} -- - static inline struct rapl_pmu *cpu_to_rapl_pmu(unsigned int cpu) - { -- unsigned int rapl_pmu_idx = get_rapl_pmu_idx(cpu); -+ unsigned int rapl_pmu_idx = topology_logical_die_id(cpu); - - /* - * The unsigned check also catches the '-1' return value for non -@@ -581,7 +552,7 @@ static int rapl_cpu_offline(unsigned int - - pmu->cpu = -1; - /* Find a new cpu to collect rapl events */ -- target = cpumask_any_but(get_rapl_pmu_cpumask(cpu), cpu); -+ target = cpumask_any_but(topology_die_cpumask(cpu), cpu); - - /* Migrate rapl events to the new target */ - if (target < nr_cpu_ids) { -@@ -594,11 +565,6 @@ static int rapl_cpu_offline(unsigned int - - static int rapl_cpu_online(unsigned int cpu) - { -- s32 rapl_pmu_idx = get_rapl_pmu_idx(cpu); -- if (rapl_pmu_idx < 0) { -- pr_err("topology_logical_(package/die)_id() returned a negative value"); -- return -EINVAL; -- } - struct rapl_pmu *pmu = cpu_to_rapl_pmu(cpu); - int target; - -@@ -613,14 +579,14 @@ static int rapl_cpu_online(unsigned int - pmu->timer_interval = ms_to_ktime(rapl_timer_ms); - rapl_hrtimer_init(pmu); - -- rapl_pmus->pmus[rapl_pmu_idx] = pmu; -+ rapl_pmus->pmus[topology_logical_die_id(cpu)] = pmu; - } - - /* - * Check if there is an online cpu in the package which collects rapl - * events already. - */ -- target = cpumask_any_and(&rapl_cpu_mask, get_rapl_pmu_cpumask(cpu)); -+ target = cpumask_any_and(&rapl_cpu_mask, topology_die_cpumask(cpu)); - if (target < nr_cpu_ids) - return 0; - -@@ -709,10 +675,7 @@ static const struct attribute_group *rap - - static int __init init_rapl_pmus(void) - { -- int nr_rapl_pmu = topology_max_packages(); -- -- if (!rapl_pmu_is_pkg_scope()) -- nr_rapl_pmu *= topology_max_dies_per_package(); -+ int nr_rapl_pmu = topology_max_packages() * topology_max_dies_per_package(); - - rapl_pmus = kzalloc(struct_size(rapl_pmus, pmus, nr_rapl_pmu), GFP_KERNEL); - if (!rapl_pmus) diff --git a/debian/patches/misc-bbr3/0001-net-tcp_bbr-broaden-app-limited-rate-sample-detectio.patch b/debian/patches/misc-bbr3/0001-net-tcp_bbr-broaden-app-limited-rate-sample-detectio.patch index 620da28..b070afa 100644 --- a/debian/patches/misc-bbr3/0001-net-tcp_bbr-broaden-app-limited-rate-sample-detectio.patch +++ b/debian/patches/misc-bbr3/0001-net-tcp_bbr-broaden-app-limited-rate-sample-detectio.patch @@ -1,4 +1,4 @@ -From ce1cd7869a208112a8728d1fe9e373f78a2e4a6e Mon Sep 17 00:00:00 2001 +From b9540ffedb31e687585b586b9f96543928f6b99b Mon Sep 17 00:00:00 2001 From: Neal Cardwell Date: Tue, 11 Jun 2019 12:26:55 -0400 Subject: [PATCH 01/19] net-tcp_bbr: broaden app-limited rate sample detection @@ -42,7 +42,7 @@ Signed-off-by: Alexandre Frade * is in window. --- a/net/ipv4/tcp_timer.c +++ b/net/ipv4/tcp_timer.c -@@ -689,6 +689,7 @@ void tcp_write_timer_handler(struct sock +@@ -690,6 +690,7 @@ void tcp_write_timer_handler(struct sock return; } diff --git a/debian/patches/misc-bbr3/0002-net-tcp_bbr-v2-shrink-delivered_mstamp-first_tx_msta.patch b/debian/patches/misc-bbr3/0002-net-tcp_bbr-v2-shrink-delivered_mstamp-first_tx_msta.patch index b279c96..50b1eb4 100644 --- a/debian/patches/misc-bbr3/0002-net-tcp_bbr-v2-shrink-delivered_mstamp-first_tx_msta.patch +++ b/debian/patches/misc-bbr3/0002-net-tcp_bbr-v2-shrink-delivered_mstamp-first_tx_msta.patch @@ -1,4 +1,4 @@ -From b32715fbe2ab96d1060ec37bb9c03feedf366494 Mon Sep 17 00:00:00 2001 +From 9fd50b0891febee43126ba643bfe56f72dd23bad Mon Sep 17 00:00:00 2001 From: Neal Cardwell Date: Sun, 24 Jun 2018 21:55:59 -0400 Subject: [PATCH 02/19] net-tcp_bbr: v2: shrink delivered_mstamp, diff --git a/debian/patches/misc-bbr3/0003-net-tcp_bbr-v2-snapshot-packets-in-flight-at-transmi.patch b/debian/patches/misc-bbr3/0003-net-tcp_bbr-v2-snapshot-packets-in-flight-at-transmi.patch index 07bebb5..4545e16 100644 --- a/debian/patches/misc-bbr3/0003-net-tcp_bbr-v2-snapshot-packets-in-flight-at-transmi.patch +++ b/debian/patches/misc-bbr3/0003-net-tcp_bbr-v2-snapshot-packets-in-flight-at-transmi.patch @@ -1,4 +1,4 @@ -From 25856231832186fe13189b986cc0e91860c18201 Mon Sep 17 00:00:00 2001 +From 7c5c7e14043aaf99390cb9c71140f63cd574ffda Mon Sep 17 00:00:00 2001 From: Neal Cardwell Date: Sat, 5 Aug 2017 11:49:50 -0400 Subject: [PATCH 03/19] net-tcp_bbr: v2: snapshot packets in flight at transmit @@ -38,7 +38,7 @@ Signed-off-by: Alexandre Frade } tx; /* only used for outgoing skbs */ union { struct inet_skb_parm h4; -@@ -1136,6 +1140,7 @@ struct rate_sample { +@@ -1137,6 +1141,7 @@ struct rate_sample { u64 prior_mstamp; /* starting timestamp for interval */ u32 prior_delivered; /* tp->delivered at "prior_mstamp" */ u32 prior_delivered_ce;/* tp->delivered_ce at "prior_mstamp" */ @@ -46,7 +46,7 @@ Signed-off-by: Alexandre Frade s32 delivered; /* number of packets delivered over interval */ s32 delivered_ce; /* number of packets delivered w/ CE marks*/ long interval_us; /* time for tp->delivered to incr "delivered" */ -@@ -1258,6 +1263,7 @@ static inline void tcp_ca_event(struct s +@@ -1259,6 +1264,7 @@ static inline void tcp_ca_event(struct s void tcp_set_ca_state(struct sock *sk, const u8 ca_state); /* From tcp_rate.c */ diff --git a/debian/patches/misc-bbr3/0004-net-tcp_bbr-v2-count-packets-lost-over-TCP-rate-samp.patch b/debian/patches/misc-bbr3/0004-net-tcp_bbr-v2-count-packets-lost-over-TCP-rate-samp.patch index 8882ff8..2909099 100644 --- a/debian/patches/misc-bbr3/0004-net-tcp_bbr-v2-count-packets-lost-over-TCP-rate-samp.patch +++ b/debian/patches/misc-bbr3/0004-net-tcp_bbr-v2-count-packets-lost-over-TCP-rate-samp.patch @@ -1,4 +1,4 @@ -From b1772710e8b5b98c09e96d4f1af620cd938fddf7 Mon Sep 17 00:00:00 2001 +From 205288c0ef4b4059c0ae8a2bb85b74a1c371d700 Mon Sep 17 00:00:00 2001 From: Neal Cardwell Date: Thu, 12 Oct 2017 23:44:27 -0400 Subject: [PATCH 04/19] net-tcp_bbr: v2: count packets lost over TCP rate @@ -27,7 +27,7 @@ Signed-off-by: Alexandre Frade } tx; /* only used for outgoing skbs */ union { struct inet_skb_parm h4; -@@ -1138,11 +1139,13 @@ struct ack_sample { +@@ -1139,11 +1140,13 @@ struct ack_sample { */ struct rate_sample { u64 prior_mstamp; /* starting timestamp for interval */ diff --git a/debian/patches/misc-bbr3/0005-net-tcp_bbr-v2-export-FLAG_ECE-in-rate_sample.is_ece.patch b/debian/patches/misc-bbr3/0005-net-tcp_bbr-v2-export-FLAG_ECE-in-rate_sample.is_ece.patch index 1045dbf..351f67f 100644 --- a/debian/patches/misc-bbr3/0005-net-tcp_bbr-v2-export-FLAG_ECE-in-rate_sample.is_ece.patch +++ b/debian/patches/misc-bbr3/0005-net-tcp_bbr-v2-export-FLAG_ECE-in-rate_sample.is_ece.patch @@ -1,4 +1,4 @@ -From fdf01142aea8645186e080f1278d3b5a5fd8c66c Mon Sep 17 00:00:00 2001 +From 1fe2a421fbf80580ad76f528c6489633667e5851 Mon Sep 17 00:00:00 2001 From: Neal Cardwell Date: Mon, 19 Nov 2018 13:48:36 -0500 Subject: [PATCH 05/19] net-tcp_bbr: v2: export FLAG_ECE in rate_sample.is_ece @@ -18,7 +18,7 @@ Signed-off-by: Alexandre Frade --- a/include/net/tcp.h +++ b/include/net/tcp.h -@@ -1157,6 +1157,7 @@ struct rate_sample { +@@ -1158,6 +1158,7 @@ struct rate_sample { bool is_app_limited; /* is sample from packet with bubble in pipe? */ bool is_retrans; /* is sample from retransmission? */ bool is_ack_delayed; /* is this (likely) a delayed ACK? */ diff --git a/debian/patches/misc-bbr3/0006-net-tcp_bbr-v2-introduce-ca_ops-skb_marked_lost-CC-m.patch b/debian/patches/misc-bbr3/0006-net-tcp_bbr-v2-introduce-ca_ops-skb_marked_lost-CC-m.patch index 1582d9e..11a4f89 100644 --- a/debian/patches/misc-bbr3/0006-net-tcp_bbr-v2-introduce-ca_ops-skb_marked_lost-CC-m.patch +++ b/debian/patches/misc-bbr3/0006-net-tcp_bbr-v2-introduce-ca_ops-skb_marked_lost-CC-m.patch @@ -1,4 +1,4 @@ -From a3e88432c2ebf12de9c2053a13417ddf2ad4cb4e Mon Sep 17 00:00:00 2001 +From 96bcebd73a3df154c7c5100694deb069a2157655 Mon Sep 17 00:00:00 2001 From: Neal Cardwell Date: Tue, 7 Aug 2018 21:52:06 -0400 Subject: [PATCH 06/19] net-tcp_bbr: v2: introduce ca_ops->skb_marked_lost() CC @@ -30,7 +30,7 @@ Signed-off-by: Alexandre Frade --- a/include/net/tcp.h +++ b/include/net/tcp.h -@@ -1184,6 +1184,9 @@ struct tcp_congestion_ops { +@@ -1185,6 +1185,9 @@ struct tcp_congestion_ops { /* override sysctl_tcp_min_tso_segs */ u32 (*min_tso_segs)(struct sock *sk); diff --git a/debian/patches/misc-bbr3/0007-net-tcp_bbr-v2-adjust-skb-tx.in_flight-upon-merge-in.patch b/debian/patches/misc-bbr3/0007-net-tcp_bbr-v2-adjust-skb-tx.in_flight-upon-merge-in.patch index 35dec47..7131af9 100644 --- a/debian/patches/misc-bbr3/0007-net-tcp_bbr-v2-adjust-skb-tx.in_flight-upon-merge-in.patch +++ b/debian/patches/misc-bbr3/0007-net-tcp_bbr-v2-adjust-skb-tx.in_flight-upon-merge-in.patch @@ -1,4 +1,4 @@ -From af7d33e71649b8e2ae00dccf336720a8ab891606 Mon Sep 17 00:00:00 2001 +From ab109789c18f7edf7a34923398a64ba7ba38cc6c Mon Sep 17 00:00:00 2001 From: Neal Cardwell Date: Wed, 1 May 2019 20:16:33 -0400 Subject: [PATCH 07/19] net-tcp_bbr: v2: adjust skb tx.in_flight upon merge in diff --git a/debian/patches/misc-bbr3/0008-net-tcp_bbr-v2-adjust-skb-tx.in_flight-upon-split-in.patch b/debian/patches/misc-bbr3/0008-net-tcp_bbr-v2-adjust-skb-tx.in_flight-upon-split-in.patch index f437449..d666068 100644 --- a/debian/patches/misc-bbr3/0008-net-tcp_bbr-v2-adjust-skb-tx.in_flight-upon-split-in.patch +++ b/debian/patches/misc-bbr3/0008-net-tcp_bbr-v2-adjust-skb-tx.in_flight-upon-split-in.patch @@ -1,4 +1,4 @@ -From a4d44bce49f61f8755f558dc40edff5f8958b7c6 Mon Sep 17 00:00:00 2001 +From 6d0d550fdc6692ee65d01453d380ffba4b5a97e9 Mon Sep 17 00:00:00 2001 From: Neal Cardwell Date: Wed, 1 May 2019 20:16:25 -0400 Subject: [PATCH 08/19] net-tcp_bbr: v2: adjust skb tx.in_flight upon split in @@ -31,7 +31,7 @@ Signed-off-by: Alexandre Frade --- a/include/net/tcp.h +++ b/include/net/tcp.h -@@ -1283,6 +1283,21 @@ static inline bool tcp_skb_sent_after(u6 +@@ -1284,6 +1284,21 @@ static inline bool tcp_skb_sent_after(u6 return t1 > t2 || (t1 == t2 && after(seq1, seq2)); } diff --git a/debian/patches/misc-bbr3/0009-net-tcp-add-new-ca-opts-flag-TCP_CONG_WANTS_CE_EVENT.patch b/debian/patches/misc-bbr3/0009-net-tcp-add-new-ca-opts-flag-TCP_CONG_WANTS_CE_EVENT.patch index 4f9b314..532c7e7 100644 --- a/debian/patches/misc-bbr3/0009-net-tcp-add-new-ca-opts-flag-TCP_CONG_WANTS_CE_EVENT.patch +++ b/debian/patches/misc-bbr3/0009-net-tcp-add-new-ca-opts-flag-TCP_CONG_WANTS_CE_EVENT.patch @@ -1,4 +1,4 @@ -From 65cca0e8fd954a150ec874650af47f7800ea3049 Mon Sep 17 00:00:00 2001 +From 55dba52fd12522bb1c211acdd37f051e8bf5c57b Mon Sep 17 00:00:00 2001 From: Yousuk Seung Date: Wed, 23 May 2018 17:55:54 -0700 Subject: [PATCH 09/19] net-tcp: add new ca opts flag TCP_CONG_WANTS_CE_EVENTS @@ -23,7 +23,7 @@ Signed-off-by: Alexandre Frade --- a/include/net/tcp.h +++ b/include/net/tcp.h -@@ -1119,7 +1119,11 @@ enum tcp_ca_ack_event_flags { +@@ -1120,7 +1120,11 @@ enum tcp_ca_ack_event_flags { #define TCP_CONG_NON_RESTRICTED 0x1 /* Requires ECN/ECT set on all packets */ #define TCP_CONG_NEEDS_ECN 0x2 @@ -36,7 +36,7 @@ Signed-off-by: Alexandre Frade union tcp_cc_info; -@@ -1251,6 +1255,14 @@ static inline char *tcp_ca_get_name_by_k +@@ -1252,6 +1256,14 @@ static inline char *tcp_ca_get_name_by_k } #endif diff --git a/debian/patches/misc-bbr3/0010-net-tcp-re-generalize-TSO-sizing-in-TCP-CC-module-AP.patch b/debian/patches/misc-bbr3/0010-net-tcp-re-generalize-TSO-sizing-in-TCP-CC-module-AP.patch index b195ec9..f8c1025 100644 --- a/debian/patches/misc-bbr3/0010-net-tcp-re-generalize-TSO-sizing-in-TCP-CC-module-AP.patch +++ b/debian/patches/misc-bbr3/0010-net-tcp-re-generalize-TSO-sizing-in-TCP-CC-module-AP.patch @@ -1,4 +1,4 @@ -From 3acb852e1cfcdeea388bd428c6dd81609fd40792 Mon Sep 17 00:00:00 2001 +From 2c015b38804583667528b976c1cc9f9c1c42c104 Mon Sep 17 00:00:00 2001 From: Neal Cardwell Date: Fri, 27 Sep 2019 17:10:26 -0400 Subject: [PATCH 10/19] net-tcp: re-generalize TSO sizing in TCP CC module API @@ -27,7 +27,7 @@ Signed-off-by: Alexandre Frade --- a/include/net/tcp.h +++ b/include/net/tcp.h -@@ -1185,8 +1185,8 @@ struct tcp_congestion_ops { +@@ -1186,8 +1186,8 @@ struct tcp_congestion_ops { /* hook for packet ack accounting (optional) */ void (*pkts_acked)(struct sock *sk, const struct ack_sample *sample); diff --git a/debian/patches/misc-bbr3/0011-net-tcp-add-fast_ack_mode-1-skip-rwin-check-in-tcp_f.patch b/debian/patches/misc-bbr3/0011-net-tcp-add-fast_ack_mode-1-skip-rwin-check-in-tcp_f.patch index 894d5b1..2b8c1a0 100644 --- a/debian/patches/misc-bbr3/0011-net-tcp-add-fast_ack_mode-1-skip-rwin-check-in-tcp_f.patch +++ b/debian/patches/misc-bbr3/0011-net-tcp-add-fast_ack_mode-1-skip-rwin-check-in-tcp_f.patch @@ -1,4 +1,4 @@ -From 3741ada76bab5111cbb9c279cf27e67a0334eb05 Mon Sep 17 00:00:00 2001 +From 3002091ca590f27c6c7c5966883502c87502e01f Mon Sep 17 00:00:00 2001 From: Neal Cardwell Date: Sun, 7 Jan 2024 21:11:26 -0300 Subject: [PATCH 11/19] net-tcp: add fast_ack_mode=1: skip rwin check in @@ -33,7 +33,7 @@ Signed-off-by: Alexandre Frade fastopen_no_cookie:1, /* Allow send/recv SYN+data without a cookie */ --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c -@@ -3123,6 +3123,7 @@ int tcp_disconnect(struct sock *sk, int +@@ -3384,6 +3384,7 @@ int tcp_disconnect(struct sock *sk, int tp->rx_opt.dsack = 0; tp->rx_opt.num_sacks = 0; tp->rcv_ooopack = 0; @@ -53,7 +53,7 @@ Signed-off-by: Alexandre Frade if (tcp_ca_needs_ecn(sk)) --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c -@@ -5763,13 +5763,14 @@ static void __tcp_ack_snd_check(struct s +@@ -5770,13 +5770,14 @@ static void __tcp_ack_snd_check(struct s /* More than one full frame received... */ if (((tp->rcv_nxt - tp->rcv_wup) > inet_csk(sk)->icsk_ack.rcv_mss && diff --git a/debian/patches/misc-bbr3/0012-net-tcp_bbr-v2-record-app-limited-status-of-TLP-repa.patch b/debian/patches/misc-bbr3/0012-net-tcp_bbr-v2-record-app-limited-status-of-TLP-repa.patch index 07b0d0c..b2cf516 100644 --- a/debian/patches/misc-bbr3/0012-net-tcp_bbr-v2-record-app-limited-status-of-TLP-repa.patch +++ b/debian/patches/misc-bbr3/0012-net-tcp_bbr-v2-record-app-limited-status-of-TLP-repa.patch @@ -1,4 +1,4 @@ -From e5d35b7c882b7001f8a31b14c9f08917230dedc3 Mon Sep 17 00:00:00 2001 +From 687f09c22583ec5ef52aa93844248c9f93a2ce6e Mon Sep 17 00:00:00 2001 From: Jianfeng Wang Date: Fri, 19 Jun 2020 17:33:45 +0000 Subject: [PATCH 12/19] net-tcp_bbr: v2: record app-limited status of diff --git a/debian/patches/misc-bbr3/0013-net-tcp_bbr-v2-inform-CC-module-of-losses-repaired-b.patch b/debian/patches/misc-bbr3/0013-net-tcp_bbr-v2-inform-CC-module-of-losses-repaired-b.patch index 217eaea..d98665e 100644 --- a/debian/patches/misc-bbr3/0013-net-tcp_bbr-v2-inform-CC-module-of-losses-repaired-b.patch +++ b/debian/patches/misc-bbr3/0013-net-tcp_bbr-v2-inform-CC-module-of-losses-repaired-b.patch @@ -1,4 +1,4 @@ -From 77e7c22b63f8934206b1e89c173558c3967f0779 Mon Sep 17 00:00:00 2001 +From 024469ad0aec82573e1aa8f3dde55aeac4c35aee Mon Sep 17 00:00:00 2001 From: Jianfeng Wang Date: Tue, 16 Jun 2020 17:41:19 +0000 Subject: [PATCH 13/19] net-tcp_bbr: v2: inform CC module of losses repaired by @@ -25,7 +25,7 @@ Signed-off-by: Alexandre Frade --- a/include/net/tcp.h +++ b/include/net/tcp.h -@@ -1097,6 +1097,7 @@ enum tcp_ca_event { +@@ -1098,6 +1098,7 @@ enum tcp_ca_event { CA_EVENT_LOSS, /* loss timeout */ CA_EVENT_ECN_NO_CE, /* ECT set, but not CE marked */ CA_EVENT_ECN_IS_CE, /* received CE marked IP packet */ diff --git a/debian/patches/misc-bbr3/0014-net-tcp_bbr-v2-introduce-is_acking_tlp_retrans_seq-i.patch b/debian/patches/misc-bbr3/0014-net-tcp_bbr-v2-introduce-is_acking_tlp_retrans_seq-i.patch index 43a1ade..3ccb871 100644 --- a/debian/patches/misc-bbr3/0014-net-tcp_bbr-v2-introduce-is_acking_tlp_retrans_seq-i.patch +++ b/debian/patches/misc-bbr3/0014-net-tcp_bbr-v2-introduce-is_acking_tlp_retrans_seq-i.patch @@ -1,4 +1,4 @@ -From cab22a8e2e87870e8334a12ffcd0ba04ea81126f Mon Sep 17 00:00:00 2001 +From 31adbbdcafaeac73d39cae76c6d513fea28779f1 Mon Sep 17 00:00:00 2001 From: Neal Cardwell Date: Mon, 21 Sep 2020 14:46:26 -0400 Subject: [PATCH 14/19] net-tcp_bbr: v2: introduce is_acking_tlp_retrans_seq @@ -21,7 +21,7 @@ Signed-off-by: Alexandre Frade --- a/include/net/tcp.h +++ b/include/net/tcp.h -@@ -1161,6 +1161,7 @@ struct rate_sample { +@@ -1162,6 +1162,7 @@ struct rate_sample { u32 last_end_seq; /* end_seq of most recently ACKed packet */ bool is_app_limited; /* is sample from packet with bubble in pipe? */ bool is_retrans; /* is sample from retransmission? */ diff --git a/debian/patches/misc-bbr3/0015-tcp-introduce-per-route-feature-RTAX_FEATURE_ECN_LOW.patch b/debian/patches/misc-bbr3/0015-tcp-introduce-per-route-feature-RTAX_FEATURE_ECN_LOW.patch index 5271d85..ece00b4 100644 --- a/debian/patches/misc-bbr3/0015-tcp-introduce-per-route-feature-RTAX_FEATURE_ECN_LOW.patch +++ b/debian/patches/misc-bbr3/0015-tcp-introduce-per-route-feature-RTAX_FEATURE_ECN_LOW.patch @@ -1,4 +1,4 @@ -From 38dd25482f815d949fec91edd7694b2f15823f67 Mon Sep 17 00:00:00 2001 +From 5e219e6228cb7b13a7d9a1d05c6e4846363fd6fe Mon Sep 17 00:00:00 2001 From: David Morley Date: Fri, 14 Jul 2023 11:07:56 -0400 Subject: [PATCH 15/19] tcp: introduce per-route feature RTAX_FEATURE_ECN_LOW @@ -77,7 +77,7 @@ Signed-off-by: Alexandre Frade __u8 proto; --- a/net/ipv4/tcp_minisocks.c +++ b/net/ipv4/tcp_minisocks.c -@@ -459,6 +459,8 @@ void tcp_ca_openreq_child(struct sock *s +@@ -462,6 +462,8 @@ void tcp_ca_openreq_child(struct sock *s u32 ca_key = dst_metric(dst, RTAX_CC_ALGO); bool ca_got_dst = false; diff --git a/debian/patches/misc-bbr3/0016-net-tcp_bbr-v3-update-TCP-bbr-congestion-control-mod.patch b/debian/patches/misc-bbr3/0016-net-tcp_bbr-v3-update-TCP-bbr-congestion-control-mod.patch index f1ee5be..f33f884 100644 --- a/debian/patches/misc-bbr3/0016-net-tcp_bbr-v3-update-TCP-bbr-congestion-control-mod.patch +++ b/debian/patches/misc-bbr3/0016-net-tcp_bbr-v3-update-TCP-bbr-congestion-control-mod.patch @@ -1,4 +1,4 @@ -From 6e06d157aa50e3288c749919a81f04ec792d2d91 Mon Sep 17 00:00:00 2001 +From de7a1729144df5a664b32643fc2246da8021e01c Mon Sep 17 00:00:00 2001 From: Neal Cardwell Date: Tue, 11 Jun 2019 12:54:22 -0400 Subject: [PATCH 16/19] net-tcp_bbr: v3: update TCP "bbr" congestion control @@ -153,7 +153,7 @@ Signed-off-by: Alexandre Frade #define ICSK_TIME_RETRANS 1 /* Retransmit timer */ --- a/include/net/tcp.h +++ b/include/net/tcp.h -@@ -2473,7 +2473,7 @@ struct tcp_plb_state { +@@ -2474,7 +2474,7 @@ struct tcp_plb_state { u8 consec_cong_rounds:5, /* consecutive congested rounds */ unused:3; u32 pause_until; /* jiffies32 when PLB can resume rerouting */ @@ -196,7 +196,7 @@ Signed-off-by: Alexandre Frade union tcp_cc_info { --- a/net/ipv4/Kconfig +++ b/net/ipv4/Kconfig -@@ -668,15 +668,18 @@ config TCP_CONG_BBR +@@ -669,15 +669,18 @@ config TCP_CONG_BBR default n help diff --git a/debian/patches/misc-bbr3/0017-net-tcp_bbr-v3-ensure-ECN-enabled-BBR-flows-set-ECT-.patch b/debian/patches/misc-bbr3/0017-net-tcp_bbr-v3-ensure-ECN-enabled-BBR-flows-set-ECT-.patch index af8f105..5f7ff0d 100644 --- a/debian/patches/misc-bbr3/0017-net-tcp_bbr-v3-ensure-ECN-enabled-BBR-flows-set-ECT-.patch +++ b/debian/patches/misc-bbr3/0017-net-tcp_bbr-v3-ensure-ECN-enabled-BBR-flows-set-ECT-.patch @@ -1,4 +1,4 @@ -From 99e86f904f246ae9ec7a13d1b920eaf4a8c2d47b Mon Sep 17 00:00:00 2001 +From 8a87d0d851b9c06455a2def28fa8c2624ffa2e1a Mon Sep 17 00:00:00 2001 From: Adithya Abraham Philip Date: Fri, 11 Jun 2021 21:56:10 +0000 Subject: [PATCH 17/19] net-tcp_bbr: v3: ensure ECN-enabled BBR flows set ECT diff --git a/debian/patches/misc-bbr3/0018-tcp-export-TCPI_OPT_ECN_LOW-in-tcp_info-tcpi_options.patch b/debian/patches/misc-bbr3/0018-tcp-export-TCPI_OPT_ECN_LOW-in-tcp_info-tcpi_options.patch index a5d2395..f3593ad 100644 --- a/debian/patches/misc-bbr3/0018-tcp-export-TCPI_OPT_ECN_LOW-in-tcp_info-tcpi_options.patch +++ b/debian/patches/misc-bbr3/0018-tcp-export-TCPI_OPT_ECN_LOW-in-tcp_info-tcpi_options.patch @@ -1,4 +1,4 @@ -From 5d7cb61552d374bcaaa95022129b4ca1eace1c33 Mon Sep 17 00:00:00 2001 +From 4cd6a6f7a76a9acd5acc590dfbde3b1386a9e11e Mon Sep 17 00:00:00 2001 From: Neal Cardwell Date: Sun, 23 Jul 2023 23:25:34 -0400 Subject: [PATCH 18/19] tcp: export TCPI_OPT_ECN_LOW in tcp_info tcpi_options @@ -27,7 +27,7 @@ Signed-off-by: Alexandre Frade * Sender's congestion state indicating normal or abnormal situations --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c -@@ -3850,6 +3850,8 @@ void tcp_get_info(struct sock *sk, struc +@@ -4111,6 +4111,8 @@ void tcp_get_info(struct sock *sk, struc info->tcpi_options |= TCPI_OPT_ECN; if (tp->ecn_flags & TCP_ECN_SEEN) info->tcpi_options |= TCPI_OPT_ECN_SEEN; diff --git a/debian/patches/misc-bbr3/0019-x86-cfi-bpf-Add-tso_segs-and-skb_marked_lost-to-bpf_.patch b/debian/patches/misc-bbr3/0019-x86-cfi-bpf-Add-tso_segs-and-skb_marked_lost-to-bpf_.patch index 0fb0528..3895c18 100644 --- a/debian/patches/misc-bbr3/0019-x86-cfi-bpf-Add-tso_segs-and-skb_marked_lost-to-bpf_.patch +++ b/debian/patches/misc-bbr3/0019-x86-cfi-bpf-Add-tso_segs-and-skb_marked_lost-to-bpf_.patch @@ -1,4 +1,4 @@ -From 39838c2f0b09bec02004c092904aada85da2bc2e Mon Sep 17 00:00:00 2001 +From d53b209e5fcee3b3c53c30a4cc4fcc8e392a8fce Mon Sep 17 00:00:00 2001 From: Alexandre Frade Date: Mon, 11 Mar 2024 12:01:13 -0300 Subject: [PATCH 19/19] x86/cfi,bpf: Add tso_segs and skb_marked_lost to @@ -13,7 +13,7 @@ Signed-off-by: Alexandre Frade --- a/net/ipv4/bpf_tcp_ca.c +++ b/net/ipv4/bpf_tcp_ca.c -@@ -305,11 +305,15 @@ static void bpf_tcp_ca_pkts_acked(struct +@@ -280,11 +280,15 @@ static void bpf_tcp_ca_pkts_acked(struct { } @@ -30,7 +30,7 @@ Signed-off-by: Alexandre Frade static void bpf_tcp_ca_cong_control(struct sock *sk, u32 ack, int flag, const struct rate_sample *rs) { -@@ -340,7 +344,8 @@ static struct tcp_congestion_ops __bpf_o +@@ -315,7 +319,8 @@ static struct tcp_congestion_ops __bpf_o .cwnd_event = bpf_tcp_ca_cwnd_event, .in_ack_event = bpf_tcp_ca_in_ack_event, .pkts_acked = bpf_tcp_ca_pkts_acked, diff --git a/debian/patches/misc-ntsync5/0001-ntsync-Introduce-NTSYNC_IOC_WAIT_ANY.patch b/debian/patches/misc-ntsync5/0001-ntsync-Introduce-NTSYNC_IOC_WAIT_ANY.patch index 0072ea3..7768cda 100644 --- a/debian/patches/misc-ntsync5/0001-ntsync-Introduce-NTSYNC_IOC_WAIT_ANY.patch +++ b/debian/patches/misc-ntsync5/0001-ntsync-Introduce-NTSYNC_IOC_WAIT_ANY.patch @@ -135,7 +135,7 @@ Signed-off-by: Elizabeth Figura spin_unlock(&sem->lock); -@@ -141,6 +193,7 @@ static struct ntsync_obj *ntsync_alloc_o +@@ -140,6 +192,7 @@ static struct ntsync_obj *ntsync_alloc_o obj->dev = dev; get_file(dev->file); spin_lock_init(&obj->lock); @@ -143,7 +143,7 @@ Signed-off-by: Elizabeth Figura return obj; } -@@ -191,6 +244,196 @@ static int ntsync_create_sem(struct ntsy +@@ -190,6 +243,196 @@ static int ntsync_create_sem(struct ntsy return put_user(fd, &user_args->sem); } @@ -340,7 +340,7 @@ Signed-off-by: Elizabeth Figura static int ntsync_char_open(struct inode *inode, struct file *file) { struct ntsync_device *dev; -@@ -222,6 +465,8 @@ static long ntsync_char_ioctl(struct fil +@@ -221,6 +464,8 @@ static long ntsync_char_ioctl(struct fil switch (cmd) { case NTSYNC_IOC_CREATE_SEM: return ntsync_create_sem(dev, argp); diff --git a/debian/patches/misc-ntsync5/0002-ntsync-Introduce-NTSYNC_IOC_WAIT_ALL.patch b/debian/patches/misc-ntsync5/0002-ntsync-Introduce-NTSYNC_IOC_WAIT_ALL.patch index c3cc639..7b98085 100644 --- a/debian/patches/misc-ntsync5/0002-ntsync-Introduce-NTSYNC_IOC_WAIT_ALL.patch +++ b/debian/patches/misc-ntsync5/0002-ntsync-Introduce-NTSYNC_IOC_WAIT_ALL.patch @@ -322,7 +322,7 @@ Signed-off-by: Elizabeth Figura if (!ret && put_user(prev_count, user_args)) ret = -EFAULT; -@@ -194,6 +403,8 @@ static struct ntsync_obj *ntsync_alloc_o +@@ -193,6 +402,8 @@ static struct ntsync_obj *ntsync_alloc_o get_file(dev->file); spin_lock_init(&obj->lock); INIT_LIST_HEAD(&obj->any_waiters); @@ -331,7 +331,7 @@ Signed-off-by: Elizabeth Figura return obj; } -@@ -305,7 +516,7 @@ static int ntsync_schedule(const struct +@@ -304,7 +515,7 @@ static int ntsync_schedule(const struct * Allocate and initialize the ntsync_q structure, but do not queue us yet. */ static int setup_wait(struct ntsync_device *dev, @@ -340,7 +340,7 @@ Signed-off-by: Elizabeth Figura struct ntsync_q **ret_q) { const __u32 count = args->count; -@@ -328,6 +539,7 @@ static int setup_wait(struct ntsync_devi +@@ -327,6 +538,7 @@ static int setup_wait(struct ntsync_devi return -ENOMEM; q->task = current; atomic_set(&q->signaled, -1); @@ -348,7 +348,7 @@ Signed-off-by: Elizabeth Figura q->count = count; for (i = 0; i < count; i++) { -@@ -337,6 +549,16 @@ static int setup_wait(struct ntsync_devi +@@ -336,6 +548,16 @@ static int setup_wait(struct ntsync_devi if (!obj) goto err; @@ -365,7 +365,7 @@ Signed-off-by: Elizabeth Figura entry->obj = obj; entry->q = q; entry->index = i; -@@ -366,13 +588,14 @@ static int ntsync_wait_any(struct ntsync +@@ -365,13 +587,14 @@ static int ntsync_wait_any(struct ntsync struct ntsync_wait_args args; struct ntsync_q *q; int signaled; @@ -381,7 +381,7 @@ Signed-off-by: Elizabeth Figura if (ret < 0) return ret; -@@ -382,9 +605,9 @@ static int ntsync_wait_any(struct ntsync +@@ -381,9 +604,9 @@ static int ntsync_wait_any(struct ntsync struct ntsync_q_entry *entry = &q->entries[i]; struct ntsync_obj *obj = entry->obj; @@ -393,7 +393,7 @@ Signed-off-by: Elizabeth Figura } /* check if we are already signaled */ -@@ -395,9 +618,9 @@ static int ntsync_wait_any(struct ntsync +@@ -394,9 +617,9 @@ static int ntsync_wait_any(struct ntsync if (atomic_read(&q->signaled) != -1) break; @@ -405,7 +405,7 @@ Signed-off-by: Elizabeth Figura } /* sleep */ -@@ -410,13 +633,94 @@ static int ntsync_wait_any(struct ntsync +@@ -409,13 +632,94 @@ static int ntsync_wait_any(struct ntsync struct ntsync_q_entry *entry = &q->entries[i]; struct ntsync_obj *obj = entry->obj; @@ -502,7 +502,7 @@ Signed-off-by: Elizabeth Figura signaled = atomic_read(&q->signaled); if (signaled != -1) { struct ntsync_wait_args __user *user_args = argp; -@@ -442,6 +746,8 @@ static int ntsync_char_open(struct inode +@@ -441,6 +745,8 @@ static int ntsync_char_open(struct inode if (!dev) return -ENOMEM; @@ -511,7 +511,7 @@ Signed-off-by: Elizabeth Figura file->private_data = dev; dev->file = file; return nonseekable_open(inode, file); -@@ -465,6 +771,8 @@ static long ntsync_char_ioctl(struct fil +@@ -464,6 +770,8 @@ static long ntsync_char_ioctl(struct fil switch (cmd) { case NTSYNC_IOC_CREATE_SEM: return ntsync_create_sem(dev, argp); diff --git a/debian/patches/misc-ntsync5/0003-ntsync-Introduce-NTSYNC_IOC_CREATE_MUTEX.patch b/debian/patches/misc-ntsync5/0003-ntsync-Introduce-NTSYNC_IOC_CREATE_MUTEX.patch index 377e09d..e752503 100644 --- a/debian/patches/misc-ntsync5/0003-ntsync-Introduce-NTSYNC_IOC_CREATE_MUTEX.patch +++ b/debian/patches/misc-ntsync5/0003-ntsync-Introduce-NTSYNC_IOC_CREATE_MUTEX.patch @@ -121,7 +121,7 @@ Signed-off-by: Elizabeth Figura /* * Actually change the semaphore state, returning -EOVERFLOW if it is made * invalid. -@@ -455,6 +493,33 @@ static int ntsync_create_sem(struct ntsy +@@ -454,6 +492,33 @@ static int ntsync_create_sem(struct ntsy return put_user(fd, &user_args->sem); } @@ -155,7 +155,7 @@ Signed-off-by: Elizabeth Figura static struct ntsync_obj *get_obj(struct ntsync_device *dev, int fd) { struct file *file = fget(fd); -@@ -524,7 +589,7 @@ static int setup_wait(struct ntsync_devi +@@ -523,7 +588,7 @@ static int setup_wait(struct ntsync_devi struct ntsync_q *q; __u32 i, j; @@ -164,7 +164,7 @@ Signed-off-by: Elizabeth Figura return -EINVAL; if (args->count > NTSYNC_MAX_WAIT_COUNT) -@@ -538,6 +603,7 @@ static int setup_wait(struct ntsync_devi +@@ -537,6 +602,7 @@ static int setup_wait(struct ntsync_devi if (!q) return -ENOMEM; q->task = current; @@ -172,7 +172,7 @@ Signed-off-by: Elizabeth Figura atomic_set(&q->signaled, -1); q->all = all; q->count = count; -@@ -580,6 +646,9 @@ static void try_wake_any_obj(struct ntsy +@@ -579,6 +645,9 @@ static void try_wake_any_obj(struct ntsy case NTSYNC_TYPE_SEM: try_wake_any_sem(obj); break; @@ -182,7 +182,7 @@ Signed-off-by: Elizabeth Figura } } -@@ -769,6 +838,8 @@ static long ntsync_char_ioctl(struct fil +@@ -768,6 +837,8 @@ static long ntsync_char_ioctl(struct fil void __user *argp = (void __user *)parm; switch (cmd) { diff --git a/debian/patches/misc-ntsync5/0005-ntsync-Introduce-NTSYNC_IOC_MUTEX_KILL.patch b/debian/patches/misc-ntsync5/0005-ntsync-Introduce-NTSYNC_IOC_MUTEX_KILL.patch index 8eb42fe..954c32f 100644 --- a/debian/patches/misc-ntsync5/0005-ntsync-Introduce-NTSYNC_IOC_MUTEX_KILL.patch +++ b/debian/patches/misc-ntsync5/0005-ntsync-Introduce-NTSYNC_IOC_MUTEX_KILL.patch @@ -119,7 +119,7 @@ Signed-off-by: Elizabeth Figura default: return -ENOIOCTLCMD; } -@@ -659,6 +715,7 @@ static int setup_wait(struct ntsync_devi +@@ -658,6 +714,7 @@ static int setup_wait(struct ntsync_devi q->owner = args->owner; atomic_set(&q->signaled, -1); q->all = all; @@ -127,7 +127,7 @@ Signed-off-by: Elizabeth Figura q->count = count; for (i = 0; i < count; i++) { -@@ -767,7 +824,7 @@ static int ntsync_wait_any(struct ntsync +@@ -766,7 +823,7 @@ static int ntsync_wait_any(struct ntsync struct ntsync_wait_args __user *user_args = argp; /* even if we caught a signal, we need to communicate success */ @@ -136,7 +136,7 @@ Signed-off-by: Elizabeth Figura if (put_user(signaled, &user_args->index)) ret = -EFAULT; -@@ -848,7 +905,7 @@ static int ntsync_wait_all(struct ntsync +@@ -847,7 +904,7 @@ static int ntsync_wait_all(struct ntsync struct ntsync_wait_args __user *user_args = argp; /* even if we caught a signal, we need to communicate success */ diff --git a/debian/patches/misc-ntsync5/0006-ntsync-Introduce-NTSYNC_IOC_CREATE_EVENT.patch b/debian/patches/misc-ntsync5/0006-ntsync-Introduce-NTSYNC_IOC_CREATE_EVENT.patch index 5cbb5f2..84ab14e 100644 --- a/debian/patches/misc-ntsync5/0006-ntsync-Introduce-NTSYNC_IOC_CREATE_EVENT.patch +++ b/debian/patches/misc-ntsync5/0006-ntsync-Introduce-NTSYNC_IOC_CREATE_EVENT.patch @@ -91,7 +91,7 @@ Signed-off-by: Elizabeth Figura /* * Actually change the semaphore state, returning -EOVERFLOW if it is made * invalid. -@@ -629,6 +662,30 @@ static int ntsync_create_mutex(struct nt +@@ -628,6 +661,30 @@ static int ntsync_create_mutex(struct nt return put_user(fd, &user_args->mutex); } @@ -122,7 +122,7 @@ Signed-off-by: Elizabeth Figura static struct ntsync_obj *get_obj(struct ntsync_device *dev, int fd) { struct file *file = fget(fd); -@@ -759,6 +816,9 @@ static void try_wake_any_obj(struct ntsy +@@ -758,6 +815,9 @@ static void try_wake_any_obj(struct ntsy case NTSYNC_TYPE_MUTEX: try_wake_any_mutex(obj); break; @@ -132,7 +132,7 @@ Signed-off-by: Elizabeth Figura } } -@@ -948,6 +1008,8 @@ static long ntsync_char_ioctl(struct fil +@@ -947,6 +1007,8 @@ static long ntsync_char_ioctl(struct fil void __user *argp = (void __user *)parm; switch (cmd) { diff --git a/debian/patches/misc-ntsync5/0013-ntsync-Introduce-alertable-waits.patch b/debian/patches/misc-ntsync5/0013-ntsync-Introduce-alertable-waits.patch index 88580a0..6908cf4 100644 --- a/debian/patches/misc-ntsync5/0013-ntsync-Introduce-alertable-waits.patch +++ b/debian/patches/misc-ntsync5/0013-ntsync-Introduce-alertable-waits.patch @@ -21,7 +21,7 @@ Signed-off-by: Elizabeth Figura --- a/drivers/misc/ntsync.c +++ b/drivers/misc/ntsync.c -@@ -885,22 +885,29 @@ static int setup_wait(struct ntsync_devi +@@ -884,22 +884,29 @@ static int setup_wait(struct ntsync_devi const struct ntsync_wait_args *args, bool all, struct ntsync_q **ret_q) { @@ -54,7 +54,7 @@ Signed-off-by: Elizabeth Figura if (!q) return -ENOMEM; q->task = current; -@@ -910,7 +917,7 @@ static int setup_wait(struct ntsync_devi +@@ -909,7 +916,7 @@ static int setup_wait(struct ntsync_devi q->ownerdead = false; q->count = count; @@ -63,7 +63,7 @@ Signed-off-by: Elizabeth Figura struct ntsync_q_entry *entry = &q->entries[i]; struct ntsync_obj *obj = get_obj(dev, fds[i]); -@@ -960,10 +967,10 @@ static void try_wake_any_obj(struct ntsy +@@ -959,10 +966,10 @@ static void try_wake_any_obj(struct ntsy static int ntsync_wait_any(struct ntsync_device *dev, void __user *argp) { struct ntsync_wait_args args; @@ -75,7 +75,7 @@ Signed-off-by: Elizabeth Figura int ret; if (copy_from_user(&args, argp, sizeof(args))) -@@ -973,9 +980,13 @@ static int ntsync_wait_any(struct ntsync +@@ -972,9 +979,13 @@ static int ntsync_wait_any(struct ntsync if (ret < 0) return ret; @@ -90,7 +90,7 @@ Signed-off-by: Elizabeth Figura struct ntsync_q_entry *entry = &q->entries[i]; struct ntsync_obj *obj = entry->obj; -@@ -984,9 +995,15 @@ static int ntsync_wait_any(struct ntsync +@@ -983,9 +994,15 @@ static int ntsync_wait_any(struct ntsync ntsync_unlock_obj(dev, obj, all); } @@ -108,7 +108,7 @@ Signed-off-by: Elizabeth Figura struct ntsync_obj *obj = q->entries[i].obj; if (atomic_read(&q->signaled) != -1) -@@ -1003,7 +1020,7 @@ static int ntsync_wait_any(struct ntsync +@@ -1002,7 +1019,7 @@ static int ntsync_wait_any(struct ntsync /* and finally, unqueue */ @@ -117,7 +117,7 @@ Signed-off-by: Elizabeth Figura struct ntsync_q_entry *entry = &q->entries[i]; struct ntsync_obj *obj = entry->obj; -@@ -1063,6 +1080,14 @@ static int ntsync_wait_all(struct ntsync +@@ -1062,6 +1079,14 @@ static int ntsync_wait_all(struct ntsync */ list_add_tail(&entry->node, &obj->all_waiters); } @@ -132,7 +132,7 @@ Signed-off-by: Elizabeth Figura /* check if we are already signaled */ -@@ -1070,6 +1095,21 @@ static int ntsync_wait_all(struct ntsync +@@ -1069,6 +1094,21 @@ static int ntsync_wait_all(struct ntsync mutex_unlock(&dev->wait_all_lock); @@ -154,7 +154,7 @@ Signed-off-by: Elizabeth Figura /* sleep */ ret = ntsync_schedule(q, &args); -@@ -1095,6 +1135,18 @@ static int ntsync_wait_all(struct ntsync +@@ -1094,6 +1134,18 @@ static int ntsync_wait_all(struct ntsync mutex_unlock(&dev->wait_all_lock); diff --git a/debian/patches/misc-ntsync5/0014-maintainers-Add-an-entry-for-ntsync.patch b/debian/patches/misc-ntsync5/0014-maintainers-Add-an-entry-for-ntsync.patch index 8baae5c..4b424a3 100644 --- a/debian/patches/misc-ntsync5/0014-maintainers-Add-an-entry-for-ntsync.patch +++ b/debian/patches/misc-ntsync5/0014-maintainers-Add-an-entry-for-ntsync.patch @@ -12,7 +12,7 @@ Signed-off-by: Elizabeth Figura --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -16319,6 +16319,15 @@ T: git https://github.com/Paragon-Softwa +@@ -16486,6 +16486,15 @@ T: git https://github.com/Paragon-Softwa F: Documentation/filesystems/ntfs3.rst F: fs/ntfs3/ diff --git a/debian/patches/misc-ntsync5/0016-Revert-misc-ntsync-mark-driver-as-broken-to-prevent-.patch b/debian/patches/misc-ntsync5/0016-Revert-misc-ntsync-mark-driver-as-broken-to-prevent-.patch index b46522c..208a441 100644 --- a/debian/patches/misc-ntsync5/0016-Revert-misc-ntsync-mark-driver-as-broken-to-prevent-.patch +++ b/debian/patches/misc-ntsync5/0016-Revert-misc-ntsync-mark-driver-as-broken-to-prevent-.patch @@ -11,7 +11,7 @@ This reverts commit f5b335dc025cfee90957efa90dc72fada0d5abb4. --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig -@@ -507,7 +507,6 @@ config OPEN_DICE +@@ -517,7 +517,6 @@ config OPEN_DICE config NTSYNC tristate "NT synchronization primitive emulation" diff --git a/debian/patches/misc-openwrt/0002-net-enable-fraglist-GRO-by-default.patch b/debian/patches/misc-openwrt/0002-net-enable-fraglist-GRO-by-default.patch deleted file mode 100644 index 51f9900..0000000 --- a/debian/patches/misc-openwrt/0002-net-enable-fraglist-GRO-by-default.patch +++ /dev/null @@ -1,24 +0,0 @@ -From: Felix Fietkau -Date: Tue, 23 Apr 2024 12:35:21 +0200 -Subject: [PATCH] net: enable fraglist GRO by default - -This can significantly improve performance for packet forwarding/bridging - -Signed-off-by: Felix Fietkau ---- - ---- a/include/linux/netdev_features.h -+++ b/include/linux/netdev_features.h -@@ -242,10 +242,10 @@ static inline int find_next_netdev_featu - #define NETIF_F_UPPER_DISABLES NETIF_F_LRO - - /* changeable features with no special hardware requirements */ --#define NETIF_F_SOFT_FEATURES (NETIF_F_GSO | NETIF_F_GRO) -+#define NETIF_F_SOFT_FEATURES (NETIF_F_GSO | NETIF_F_GRO | NETIF_F_GRO_FRAGLIST) - - /* Changeable features with no special hardware requirements that defaults to off. */ --#define NETIF_F_SOFT_FEATURES_OFF (NETIF_F_GRO_FRAGLIST | NETIF_F_GRO_UDP_FWD) -+#define NETIF_F_SOFT_FEATURES_OFF (NETIF_F_GRO_UDP_FWD) - - #define NETIF_F_VLAN_FEATURES (NETIF_F_HW_VLAN_CTAG_FILTER | \ - NETIF_F_HW_VLAN_CTAG_RX | \ diff --git a/debian/patches/misc-openwrt/0003-net-remove-NETIF_F_GSO_FRAGLIST-from-NETIF_F_GSO_SOF.patch b/debian/patches/misc-openwrt/0003-net-remove-NETIF_F_GSO_FRAGLIST-from-NETIF_F_GSO_SOF.patch deleted file mode 100644 index b4b2728..0000000 --- a/debian/patches/misc-openwrt/0003-net-remove-NETIF_F_GSO_FRAGLIST-from-NETIF_F_GSO_SOF.patch +++ /dev/null @@ -1,129 +0,0 @@ -From: Felix Fietkau -Date: Thu, 15 Aug 2024 21:15:13 +0200 -Subject: [PATCH] net: remove NETIF_F_GSO_FRAGLIST from NETIF_F_GSO_SOFTWARE - -Several drivers set NETIF_F_GSO_SOFTWARE, but mangle fraglist GRO packets -in a way that they can't be properly segmented anymore. -In order to properly deal with this, remove fraglist GSO from -NETIF_F_GSO_SOFTWARE and switch to NETIF_F_GSO_SOFTWARE_ALL (which includes -fraglist GSO) in places where it's safe to add. - -Signed-off-by: Felix Fietkau ---- - ---- a/drivers/net/dummy.c -+++ b/drivers/net/dummy.c -@@ -110,7 +110,7 @@ static void dummy_setup(struct net_devic - dev->flags &= ~IFF_MULTICAST; - dev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_NO_QUEUE; - dev->features |= NETIF_F_SG | NETIF_F_FRAGLIST; -- dev->features |= NETIF_F_GSO_SOFTWARE; -+ dev->features |= NETIF_F_GSO_SOFTWARE_ALL; - dev->features |= NETIF_F_HW_CSUM | NETIF_F_HIGHDMA | NETIF_F_LLTX; - dev->features |= NETIF_F_GSO_ENCAP_ALL; - dev->hw_features |= dev->features; ---- a/drivers/net/loopback.c -+++ b/drivers/net/loopback.c -@@ -172,7 +172,7 @@ static void gen_lo_setup(struct net_devi - dev->flags = IFF_LOOPBACK; - dev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_NO_QUEUE; - netif_keep_dst(dev); -- dev->hw_features = NETIF_F_GSO_SOFTWARE; -+ dev->hw_features = NETIF_F_GSO_SOFTWARE_ALL; - dev->features = NETIF_F_SG | NETIF_F_FRAGLIST - | NETIF_F_GSO_SOFTWARE - | NETIF_F_HW_CSUM ---- a/drivers/net/macvlan.c -+++ b/drivers/net/macvlan.c -@@ -897,7 +897,7 @@ static int macvlan_hwtstamp_set(struct n - static struct lock_class_key macvlan_netdev_addr_lock_key; - - #define ALWAYS_ON_OFFLOADS \ -- (NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_GSO_SOFTWARE | \ -+ (NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_GSO_SOFTWARE_ALL | \ - NETIF_F_GSO_ROBUST | NETIF_F_GSO_ENCAP_ALL) - - #define ALWAYS_ON_FEATURES (ALWAYS_ON_OFFLOADS | NETIF_F_LLTX) ---- a/include/linux/netdev_features.h -+++ b/include/linux/netdev_features.h -@@ -219,13 +219,14 @@ static inline int find_next_netdev_featu - - /* List of features with software fallbacks. */ - #define NETIF_F_GSO_SOFTWARE (NETIF_F_ALL_TSO | NETIF_F_GSO_SCTP | \ -- NETIF_F_GSO_UDP_L4 | NETIF_F_GSO_FRAGLIST) -+ NETIF_F_GSO_UDP_L4) -+#define NETIF_F_GSO_SOFTWARE_ALL (NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_FRAGLIST) - - /* - * If one device supports one of these features, then enable them - * for all in netdev_increment_features. - */ --#define NETIF_F_ONE_FOR_ALL (NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_ROBUST | \ -+#define NETIF_F_ONE_FOR_ALL (NETIF_F_GSO_SOFTWARE_ALL | NETIF_F_GSO_ROBUST | \ - NETIF_F_SG | NETIF_F_HIGHDMA | \ - NETIF_F_FRAGLIST | NETIF_F_VLAN_CHALLENGED) - ---- a/net/8021q/vlan.h -+++ b/net/8021q/vlan.h -@@ -108,7 +108,7 @@ static inline netdev_features_t vlan_tnl - netdev_features_t ret; - - ret = real_dev->hw_enc_features & -- (NETIF_F_CSUM_MASK | NETIF_F_GSO_SOFTWARE | -+ (NETIF_F_CSUM_MASK | NETIF_F_GSO_SOFTWARE_ALL | - NETIF_F_GSO_ENCAP_ALL); - - if ((ret & NETIF_F_GSO_ENCAP_ALL) && (ret & NETIF_F_CSUM_MASK)) ---- a/net/8021q/vlan_dev.c -+++ b/net/8021q/vlan_dev.c -@@ -561,7 +561,7 @@ static int vlan_dev_init(struct net_devi - dev->state |= (1 << __LINK_STATE_NOCARRIER); - - dev->hw_features = NETIF_F_HW_CSUM | NETIF_F_SG | -- NETIF_F_FRAGLIST | NETIF_F_GSO_SOFTWARE | -+ NETIF_F_FRAGLIST | NETIF_F_GSO_SOFTWARE_ALL | - NETIF_F_GSO_ENCAP_ALL | - NETIF_F_HIGHDMA | NETIF_F_SCTP_CRC | - NETIF_F_ALL_FCOE; -@@ -654,7 +654,7 @@ static netdev_features_t vlan_dev_fix_fe - if (lower_features & (NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM)) - lower_features |= NETIF_F_HW_CSUM; - features = netdev_intersect_features(features, lower_features); -- features |= old_features & (NETIF_F_SOFT_FEATURES | NETIF_F_GSO_SOFTWARE); -+ features |= old_features & (NETIF_F_SOFT_FEATURES | NETIF_F_GSO_SOFTWARE_ALL); - features |= NETIF_F_LLTX; - - return features; ---- a/net/core/sock.c -+++ b/net/core/sock.c -@@ -2451,7 +2451,7 @@ void sk_setup_caps(struct sock *sk, stru - if (sk_is_tcp(sk)) - sk->sk_route_caps |= NETIF_F_GSO; - if (sk->sk_route_caps & NETIF_F_GSO) -- sk->sk_route_caps |= NETIF_F_GSO_SOFTWARE; -+ sk->sk_route_caps |= NETIF_F_GSO_SOFTWARE_ALL; - if (unlikely(sk->sk_gso_disabled)) - sk->sk_route_caps &= ~NETIF_F_GSO_MASK; - if (sk_can_gso(sk)) { ---- a/net/mac80211/ieee80211_i.h -+++ b/net/mac80211/ieee80211_i.h -@@ -2010,7 +2010,7 @@ void ieee80211_color_collision_detection - /* interface handling */ - #define MAC80211_SUPPORTED_FEATURES_TX (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | \ - NETIF_F_HW_CSUM | NETIF_F_SG | \ -- NETIF_F_HIGHDMA | NETIF_F_GSO_SOFTWARE | \ -+ NETIF_F_HIGHDMA | NETIF_F_GSO_SOFTWARE_ALL | \ - NETIF_F_HW_TC) - #define MAC80211_SUPPORTED_FEATURES_RX (NETIF_F_RXCSUM) - #define MAC80211_SUPPORTED_FEATURES (MAC80211_SUPPORTED_FEATURES_TX | \ ---- a/net/openvswitch/vport-internal_dev.c -+++ b/net/openvswitch/vport-internal_dev.c -@@ -109,7 +109,7 @@ static void do_setup(struct net_device * - - netdev->features = NETIF_F_LLTX | NETIF_F_SG | NETIF_F_FRAGLIST | - NETIF_F_HIGHDMA | NETIF_F_HW_CSUM | -- NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_ENCAP_ALL; -+ NETIF_F_GSO_SOFTWARE_ALL | NETIF_F_GSO_ENCAP_ALL; - - netdev->vlan_features = netdev->features; - netdev->hw_enc_features = netdev->features; diff --git a/debian/patches/mixed-arch/0001-ZEN-Add-graysky-s-more-ISA-levels-and-uarches.patch b/debian/patches/mixed-arch/0001-ZEN-Add-graysky-s-more-ISA-levels-and-uarches.patch index e142f9b..e7bf781 100644 --- a/debian/patches/mixed-arch/0001-ZEN-Add-graysky-s-more-ISA-levels-and-uarches.patch +++ b/debian/patches/mixed-arch/0001-ZEN-Add-graysky-s-more-ISA-levels-and-uarches.patch @@ -1,14 +1,14 @@ -From a657df31affbb91d8cb2718e70f42cf8ed6e9a7c Mon Sep 17 00:00:00 2001 +From 421120bda34d994c5e0e07a89e2f9c40c53e8e87 Mon Sep 17 00:00:00 2001 From: graysky Date: Mon, 16 Sep 2024 05:55:58 -0400 -Subject: ZEN: Add graysky's more-ISA-levels-and-uarches +Subject: ZEN: Add graysky's more-uarches MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From https://github.com/graysky2/kernel_compiler_patch -more-ISA-levels-and-uarches-for-kernel-6.8-rc4+.patch +more-ISA-levels-and-uarches-for-kernel-6.1.79+.patch FEATURES This patch adds additional tunings via new x86-64 ISA levels and @@ -111,7 +111,7 @@ See the following experimental evidence supporting this statement: https://github.com/graysky2/kernel_compiler_patch?tab=readme-ov-file#benchmarks REQUIREMENTS -linux version 6.8-rc3+ +linux version 6.1.79+ gcc version >=9.0 or clang version >=9.0 ACKNOWLEDGMENTS @@ -123,10 +123,10 @@ REFERENCES 3. https://github.com/graysky2/kernel_gcc_patch/issues/15 4. http://www.linuxforge.net/docs/linux/linux-gcc.php --- - arch/x86/Kconfig.cpu | 363 ++++++++++++++++++++++++++++++-- - arch/x86/Makefile | 89 +++++++- - arch/x86/include/asm/vermagic.h | 70 ++++++ - 3 files changed, 506 insertions(+), 16 deletions(-) + arch/x86/Kconfig.cpu | 359 ++++++++++++++++++++++++++++++-- + arch/x86/Makefile | 87 +++++++- + arch/x86/include/asm/vermagic.h | 70 +++++++ + 3 files changed, 499 insertions(+), 17 deletions(-) --- a/arch/x86/Kconfig.cpu +++ b/arch/x86/Kconfig.cpu @@ -483,7 +483,7 @@ REFERENCES config GENERIC_CPU bool "Generic-x86-64" -@@ -294,8 +581,32 @@ config GENERIC_CPU +@@ -294,6 +581,26 @@ config GENERIC_CPU Generic x86-64 CPU. Run equally well on all x86-64 CPUs. @@ -509,14 +509,8 @@ REFERENCES + endchoice -+config SUPPORT_MARCH_CODEVERS -+ bool -+ default y if (CC_IS_GCC && GCC_VERSION > 110000) || (CC_IS_CLANG && CLANG_VERSION >= 120000) -+ config X86_GENERIC - bool "Generic x86 support" - depends on X86_32 -@@ -308,6 +619,30 @@ config X86_GENERIC +@@ -308,6 +615,30 @@ config X86_GENERIC This is really intended for distributors who need more generic optimizations. @@ -547,7 +541,7 @@ REFERENCES # # Define implied options from the CPU selection here config X86_INTERNODE_CACHE_SHIFT -@@ -318,7 +653,7 @@ config X86_INTERNODE_CACHE_SHIFT +@@ -318,7 +649,7 @@ config X86_INTERNODE_CACHE_SHIFT config X86_L1_CACHE_SHIFT int default "7" if MPENTIUM4 || MPSC @@ -556,7 +550,7 @@ REFERENCES default "4" if MELAN || M486SX || M486 || MGEODEGX1 default "5" if MWINCHIP3D || MWINCHIPC6 || MCRUSOE || MEFFICEON || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586 || MVIAC3_2 || MGEODE_LX -@@ -336,11 +671,11 @@ config X86_ALIGNMENT_16 +@@ -336,11 +667,11 @@ config X86_ALIGNMENT_16 config X86_INTEL_USERCOPY def_bool y @@ -572,11 +566,13 @@ REFERENCES # P6_NOPs are a relatively minor optimization that require a family >= --- a/arch/x86/Makefile +++ b/arch/x86/Makefile -@@ -179,14 +179,99 @@ else +@@ -182,15 +182,96 @@ else + cflags-$(CONFIG_MK8) += -march=k8 cflags-$(CONFIG_MPSC) += -march=nocona cflags-$(CONFIG_MCORE2) += -march=core2 - cflags-$(CONFIG_MATOM) += -march=atom +- cflags-$(CONFIG_MATOM) += -march=atom - cflags-$(CONFIG_GENERIC_CPU) += -mtune=generic ++ cflags-$(CONFIG_MATOM) += -march=bonnell + ifeq ($(CONFIG_X86_64_VERSION),1) + cflags-$(CONFIG_GENERIC_CPU) += -mtune=generic + rustflags-$(CONFIG_GENERIC_CPU) += -Ztune-cpu=generic @@ -600,8 +596,6 @@ REFERENCES + cflags-$(CONFIG_MZEN5) += -march=znver5 + cflags-$(CONFIG_MNATIVE_INTEL) += -march=native + cflags-$(CONFIG_MNATIVE_AMD) += -march=native -mno-tbm -+ cflags-$(CONFIG_MATOM) += -march=bonnell -+ cflags-$(CONFIG_MCORE2) += -march=core2 + cflags-$(CONFIG_MNEHALEM) += -march=nehalem + cflags-$(CONFIG_MWESTMERE) += -march=westmere + cflags-$(CONFIG_MSILVERMONT) += -march=silvermont @@ -647,8 +641,6 @@ REFERENCES + rustflags-$(CONFIG_MZEN5) += -Ctarget-cpu=znver5 + rustflags-$(CONFIG_MNATIVE_INTEL) += -Ctarget-cpu=native + rustflags-$(CONFIG_MNATIVE_AMD) += -Ctarget-cpu=native -+ rustflags-$(CONFIG_MATOM) += -Ctarget-cpu=bonnell -+ rustflags-$(CONFIG_MCORE2) += -Ctarget-cpu=core2 + rustflags-$(CONFIG_MNEHALEM) += -Ctarget-cpu=nehalem + rustflags-$(CONFIG_MWESTMERE) += -Ctarget-cpu=westmere + rustflags-$(CONFIG_MSILVERMONT) += -Ctarget-cpu=silvermont diff --git a/debian/patches/mixed-arch/0002-ZEN-Fixup-graysky-s-more-ISA-levels-and-uarches.patch b/debian/patches/mixed-arch/0002-ZEN-Fixup-graysky-s-more-ISA-levels-and-uarches.patch deleted file mode 100644 index 65ca255..0000000 --- a/debian/patches/mixed-arch/0002-ZEN-Fixup-graysky-s-more-ISA-levels-and-uarches.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 44295ad130b8735cecb288dd7463a14892803d9b Mon Sep 17 00:00:00 2001 -From: "Jan Alexander Steffens (heftig)" -Date: Tue, 1 Oct 2024 02:05:12 +0200 -Subject: ZEN: Fixup graysky's more-ISA-levels-and-uarches - -See: https://github.com/graysky2/kernel_compiler_patch/issues/105 ---- - arch/x86/Kconfig.cpu | 4 ---- - arch/x86/Makefile | 4 ---- - arch/x86/include/asm/vermagic.h | 6 ++++++ - 3 files changed, 6 insertions(+), 8 deletions(-) - ---- a/arch/x86/Kconfig.cpu -+++ b/arch/x86/Kconfig.cpu -@@ -603,10 +603,6 @@ config MNATIVE_AMD - - endchoice - --config SUPPORT_MARCH_CODEVERS -- bool -- default y if (CC_IS_GCC && GCC_VERSION > 110000) || (CC_IS_CLANG && CLANG_VERSION >= 120000) -- - config X86_GENERIC - bool "Generic x86 support" - depends on X86_32 ---- a/arch/x86/Makefile -+++ b/arch/x86/Makefile -@@ -177,8 +177,6 @@ else - # FIXME - should be integrated in Makefile.cpu (Makefile_32.cpu) - cflags-$(CONFIG_MK8) += -march=k8 - cflags-$(CONFIG_MPSC) += -march=nocona -- cflags-$(CONFIG_MCORE2) += -march=core2 -- cflags-$(CONFIG_MATOM) += -march=atom - ifeq ($(CONFIG_X86_64_VERSION),1) - cflags-$(CONFIG_GENERIC_CPU) += -mtune=generic - rustflags-$(CONFIG_GENERIC_CPU) += -Ztune-cpu=generic -@@ -230,8 +228,6 @@ else - - rustflags-$(CONFIG_MK8) += -Ctarget-cpu=k8 - rustflags-$(CONFIG_MPSC) += -Ctarget-cpu=nocona -- rustflags-$(CONFIG_MCORE2) += -Ctarget-cpu=core2 -- rustflags-$(CONFIG_MATOM) += -Ctarget-cpu=atom - rustflags-$(CONFIG_MK8SSE3) += -Ctarget-cpu=k8-sse3 - rustflags-$(CONFIG_MK10) += -Ctarget-cpu=amdfam10 - rustflags-$(CONFIG_MBARCELONA) += -Ctarget-cpu=barcelona ---- a/arch/x86/include/asm/vermagic.h -+++ b/arch/x86/include/asm/vermagic.h -@@ -105,6 +105,12 @@ - #define MODULE_PROC_FAMILY "ZEN " - #elif defined CONFIG_MZEN2 - #define MODULE_PROC_FAMILY "ZEN2 " -+#elif defined CONFIG_MZEN3 -+#define MODULE_PROC_FAMILY "ZEN3 " -+#elif defined CONFIG_MZEN4 -+#define MODULE_PROC_FAMILY "ZEN4 " -+#elif defined CONFIG_MZEN5 -+#define MODULE_PROC_FAMILY "ZEN5 " - #elif defined CONFIG_MELAN - #define MODULE_PROC_FAMILY "ELAN " - #elif defined CONFIG_MCRUSOE diff --git a/debian/patches/mixed-arch/0003-ZEN-Restore-CONFIG_OPTIMIZE_FOR_PERFORMANCE_O3.patch b/debian/patches/mixed-arch/0002-ZEN-Restore-CONFIG_OPTIMIZE_FOR_PERFORMANCE_O3.patch similarity index 86% rename from debian/patches/mixed-arch/0003-ZEN-Restore-CONFIG_OPTIMIZE_FOR_PERFORMANCE_O3.patch rename to debian/patches/mixed-arch/0002-ZEN-Restore-CONFIG_OPTIMIZE_FOR_PERFORMANCE_O3.patch index f6dee20..aecbdf6 100644 --- a/debian/patches/mixed-arch/0003-ZEN-Restore-CONFIG_OPTIMIZE_FOR_PERFORMANCE_O3.patch +++ b/debian/patches/mixed-arch/0002-ZEN-Restore-CONFIG_OPTIMIZE_FOR_PERFORMANCE_O3.patch @@ -1,4 +1,4 @@ -From 8dc948926f5b68b16a6a47a8f6e0a2154ac8ef3e Mon Sep 17 00:00:00 2001 +From 1fc1195e784540ad1966b57267fc927a87c5d21d Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Sun, 11 Dec 2022 23:51:16 +0100 Subject: ZEN: Restore CONFIG_OPTIMIZE_FOR_PERFORMANCE_O3 @@ -13,7 +13,7 @@ dependency on CONFIG_ARC and adds RUSTFLAGS. --- a/Makefile +++ b/Makefile -@@ -814,6 +814,9 @@ KBUILD_CFLAGS += -fno-delete-null-pointe +@@ -812,6 +812,9 @@ KBUILD_CFLAGS += -fno-delete-null-pointe ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE KBUILD_CFLAGS += -O2 KBUILD_RUSTFLAGS += -Copt-level=2 @@ -25,7 +25,7 @@ dependency on CONFIG_ARC and adds RUSTFLAGS. KBUILD_RUSTFLAGS += -Copt-level=s --- a/init/Kconfig +++ b/init/Kconfig -@@ -1416,6 +1416,12 @@ config CC_OPTIMIZE_FOR_PERFORMANCE +@@ -1451,6 +1451,12 @@ config CC_OPTIMIZE_FOR_PERFORMANCE with the "-O2" compiler flag for best performance and most helpful compile-time warnings. diff --git a/debian/patches/mixed-arch/0003-krd-adjust-CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3.patch b/debian/patches/mixed-arch/0003-krd-adjust-CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3.patch new file mode 100644 index 0000000..9e28451 --- /dev/null +++ b/debian/patches/mixed-arch/0003-krd-adjust-CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3.patch @@ -0,0 +1,13 @@ +--- a/Makefile ++++ b/Makefile +@@ -820,6 +820,10 @@ KBUILD_CFLAGS += -Os + KBUILD_RUSTFLAGS += -Copt-level=s + endif + ++ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3 ++KBUILD_CFLAGS += $(call cc-option,-fivopts) ++endif ++ + # Always set `debug-assertions` and `overflow-checks` because their default + # depends on `opt-level` and `debug-assertions`, respectively. + KBUILD_RUSTFLAGS += -Cdebug-assertions=$(if $(CONFIG_RUST_DEBUG_ASSERTIONS),y,n) diff --git a/debian/patches/mixed-arch/0005-XANMOD-x86-build-Prevent-generating-avx2-and-avx512-.patch b/debian/patches/mixed-arch/0004-XANMOD-x86-build-Prevent-generating-avx2-and-avx512-.patch similarity index 96% rename from debian/patches/mixed-arch/0005-XANMOD-x86-build-Prevent-generating-avx2-and-avx512-.patch rename to debian/patches/mixed-arch/0004-XANMOD-x86-build-Prevent-generating-avx2-and-avx512-.patch index b66b0b9..f90593e 100644 --- a/debian/patches/mixed-arch/0005-XANMOD-x86-build-Prevent-generating-avx2-and-avx512-.patch +++ b/debian/patches/mixed-arch/0004-XANMOD-x86-build-Prevent-generating-avx2-and-avx512-.patch @@ -11,7 +11,7 @@ Signed-off-by: Alexandre Frade --- a/arch/x86/Makefile +++ b/arch/x86/Makefile -@@ -70,9 +70,9 @@ export BITS +@@ -74,9 +74,9 @@ export BITS # # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53383 # diff --git a/debian/patches/mixed-arch/0004-krd-adjust-CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3.patch b/debian/patches/mixed-arch/0004-krd-adjust-CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3.patch deleted file mode 100644 index 2507221..0000000 --- a/debian/patches/mixed-arch/0004-krd-adjust-CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/Makefile -+++ b/Makefile -@@ -815,7 +815,7 @@ ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE - KBUILD_CFLAGS += -O2 - KBUILD_RUSTFLAGS += -Copt-level=2 - else ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3 --KBUILD_CFLAGS += -O3 -+KBUILD_CFLAGS += -O3 $(call cc-option,-fivopts) - KBUILD_RUSTFLAGS += -Copt-level=3 - else ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE - KBUILD_CFLAGS += -Os diff --git a/debian/patches/mixed-arch/0006-krd-adjust-KBUILD_CFLAGS-fno-tree-vectorize.patch b/debian/patches/mixed-arch/0005-krd-adjust-KBUILD_CFLAGS-fno-tree-vectorize.patch similarity index 94% rename from debian/patches/mixed-arch/0006-krd-adjust-KBUILD_CFLAGS-fno-tree-vectorize.patch rename to debian/patches/mixed-arch/0005-krd-adjust-KBUILD_CFLAGS-fno-tree-vectorize.patch index 58c9da1..1ea5c2a 100644 --- a/debian/patches/mixed-arch/0006-krd-adjust-KBUILD_CFLAGS-fno-tree-vectorize.patch +++ b/debian/patches/mixed-arch/0005-krd-adjust-KBUILD_CFLAGS-fno-tree-vectorize.patch @@ -1,6 +1,6 @@ --- a/arch/x86/Makefile +++ b/arch/x86/Makefile -@@ -70,7 +70,7 @@ export BITS +@@ -74,7 +74,7 @@ export BITS # # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53383 # diff --git a/debian/patches/patchset-xanmod/xanmod/0001-XANMOD-kbuild-Add-GCC-SMS-based-modulo-scheduling-fl.patch b/debian/patches/mixed-arch/0006-XANMOD-kbuild-Add-GCC-SMS-based-modulo-scheduling-fl.patch similarity index 67% rename from debian/patches/patchset-xanmod/xanmod/0001-XANMOD-kbuild-Add-GCC-SMS-based-modulo-scheduling-fl.patch rename to debian/patches/mixed-arch/0006-XANMOD-kbuild-Add-GCC-SMS-based-modulo-scheduling-fl.patch index 967c233..27480d7 100644 --- a/debian/patches/patchset-xanmod/xanmod/0001-XANMOD-kbuild-Add-GCC-SMS-based-modulo-scheduling-fl.patch +++ b/debian/patches/mixed-arch/0006-XANMOD-kbuild-Add-GCC-SMS-based-modulo-scheduling-fl.patch @@ -1,24 +1,26 @@ -From 2a949c896ea66e647d94254c28b1d4d6194ee14b Mon Sep 17 00:00:00 2001 +From dccbc0ca6c05ae315967a603870d553c231a68a1 Mon Sep 17 00:00:00 2001 From: Alexandre Frade Date: Mon, 16 Sep 2024 00:55:35 +0000 -Subject: [PATCH 03/19] XANMOD: kbuild: Add GCC SMS-based modulo scheduling +Subject: [PATCH 02/18] XANMOD: kbuild: Add GCC SMS-based modulo scheduling flags Signed-off-by: Alexandre Frade --- - Makefile | 5 +++++ - 1 file changed, 5 insertions(+) + Makefile | 7 ++++ + 1 file changed, 7 insertions(+) --- a/Makefile +++ b/Makefile -@@ -822,6 +822,11 @@ KBUILD_CFLAGS += -Os - KBUILD_RUSTFLAGS += -Copt-level=s +@@ -824,6 +824,13 @@ ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE + KBUILD_CFLAGS += $(call cc-option,-fivopts) endif ++ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3 +# Perform swing modulo scheduling immediately before the first scheduling pass. +# This pass looks at innermost loops and reorders their instructions by +# overlapping different iterations. +KBUILD_CFLAGS += $(call cc-option,-fmodulo-sched -fmodulo-sched-allow-regmoves) ++endif + # Always set `debug-assertions` and `overflow-checks` because their default # depends on `opt-level` and `debug-assertions`, respectively. diff --git a/debian/patches/patchset-pf/amd-pstate/0001-cpufreq-amd-pstate-add-quirk-for-Ryzen-3000-series-p.patch b/debian/patches/patchset-pf/amd-pstate/0001-cpufreq-amd-pstate-add-quirk-for-Ryzen-3000-series-p.patch index 01b3aed..4cddd86 100644 --- a/debian/patches/patchset-pf/amd-pstate/0001-cpufreq-amd-pstate-add-quirk-for-Ryzen-3000-series-p.patch +++ b/debian/patches/patchset-pf/amd-pstate/0001-cpufreq-amd-pstate-add-quirk-for-Ryzen-3000-series-p.patch @@ -1,4 +1,4 @@ -From 3427331872c37b2edb42406c65764e1565b0591b Mon Sep 17 00:00:00 2001 +From f077f4265c59f5d417aa40eaf82bb632c891b221 Mon Sep 17 00:00:00 2001 From: Perry Yuan Date: Fri, 9 Aug 2024 14:09:05 +0800 Subject: cpufreq: amd-pstate: add quirk for Ryzen 3000 series processor @@ -17,7 +17,7 @@ Signed-off-by: Perry Yuan --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c -@@ -142,6 +142,11 @@ static struct quirk_entry quirk_amd_7k62 +@@ -136,6 +136,11 @@ static struct quirk_entry quirk_amd_7k62 .lowest_freq = 550, }; @@ -29,7 +29,7 @@ Signed-off-by: Perry Yuan static int __init dmi_matched_7k62_bios_bug(const struct dmi_system_id *dmi) { /** -@@ -158,6 +163,21 @@ static int __init dmi_matched_7k62_bios_ +@@ -152,6 +157,21 @@ static int __init dmi_matched_7k62_bios_ return 0; } @@ -51,7 +51,7 @@ Signed-off-by: Perry Yuan static const struct dmi_system_id amd_pstate_quirks_table[] __initconst = { { .callback = dmi_matched_7k62_bios_bug, -@@ -168,6 +188,16 @@ static const struct dmi_system_id amd_ps +@@ -162,6 +182,16 @@ static const struct dmi_system_id amd_ps }, .driver_data = &quirk_amd_7k62, }, diff --git a/debian/patches/patchset-pf/amd-pstate/0002-cpufreq-amd-pstate-Export-symbols-for-changing-modes.patch b/debian/patches/patchset-pf/amd-pstate/0002-cpufreq-amd-pstate-Export-symbols-for-changing-modes.patch deleted file mode 100644 index 8046713..0000000 --- a/debian/patches/patchset-pf/amd-pstate/0002-cpufreq-amd-pstate-Export-symbols-for-changing-modes.patch +++ /dev/null @@ -1,88 +0,0 @@ -From 44f21855901b1fd618ac16b07dbd14e8fea4ee13 Mon Sep 17 00:00:00 2001 -From: Mario Limonciello -Date: Sat, 31 Aug 2024 21:49:11 -0500 -Subject: cpufreq/amd-pstate: Export symbols for changing modes - -In order to effectively test all mode switch combinations export -everything necessarily for amd-pstate-ut to trigger a mode switch. - -Signed-off-by: Mario Limonciello ---- - drivers/cpufreq/amd-pstate.c | 23 ++++++++++------------- - drivers/cpufreq/amd-pstate.h | 14 ++++++++++++++ - 2 files changed, 24 insertions(+), 13 deletions(-) - ---- a/drivers/cpufreq/amd-pstate.c -+++ b/drivers/cpufreq/amd-pstate.c -@@ -60,18 +60,6 @@ - #define AMD_CPPC_EPP_BALANCE_POWERSAVE 0xBF - #define AMD_CPPC_EPP_POWERSAVE 0xFF - --/* -- * enum amd_pstate_mode - driver working mode of amd pstate -- */ --enum amd_pstate_mode { -- AMD_PSTATE_UNDEFINED = 0, -- AMD_PSTATE_DISABLE, -- AMD_PSTATE_PASSIVE, -- AMD_PSTATE_ACTIVE, -- AMD_PSTATE_GUIDED, -- AMD_PSTATE_MAX, --}; -- - static const char * const amd_pstate_mode_string[] = { - [AMD_PSTATE_UNDEFINED] = "undefined", - [AMD_PSTATE_DISABLE] = "disable", -@@ -81,6 +69,14 @@ static const char * const amd_pstate_mod - NULL, - }; - -+const char *amd_pstate_get_mode_string(enum amd_pstate_mode mode) -+{ -+ if (mode < 0 || mode >= AMD_PSTATE_MAX) -+ return NULL; -+ return amd_pstate_mode_string[mode]; -+} -+EXPORT_SYMBOL_GPL(amd_pstate_get_mode_string); -+ - struct quirk_entry { - u32 nominal_freq; - u32 lowest_freq; -@@ -1380,7 +1376,7 @@ static ssize_t amd_pstate_show_status(ch - return sysfs_emit(buf, "%s\n", amd_pstate_mode_string[cppc_state]); - } - --static int amd_pstate_update_status(const char *buf, size_t size) -+int amd_pstate_update_status(const char *buf, size_t size) - { - int mode_idx; - -@@ -1397,6 +1393,7 @@ static int amd_pstate_update_status(cons - - return 0; - } -+EXPORT_SYMBOL_GPL(amd_pstate_update_status); - - static ssize_t status_show(struct device *dev, - struct device_attribute *attr, char *buf) ---- a/drivers/cpufreq/amd-pstate.h -+++ b/drivers/cpufreq/amd-pstate.h -@@ -103,4 +103,18 @@ struct amd_cpudata { - bool boost_state; - }; - -+/* -+ * enum amd_pstate_mode - driver working mode of amd pstate -+ */ -+enum amd_pstate_mode { -+ AMD_PSTATE_UNDEFINED = 0, -+ AMD_PSTATE_DISABLE, -+ AMD_PSTATE_PASSIVE, -+ AMD_PSTATE_ACTIVE, -+ AMD_PSTATE_GUIDED, -+ AMD_PSTATE_MAX, -+}; -+const char *amd_pstate_get_mode_string(enum amd_pstate_mode mode); -+int amd_pstate_update_status(const char *buf, size_t size); -+ - #endif /* _LINUX_AMD_PSTATE_H */ diff --git a/debian/patches/patchset-pf/amd-pstate/0016-cpufreq-amd-pstate-Fix-non-kerneldoc-comment.patch b/debian/patches/patchset-pf/amd-pstate/0002-cpufreq-amd-pstate-Fix-non-kerneldoc-comment.patch similarity index 85% rename from debian/patches/patchset-pf/amd-pstate/0016-cpufreq-amd-pstate-Fix-non-kerneldoc-comment.patch rename to debian/patches/patchset-pf/amd-pstate/0002-cpufreq-amd-pstate-Fix-non-kerneldoc-comment.patch index 0cd7b1c..3658b5f 100644 --- a/debian/patches/patchset-pf/amd-pstate/0016-cpufreq-amd-pstate-Fix-non-kerneldoc-comment.patch +++ b/debian/patches/patchset-pf/amd-pstate/0002-cpufreq-amd-pstate-Fix-non-kerneldoc-comment.patch @@ -1,4 +1,4 @@ -From 2e2ba39aec71fb51e897c3275b255ef806800cf0 Mon Sep 17 00:00:00 2001 +From da2702cb43c82219d4624135d85e2fc8768aeb09 Mon Sep 17 00:00:00 2001 From: Mario Limonciello Date: Thu, 5 Sep 2024 11:23:51 -0500 Subject: cpufreq/amd-pstate: Fix non kerneldoc comment @@ -13,7 +13,7 @@ Signed-off-by: Mario Limonciello --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c -@@ -1774,7 +1774,7 @@ static int __init amd_pstate_set_driver( +@@ -1782,7 +1782,7 @@ static int __init amd_pstate_set_driver( return -EINVAL; } diff --git a/debian/patches/patchset-pf/amd-pstate/0018-cpufreq-amd-pstate-Rename-MSR-and-shared-memory-spec.patch b/debian/patches/patchset-pf/amd-pstate/0003-cpufreq-amd-pstate-Rename-MSR-and-shared-memory-spec.patch similarity index 96% rename from debian/patches/patchset-pf/amd-pstate/0018-cpufreq-amd-pstate-Rename-MSR-and-shared-memory-spec.patch rename to debian/patches/patchset-pf/amd-pstate/0003-cpufreq-amd-pstate-Rename-MSR-and-shared-memory-spec.patch index f9db96e..990df64 100644 --- a/debian/patches/patchset-pf/amd-pstate/0018-cpufreq-amd-pstate-Rename-MSR-and-shared-memory-spec.patch +++ b/debian/patches/patchset-pf/amd-pstate/0003-cpufreq-amd-pstate-Rename-MSR-and-shared-memory-spec.patch @@ -1,4 +1,4 @@ -From d74ce254cc470da670d6b90c69bab553cdbde62b Mon Sep 17 00:00:00 2001 +From a7b86a6057ccc8f5b5ab4d08e753b2a034fa7d28 Mon Sep 17 00:00:00 2001 From: Dhananjay Ugwekar Date: Tue, 17 Sep 2024 09:14:35 +0000 Subject: cpufreq/amd-pstate: Rename MSR and shared memory specific functions @@ -93,7 +93,7 @@ Signed-off-by: Dhananjay Ugwekar u32 min_perf, u32 des_perf, u32 max_perf, bool fast_switch) { -@@ -1897,9 +1897,9 @@ static int __init amd_pstate_init(void) +@@ -1905,9 +1905,9 @@ static int __init amd_pstate_init(void) current_pstate_driver->adjust_perf = amd_pstate_adjust_perf; } else { pr_debug("AMD CPPC shared memory based functionality is supported\n"); diff --git a/debian/patches/patchset-pf/amd-pstate/0003-cpufreq-amd-pstate-ut-Add-test-case-for-mode-switche.patch b/debian/patches/patchset-pf/amd-pstate/0003-cpufreq-amd-pstate-ut-Add-test-case-for-mode-switche.patch deleted file mode 100644 index ccfc5ab..0000000 --- a/debian/patches/patchset-pf/amd-pstate/0003-cpufreq-amd-pstate-ut-Add-test-case-for-mode-switche.patch +++ /dev/null @@ -1,77 +0,0 @@ -From aabfc7370a7da9c52be97c79ba70a20201e6864a Mon Sep 17 00:00:00 2001 -From: Mario Limonciello -Date: Sat, 31 Aug 2024 21:49:12 -0500 -Subject: cpufreq/amd-pstate-ut: Add test case for mode switches - -There is a state machine in the amd-pstate driver utilized for -switches for all modes. To make sure that cleanup and setup works -properly for each mode add a unit test case that tries all -combinations. - -Signed-off-by: Mario Limonciello ---- - drivers/cpufreq/amd-pstate-ut.c | 41 ++++++++++++++++++++++++++++++++- - 1 file changed, 40 insertions(+), 1 deletion(-) - ---- a/drivers/cpufreq/amd-pstate-ut.c -+++ b/drivers/cpufreq/amd-pstate-ut.c -@@ -54,12 +54,14 @@ static void amd_pstate_ut_acpi_cpc_valid - static void amd_pstate_ut_check_enabled(u32 index); - static void amd_pstate_ut_check_perf(u32 index); - static void amd_pstate_ut_check_freq(u32 index); -+static void amd_pstate_ut_check_driver(u32 index); - - static struct amd_pstate_ut_struct amd_pstate_ut_cases[] = { - {"amd_pstate_ut_acpi_cpc_valid", amd_pstate_ut_acpi_cpc_valid }, - {"amd_pstate_ut_check_enabled", amd_pstate_ut_check_enabled }, - {"amd_pstate_ut_check_perf", amd_pstate_ut_check_perf }, -- {"amd_pstate_ut_check_freq", amd_pstate_ut_check_freq } -+ {"amd_pstate_ut_check_freq", amd_pstate_ut_check_freq }, -+ {"amd_pstate_ut_check_driver", amd_pstate_ut_check_driver } - }; - - static bool get_shared_mem(void) -@@ -257,6 +259,43 @@ skip_test: - cpufreq_cpu_put(policy); - } - -+static int amd_pstate_set_mode(enum amd_pstate_mode mode) -+{ -+ const char *mode_str = amd_pstate_get_mode_string(mode); -+ -+ pr_debug("->setting mode to %s\n", mode_str); -+ -+ return amd_pstate_update_status(mode_str, strlen(mode_str)); -+} -+ -+static void amd_pstate_ut_check_driver(u32 index) -+{ -+ enum amd_pstate_mode mode1, mode2; -+ int ret; -+ -+ for (mode1 = AMD_PSTATE_DISABLE; mode1 < AMD_PSTATE_MAX; mode1++) { -+ ret = amd_pstate_set_mode(mode1); -+ if (ret) -+ goto out; -+ for (mode2 = AMD_PSTATE_DISABLE; mode2 < AMD_PSTATE_MAX; mode2++) { -+ if (mode1 == mode2) -+ continue; -+ ret = amd_pstate_set_mode(mode2); -+ if (ret) -+ goto out; -+ } -+ } -+out: -+ if (ret) -+ pr_warn("%s: failed to update status for %s->%s: %d\n", __func__, -+ amd_pstate_get_mode_string(mode1), -+ amd_pstate_get_mode_string(mode2), ret); -+ -+ amd_pstate_ut_cases[index].result = ret ? -+ AMD_PSTATE_UT_RESULT_FAIL : -+ AMD_PSTATE_UT_RESULT_PASS; -+} -+ - static int __init amd_pstate_ut_init(void) - { - u32 i = 0, arr_size = ARRAY_SIZE(amd_pstate_ut_cases); diff --git a/debian/patches/patchset-pf/amd-pstate/0004-cpufreq-amd-pstate-Catch-failures-for-amd_pstate_epp.patch b/debian/patches/patchset-pf/amd-pstate/0004-cpufreq-amd-pstate-Catch-failures-for-amd_pstate_epp.patch deleted file mode 100644 index cdb3bb0..0000000 --- a/debian/patches/patchset-pf/amd-pstate/0004-cpufreq-amd-pstate-Catch-failures-for-amd_pstate_epp.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 24e62fbc101d079d398ac6fc76f458676d3d9491 Mon Sep 17 00:00:00 2001 -From: Mario Limonciello -Date: Sun, 1 Sep 2024 00:00:35 -0500 -Subject: cpufreq/amd-pstate: Catch failures for amd_pstate_epp_update_limit() - -amd_pstate_set_epp() calls cppc_set_epp_perf() which can fail for -a variety of reasons but this is ignored. Change the return flow -to allow failures. - -Signed-off-by: Mario Limonciello ---- - drivers/cpufreq/amd-pstate.c | 11 +++++++---- - 1 file changed, 7 insertions(+), 4 deletions(-) - ---- a/drivers/cpufreq/amd-pstate.c -+++ b/drivers/cpufreq/amd-pstate.c -@@ -1583,7 +1583,7 @@ static void amd_pstate_epp_cpu_exit(stru - pr_debug("CPU %d exiting\n", policy->cpu); - } - --static void amd_pstate_epp_update_limit(struct cpufreq_policy *policy) -+static int amd_pstate_epp_update_limit(struct cpufreq_policy *policy) - { - struct amd_cpudata *cpudata = policy->driver_data; - u32 max_perf, min_perf, min_limit_perf, max_limit_perf; -@@ -1633,7 +1633,7 @@ static void amd_pstate_epp_update_limit( - * This return value can only be negative for shared_memory - * systems where EPP register read/write not supported. - */ -- return; -+ return epp; - } - - if (cpudata->policy == CPUFREQ_POLICY_PERFORMANCE) -@@ -1646,12 +1646,13 @@ static void amd_pstate_epp_update_limit( - } - - WRITE_ONCE(cpudata->cppc_req_cached, value); -- amd_pstate_set_epp(cpudata, epp); -+ return amd_pstate_set_epp(cpudata, epp); - } - - static int amd_pstate_epp_set_policy(struct cpufreq_policy *policy) - { - struct amd_cpudata *cpudata = policy->driver_data; -+ int ret; - - if (!policy->cpuinfo.max_freq) - return -ENODEV; -@@ -1661,7 +1662,9 @@ static int amd_pstate_epp_set_policy(str - - cpudata->policy = policy->policy; - -- amd_pstate_epp_update_limit(policy); -+ ret = amd_pstate_epp_update_limit(policy); -+ if (ret) -+ return ret; - - /* - * policy->cur is never updated with the amd_pstate_epp driver, but it diff --git a/debian/patches/patchset-pf/amd-pstate/0024-cpufreq-amd-pstate-Use-amd_pstate_update_min_max_lim.patch b/debian/patches/patchset-pf/amd-pstate/0004-cpufreq-amd-pstate-Use-amd_pstate_update_min_max_lim.patch similarity index 93% rename from debian/patches/patchset-pf/amd-pstate/0024-cpufreq-amd-pstate-Use-amd_pstate_update_min_max_lim.patch rename to debian/patches/patchset-pf/amd-pstate/0004-cpufreq-amd-pstate-Use-amd_pstate_update_min_max_lim.patch index 3fd8c77..b995b0f 100644 --- a/debian/patches/patchset-pf/amd-pstate/0024-cpufreq-amd-pstate-Use-amd_pstate_update_min_max_lim.patch +++ b/debian/patches/patchset-pf/amd-pstate/0004-cpufreq-amd-pstate-Use-amd_pstate_update_min_max_lim.patch @@ -1,4 +1,4 @@ -From 684d162c08ab86fff02861c907ecc92bf9c09af4 Mon Sep 17 00:00:00 2001 +From 4e784acad1b275ddcb105b053922ab2179ab3f86 Mon Sep 17 00:00:00 2001 From: Mario Limonciello Date: Sat, 12 Oct 2024 12:45:18 -0500 Subject: cpufreq/amd-pstate: Use amd_pstate_update_min_max_limit() for EPP @@ -17,7 +17,7 @@ Signed-off-by: Mario Limonciello --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c -@@ -1505,26 +1505,13 @@ static void amd_pstate_epp_cpu_exit(stru +@@ -1515,26 +1515,13 @@ static void amd_pstate_epp_cpu_exit(stru static int amd_pstate_epp_update_limit(struct cpufreq_policy *policy) { struct amd_cpudata *cpudata = policy->driver_data; diff --git a/debian/patches/patchset-pf/amd-pstate/0025-cpufreq-amd-pstate-Drop-needless-EPP-initialization.patch b/debian/patches/patchset-pf/amd-pstate/0005-cpufreq-amd-pstate-Drop-needless-EPP-initialization.patch similarity index 87% rename from debian/patches/patchset-pf/amd-pstate/0025-cpufreq-amd-pstate-Drop-needless-EPP-initialization.patch rename to debian/patches/patchset-pf/amd-pstate/0005-cpufreq-amd-pstate-Drop-needless-EPP-initialization.patch index 33964dc..3bb030f 100644 --- a/debian/patches/patchset-pf/amd-pstate/0025-cpufreq-amd-pstate-Drop-needless-EPP-initialization.patch +++ b/debian/patches/patchset-pf/amd-pstate/0005-cpufreq-amd-pstate-Drop-needless-EPP-initialization.patch @@ -1,4 +1,4 @@ -From fa46d2873c9fa4060ce407e4bc5c7e29babce9d0 Mon Sep 17 00:00:00 2001 +From ed39a400d49baf070571bb1da475297a8495aa67 Mon Sep 17 00:00:00 2001 From: Mario Limonciello Date: Sat, 12 Oct 2024 12:45:19 -0500 Subject: cpufreq/amd-pstate: Drop needless EPP initialization @@ -14,7 +14,7 @@ Signed-off-by: Mario Limonciello --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c -@@ -1548,12 +1548,6 @@ static int amd_pstate_epp_update_limit(s +@@ -1558,12 +1558,6 @@ static int amd_pstate_epp_update_limit(s if (cpudata->policy == CPUFREQ_POLICY_PERFORMANCE) epp = 0; diff --git a/debian/patches/patchset-pf/amd-pstate/0005-x86-amd-Move-amd_get_highest_perf-from-amd.c-to-cppc.patch b/debian/patches/patchset-pf/amd-pstate/0005-x86-amd-Move-amd_get_highest_perf-from-amd.c-to-cppc.patch deleted file mode 100644 index caa2b7e..0000000 --- a/debian/patches/patchset-pf/amd-pstate/0005-x86-amd-Move-amd_get_highest_perf-from-amd.c-to-cppc.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 29c0347dd542e091e2f7e5980dd885f918f5f676 Mon Sep 17 00:00:00 2001 -From: Mario Limonciello -Date: Thu, 5 Sep 2024 11:29:57 -0500 -Subject: x86/amd: Move amd_get_highest_perf() from amd.c to cppc.c - -To prepare to let amd_get_highest_perf() detect preferred cores -it will require CPPC functions. Move amd_get_highest_perf() to -cppc.c to prepare for 'preferred core detection' rework. - -No functional changes intended. - -Reviewed-by: Perry Yuan -Reviewed-by: Gautham R. Shenoy -Signed-off-by: Mario Limonciello -Reviewed-by: Gautham R. Shenoy ---- - arch/x86/kernel/acpi/cppc.c | 16 ++++++++++++++++ - arch/x86/kernel/cpu/amd.c | 16 ---------------- - 2 files changed, 16 insertions(+), 16 deletions(-) - ---- a/arch/x86/kernel/acpi/cppc.c -+++ b/arch/x86/kernel/acpi/cppc.c -@@ -116,3 +116,19 @@ void init_freq_invariance_cppc(void) - init_done = true; - mutex_unlock(&freq_invariance_lock); - } -+ -+u32 amd_get_highest_perf(void) -+{ -+ struct cpuinfo_x86 *c = &boot_cpu_data; -+ -+ if (c->x86 == 0x17 && ((c->x86_model >= 0x30 && c->x86_model < 0x40) || -+ (c->x86_model >= 0x70 && c->x86_model < 0x80))) -+ return 166; -+ -+ if (c->x86 == 0x19 && ((c->x86_model >= 0x20 && c->x86_model < 0x30) || -+ (c->x86_model >= 0x40 && c->x86_model < 0x70))) -+ return 166; -+ -+ return 255; -+} -+EXPORT_SYMBOL_GPL(amd_get_highest_perf); ---- a/arch/x86/kernel/cpu/amd.c -+++ b/arch/x86/kernel/cpu/amd.c -@@ -1202,22 +1202,6 @@ unsigned long amd_get_dr_addr_mask(unsig - } - EXPORT_SYMBOL_GPL(amd_get_dr_addr_mask); - --u32 amd_get_highest_perf(void) --{ -- struct cpuinfo_x86 *c = &boot_cpu_data; -- -- if (c->x86 == 0x17 && ((c->x86_model >= 0x30 && c->x86_model < 0x40) || -- (c->x86_model >= 0x70 && c->x86_model < 0x80))) -- return 166; -- -- if (c->x86 == 0x19 && ((c->x86_model >= 0x20 && c->x86_model < 0x30) || -- (c->x86_model >= 0x40 && c->x86_model < 0x70))) -- return 166; -- -- return 255; --} --EXPORT_SYMBOL_GPL(amd_get_highest_perf); -- - static void zenbleed_check_cpu(void *unused) - { - struct cpuinfo_x86 *c = &cpu_data(smp_processor_id()); diff --git a/debian/patches/patchset-pf/amd-pstate/0006-ACPI-CPPC-Adjust-return-code-for-inline-functions-in.patch b/debian/patches/patchset-pf/amd-pstate/0006-ACPI-CPPC-Adjust-return-code-for-inline-functions-in.patch deleted file mode 100644 index 7548e16..0000000 --- a/debian/patches/patchset-pf/amd-pstate/0006-ACPI-CPPC-Adjust-return-code-for-inline-functions-in.patch +++ /dev/null @@ -1,95 +0,0 @@ -From 072efeb45349edd8ba9def11b6a450eaf56690a8 Mon Sep 17 00:00:00 2001 -From: Mario Limonciello -Date: Thu, 5 Sep 2024 11:29:58 -0500 -Subject: ACPI: CPPC: Adjust return code for inline functions in - !CONFIG_ACPI_CPPC_LIB - -Checkpath emits the following warning: -``` -WARNING: ENOTSUPP is not a SUSV4 error code, prefer EOPNOTSUPP -``` - -Adjust the code accordingly. - -Reviewed-by: Gautham R. Shenoy -Signed-off-by: Mario Limonciello -Reviewed-by: Gautham R. Shenoy ---- - include/acpi/cppc_acpi.h | 26 +++++++++++++------------- - 1 file changed, 13 insertions(+), 13 deletions(-) - ---- a/include/acpi/cppc_acpi.h -+++ b/include/acpi/cppc_acpi.h -@@ -164,31 +164,31 @@ extern int cppc_set_auto_sel(int cpu, bo - #else /* !CONFIG_ACPI_CPPC_LIB */ - static inline int cppc_get_desired_perf(int cpunum, u64 *desired_perf) - { -- return -ENOTSUPP; -+ return -EOPNOTSUPP; - } - static inline int cppc_get_nominal_perf(int cpunum, u64 *nominal_perf) - { -- return -ENOTSUPP; -+ return -EOPNOTSUPP; - } - static inline int cppc_get_highest_perf(int cpunum, u64 *highest_perf) - { -- return -ENOTSUPP; -+ return -EOPNOTSUPP; - } - static inline int cppc_get_perf_ctrs(int cpu, struct cppc_perf_fb_ctrs *perf_fb_ctrs) - { -- return -ENOTSUPP; -+ return -EOPNOTSUPP; - } - static inline int cppc_set_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls) - { -- return -ENOTSUPP; -+ return -EOPNOTSUPP; - } - static inline int cppc_set_enable(int cpu, bool enable) - { -- return -ENOTSUPP; -+ return -EOPNOTSUPP; - } - static inline int cppc_get_perf_caps(int cpu, struct cppc_perf_caps *caps) - { -- return -ENOTSUPP; -+ return -EOPNOTSUPP; - } - static inline bool cppc_perf_ctrs_in_pcc(void) - { -@@ -212,27 +212,27 @@ static inline bool cpc_ffh_supported(voi - } - static inline int cpc_read_ffh(int cpunum, struct cpc_reg *reg, u64 *val) - { -- return -ENOTSUPP; -+ return -EOPNOTSUPP; - } - static inline int cpc_write_ffh(int cpunum, struct cpc_reg *reg, u64 val) - { -- return -ENOTSUPP; -+ return -EOPNOTSUPP; - } - static inline int cppc_set_epp_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls, bool enable) - { -- return -ENOTSUPP; -+ return -EOPNOTSUPP; - } - static inline int cppc_get_epp_perf(int cpunum, u64 *epp_perf) - { -- return -ENOTSUPP; -+ return -EOPNOTSUPP; - } - static inline int cppc_set_auto_sel(int cpu, bool enable) - { -- return -ENOTSUPP; -+ return -EOPNOTSUPP; - } - static inline int cppc_get_auto_sel_caps(int cpunum, struct cppc_perf_caps *perf_caps) - { -- return -ENOTSUPP; -+ return -EOPNOTSUPP; - } - #endif /* !CONFIG_ACPI_CPPC_LIB */ - diff --git a/debian/patches/patchset-pf/amd-pstate/0006-cpufreq-amd-pstate-Remove-the-redundant-verify-funct.patch b/debian/patches/patchset-pf/amd-pstate/0006-cpufreq-amd-pstate-Remove-the-redundant-verify-funct.patch new file mode 100644 index 0000000..ff3ecd4 --- /dev/null +++ b/debian/patches/patchset-pf/amd-pstate/0006-cpufreq-amd-pstate-Remove-the-redundant-verify-funct.patch @@ -0,0 +1,54 @@ +From 2a012fdcef91db6e380000b8042f90544ea49fd7 Mon Sep 17 00:00:00 2001 +From: Dhananjay Ugwekar +Date: Thu, 17 Oct 2024 05:39:28 +0000 +Subject: cpufreq/amd-pstate: Remove the redundant verify() function + +Merge the two verify() callback functions and rename the +cpufreq_policy_data argument for better readability. + +Signed-off-by: Dhananjay Ugwekar +Reviewed-by: Mario Limonciello +Reviewed-by: Gautham R. Shenoy +--- + drivers/cpufreq/amd-pstate.c | 15 ++++----------- + 1 file changed, 4 insertions(+), 11 deletions(-) + +--- a/drivers/cpufreq/amd-pstate.c ++++ b/drivers/cpufreq/amd-pstate.c +@@ -557,10 +557,10 @@ cpufreq_policy_put: + cpufreq_cpu_put(policy); + } + +-static int amd_pstate_verify(struct cpufreq_policy_data *policy) ++static int amd_pstate_verify(struct cpufreq_policy_data *policy_data) + { +- cpufreq_verify_within_cpu_limits(policy); +- ++ cpufreq_verify_within_cpu_limits(policy_data); ++ pr_debug("policy_max =%d, policy_min=%d\n", policy_data->max, policy_data->min); + return 0; + } + +@@ -1668,13 +1668,6 @@ static int amd_pstate_epp_cpu_offline(st + return 0; + } + +-static int amd_pstate_epp_verify_policy(struct cpufreq_policy_data *policy) +-{ +- cpufreq_verify_within_cpu_limits(policy); +- pr_debug("policy_max =%d, policy_min=%d\n", policy->max, policy->min); +- return 0; +-} +- + static int amd_pstate_epp_suspend(struct cpufreq_policy *policy) + { + struct amd_cpudata *cpudata = policy->driver_data; +@@ -1730,7 +1723,7 @@ static struct cpufreq_driver amd_pstate_ + + static struct cpufreq_driver amd_pstate_epp_driver = { + .flags = CPUFREQ_CONST_LOOPS, +- .verify = amd_pstate_epp_verify_policy, ++ .verify = amd_pstate_verify, + .setpolicy = amd_pstate_epp_set_policy, + .init = amd_pstate_epp_cpu_init, + .exit = amd_pstate_epp_cpu_exit, diff --git a/debian/patches/patchset-pf/amd-pstate/0020-cpufreq-amd-pstate-Set-the-initial-min_freq-to-lowes.patch b/debian/patches/patchset-pf/amd-pstate/0007-cpufreq-amd-pstate-Set-the-initial-min_freq-to-lowes.patch similarity index 50% rename from debian/patches/patchset-pf/amd-pstate/0020-cpufreq-amd-pstate-Set-the-initial-min_freq-to-lowes.patch rename to debian/patches/patchset-pf/amd-pstate/0007-cpufreq-amd-pstate-Set-the-initial-min_freq-to-lowes.patch index 3aeab8a..2aac49e 100644 --- a/debian/patches/patchset-pf/amd-pstate/0020-cpufreq-amd-pstate-Set-the-initial-min_freq-to-lowes.patch +++ b/debian/patches/patchset-pf/amd-pstate/0007-cpufreq-amd-pstate-Set-the-initial-min_freq-to-lowes.patch @@ -1,6 +1,6 @@ -From f5b234be445a45b0bcacc37e0aad7a6bc7900eac Mon Sep 17 00:00:00 2001 +From ba9f0c8ca71a1c44e35dd8d3221abda0bd4e465a Mon Sep 17 00:00:00 2001 From: Dhananjay Ugwekar -Date: Thu, 3 Oct 2024 08:39:54 +0000 +Date: Thu, 17 Oct 2024 05:39:30 +0000 Subject: cpufreq/amd-pstate: Set the initial min_freq to lowest_nonlinear_freq According to the AMD architectural programmer's manual volume 2 [1], in @@ -20,60 +20,55 @@ are completed sooner). This has shown a power benefit in some systems, in other systems, power consumption has increased but so has the throughput/watt. -Use the get_init_min_freq() callback to set the initial lower limit for -amd-pstate driver to lowest_nonlinear_freq instead of lowest_freq. +Modify the initial policy_data->min set by cpufreq-core to +lowest_nonlinear_freq, in the ->verify() callback. Also set the +cpudata->req[0] to FREQ_QOS_MIN_DEFAULT_VALUE (i.e. 0), so that it also +gets overriden by the check in verify function. Link: https://www.amd.com/content/dam/amd/en/documents/processor-tech-docs/programmer-references/24593.pdf [1] Signed-off-by: Dhananjay Ugwekar Reviewed-by: Mario Limonciello --- - drivers/cpufreq/amd-pstate.c | 16 +++++++++------- - 1 file changed, 9 insertions(+), 7 deletions(-) + drivers/cpufreq/amd-pstate.c | 21 ++++++++++++++++++++- + 1 file changed, 20 insertions(+), 1 deletion(-) --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c -@@ -1003,13 +1003,6 @@ static int amd_pstate_cpu_init(struct cp - if (cpu_feature_enabled(X86_FEATURE_CPPC)) - policy->fast_switch_possible = true; +@@ -559,8 +559,27 @@ cpufreq_policy_put: -- ret = freq_qos_add_request(&policy->constraints, &cpudata->req[0], -- FREQ_QOS_MIN, policy->cpuinfo.min_freq); -- if (ret < 0) { -- dev_err(dev, "Failed to add min-freq constraint (%d)\n", ret); -- goto free_cpudata1; -- } -- - ret = freq_qos_add_request(&policy->constraints, &cpudata->req[1], - FREQ_QOS_MAX, policy->cpuinfo.max_freq); - if (ret < 0) { -@@ -1724,6 +1717,13 @@ static int amd_pstate_epp_resume(struct + static int amd_pstate_verify(struct cpufreq_policy_data *policy_data) + { ++ /* ++ * Initialize lower frequency limit (i.e.policy->min) with ++ * lowest_nonlinear_frequency which is the most energy efficient ++ * frequency. Override the initial value set by cpufreq core and ++ * amd-pstate qos_requests. ++ */ ++ if (policy_data->min == FREQ_QOS_MIN_DEFAULT_VALUE) { ++ struct cpufreq_policy *policy = cpufreq_cpu_get(policy_data->cpu); ++ struct amd_cpudata *cpudata; ++ ++ if (!policy) ++ return -EINVAL; ++ ++ cpudata = policy->driver_data; ++ policy_data->min = cpudata->lowest_nonlinear_freq; ++ cpufreq_cpu_put(policy); ++ } ++ + cpufreq_verify_within_cpu_limits(policy_data); + pr_debug("policy_max =%d, policy_min=%d\n", policy_data->max, policy_data->min); ++ return 0; } -+static int amd_pstate_get_init_min_freq(struct cpufreq_policy *policy) -+{ -+ struct amd_cpudata *cpudata = policy->driver_data; -+ -+ return READ_ONCE(cpudata->lowest_nonlinear_freq); -+} -+ - static struct cpufreq_driver amd_pstate_driver = { - .flags = CPUFREQ_CONST_LOOPS | CPUFREQ_NEED_UPDATE_LIMITS, - .verify = amd_pstate_verify, -@@ -1737,6 +1737,7 @@ static struct cpufreq_driver amd_pstate_ - .update_limits = amd_pstate_update_limits, - .name = "amd-pstate", - .attr = amd_pstate_attr, -+ .get_init_min_freq = amd_pstate_get_init_min_freq, - }; +@@ -1009,7 +1028,7 @@ static int amd_pstate_cpu_init(struct cp + policy->fast_switch_possible = true; - static struct cpufreq_driver amd_pstate_epp_driver = { -@@ -1753,6 +1754,7 @@ static struct cpufreq_driver amd_pstate_ - .set_boost = amd_pstate_set_boost, - .name = "amd-pstate-epp", - .attr = amd_pstate_epp_attr, -+ .get_init_min_freq = amd_pstate_get_init_min_freq, - }; - - static int __init amd_pstate_set_driver(int mode_idx) + ret = freq_qos_add_request(&policy->constraints, &cpudata->req[0], +- FREQ_QOS_MIN, policy->cpuinfo.min_freq); ++ FREQ_QOS_MIN, FREQ_QOS_MIN_DEFAULT_VALUE); + if (ret < 0) { + dev_err(dev, "Failed to add min-freq constraint (%d)\n", ret); + goto free_cpudata1; diff --git a/debian/patches/patchset-pf/amd-pstate/0007-x86-amd-Rename-amd_get_highest_perf-to-amd_get_boost.patch b/debian/patches/patchset-pf/amd-pstate/0007-x86-amd-Rename-amd_get_highest_perf-to-amd_get_boost.patch deleted file mode 100644 index dea1ebe..0000000 --- a/debian/patches/patchset-pf/amd-pstate/0007-x86-amd-Rename-amd_get_highest_perf-to-amd_get_boost.patch +++ /dev/null @@ -1,162 +0,0 @@ -From 21492d91ffc7c3fdb6507f64a74abf8326c75141 Mon Sep 17 00:00:00 2001 -From: Mario Limonciello -Date: Thu, 5 Sep 2024 11:29:59 -0500 -Subject: x86/amd: Rename amd_get_highest_perf() to - amd_get_boost_ratio_numerator() - -The function name is ambiguous because it returns an intermediate value -for calculating maximum frequency rather than the CPPC 'Highest Perf' -register. - -Rename the function to clarify its use and allow the function to return -errors. Adjust the consumer in acpi-cpufreq to catch errors. - -Reviewed-by: Gautham R. Shenoy -Signed-off-by: Mario Limonciello -Reviewed-by: Gautham R. Shenoy ---- - arch/x86/include/asm/processor.h | 3 --- - arch/x86/kernel/acpi/cppc.c | 44 +++++++++++++++++++++++--------- - drivers/cpufreq/acpi-cpufreq.c | 12 ++++++--- - include/acpi/cppc_acpi.h | 5 ++++ - 4 files changed, 46 insertions(+), 18 deletions(-) - ---- a/arch/x86/include/asm/processor.h -+++ b/arch/x86/include/asm/processor.h -@@ -691,8 +691,6 @@ static inline u32 per_cpu_l2c_id(unsigne - } - - #ifdef CONFIG_CPU_SUP_AMD --extern u32 amd_get_highest_perf(void); -- - /* - * Issue a DIV 0/1 insn to clear any division data from previous DIV - * operations. -@@ -705,7 +703,6 @@ static __always_inline void amd_clear_di - - extern void amd_check_microcode(void); - #else --static inline u32 amd_get_highest_perf(void) { return 0; } - static inline void amd_clear_divider(void) { } - static inline void amd_check_microcode(void) { } - #endif ---- a/arch/x86/kernel/acpi/cppc.c -+++ b/arch/x86/kernel/acpi/cppc.c -@@ -69,7 +69,7 @@ int cpc_write_ffh(int cpunum, struct cpc - static void amd_set_max_freq_ratio(void) - { - struct cppc_perf_caps perf_caps; -- u64 highest_perf, nominal_perf; -+ u64 numerator, nominal_perf; - u64 perf_ratio; - int rc; - -@@ -79,15 +79,19 @@ static void amd_set_max_freq_ratio(void) - return; - } - -- highest_perf = amd_get_highest_perf(); -+ rc = amd_get_boost_ratio_numerator(0, &numerator); -+ if (rc) { -+ pr_debug("Could not retrieve highest performance (%d)\n", rc); -+ return; -+ } - nominal_perf = perf_caps.nominal_perf; - -- if (!highest_perf || !nominal_perf) { -- pr_debug("Could not retrieve highest or nominal performance\n"); -+ if (!nominal_perf) { -+ pr_debug("Could not retrieve nominal performance\n"); - return; - } - -- perf_ratio = div_u64(highest_perf * SCHED_CAPACITY_SCALE, nominal_perf); -+ perf_ratio = div_u64(numerator * SCHED_CAPACITY_SCALE, nominal_perf); - /* midpoint between max_boost and max_P */ - perf_ratio = (perf_ratio + SCHED_CAPACITY_SCALE) >> 1; - if (!perf_ratio) { -@@ -117,18 +121,34 @@ void init_freq_invariance_cppc(void) - mutex_unlock(&freq_invariance_lock); - } - --u32 amd_get_highest_perf(void) -+/** -+ * amd_get_boost_ratio_numerator: Get the numerator to use for boost ratio calculation -+ * @cpu: CPU to get numerator for. -+ * @numerator: Output variable for numerator. -+ * -+ * Determine the numerator to use for calculating the boost ratio on -+ * a CPU. On systems that support preferred cores, this will be a hardcoded -+ * value. On other systems this will the highest performance register value. -+ * -+ * Return: 0 for success, negative error code otherwise. -+ */ -+int amd_get_boost_ratio_numerator(unsigned int cpu, u64 *numerator) - { - struct cpuinfo_x86 *c = &boot_cpu_data; - - if (c->x86 == 0x17 && ((c->x86_model >= 0x30 && c->x86_model < 0x40) || -- (c->x86_model >= 0x70 && c->x86_model < 0x80))) -- return 166; -+ (c->x86_model >= 0x70 && c->x86_model < 0x80))) { -+ *numerator = 166; -+ return 0; -+ } - - if (c->x86 == 0x19 && ((c->x86_model >= 0x20 && c->x86_model < 0x30) || -- (c->x86_model >= 0x40 && c->x86_model < 0x70))) -- return 166; -+ (c->x86_model >= 0x40 && c->x86_model < 0x70))) { -+ *numerator = 166; -+ return 0; -+ } -+ *numerator = 255; - -- return 255; -+ return 0; - } --EXPORT_SYMBOL_GPL(amd_get_highest_perf); -+EXPORT_SYMBOL_GPL(amd_get_boost_ratio_numerator); ---- a/drivers/cpufreq/acpi-cpufreq.c -+++ b/drivers/cpufreq/acpi-cpufreq.c -@@ -642,10 +642,16 @@ static u64 get_max_boost_ratio(unsigned - return 0; - } - -- if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD) -- highest_perf = amd_get_highest_perf(); -- else -+ if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD) { -+ ret = amd_get_boost_ratio_numerator(cpu, &highest_perf); -+ if (ret) { -+ pr_debug("CPU%d: Unable to get boost ratio numerator (%d)\n", -+ cpu, ret); -+ return 0; -+ } -+ } else { - highest_perf = perf_caps.highest_perf; -+ } - - nominal_perf = perf_caps.nominal_perf; - ---- a/include/acpi/cppc_acpi.h -+++ b/include/acpi/cppc_acpi.h -@@ -161,6 +161,7 @@ extern int cppc_get_epp_perf(int cpunum, - extern int cppc_set_epp_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls, bool enable); - extern int cppc_get_auto_sel_caps(int cpunum, struct cppc_perf_caps *perf_caps); - extern int cppc_set_auto_sel(int cpu, bool enable); -+extern int amd_get_boost_ratio_numerator(unsigned int cpu, u64 *numerator); - #else /* !CONFIG_ACPI_CPPC_LIB */ - static inline int cppc_get_desired_perf(int cpunum, u64 *desired_perf) - { -@@ -234,6 +235,10 @@ static inline int cppc_get_auto_sel_caps - { - return -EOPNOTSUPP; - } -+static inline int amd_get_boost_ratio_numerator(unsigned int cpu, u64 *numerator) -+{ -+ return -EOPNOTSUPP; -+} - #endif /* !CONFIG_ACPI_CPPC_LIB */ - - #endif /* _CPPC_ACPI_H*/ diff --git a/debian/patches/patchset-pf/amd-pstate/0008-ACPI-CPPC-Drop-check-for-non-zero-perf-ratio.patch b/debian/patches/patchset-pf/amd-pstate/0008-ACPI-CPPC-Drop-check-for-non-zero-perf-ratio.patch deleted file mode 100644 index dcfd0a2..0000000 --- a/debian/patches/patchset-pf/amd-pstate/0008-ACPI-CPPC-Drop-check-for-non-zero-perf-ratio.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 6f10d066dce0f1781b514a0352f0b427a32b1bb2 Mon Sep 17 00:00:00 2001 -From: Mario Limonciello -Date: Thu, 5 Sep 2024 11:30:00 -0500 -Subject: ACPI: CPPC: Drop check for non zero perf ratio - -perf_ratio is a u64 and SCHED_CAPACITY_SCALE is a large number. -Shifting by one will never have a zero value. - -Drop the check. - -Suggested-by: Gautham R. Shenoy -Reviewed-by: Gautham R. Shenoy -Signed-off-by: Mario Limonciello -Reviewed-by: Gautham R. Shenoy ---- - arch/x86/kernel/acpi/cppc.c | 7 +------ - 1 file changed, 1 insertion(+), 6 deletions(-) - ---- a/arch/x86/kernel/acpi/cppc.c -+++ b/arch/x86/kernel/acpi/cppc.c -@@ -91,13 +91,8 @@ static void amd_set_max_freq_ratio(void) - return; - } - -- perf_ratio = div_u64(numerator * SCHED_CAPACITY_SCALE, nominal_perf); - /* midpoint between max_boost and max_P */ -- perf_ratio = (perf_ratio + SCHED_CAPACITY_SCALE) >> 1; -- if (!perf_ratio) { -- pr_debug("Non-zero highest/nominal perf values led to a 0 ratio\n"); -- return; -- } -+ perf_ratio = (div_u64(numerator * SCHED_CAPACITY_SCALE, nominal_perf) + SCHED_CAPACITY_SCALE) >> 1; - - freq_invariance_set_perf_ratio(perf_ratio, false); - } diff --git a/debian/patches/patchset-pf/amd-pstate/0027-cpufreq-amd-pstate-Call-amd_pstate_register-in-amd_p.patch b/debian/patches/patchset-pf/amd-pstate/0008-cpufreq-amd-pstate-Call-amd_pstate_register-in-amd_p.patch similarity index 95% rename from debian/patches/patchset-pf/amd-pstate/0027-cpufreq-amd-pstate-Call-amd_pstate_register-in-amd_p.patch rename to debian/patches/patchset-pf/amd-pstate/0008-cpufreq-amd-pstate-Call-amd_pstate_register-in-amd_p.patch index cc03ae5..24482d3 100644 --- a/debian/patches/patchset-pf/amd-pstate/0027-cpufreq-amd-pstate-Call-amd_pstate_register-in-amd_p.patch +++ b/debian/patches/patchset-pf/amd-pstate/0008-cpufreq-amd-pstate-Call-amd_pstate_register-in-amd_p.patch @@ -1,4 +1,4 @@ -From db147a0a6341822a15fd9c4cd51f8dc4a9a1747b Mon Sep 17 00:00:00 2001 +From e50aedf7fcd345c6f2e22a942deae007d71582df Mon Sep 17 00:00:00 2001 From: Dhananjay Ugwekar Date: Thu, 17 Oct 2024 10:05:27 +0000 Subject: cpufreq/amd-pstate: Call amd_pstate_register() in amd_pstate_init() diff --git a/debian/patches/patchset-pf/amd-pstate/0009-ACPI-CPPC-Adjust-debug-messages-in-amd_set_max_freq_.patch b/debian/patches/patchset-pf/amd-pstate/0009-ACPI-CPPC-Adjust-debug-messages-in-amd_set_max_freq_.patch deleted file mode 100644 index f7caec6..0000000 --- a/debian/patches/patchset-pf/amd-pstate/0009-ACPI-CPPC-Adjust-debug-messages-in-amd_set_max_freq_.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 8c142a91a58f24119e99d4e66b11890f4a4ef984 Mon Sep 17 00:00:00 2001 -From: Mario Limonciello -Date: Thu, 5 Sep 2024 11:30:01 -0500 -Subject: ACPI: CPPC: Adjust debug messages in amd_set_max_freq_ratio() to warn - -If the boost ratio isn't calculated properly for the system for any -reason this can cause other problems that are non-obvious. - -Raise all messages to warn instead. - -Suggested-by: Perry Yuan -Reviewed-by: Perry Yuan -Reviewed-by: Gautham R. Shenoy -Signed-off-by: Mario Limonciello -Reviewed-by: Gautham R. Shenoy ---- - arch/x86/kernel/acpi/cppc.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - ---- a/arch/x86/kernel/acpi/cppc.c -+++ b/arch/x86/kernel/acpi/cppc.c -@@ -75,19 +75,19 @@ static void amd_set_max_freq_ratio(void) - - rc = cppc_get_perf_caps(0, &perf_caps); - if (rc) { -- pr_debug("Could not retrieve perf counters (%d)\n", rc); -+ pr_warn("Could not retrieve perf counters (%d)\n", rc); - return; - } - - rc = amd_get_boost_ratio_numerator(0, &numerator); - if (rc) { -- pr_debug("Could not retrieve highest performance (%d)\n", rc); -+ pr_warn("Could not retrieve highest performance (%d)\n", rc); - return; - } - nominal_perf = perf_caps.nominal_perf; - - if (!nominal_perf) { -- pr_debug("Could not retrieve nominal performance\n"); -+ pr_warn("Could not retrieve nominal performance\n"); - return; - } - diff --git a/debian/patches/patchset-pf/amd-pstate/0028-cpufreq-amd-pstate-Call-amd_pstate_set_driver-in-amd.patch b/debian/patches/patchset-pf/amd-pstate/0009-cpufreq-amd-pstate-Call-amd_pstate_set_driver-in-amd.patch similarity index 97% rename from debian/patches/patchset-pf/amd-pstate/0028-cpufreq-amd-pstate-Call-amd_pstate_set_driver-in-amd.patch rename to debian/patches/patchset-pf/amd-pstate/0009-cpufreq-amd-pstate-Call-amd_pstate_set_driver-in-amd.patch index 39b68b6..37491dd 100644 --- a/debian/patches/patchset-pf/amd-pstate/0028-cpufreq-amd-pstate-Call-amd_pstate_set_driver-in-amd.patch +++ b/debian/patches/patchset-pf/amd-pstate/0009-cpufreq-amd-pstate-Call-amd_pstate_set_driver-in-amd.patch @@ -1,4 +1,4 @@ -From 7c658490b05f6ab4dd59e1c25e75ba1037f6cfeb Mon Sep 17 00:00:00 2001 +From 658af2bf561ee3883369b2caca4d688983f943de Mon Sep 17 00:00:00 2001 From: Dhananjay Ugwekar Date: Thu, 17 Oct 2024 10:05:29 +0000 Subject: cpufreq/amd-pstate: Call amd_pstate_set_driver() in diff --git a/debian/patches/patchset-pf/amd-pstate/0029-cpufreq-amd-pstate-Remove-the-switch-case-in-amd_pst.patch b/debian/patches/patchset-pf/amd-pstate/0010-cpufreq-amd-pstate-Remove-the-switch-case-in-amd_pst.patch similarity index 94% rename from debian/patches/patchset-pf/amd-pstate/0029-cpufreq-amd-pstate-Remove-the-switch-case-in-amd_pst.patch rename to debian/patches/patchset-pf/amd-pstate/0010-cpufreq-amd-pstate-Remove-the-switch-case-in-amd_pst.patch index 507e5e4..6171674 100644 --- a/debian/patches/patchset-pf/amd-pstate/0029-cpufreq-amd-pstate-Remove-the-switch-case-in-amd_pst.patch +++ b/debian/patches/patchset-pf/amd-pstate/0010-cpufreq-amd-pstate-Remove-the-switch-case-in-amd_pst.patch @@ -1,4 +1,4 @@ -From 55be5db97f4f52badc958463ee8d9cbc2ae91615 Mon Sep 17 00:00:00 2001 +From 0f2929e03651c101f1a6fa8ccf40167eb48c1789 Mon Sep 17 00:00:00 2001 From: Dhananjay Ugwekar Date: Thu, 17 Oct 2024 10:05:31 +0000 Subject: cpufreq/amd-pstate: Remove the switch case in amd_pstate_init() diff --git a/debian/patches/patchset-pf/amd-pstate/0010-x86-amd-Move-amd_get_highest_perf-out-of-amd-pstate.patch b/debian/patches/patchset-pf/amd-pstate/0010-x86-amd-Move-amd_get_highest_perf-out-of-amd-pstate.patch deleted file mode 100644 index 9115a48..0000000 --- a/debian/patches/patchset-pf/amd-pstate/0010-x86-amd-Move-amd_get_highest_perf-out-of-amd-pstate.patch +++ /dev/null @@ -1,138 +0,0 @@ -From 952e7bdc4cf67603f230f8eb91818ad4676e5a83 Mon Sep 17 00:00:00 2001 -From: Mario Limonciello -Date: Thu, 5 Sep 2024 11:30:02 -0500 -Subject: x86/amd: Move amd_get_highest_perf() out of amd-pstate - -amd_pstate_get_highest_perf() is a helper used to get the highest perf -value on AMD systems. It's used in amd-pstate as part of preferred -core handling, but applicable for acpi-cpufreq as well. - -Move it out to cppc handling code as amd_get_highest_perf(). - -Reviewed-by: Perry Yuan -Reviewed-by: Gautham R. Shenoy -Signed-off-by: Mario Limonciello -Reviewed-by: Gautham R. Shenoy ---- - arch/x86/kernel/acpi/cppc.c | 30 ++++++++++++++++++++++++++++++ - drivers/cpufreq/amd-pstate.c | 34 ++-------------------------------- - include/acpi/cppc_acpi.h | 5 +++++ - 3 files changed, 37 insertions(+), 32 deletions(-) - ---- a/arch/x86/kernel/acpi/cppc.c -+++ b/arch/x86/kernel/acpi/cppc.c -@@ -116,6 +116,36 @@ void init_freq_invariance_cppc(void) - mutex_unlock(&freq_invariance_lock); - } - -+/* -+ * Get the highest performance register value. -+ * @cpu: CPU from which to get highest performance. -+ * @highest_perf: Return address for highest performance value. -+ * -+ * Return: 0 for success, negative error code otherwise. -+ */ -+int amd_get_highest_perf(unsigned int cpu, u32 *highest_perf) -+{ -+ u64 val; -+ int ret; -+ -+ if (cpu_feature_enabled(X86_FEATURE_CPPC)) { -+ ret = rdmsrl_safe_on_cpu(cpu, MSR_AMD_CPPC_CAP1, &val); -+ if (ret) -+ goto out; -+ -+ val = AMD_CPPC_HIGHEST_PERF(val); -+ } else { -+ ret = cppc_get_highest_perf(cpu, &val); -+ if (ret) -+ goto out; -+ } -+ -+ WRITE_ONCE(*highest_perf, (u32)val); -+out: -+ return ret; -+} -+EXPORT_SYMBOL_GPL(amd_get_highest_perf); -+ - /** - * amd_get_boost_ratio_numerator: Get the numerator to use for boost ratio calculation - * @cpu: CPU to get numerator for. ---- a/drivers/cpufreq/amd-pstate.c -+++ b/drivers/cpufreq/amd-pstate.c -@@ -815,36 +815,6 @@ static void amd_pstste_sched_prefcore_wo - } - static DECLARE_WORK(sched_prefcore_work, amd_pstste_sched_prefcore_workfn); - --/* -- * Get the highest performance register value. -- * @cpu: CPU from which to get highest performance. -- * @highest_perf: Return address. -- * -- * Return: 0 for success, -EIO otherwise. -- */ --static int amd_pstate_get_highest_perf(int cpu, u32 *highest_perf) --{ -- int ret; -- -- if (cpu_feature_enabled(X86_FEATURE_CPPC)) { -- u64 cap1; -- -- ret = rdmsrl_safe_on_cpu(cpu, MSR_AMD_CPPC_CAP1, &cap1); -- if (ret) -- return ret; -- WRITE_ONCE(*highest_perf, AMD_CPPC_HIGHEST_PERF(cap1)); -- } else { -- u64 cppc_highest_perf; -- -- ret = cppc_get_highest_perf(cpu, &cppc_highest_perf); -- if (ret) -- return ret; -- WRITE_ONCE(*highest_perf, cppc_highest_perf); -- } -- -- return (ret); --} -- - #define CPPC_MAX_PERF U8_MAX - - static void amd_pstate_init_prefcore(struct amd_cpudata *cpudata) -@@ -852,7 +822,7 @@ static void amd_pstate_init_prefcore(str - int ret, prio; - u32 highest_perf; - -- ret = amd_pstate_get_highest_perf(cpudata->cpu, &highest_perf); -+ ret = amd_get_highest_perf(cpudata->cpu, &highest_perf); - if (ret) - return; - -@@ -896,7 +866,7 @@ static void amd_pstate_update_limits(uns - if ((!amd_pstate_prefcore) || (!cpudata->hw_prefcore)) - goto free_cpufreq_put; - -- ret = amd_pstate_get_highest_perf(cpu, &cur_high); -+ ret = amd_get_highest_perf(cpu, &cur_high); - if (ret) - goto free_cpufreq_put; - ---- a/include/acpi/cppc_acpi.h -+++ b/include/acpi/cppc_acpi.h -@@ -161,6 +161,7 @@ extern int cppc_get_epp_perf(int cpunum, - extern int cppc_set_epp_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls, bool enable); - extern int cppc_get_auto_sel_caps(int cpunum, struct cppc_perf_caps *perf_caps); - extern int cppc_set_auto_sel(int cpu, bool enable); -+extern int amd_get_highest_perf(unsigned int cpu, u32 *highest_perf); - extern int amd_get_boost_ratio_numerator(unsigned int cpu, u64 *numerator); - #else /* !CONFIG_ACPI_CPPC_LIB */ - static inline int cppc_get_desired_perf(int cpunum, u64 *desired_perf) -@@ -235,6 +236,10 @@ static inline int cppc_get_auto_sel_caps - { - return -EOPNOTSUPP; - } -+static inline int amd_get_highest_perf(unsigned int cpu, u32 *highest_perf) -+{ -+ return -ENODEV; -+} - static inline int amd_get_boost_ratio_numerator(unsigned int cpu, u64 *numerator) - { - return -EOPNOTSUPP; diff --git a/debian/patches/patchset-pf/amd-pstate/0030-cpufreq-amd-pstate-Remove-the-redundant-amd_pstate_s.patch b/debian/patches/patchset-pf/amd-pstate/0011-cpufreq-amd-pstate-Remove-the-redundant-amd_pstate_s.patch similarity index 95% rename from debian/patches/patchset-pf/amd-pstate/0030-cpufreq-amd-pstate-Remove-the-redundant-amd_pstate_s.patch rename to debian/patches/patchset-pf/amd-pstate/0011-cpufreq-amd-pstate-Remove-the-redundant-amd_pstate_s.patch index d66b162..9636497 100644 --- a/debian/patches/patchset-pf/amd-pstate/0030-cpufreq-amd-pstate-Remove-the-redundant-amd_pstate_s.patch +++ b/debian/patches/patchset-pf/amd-pstate/0011-cpufreq-amd-pstate-Remove-the-redundant-amd_pstate_s.patch @@ -1,4 +1,4 @@ -From 7305364888151cb9e6b435c5f219ccfd18132b58 Mon Sep 17 00:00:00 2001 +From bec664db265db933a107bac290601eb89acb938b Mon Sep 17 00:00:00 2001 From: Dhananjay Ugwekar Date: Thu, 17 Oct 2024 10:05:33 +0000 Subject: cpufreq/amd-pstate: Remove the redundant amd_pstate_set_driver() call diff --git a/debian/patches/patchset-pf/amd-pstate/0011-x86-amd-Detect-preferred-cores-in-amd_get_boost_rati.patch b/debian/patches/patchset-pf/amd-pstate/0011-x86-amd-Detect-preferred-cores-in-amd_get_boost_rati.patch deleted file mode 100644 index 948e4fe..0000000 --- a/debian/patches/patchset-pf/amd-pstate/0011-x86-amd-Detect-preferred-cores-in-amd_get_boost_rati.patch +++ /dev/null @@ -1,251 +0,0 @@ -From 3ab7da5bbf2087982dbfe2b0f2937d0dddc3afb1 Mon Sep 17 00:00:00 2001 -From: Mario Limonciello -Date: Thu, 5 Sep 2024 11:30:03 -0500 -Subject: x86/amd: Detect preferred cores in amd_get_boost_ratio_numerator() - -AMD systems that support preferred cores will use "166" as their -numerator for max frequency calculations instead of "255". - -Add a function for detecting preferred cores by looking at the -highest perf value on all cores. - -If preferred cores are enabled return 166 and if disabled the -value in the highest perf register. As the function will be called -multiple times, cache the values for the boost numerator and if -preferred cores will be enabled in global variables. - -Reviewed-by: Gautham R. Shenoy -Signed-off-by: Mario Limonciello ---- - arch/x86/kernel/acpi/cppc.c | 93 ++++++++++++++++++++++++++++++++---- - drivers/cpufreq/amd-pstate.c | 34 +++++-------- - include/acpi/cppc_acpi.h | 5 ++ - 3 files changed, 101 insertions(+), 31 deletions(-) - ---- a/arch/x86/kernel/acpi/cppc.c -+++ b/arch/x86/kernel/acpi/cppc.c -@@ -9,6 +9,16 @@ - #include - #include - -+#define CPPC_HIGHEST_PERF_PREFCORE 166 -+ -+enum amd_pref_core { -+ AMD_PREF_CORE_UNKNOWN = 0, -+ AMD_PREF_CORE_SUPPORTED, -+ AMD_PREF_CORE_UNSUPPORTED, -+}; -+static enum amd_pref_core amd_pref_core_detected; -+static u64 boost_numerator; -+ - /* Refer to drivers/acpi/cppc_acpi.c for the description of functions */ - - bool cpc_supported_by_cpu(void) -@@ -147,6 +157,66 @@ out: - EXPORT_SYMBOL_GPL(amd_get_highest_perf); - - /** -+ * amd_detect_prefcore: Detect if CPUs in the system support preferred cores -+ * @detected: Output variable for the result of the detection. -+ * -+ * Determine whether CPUs in the system support preferred cores. On systems -+ * that support preferred cores, different highest perf values will be found -+ * on different cores. On other systems, the highest perf value will be the -+ * same on all cores. -+ * -+ * The result of the detection will be stored in the 'detected' parameter. -+ * -+ * Return: 0 for success, negative error code otherwise -+ */ -+int amd_detect_prefcore(bool *detected) -+{ -+ int cpu, count = 0; -+ u64 highest_perf[2] = {0}; -+ -+ if (WARN_ON(!detected)) -+ return -EINVAL; -+ -+ switch (amd_pref_core_detected) { -+ case AMD_PREF_CORE_SUPPORTED: -+ *detected = true; -+ return 0; -+ case AMD_PREF_CORE_UNSUPPORTED: -+ *detected = false; -+ return 0; -+ default: -+ break; -+ } -+ -+ for_each_present_cpu(cpu) { -+ u32 tmp; -+ int ret; -+ -+ ret = amd_get_highest_perf(cpu, &tmp); -+ if (ret) -+ return ret; -+ -+ if (!count || (count == 1 && tmp != highest_perf[0])) -+ highest_perf[count++] = tmp; -+ -+ if (count == 2) -+ break; -+ } -+ -+ *detected = (count == 2); -+ boost_numerator = highest_perf[0]; -+ -+ amd_pref_core_detected = *detected ? AMD_PREF_CORE_SUPPORTED : -+ AMD_PREF_CORE_UNSUPPORTED; -+ -+ pr_debug("AMD CPPC preferred core is %ssupported (highest perf: 0x%llx)\n", -+ *detected ? "" : "un", highest_perf[0]); -+ -+ return 0; -+} -+EXPORT_SYMBOL_GPL(amd_detect_prefcore); -+ -+/** - * amd_get_boost_ratio_numerator: Get the numerator to use for boost ratio calculation - * @cpu: CPU to get numerator for. - * @numerator: Output variable for numerator. -@@ -155,24 +225,27 @@ EXPORT_SYMBOL_GPL(amd_get_highest_perf); - * a CPU. On systems that support preferred cores, this will be a hardcoded - * value. On other systems this will the highest performance register value. - * -+ * If booting the system with amd-pstate enabled but preferred cores disabled then -+ * the correct boost numerator will be returned to match hardware capabilities -+ * even if the preferred cores scheduling hints are not enabled. -+ * - * Return: 0 for success, negative error code otherwise. - */ - int amd_get_boost_ratio_numerator(unsigned int cpu, u64 *numerator) - { -- struct cpuinfo_x86 *c = &boot_cpu_data; -- -- if (c->x86 == 0x17 && ((c->x86_model >= 0x30 && c->x86_model < 0x40) || -- (c->x86_model >= 0x70 && c->x86_model < 0x80))) { -- *numerator = 166; -- return 0; -- } -+ bool prefcore; -+ int ret; - -- if (c->x86 == 0x19 && ((c->x86_model >= 0x20 && c->x86_model < 0x30) || -- (c->x86_model >= 0x40 && c->x86_model < 0x70))) { -- *numerator = 166; -+ ret = amd_detect_prefcore(&prefcore); -+ if (ret) -+ return ret; -+ -+ /* without preferred cores, return the highest perf register value */ -+ if (!prefcore) { -+ *numerator = boost_numerator; - return 0; - } -- *numerator = 255; -+ *numerator = CPPC_HIGHEST_PERF_PREFCORE; - - return 0; - } ---- a/drivers/cpufreq/amd-pstate.c -+++ b/drivers/cpufreq/amd-pstate.c -@@ -819,32 +819,18 @@ static DECLARE_WORK(sched_prefcore_work, - - static void amd_pstate_init_prefcore(struct amd_cpudata *cpudata) - { -- int ret, prio; -- u32 highest_perf; -- -- ret = amd_get_highest_perf(cpudata->cpu, &highest_perf); -- if (ret) -+ /* user disabled or not detected */ -+ if (!amd_pstate_prefcore) - return; - - cpudata->hw_prefcore = true; -- /* check if CPPC preferred core feature is enabled*/ -- if (highest_perf < CPPC_MAX_PERF) -- prio = (int)highest_perf; -- else { -- pr_debug("AMD CPPC preferred core is unsupported!\n"); -- cpudata->hw_prefcore = false; -- return; -- } -- -- if (!amd_pstate_prefcore) -- return; - - /* - * The priorities can be set regardless of whether or not - * sched_set_itmt_support(true) has been called and it is valid to - * update them at any time after it has been called. - */ -- sched_set_itmt_core_prio(prio, cpudata->cpu); -+ sched_set_itmt_core_prio((int)READ_ONCE(cpudata->highest_perf), cpudata->cpu); - - schedule_work(&sched_prefcore_work); - } -@@ -1015,12 +1001,12 @@ static int amd_pstate_cpu_init(struct cp - - cpudata->cpu = policy->cpu; - -- amd_pstate_init_prefcore(cpudata); -- - ret = amd_pstate_init_perf(cpudata); - if (ret) - goto free_cpudata1; - -+ amd_pstate_init_prefcore(cpudata); -+ - ret = amd_pstate_init_freq(cpudata); - if (ret) - goto free_cpudata1; -@@ -1481,12 +1467,12 @@ static int amd_pstate_epp_cpu_init(struc - cpudata->cpu = policy->cpu; - cpudata->epp_policy = 0; - -- amd_pstate_init_prefcore(cpudata); -- - ret = amd_pstate_init_perf(cpudata); - if (ret) - goto free_cpudata1; - -+ amd_pstate_init_prefcore(cpudata); -+ - ret = amd_pstate_init_freq(cpudata); - if (ret) - goto free_cpudata1; -@@ -1948,6 +1934,12 @@ static int __init amd_pstate_init(void) - static_call_update(amd_pstate_update_perf, cppc_update_perf); - } - -+ if (amd_pstate_prefcore) { -+ ret = amd_detect_prefcore(&amd_pstate_prefcore); -+ if (ret) -+ return ret; -+ } -+ - /* enable amd pstate feature */ - ret = amd_pstate_enable(true); - if (ret) { ---- a/include/acpi/cppc_acpi.h -+++ b/include/acpi/cppc_acpi.h -@@ -163,6 +163,7 @@ extern int cppc_get_auto_sel_caps(int cp - extern int cppc_set_auto_sel(int cpu, bool enable); - extern int amd_get_highest_perf(unsigned int cpu, u32 *highest_perf); - extern int amd_get_boost_ratio_numerator(unsigned int cpu, u64 *numerator); -+extern int amd_detect_prefcore(bool *detected); - #else /* !CONFIG_ACPI_CPPC_LIB */ - static inline int cppc_get_desired_perf(int cpunum, u64 *desired_perf) - { -@@ -244,6 +245,10 @@ static inline int amd_get_boost_ratio_nu - { - return -EOPNOTSUPP; - } -+static inline int amd_detect_prefcore(bool *detected) -+{ -+ return -ENODEV; -+} - #endif /* !CONFIG_ACPI_CPPC_LIB */ - - #endif /* _CPPC_ACPI_H*/ diff --git a/debian/patches/patchset-pf/amd-pstate/0012-cpufreq-amd-pstate-Merge-amd_pstate_highest_perf_set.patch b/debian/patches/patchset-pf/amd-pstate/0012-cpufreq-amd-pstate-Merge-amd_pstate_highest_perf_set.patch deleted file mode 100644 index 0906c42..0000000 --- a/debian/patches/patchset-pf/amd-pstate/0012-cpufreq-amd-pstate-Merge-amd_pstate_highest_perf_set.patch +++ /dev/null @@ -1,169 +0,0 @@ -From 68d89574b86625f4bd7a784fe9bcc221dc290e4f Mon Sep 17 00:00:00 2001 -From: Mario Limonciello -Date: Thu, 5 Sep 2024 11:30:04 -0500 -Subject: cpufreq: amd-pstate: Merge amd_pstate_highest_perf_set() into - amd_get_boost_ratio_numerator() - -The special case in amd_pstate_highest_perf_set() is the value used -for calculating the boost numerator. Merge this into -amd_get_boost_ratio_numerator() and then use that to calculate boost -ratio. - -This allows dropping more special casing of the highest perf value. - -Reviewed-by: Gautham R. Shenoy -Signed-off-by: Mario Limonciello -Reviewed-by: Gautham R. Shenoy ---- - Documentation/admin-guide/pm/amd-pstate.rst | 3 +- - arch/x86/kernel/acpi/cppc.c | 16 +++++++ - drivers/cpufreq/amd-pstate.c | 52 ++++----------------- - 3 files changed, 28 insertions(+), 43 deletions(-) - ---- a/Documentation/admin-guide/pm/amd-pstate.rst -+++ b/Documentation/admin-guide/pm/amd-pstate.rst -@@ -251,7 +251,8 @@ performance supported in `AMD CPPC Perfo - In some ASICs, the highest CPPC performance is not the one in the ``_CPC`` - table, so we need to expose it to sysfs. If boost is not active, but - still supported, this maximum frequency will be larger than the one in --``cpuinfo``. -+``cpuinfo``. On systems that support preferred core, the driver will have -+different values for some cores than others. - This attribute is read-only. - - ``amd_pstate_lowest_nonlinear_freq`` ---- a/arch/x86/kernel/acpi/cppc.c -+++ b/arch/x86/kernel/acpi/cppc.c -@@ -9,6 +9,7 @@ - #include - #include - -+#define CPPC_HIGHEST_PERF_PERFORMANCE 196 - #define CPPC_HIGHEST_PERF_PREFCORE 166 - - enum amd_pref_core { -@@ -245,6 +246,21 @@ int amd_get_boost_ratio_numerator(unsign - *numerator = boost_numerator; - return 0; - } -+ -+ /* -+ * For AMD CPUs with Family ID 19H and Model ID range 0x70 to 0x7f, -+ * the highest performance level is set to 196. -+ * https://bugzilla.kernel.org/show_bug.cgi?id=218759 -+ */ -+ if (cpu_feature_enabled(X86_FEATURE_ZEN4)) { -+ switch (boot_cpu_data.x86_model) { -+ case 0x70 ... 0x7f: -+ *numerator = CPPC_HIGHEST_PERF_PERFORMANCE; -+ return 0; -+ default: -+ break; -+ } -+ } - *numerator = CPPC_HIGHEST_PERF_PREFCORE; - - return 0; ---- a/drivers/cpufreq/amd-pstate.c -+++ b/drivers/cpufreq/amd-pstate.c -@@ -52,8 +52,6 @@ - #define AMD_PSTATE_TRANSITION_LATENCY 20000 - #define AMD_PSTATE_TRANSITION_DELAY 1000 - #define AMD_PSTATE_FAST_CPPC_TRANSITION_DELAY 600 --#define CPPC_HIGHEST_PERF_PERFORMANCE 196 --#define CPPC_HIGHEST_PERF_DEFAULT 166 - - #define AMD_CPPC_EPP_PERFORMANCE 0x00 - #define AMD_CPPC_EPP_BALANCE_PERFORMANCE 0x80 -@@ -398,43 +396,17 @@ static inline int amd_pstate_enable(bool - return static_call(amd_pstate_enable)(enable); - } - --static u32 amd_pstate_highest_perf_set(struct amd_cpudata *cpudata) --{ -- struct cpuinfo_x86 *c = &cpu_data(0); -- -- /* -- * For AMD CPUs with Family ID 19H and Model ID range 0x70 to 0x7f, -- * the highest performance level is set to 196. -- * https://bugzilla.kernel.org/show_bug.cgi?id=218759 -- */ -- if (c->x86 == 0x19 && (c->x86_model >= 0x70 && c->x86_model <= 0x7f)) -- return CPPC_HIGHEST_PERF_PERFORMANCE; -- -- return CPPC_HIGHEST_PERF_DEFAULT; --} -- - static int pstate_init_perf(struct amd_cpudata *cpudata) - { - u64 cap1; -- u32 highest_perf; - - int ret = rdmsrl_safe_on_cpu(cpudata->cpu, MSR_AMD_CPPC_CAP1, - &cap1); - if (ret) - return ret; - -- /* For platforms that do not support the preferred core feature, the -- * highest_pef may be configured with 166 or 255, to avoid max frequency -- * calculated wrongly. we take the AMD_CPPC_HIGHEST_PERF(cap1) value as -- * the default max perf. -- */ -- if (cpudata->hw_prefcore) -- highest_perf = amd_pstate_highest_perf_set(cpudata); -- else -- highest_perf = AMD_CPPC_HIGHEST_PERF(cap1); -- -- WRITE_ONCE(cpudata->highest_perf, highest_perf); -- WRITE_ONCE(cpudata->max_limit_perf, highest_perf); -+ WRITE_ONCE(cpudata->highest_perf, AMD_CPPC_HIGHEST_PERF(cap1)); -+ WRITE_ONCE(cpudata->max_limit_perf, AMD_CPPC_HIGHEST_PERF(cap1)); - WRITE_ONCE(cpudata->nominal_perf, AMD_CPPC_NOMINAL_PERF(cap1)); - WRITE_ONCE(cpudata->lowest_nonlinear_perf, AMD_CPPC_LOWNONLIN_PERF(cap1)); - WRITE_ONCE(cpudata->lowest_perf, AMD_CPPC_LOWEST_PERF(cap1)); -@@ -446,19 +418,13 @@ static int pstate_init_perf(struct amd_c - static int cppc_init_perf(struct amd_cpudata *cpudata) - { - struct cppc_perf_caps cppc_perf; -- u32 highest_perf; - - int ret = cppc_get_perf_caps(cpudata->cpu, &cppc_perf); - if (ret) - return ret; - -- if (cpudata->hw_prefcore) -- highest_perf = amd_pstate_highest_perf_set(cpudata); -- else -- highest_perf = cppc_perf.highest_perf; -- -- WRITE_ONCE(cpudata->highest_perf, highest_perf); -- WRITE_ONCE(cpudata->max_limit_perf, highest_perf); -+ WRITE_ONCE(cpudata->highest_perf, cppc_perf.highest_perf); -+ WRITE_ONCE(cpudata->max_limit_perf, cppc_perf.highest_perf); - WRITE_ONCE(cpudata->nominal_perf, cppc_perf.nominal_perf); - WRITE_ONCE(cpudata->lowest_nonlinear_perf, - cppc_perf.lowest_nonlinear_perf); -@@ -922,8 +888,8 @@ static u32 amd_pstate_get_transition_lat - static int amd_pstate_init_freq(struct amd_cpudata *cpudata) - { - int ret; -- u32 min_freq; -- u32 highest_perf, max_freq; -+ u32 min_freq, max_freq; -+ u64 numerator; - u32 nominal_perf, nominal_freq; - u32 lowest_nonlinear_perf, lowest_nonlinear_freq; - u32 boost_ratio, lowest_nonlinear_ratio; -@@ -945,8 +911,10 @@ static int amd_pstate_init_freq(struct a - - nominal_perf = READ_ONCE(cpudata->nominal_perf); - -- highest_perf = READ_ONCE(cpudata->highest_perf); -- boost_ratio = div_u64(highest_perf << SCHED_CAPACITY_SHIFT, nominal_perf); -+ ret = amd_get_boost_ratio_numerator(cpudata->cpu, &numerator); -+ if (ret) -+ return ret; -+ boost_ratio = div_u64(numerator << SCHED_CAPACITY_SHIFT, nominal_perf); - max_freq = (nominal_freq * boost_ratio >> SCHED_CAPACITY_SHIFT) * 1000; - - lowest_nonlinear_perf = READ_ONCE(cpudata->lowest_nonlinear_perf); diff --git a/debian/patches/patchset-pf/amd-pstate/0031-cpufreq-amd-pstate-ut-Add-fix-for-min-freq-unit-test.patch b/debian/patches/patchset-pf/amd-pstate/0012-cpufreq-amd-pstate-ut-Add-fix-for-min-freq-unit-test.patch similarity index 95% rename from debian/patches/patchset-pf/amd-pstate/0031-cpufreq-amd-pstate-ut-Add-fix-for-min-freq-unit-test.patch rename to debian/patches/patchset-pf/amd-pstate/0012-cpufreq-amd-pstate-ut-Add-fix-for-min-freq-unit-test.patch index 30b28d1..b2c20e9 100644 --- a/debian/patches/patchset-pf/amd-pstate/0031-cpufreq-amd-pstate-ut-Add-fix-for-min-freq-unit-test.patch +++ b/debian/patches/patchset-pf/amd-pstate/0012-cpufreq-amd-pstate-ut-Add-fix-for-min-freq-unit-test.patch @@ -1,4 +1,4 @@ -From 5886ef269d069c72ea952cb00699e16221289e8c Mon Sep 17 00:00:00 2001 +From 82d4b19d01912cd9c2cfb3c638a43cc2b04ffc63 Mon Sep 17 00:00:00 2001 From: Mario Limonciello Date: Thu, 17 Oct 2024 12:34:39 -0500 Subject: cpufreq/amd-pstate-ut: Add fix for min freq unit test diff --git a/debian/patches/patchset-pf/amd-pstate/0033-amd-pstate-Switch-to-amd-pstate-by-default-on-some-S.patch b/debian/patches/patchset-pf/amd-pstate/0013-amd-pstate-Switch-to-amd-pstate-by-default-on-some-S.patch similarity index 96% rename from debian/patches/patchset-pf/amd-pstate/0033-amd-pstate-Switch-to-amd-pstate-by-default-on-some-S.patch rename to debian/patches/patchset-pf/amd-pstate/0013-amd-pstate-Switch-to-amd-pstate-by-default-on-some-S.patch index bfe6fd4..9284dbf 100644 --- a/debian/patches/patchset-pf/amd-pstate/0033-amd-pstate-Switch-to-amd-pstate-by-default-on-some-S.patch +++ b/debian/patches/patchset-pf/amd-pstate/0013-amd-pstate-Switch-to-amd-pstate-by-default-on-some-S.patch @@ -1,4 +1,4 @@ -From 497447cf96a785a4edd0756da5d5718037f5687c Mon Sep 17 00:00:00 2001 +From b1bc26a3ecd5afc4d6106332910fbdc3f6718acd Mon Sep 17 00:00:00 2001 From: Swapnil Sapkal Date: Mon, 21 Oct 2024 15:48:36 +0530 Subject: amd-pstate: Switch to amd-pstate by default on some Server platforms diff --git a/debian/patches/patchset-pf/amd-pstate/0013-cpufreq-amd-pstate-Optimize-amd_pstate_update_limits.patch b/debian/patches/patchset-pf/amd-pstate/0013-cpufreq-amd-pstate-Optimize-amd_pstate_update_limits.patch deleted file mode 100644 index 6c940bc..0000000 --- a/debian/patches/patchset-pf/amd-pstate/0013-cpufreq-amd-pstate-Optimize-amd_pstate_update_limits.patch +++ /dev/null @@ -1,42 +0,0 @@ -From deed718125e73b6bf280dcebb80c39108226388c Mon Sep 17 00:00:00 2001 -From: Mario Limonciello -Date: Thu, 5 Sep 2024 11:30:05 -0500 -Subject: cpufreq: amd-pstate: Optimize amd_pstate_update_limits() - -Don't take and release the mutex when prefcore isn't present and -avoid initialization of variables that will be initially set -in the function. - -Reviewed-by: Gautham R. Shenoy -Reviewed-by: Perry Yuan -Signed-off-by: Mario Limonciello -Reviewed-by: Gautham R. Shenoy ---- - drivers/cpufreq/amd-pstate.c | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - ---- a/drivers/cpufreq/amd-pstate.c -+++ b/drivers/cpufreq/amd-pstate.c -@@ -814,17 +814,17 @@ static void amd_pstate_update_limits(uns - - cpudata = policy->driver_data; - -- mutex_lock(&amd_pstate_driver_lock); -- if ((!amd_pstate_prefcore) || (!cpudata->hw_prefcore)) -- goto free_cpufreq_put; -+ if (!amd_pstate_prefcore) -+ return; - -+ mutex_lock(&amd_pstate_driver_lock); - ret = amd_get_highest_perf(cpu, &cur_high); - if (ret) - goto free_cpufreq_put; - - prev_high = READ_ONCE(cpudata->prefcore_ranking); -- if (prev_high != cur_high) { -- highest_perf_changed = true; -+ highest_perf_changed = (prev_high != cur_high); -+ if (highest_perf_changed) { - WRITE_ONCE(cpudata->prefcore_ranking, cur_high); - - if (cur_high < CPPC_MAX_PERF) diff --git a/debian/patches/patchset-pf/amd-pstate/0014-cpufreq-amd-pstate-Add-documentation-for-amd_pstate_.patch b/debian/patches/patchset-pf/amd-pstate/0014-cpufreq-amd-pstate-Add-documentation-for-amd_pstate_.patch deleted file mode 100644 index 34b04aa..0000000 --- a/debian/patches/patchset-pf/amd-pstate/0014-cpufreq-amd-pstate-Add-documentation-for-amd_pstate_.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 391075a34e392c7cacd338a6b034a21a10679855 Mon Sep 17 00:00:00 2001 -From: Mario Limonciello -Date: Thu, 5 Sep 2024 11:30:06 -0500 -Subject: cpufreq: amd-pstate: Add documentation for `amd_pstate_hw_prefcore` - -Explain that the sysfs file represents both preferred core being -enabled by the user and supported by the hardware. - -Reviewed-by: Gautham R. Shenoy -Signed-off-by: Mario Limonciello -Reviewed-by: Gautham R. Shenoy ---- - Documentation/admin-guide/pm/amd-pstate.rst | 5 +++++ - 1 file changed, 5 insertions(+) - ---- a/Documentation/admin-guide/pm/amd-pstate.rst -+++ b/Documentation/admin-guide/pm/amd-pstate.rst -@@ -263,6 +263,11 @@ lowest non-linear performance in `AMD CP - `_.) - This attribute is read-only. - -+``amd_pstate_hw_prefcore`` -+ -+Whether the platform supports the preferred core feature and it has been -+enabled. This attribute is read-only. -+ - ``energy_performance_available_preferences`` - - A list of all the supported EPP preferences that could be used for diff --git a/debian/patches/patchset-pf/amd-pstate/0014-cpufreq-amd-pstate-Rename-functions-that-enable-CPPC.patch b/debian/patches/patchset-pf/amd-pstate/0014-cpufreq-amd-pstate-Rename-functions-that-enable-CPPC.patch new file mode 100644 index 0000000..961b30b --- /dev/null +++ b/debian/patches/patchset-pf/amd-pstate/0014-cpufreq-amd-pstate-Rename-functions-that-enable-CPPC.patch @@ -0,0 +1,121 @@ +From ca32f306d11e95ca133a2f90249bb4555c2742c3 Mon Sep 17 00:00:00 2001 +From: Dhananjay Ugwekar +Date: Wed, 23 Oct 2024 10:21:06 +0000 +Subject: cpufreq/amd-pstate: Rename functions that enable CPPC + +Explicitly rename functions that enable CPPC as *_cppc_*. + +Signed-off-by: Dhananjay Ugwekar +Reviewed-by: Perry Yuan +Reviewed-by: Mario Limonciello +--- + drivers/cpufreq/amd-pstate.c | 26 +++++++++++++------------- + 1 file changed, 13 insertions(+), 13 deletions(-) + +--- a/drivers/cpufreq/amd-pstate.c ++++ b/drivers/cpufreq/amd-pstate.c +@@ -336,7 +336,7 @@ static int amd_pstate_set_energy_pref_in + return ret; + } + +-static inline int msr_enable(bool enable) ++static inline int msr_cppc_enable(bool enable) + { + int ret, cpu; + unsigned long logical_proc_id_mask = 0; +@@ -362,7 +362,7 @@ static inline int msr_enable(bool enable + return 0; + } + +-static int shmem_enable(bool enable) ++static int shmem_cppc_enable(bool enable) + { + int cpu, ret = 0; + struct cppc_perf_ctrls perf_ctrls; +@@ -389,11 +389,11 @@ static int shmem_enable(bool enable) + return ret; + } + +-DEFINE_STATIC_CALL(amd_pstate_enable, msr_enable); ++DEFINE_STATIC_CALL(amd_pstate_cppc_enable, msr_cppc_enable); + +-static inline int amd_pstate_enable(bool enable) ++static inline int amd_pstate_cppc_enable(bool enable) + { +- return static_call(amd_pstate_enable)(enable); ++ return static_call(amd_pstate_cppc_enable)(enable); + } + + static int msr_init_perf(struct amd_cpudata *cpudata) +@@ -1072,7 +1072,7 @@ static int amd_pstate_cpu_resume(struct + { + int ret; + +- ret = amd_pstate_enable(true); ++ ret = amd_pstate_cppc_enable(true); + if (ret) + pr_err("failed to enable amd-pstate during resume, return %d\n", ret); + +@@ -1083,7 +1083,7 @@ static int amd_pstate_cpu_suspend(struct + { + int ret; + +- ret = amd_pstate_enable(false); ++ ret = amd_pstate_cppc_enable(false); + if (ret) + pr_err("failed to disable amd-pstate during suspend, return %d\n", ret); + +@@ -1216,7 +1216,7 @@ static ssize_t show_energy_performance_p + + static void amd_pstate_driver_cleanup(void) + { +- amd_pstate_enable(false); ++ amd_pstate_cppc_enable(false); + cppc_state = AMD_PSTATE_DISABLE; + current_pstate_driver = NULL; + } +@@ -1250,7 +1250,7 @@ static int amd_pstate_register_driver(in + + cppc_state = mode; + +- ret = amd_pstate_enable(true); ++ ret = amd_pstate_cppc_enable(true); + if (ret) { + pr_err("failed to enable cppc during amd-pstate driver registration, return %d\n", + ret); +@@ -1629,7 +1629,7 @@ static void amd_pstate_epp_reenable(stru + u64 value, max_perf; + int ret; + +- ret = amd_pstate_enable(true); ++ ret = amd_pstate_cppc_enable(true); + if (ret) + pr_err("failed to enable amd pstate during resume, return %d\n", ret); + +@@ -1716,7 +1716,7 @@ static int amd_pstate_epp_suspend(struct + cpudata->suspended = true; + + /* disable CPPC in lowlevel firmware */ +- ret = amd_pstate_enable(false); ++ ret = amd_pstate_cppc_enable(false); + if (ret) + pr_err("failed to suspend, return %d\n", ret); + +@@ -1891,7 +1891,7 @@ static int __init amd_pstate_init(void) + current_pstate_driver->adjust_perf = amd_pstate_adjust_perf; + } else { + pr_debug("AMD CPPC shared memory based functionality is supported\n"); +- static_call_update(amd_pstate_enable, shmem_enable); ++ static_call_update(amd_pstate_cppc_enable, shmem_cppc_enable); + static_call_update(amd_pstate_init_perf, shmem_init_perf); + static_call_update(amd_pstate_update_perf, shmem_update_perf); + } +@@ -1916,7 +1916,7 @@ static int __init amd_pstate_init(void) + + global_attr_free: + cpufreq_unregister_driver(current_pstate_driver); +- amd_pstate_enable(false); ++ amd_pstate_cppc_enable(false); + return ret; + } + device_initcall(amd_pstate_init); diff --git a/debian/patches/patchset-pf/amd-pstate/0015-amd-pstate-Add-missing-documentation-for-amd_pstate_.patch b/debian/patches/patchset-pf/amd-pstate/0015-amd-pstate-Add-missing-documentation-for-amd_pstate_.patch deleted file mode 100644 index 09b194b..0000000 --- a/debian/patches/patchset-pf/amd-pstate/0015-amd-pstate-Add-missing-documentation-for-amd_pstate_.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 2ed9874f6dcafcc2bee7a922af9e1d1c62dbeb18 Mon Sep 17 00:00:00 2001 -From: Mario Limonciello -Date: Thu, 5 Sep 2024 11:30:07 -0500 -Subject: amd-pstate: Add missing documentation for - `amd_pstate_prefcore_ranking` - -`amd_pstate_prefcore_ranking` reflects the dynamic rankings of a CPU -core based on platform conditions. Explicitly include it in the -documentation. - -Reviewed-by: Gautham R. Shenoy -Signed-off-by: Mario Limonciello -Reviewed-by: Gautham R. Shenoy ---- - Documentation/admin-guide/pm/amd-pstate.rst | 9 ++++++++- - 1 file changed, 8 insertions(+), 1 deletion(-) - ---- a/Documentation/admin-guide/pm/amd-pstate.rst -+++ b/Documentation/admin-guide/pm/amd-pstate.rst -@@ -252,7 +252,8 @@ In some ASICs, the highest CPPC performa - table, so we need to expose it to sysfs. If boost is not active, but - still supported, this maximum frequency will be larger than the one in - ``cpuinfo``. On systems that support preferred core, the driver will have --different values for some cores than others. -+different values for some cores than others and this will reflect the values -+advertised by the platform at bootup. - This attribute is read-only. - - ``amd_pstate_lowest_nonlinear_freq`` -@@ -268,6 +269,12 @@ This attribute is read-only. - Whether the platform supports the preferred core feature and it has been - enabled. This attribute is read-only. - -+``amd_pstate_prefcore_ranking`` -+ -+The performance ranking of the core. This number doesn't have any unit, but -+larger numbers are preferred at the time of reading. This can change at -+runtime based on platform conditions. This attribute is read-only. -+ - ``energy_performance_available_preferences`` - - A list of all the supported EPP preferences that could be used for diff --git a/debian/patches/patchset-pf/amd-pstate/0015-cpufreq-amd-pstate-Do-not-attempt-to-clear-MSR_AMD_C.patch b/debian/patches/patchset-pf/amd-pstate/0015-cpufreq-amd-pstate-Do-not-attempt-to-clear-MSR_AMD_C.patch new file mode 100644 index 0000000..87c80c7 --- /dev/null +++ b/debian/patches/patchset-pf/amd-pstate/0015-cpufreq-amd-pstate-Do-not-attempt-to-clear-MSR_AMD_C.patch @@ -0,0 +1,30 @@ +From de31d4a11e894a73ed7ef2388fb27f0bb4036de3 Mon Sep 17 00:00:00 2001 +From: Dhananjay Ugwekar +Date: Wed, 23 Oct 2024 10:21:08 +0000 +Subject: cpufreq/amd-pstate: Do not attempt to clear MSR_AMD_CPPC_ENABLE + +MSR_AMD_CPPC_ENABLE is a write once register, i.e. attempting to clear +it is futile, it will not take effect. Hence, return if disable (0) +argument is passed to the msr_cppc_enable() + +Signed-off-by: Dhananjay Ugwekar +Reviewed-by: Mario Limonciello +--- + drivers/cpufreq/amd-pstate.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/drivers/cpufreq/amd-pstate.c ++++ b/drivers/cpufreq/amd-pstate.c +@@ -341,6 +341,12 @@ static inline int msr_cppc_enable(bool e + int ret, cpu; + unsigned long logical_proc_id_mask = 0; + ++ /* ++ * MSR_AMD_CPPC_ENABLE is write-once, once set it cannot be cleared. ++ */ ++ if (!enable) ++ return 0; ++ + if (enable == cppc_enabled) + return 0; + diff --git a/debian/patches/patchset-pf/amd-pstate/0016-cpufreq-amd-pstate-Call-cppc_set_epp_perf-in-the-ree.patch b/debian/patches/patchset-pf/amd-pstate/0016-cpufreq-amd-pstate-Call-cppc_set_epp_perf-in-the-ree.patch new file mode 100644 index 0000000..cc202b5 --- /dev/null +++ b/debian/patches/patchset-pf/amd-pstate/0016-cpufreq-amd-pstate-Call-cppc_set_epp_perf-in-the-ree.patch @@ -0,0 +1,39 @@ +From c5eadae39ccdf6bada95c834147e285e445b12ad Mon Sep 17 00:00:00 2001 +From: Dhananjay Ugwekar +Date: Wed, 23 Oct 2024 10:21:10 +0000 +Subject: cpufreq/amd-pstate: Call cppc_set_epp_perf in the reenable function + +The EPP value being set in perf_ctrls.energy_perf is not being propagated +to the shared memory, fix that. + +Signed-off-by: Dhananjay Ugwekar +Reviewed-by: Perry Yuan +Reviewed-by: Mario Limonciello +--- + drivers/cpufreq/amd-pstate.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/drivers/cpufreq/amd-pstate.c ++++ b/drivers/cpufreq/amd-pstate.c +@@ -1646,8 +1646,9 @@ static void amd_pstate_epp_reenable(stru + wrmsrl_on_cpu(cpudata->cpu, MSR_AMD_CPPC_REQ, value); + } else { + perf_ctrls.max_perf = max_perf; +- perf_ctrls.energy_perf = AMD_CPPC_ENERGY_PERF_PREF(cpudata->epp_cached); + cppc_set_perf(cpudata->cpu, &perf_ctrls); ++ perf_ctrls.energy_perf = AMD_CPPC_ENERGY_PERF_PREF(cpudata->epp_cached); ++ cppc_set_epp_perf(cpudata->cpu, &perf_ctrls, 1); + } + } + +@@ -1688,8 +1689,9 @@ static void amd_pstate_epp_offline(struc + } else { + perf_ctrls.desired_perf = 0; + perf_ctrls.max_perf = min_perf; +- perf_ctrls.energy_perf = AMD_CPPC_ENERGY_PERF_PREF(HWP_EPP_BALANCE_POWERSAVE); + cppc_set_perf(cpudata->cpu, &perf_ctrls); ++ perf_ctrls.energy_perf = AMD_CPPC_ENERGY_PERF_PREF(HWP_EPP_BALANCE_POWERSAVE); ++ cppc_set_epp_perf(cpudata->cpu, &perf_ctrls, 1); + } + mutex_unlock(&amd_pstate_limits_lock); + } diff --git a/debian/patches/patchset-pf/amd-pstate/0017-cpufreq-amd-pstate-Align-offline-flow-of-shared-memo.patch b/debian/patches/patchset-pf/amd-pstate/0017-cpufreq-amd-pstate-Align-offline-flow-of-shared-memo.patch new file mode 100644 index 0000000..c9805db --- /dev/null +++ b/debian/patches/patchset-pf/amd-pstate/0017-cpufreq-amd-pstate-Align-offline-flow-of-shared-memo.patch @@ -0,0 +1,25 @@ +From 275a7a8c95ac5d0c0ff586acd882d751478f6a00 Mon Sep 17 00:00:00 2001 +From: Dhananjay Ugwekar +Date: Wed, 23 Oct 2024 10:21:12 +0000 +Subject: cpufreq/amd-pstate: Align offline flow of shared memory and MSR based + systems + +Set min_perf to lowest_perf for shared memory systems, similar to the MSR +based systems. + +Signed-off-by: Dhananjay Ugwekar +Reviewed-by: Mario Limonciello +--- + drivers/cpufreq/amd-pstate.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/cpufreq/amd-pstate.c ++++ b/drivers/cpufreq/amd-pstate.c +@@ -1688,6 +1688,7 @@ static void amd_pstate_epp_offline(struc + wrmsrl_on_cpu(cpudata->cpu, MSR_AMD_CPPC_REQ, value); + } else { + perf_ctrls.desired_perf = 0; ++ perf_ctrls.min_perf = min_perf; + perf_ctrls.max_perf = min_perf; + cppc_set_perf(cpudata->cpu, &perf_ctrls); + perf_ctrls.energy_perf = AMD_CPPC_ENERGY_PERF_PREF(HWP_EPP_BALANCE_POWERSAVE); diff --git a/debian/patches/patchset-pf/amd-pstate/0017-cpufreq-amd-pstate-ut-Fix-an-Uninitialized-variables.patch b/debian/patches/patchset-pf/amd-pstate/0017-cpufreq-amd-pstate-ut-Fix-an-Uninitialized-variables.patch deleted file mode 100644 index e770805..0000000 --- a/debian/patches/patchset-pf/amd-pstate/0017-cpufreq-amd-pstate-ut-Fix-an-Uninitialized-variables.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 185e64a7e1a749593f3d6dadc666da9dda82d48c Mon Sep 17 00:00:00 2001 -From: Qianqiang Liu -Date: Wed, 11 Sep 2024 07:39:24 +0800 -Subject: cpufreq/amd-pstate-ut: Fix an "Uninitialized variables" issue - -Using uninitialized value "mode2" when calling "amd_pstate_get_mode_string". -Set "mode2" to "AMD_PSTATE_DISABLE" by default. - -Signed-off-by: Qianqiang Liu ---- - drivers/cpufreq/amd-pstate-ut.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/drivers/cpufreq/amd-pstate-ut.c -+++ b/drivers/cpufreq/amd-pstate-ut.c -@@ -270,7 +270,7 @@ static int amd_pstate_set_mode(enum amd_ - - static void amd_pstate_ut_check_driver(u32 index) - { -- enum amd_pstate_mode mode1, mode2; -+ enum amd_pstate_mode mode1, mode2 = AMD_PSTATE_DISABLE; - int ret; - - for (mode1 = AMD_PSTATE_DISABLE; mode1 < AMD_PSTATE_MAX; mode1++) { diff --git a/debian/patches/patchset-pf/amd-pstate/0018-x86-cpufeatures-Rename-X86_FEATURE_FAST_CPPC-to-have.patch b/debian/patches/patchset-pf/amd-pstate/0018-x86-cpufeatures-Rename-X86_FEATURE_FAST_CPPC-to-have.patch new file mode 100644 index 0000000..ef64f45 --- /dev/null +++ b/debian/patches/patchset-pf/amd-pstate/0018-x86-cpufeatures-Rename-X86_FEATURE_FAST_CPPC-to-have.patch @@ -0,0 +1,60 @@ +From 173172a4604a050ccb5a6745acd9fa90d01257a7 Mon Sep 17 00:00:00 2001 +From: Mario Limonciello +Date: Fri, 25 Oct 2024 12:14:55 -0500 +Subject: x86/cpufeatures: Rename X86_FEATURE_FAST_CPPC to have AMD prefix + +This feature is an AMD unique feature of some processors, so put +AMD into the name. + +Signed-off-by: Mario Limonciello +--- + arch/x86/include/asm/cpufeatures.h | 2 +- + arch/x86/kernel/cpu/scattered.c | 2 +- + drivers/cpufreq/amd-pstate.c | 2 +- + tools/arch/x86/include/asm/cpufeatures.h | 2 +- + 4 files changed, 4 insertions(+), 4 deletions(-) + +--- a/arch/x86/include/asm/cpufeatures.h ++++ b/arch/x86/include/asm/cpufeatures.h +@@ -473,7 +473,7 @@ + #define X86_FEATURE_BHI_CTRL (21*32+ 2) /* BHI_DIS_S HW control available */ + #define X86_FEATURE_CLEAR_BHB_HW (21*32+ 3) /* BHI_DIS_S HW control enabled */ + #define X86_FEATURE_CLEAR_BHB_LOOP_ON_VMEXIT (21*32+ 4) /* Clear branch history at vmexit using SW loop */ +-#define X86_FEATURE_FAST_CPPC (21*32 + 5) /* AMD Fast CPPC */ ++#define X86_FEATURE_AMD_FAST_CPPC (21*32 + 5) /* Fast CPPC */ + + /* + * BUG word(s) +--- a/arch/x86/kernel/cpu/scattered.c ++++ b/arch/x86/kernel/cpu/scattered.c +@@ -45,7 +45,7 @@ static const struct cpuid_bit cpuid_bits + { X86_FEATURE_HW_PSTATE, CPUID_EDX, 7, 0x80000007, 0 }, + { X86_FEATURE_CPB, CPUID_EDX, 9, 0x80000007, 0 }, + { X86_FEATURE_PROC_FEEDBACK, CPUID_EDX, 11, 0x80000007, 0 }, +- { X86_FEATURE_FAST_CPPC, CPUID_EDX, 15, 0x80000007, 0 }, ++ { X86_FEATURE_AMD_FAST_CPPC, CPUID_EDX, 15, 0x80000007, 0 }, + { X86_FEATURE_MBA, CPUID_EBX, 6, 0x80000008, 0 }, + { X86_FEATURE_SMBA, CPUID_EBX, 2, 0x80000020, 0 }, + { X86_FEATURE_BMEC, CPUID_EBX, 3, 0x80000020, 0 }, +--- a/drivers/cpufreq/amd-pstate.c ++++ b/drivers/cpufreq/amd-pstate.c +@@ -880,7 +880,7 @@ static u32 amd_pstate_get_transition_del + + transition_delay_ns = cppc_get_transition_latency(cpu); + if (transition_delay_ns == CPUFREQ_ETERNAL) { +- if (cpu_feature_enabled(X86_FEATURE_FAST_CPPC)) ++ if (cpu_feature_enabled(X86_FEATURE_AMD_FAST_CPPC)) + return AMD_PSTATE_FAST_CPPC_TRANSITION_DELAY; + else + return AMD_PSTATE_TRANSITION_DELAY; +--- a/tools/arch/x86/include/asm/cpufeatures.h ++++ b/tools/arch/x86/include/asm/cpufeatures.h +@@ -472,7 +472,7 @@ + #define X86_FEATURE_BHI_CTRL (21*32+ 2) /* BHI_DIS_S HW control available */ + #define X86_FEATURE_CLEAR_BHB_HW (21*32+ 3) /* BHI_DIS_S HW control enabled */ + #define X86_FEATURE_CLEAR_BHB_LOOP_ON_VMEXIT (21*32+ 4) /* Clear branch history at vmexit using SW loop */ +-#define X86_FEATURE_FAST_CPPC (21*32 + 5) /* AMD Fast CPPC */ ++#define X86_FEATURE_AMD_FAST_CPPC (21*32 + 5) /* AMD Fast CPPC */ + + /* + * BUG word(s) diff --git a/debian/patches/patchset-pf/amd-pstate/0019-cpufreq-Add-a-callback-to-update-the-min_freq_req-fr.patch b/debian/patches/patchset-pf/amd-pstate/0019-cpufreq-Add-a-callback-to-update-the-min_freq_req-fr.patch deleted file mode 100644 index bd41ffe..0000000 --- a/debian/patches/patchset-pf/amd-pstate/0019-cpufreq-Add-a-callback-to-update-the-min_freq_req-fr.patch +++ /dev/null @@ -1,115 +0,0 @@ -From 787175146e26a199c06be4e6bf8cf8da0f757271 Mon Sep 17 00:00:00 2001 -From: Dhananjay Ugwekar -Date: Thu, 3 Oct 2024 08:39:52 +0000 -Subject: cpufreq: Add a callback to update the min_freq_req from drivers - -Currently, there is no proper way to update the initial lower frequency -limit from cpufreq drivers. Only way is to add a new min_freq qos -request from the driver side, but it leads to the issue explained below. - -The QoS infrastructure collates the constraints from multiple -subsystems and saves them in a plist. The "current value" is defined to -be the highest value in the plist for min_freq constraint. - -The cpufreq core adds a qos_request for min_freq to be 0 and the amd-pstate -driver today adds qos request for min_freq to be lowest_freq, where -lowest_freq corresponds to CPPC.lowest_perf. - -Eg: Suppose WLOG considering amd-pstate driver, lowest_freq is 400000 KHz, -lowest_non_linear_freq is 1200000 KHz. - -At this point of time, the min_freq QoS plist looks like: - -head--> 400000 KHz (registered by amd-pstate) --> 0 KHz (registered by -cpufreq core) - -When a user updates /sys/devices/system/cpu/cpuX/cpufreq/scaling_min_freq, -it only results in updating the cpufreq-core's node in the plist, where -say 0 becomes the newly echoed value. - -Now, if the user echoes a value 1000000 KHz, to scaling_min_freq, then the -new list would be - -head--> 1000000 KHz (registered by cpufreq core) --> 400000 KHz (registered -by amd-pstate) - -and the new "current value" of the min_freq QoS constraint will be 1000000 -KHz, this is the scenario where it works as expected. - -Suppose we change the amd-pstate driver code's min_freq qos constraint -to lowest_non_linear_freq instead of lowest_freq, then the user will -never be able to request a value below that, due to the following: - -At boot time, the min_freq QoS plist would be - -head--> 1200000 KHz (registered by amd-pstate) --> 0 KHz (registered by -cpufreq core) - -When the user echoes a value of 1000000 KHz, to -/sys/devices/..../scaling_min_freq, then the new list would be - -head--> 1200000 KHz (registered by amd-pstate) --> 1000000 KHz (registered -by cpufreq core) - -with the new "current value" of the min_freq QoS remaining 1200000 KHz. -Since the current value has not changed, there won't be any notifications -sent to the subsystems which have added their QoS constraints. In -particular, the amd-pstate driver will not get the notification, and thus, -the user's request to lower the scaling_min_freq will be ineffective. - -Hence, it is advisable to have a single source of truth for the min and -max freq QoS constraints between the cpufreq and the cpufreq drivers. - -So add a new callback get_init_min_freq() add in struct cpufreq_driver, -which allows amd-pstate (or any other cpufreq driver) to override the -default min_freq value being set in the policy->min_freq_req. Now -scaling_min_freq can be modified by the user to any value (lower or -higher than the init value) later on if desired. - -Signed-off-by: Dhananjay Ugwekar -Reviewed-by: Gautham R. Shenoy -Reviewed-by: Mario Limonciello ---- - drivers/cpufreq/cpufreq.c | 6 +++++- - include/linux/cpufreq.h | 6 ++++++ - 2 files changed, 11 insertions(+), 1 deletion(-) - ---- a/drivers/cpufreq/cpufreq.c -+++ b/drivers/cpufreq/cpufreq.c -@@ -1380,6 +1380,7 @@ static int cpufreq_online(unsigned int c - bool new_policy; - unsigned long flags; - unsigned int j; -+ u32 init_min_freq = FREQ_QOS_MIN_DEFAULT_VALUE; - int ret; - - pr_debug("%s: bringing CPU%u online\n", __func__, cpu); -@@ -1464,9 +1465,12 @@ static int cpufreq_online(unsigned int c - goto out_destroy_policy; - } - -+ if (cpufreq_driver->get_init_min_freq) -+ init_min_freq = cpufreq_driver->get_init_min_freq(policy); -+ - ret = freq_qos_add_request(&policy->constraints, - policy->min_freq_req, FREQ_QOS_MIN, -- FREQ_QOS_MIN_DEFAULT_VALUE); -+ init_min_freq); - if (ret < 0) { - /* - * So we don't call freq_qos_remove_request() for an ---- a/include/linux/cpufreq.h -+++ b/include/linux/cpufreq.h -@@ -414,6 +414,12 @@ struct cpufreq_driver { - * policy is properly initialized, but before the governor is started. - */ - void (*register_em)(struct cpufreq_policy *policy); -+ -+ /* -+ * Set by drivers that want to initialize the policy->min_freq_req with -+ * a value different from the default value (0) in cpufreq core. -+ */ -+ int (*get_init_min_freq)(struct cpufreq_policy *policy); - }; - - /* flags */ diff --git a/debian/patches/patchset-pf/amd-pstate/0019-x86-cpufeatures-Add-feature-bits-for-AMD-heterogeneo.patch b/debian/patches/patchset-pf/amd-pstate/0019-x86-cpufeatures-Add-feature-bits-for-AMD-heterogeneo.patch new file mode 100644 index 0000000..4494d6a --- /dev/null +++ b/debian/patches/patchset-pf/amd-pstate/0019-x86-cpufeatures-Add-feature-bits-for-AMD-heterogeneo.patch @@ -0,0 +1,43 @@ +From 34ef29430b9a217ef0811f218b8f86c631d6c574 Mon Sep 17 00:00:00 2001 +From: Perry Yuan +Date: Fri, 25 Oct 2024 12:14:56 -0500 +Subject: x86/cpufeatures: Add feature bits for AMD heterogeneous processor + +CPUID leaf 0x80000026 advertises core types with different efficiency +rankings. + +Bit 30 indicates the heterogeneous core topology feature, if the bit +set, it means not all instances at the current hierarchical level have +the same core topology. + +This is described in the AMD64 Architecture Programmers Manual Volume +2 and 3, doc ID #25493 and #25494. + +Signed-off-by: Perry Yuan +Co-developed-by: Mario Limonciello +Signed-off-by: Mario Limonciello +--- + arch/x86/include/asm/cpufeatures.h | 1 + + arch/x86/kernel/cpu/scattered.c | 1 + + 2 files changed, 2 insertions(+) + +--- a/arch/x86/include/asm/cpufeatures.h ++++ b/arch/x86/include/asm/cpufeatures.h +@@ -474,6 +474,7 @@ + #define X86_FEATURE_CLEAR_BHB_HW (21*32+ 3) /* BHI_DIS_S HW control enabled */ + #define X86_FEATURE_CLEAR_BHB_LOOP_ON_VMEXIT (21*32+ 4) /* Clear branch history at vmexit using SW loop */ + #define X86_FEATURE_AMD_FAST_CPPC (21*32 + 5) /* Fast CPPC */ ++#define X86_FEATURE_AMD_HETEROGENEOUS_CORES (21*32 + 6) /* Heterogeneous Core Topology */ + + /* + * BUG word(s) +--- a/arch/x86/kernel/cpu/scattered.c ++++ b/arch/x86/kernel/cpu/scattered.c +@@ -52,6 +52,7 @@ static const struct cpuid_bit cpuid_bits + { X86_FEATURE_PERFMON_V2, CPUID_EAX, 0, 0x80000022, 0 }, + { X86_FEATURE_AMD_LBR_V2, CPUID_EAX, 1, 0x80000022, 0 }, + { X86_FEATURE_AMD_LBR_PMC_FREEZE, CPUID_EAX, 2, 0x80000022, 0 }, ++ { X86_FEATURE_AMD_HETEROGENEOUS_CORES, CPUID_EAX, 30, 0x80000026, 0 }, + { 0, 0, 0, 0, 0 } + }; + diff --git a/debian/patches/patchset-pf/amd-pstate/0020-x86-cpu-Enable-SD_ASYM_PACKING-for-PKG-Domain-on-AMD.patch b/debian/patches/patchset-pf/amd-pstate/0020-x86-cpu-Enable-SD_ASYM_PACKING-for-PKG-Domain-on-AMD.patch new file mode 100644 index 0000000..cb5caa4 --- /dev/null +++ b/debian/patches/patchset-pf/amd-pstate/0020-x86-cpu-Enable-SD_ASYM_PACKING-for-PKG-Domain-on-AMD.patch @@ -0,0 +1,32 @@ +From 5bd4c7b75f5588eb81bee35179569e27a4e164e4 Mon Sep 17 00:00:00 2001 +From: Perry Yuan +Date: Fri, 25 Oct 2024 12:14:57 -0500 +Subject: x86/cpu: Enable SD_ASYM_PACKING for PKG Domain on AMD Processors + +Enable the SD_ASYM_PACKING domain flag for the PKG domain on AMD +heterogeneous processors. +This flag is beneficial for processors with one or more CCDs and +relies on x86_sched_itmt_flags(). + +Reviewed-by: Gautham R. Shenoy +Signed-off-by: Perry Yuan +Co-developed-by: Mario Limonciello +Signed-off-by: Mario Limonciello +--- + arch/x86/kernel/smpboot.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- a/arch/x86/kernel/smpboot.c ++++ b/arch/x86/kernel/smpboot.c +@@ -497,8 +497,9 @@ static int x86_cluster_flags(void) + + static int x86_die_flags(void) + { +- if (cpu_feature_enabled(X86_FEATURE_HYBRID_CPU)) +- return x86_sched_itmt_flags(); ++ if (cpu_feature_enabled(X86_FEATURE_HYBRID_CPU) || ++ cpu_feature_enabled(X86_FEATURE_AMD_HETEROGENEOUS_CORES)) ++ return x86_sched_itmt_flags(); + + return 0; + } diff --git a/debian/patches/patchset-pf/amd-pstate/0021-cpufreq-amd-pstate-Cleanup-the-old-min_freq-qos-requ.patch b/debian/patches/patchset-pf/amd-pstate/0021-cpufreq-amd-pstate-Cleanup-the-old-min_freq-qos-requ.patch deleted file mode 100644 index 1b64445..0000000 --- a/debian/patches/patchset-pf/amd-pstate/0021-cpufreq-amd-pstate-Cleanup-the-old-min_freq-qos-requ.patch +++ /dev/null @@ -1,103 +0,0 @@ -From f7b2b3a1c0d015c4272793bed89734c5cffb354c Mon Sep 17 00:00:00 2001 -From: Dhananjay Ugwekar -Date: Thu, 3 Oct 2024 08:39:56 +0000 -Subject: cpufreq/amd-pstate: Cleanup the old min_freq qos request remnants - -Convert the freq_qos_request array in struct amd_cpudata to a single -variable (only for max_freq request). Remove the references to cpudata->req -array. Remove and rename the jump labels accordingly. - -Signed-off-by: Dhananjay Ugwekar -Reviewed-by: Mario Limonciello ---- - drivers/cpufreq/amd-pstate.c | 19 ++++++++----------- - drivers/cpufreq/amd-pstate.h | 4 ++-- - 2 files changed, 10 insertions(+), 13 deletions(-) - ---- a/drivers/cpufreq/amd-pstate.c -+++ b/drivers/cpufreq/amd-pstate.c -@@ -704,7 +704,7 @@ static int amd_pstate_cpu_boost_update(s - policy->max = policy->cpuinfo.max_freq; - - if (cppc_state == AMD_PSTATE_PASSIVE) { -- ret = freq_qos_update_request(&cpudata->req[1], policy->cpuinfo.max_freq); -+ ret = freq_qos_update_request(&cpudata->max_freq_req, policy->cpuinfo.max_freq); - if (ret < 0) - pr_debug("Failed to update freq constraint: CPU%d\n", cpudata->cpu); - } -@@ -971,17 +971,17 @@ static int amd_pstate_cpu_init(struct cp - - ret = amd_pstate_init_perf(cpudata); - if (ret) -- goto free_cpudata1; -+ goto free_cpudata; - - amd_pstate_init_prefcore(cpudata); - - ret = amd_pstate_init_freq(cpudata); - if (ret) -- goto free_cpudata1; -+ goto free_cpudata; - - ret = amd_pstate_init_boost_support(cpudata); - if (ret) -- goto free_cpudata1; -+ goto free_cpudata; - - min_freq = READ_ONCE(cpudata->min_freq); - max_freq = READ_ONCE(cpudata->max_freq); -@@ -1003,11 +1003,11 @@ static int amd_pstate_cpu_init(struct cp - if (cpu_feature_enabled(X86_FEATURE_CPPC)) - policy->fast_switch_possible = true; - -- ret = freq_qos_add_request(&policy->constraints, &cpudata->req[1], -+ ret = freq_qos_add_request(&policy->constraints, &cpudata->max_freq_req, - FREQ_QOS_MAX, policy->cpuinfo.max_freq); - if (ret < 0) { - dev_err(dev, "Failed to add max-freq constraint (%d)\n", ret); -- goto free_cpudata2; -+ goto free_cpudata; - } - - cpudata->max_limit_freq = max_freq; -@@ -1020,9 +1020,7 @@ static int amd_pstate_cpu_init(struct cp - - return 0; - --free_cpudata2: -- freq_qos_remove_request(&cpudata->req[0]); --free_cpudata1: -+free_cpudata: - kfree(cpudata); - return ret; - } -@@ -1031,8 +1029,7 @@ static void amd_pstate_cpu_exit(struct c - { - struct amd_cpudata *cpudata = policy->driver_data; - -- freq_qos_remove_request(&cpudata->req[1]); -- freq_qos_remove_request(&cpudata->req[0]); -+ freq_qos_remove_request(&cpudata->max_freq_req); - policy->fast_switch_possible = false; - kfree(cpudata); - } ---- a/drivers/cpufreq/amd-pstate.h -+++ b/drivers/cpufreq/amd-pstate.h -@@ -28,7 +28,7 @@ struct amd_aperf_mperf { - /** - * struct amd_cpudata - private CPU data for AMD P-State - * @cpu: CPU number -- * @req: constraint request to apply -+ * @max_freq_req: maximum frequency constraint request to apply - * @cppc_req_cached: cached performance request hints - * @highest_perf: the maximum performance an individual processor may reach, - * assuming ideal conditions -@@ -68,7 +68,7 @@ struct amd_aperf_mperf { - struct amd_cpudata { - int cpu; - -- struct freq_qos_request req[2]; -+ struct freq_qos_request max_freq_req; - u64 cppc_req_cached; - - u32 highest_perf; diff --git a/debian/patches/patchset-pf/amd-pstate/0021-x86-cpu-Add-CPU-type-to-struct-cpuinfo_topology.patch b/debian/patches/patchset-pf/amd-pstate/0021-x86-cpu-Add-CPU-type-to-struct-cpuinfo_topology.patch new file mode 100644 index 0000000..cc2fe2d --- /dev/null +++ b/debian/patches/patchset-pf/amd-pstate/0021-x86-cpu-Add-CPU-type-to-struct-cpuinfo_topology.patch @@ -0,0 +1,187 @@ +From c30f11be765d5a5a68e975fbe720a4bdb6900388 Mon Sep 17 00:00:00 2001 +From: Pawan Gupta +Date: Fri, 25 Oct 2024 12:14:58 -0500 +Subject: x86/cpu: Add CPU type to struct cpuinfo_topology + +Sometimes it is required to take actions based on if a CPU is a performance +or efficiency core. As an example, intel_pstate driver uses the Intel +core-type to determine CPU scaling. Also, some CPU vulnerabilities only +affect a specific CPU type, like RFDS only affects Intel Atom. Hybrid +systems that have variants P+E, P-only(Core) and E-only(Atom), it is not +straightforward to identify which variant is affected by a type specific +vulnerability. + +Such processors do have CPUID field that can uniquely identify them. Like, +P+E, P-only and E-only enumerates CPUID.1A.CORE_TYPE identification, while +P+E additionally enumerates CPUID.7.HYBRID. Based on this information, it +is possible for boot CPU to identify if a system has mixed CPU types. + +Add a new field hw_cpu_type to struct cpuinfo_topology that stores the +hardware specific CPU type. This saves the overhead of IPIs to get the CPU +type of a different CPU. CPU type is populated early in the boot process, +before vulnerabilities are enumerated. + +Acked-by: Dave Hansen +Signed-off-by: Pawan Gupta +Co-developed-by: Mario Limonciello +Signed-off-by: Mario Limonciello +--- + arch/x86/include/asm/intel-family.h | 6 +++++ + arch/x86/include/asm/processor.h | 18 ++++++++++++++ + arch/x86/include/asm/topology.h | 9 +++++++ + arch/x86/kernel/cpu/debugfs.c | 1 + + arch/x86/kernel/cpu/topology_amd.c | 3 +++ + arch/x86/kernel/cpu/topology_common.c | 34 +++++++++++++++++++++++++++ + 6 files changed, 71 insertions(+) + +--- a/arch/x86/include/asm/intel-family.h ++++ b/arch/x86/include/asm/intel-family.h +@@ -183,4 +183,10 @@ + /* Family 19 */ + #define INTEL_PANTHERCOVE_X IFM(19, 0x01) /* Diamond Rapids */ + ++/* CPU core types */ ++enum intel_cpu_type { ++ INTEL_CPU_TYPE_ATOM = 0x20, ++ INTEL_CPU_TYPE_CORE = 0x40, ++}; ++ + #endif /* _ASM_X86_INTEL_FAMILY_H */ +--- a/arch/x86/include/asm/processor.h ++++ b/arch/x86/include/asm/processor.h +@@ -105,6 +105,24 @@ struct cpuinfo_topology { + // Cache level topology IDs + u32 llc_id; + u32 l2c_id; ++ ++ // Hardware defined CPU-type ++ union { ++ u32 cpu_type; ++ struct { ++ // CPUID.1A.EAX[23-0] ++ u32 intel_native_model_id :24; ++ // CPUID.1A.EAX[31-24] ++ u32 intel_type :8; ++ }; ++ struct { ++ // CPUID 0x80000026.EBX ++ u32 amd_num_processors :16, ++ amd_power_eff_ranking :8, ++ amd_native_model_id :4, ++ amd_type :4; ++ }; ++ }; + }; + + struct cpuinfo_x86 { +--- a/arch/x86/include/asm/topology.h ++++ b/arch/x86/include/asm/topology.h +@@ -114,6 +114,12 @@ enum x86_topology_domains { + TOPO_MAX_DOMAIN, + }; + ++enum x86_topology_cpu_type { ++ TOPO_CPU_TYPE_PERFORMANCE, ++ TOPO_CPU_TYPE_EFFICIENCY, ++ TOPO_CPU_TYPE_UNKNOWN, ++}; ++ + struct x86_topology_system { + unsigned int dom_shifts[TOPO_MAX_DOMAIN]; + unsigned int dom_size[TOPO_MAX_DOMAIN]; +@@ -149,6 +155,9 @@ extern unsigned int __max_threads_per_co + extern unsigned int __num_threads_per_package; + extern unsigned int __num_cores_per_package; + ++const char *get_topology_cpu_type_name(struct cpuinfo_x86 *c); ++enum x86_topology_cpu_type get_topology_cpu_type(struct cpuinfo_x86 *c); ++ + static inline unsigned int topology_max_packages(void) + { + return __max_logical_packages; +--- a/arch/x86/kernel/cpu/debugfs.c ++++ b/arch/x86/kernel/cpu/debugfs.c +@@ -22,6 +22,7 @@ static int cpu_debug_show(struct seq_fil + seq_printf(m, "die_id: %u\n", c->topo.die_id); + seq_printf(m, "cu_id: %u\n", c->topo.cu_id); + seq_printf(m, "core_id: %u\n", c->topo.core_id); ++ seq_printf(m, "cpu_type: %s\n", get_topology_cpu_type_name(c)); + seq_printf(m, "logical_pkg_id: %u\n", c->topo.logical_pkg_id); + seq_printf(m, "logical_die_id: %u\n", c->topo.logical_die_id); + seq_printf(m, "llc_id: %u\n", c->topo.llc_id); +--- a/arch/x86/kernel/cpu/topology_amd.c ++++ b/arch/x86/kernel/cpu/topology_amd.c +@@ -182,6 +182,9 @@ static void parse_topology_amd(struct to + if (cpu_feature_enabled(X86_FEATURE_TOPOEXT)) + has_topoext = cpu_parse_topology_ext(tscan); + ++ if (cpu_feature_enabled(X86_FEATURE_AMD_HETEROGENEOUS_CORES)) ++ tscan->c->topo.cpu_type = cpuid_ebx(0x80000026); ++ + if (!has_topoext && !parse_8000_0008(tscan)) + return; + +--- a/arch/x86/kernel/cpu/topology_common.c ++++ b/arch/x86/kernel/cpu/topology_common.c +@@ -3,6 +3,7 @@ + + #include + ++#include + #include + #include + #include +@@ -27,6 +28,36 @@ void topology_set_dom(struct topo_scan * + } + } + ++enum x86_topology_cpu_type get_topology_cpu_type(struct cpuinfo_x86 *c) ++{ ++ if (c->x86_vendor == X86_VENDOR_INTEL) { ++ switch (c->topo.intel_type) { ++ case INTEL_CPU_TYPE_ATOM: return TOPO_CPU_TYPE_EFFICIENCY; ++ case INTEL_CPU_TYPE_CORE: return TOPO_CPU_TYPE_PERFORMANCE; ++ } ++ } ++ if (c->x86_vendor == X86_VENDOR_AMD) { ++ switch (c->topo.amd_type) { ++ case 0: return TOPO_CPU_TYPE_PERFORMANCE; ++ case 1: return TOPO_CPU_TYPE_EFFICIENCY; ++ } ++ } ++ ++ return TOPO_CPU_TYPE_UNKNOWN; ++} ++ ++const char *get_topology_cpu_type_name(struct cpuinfo_x86 *c) ++{ ++ switch (get_topology_cpu_type(c)) { ++ case TOPO_CPU_TYPE_PERFORMANCE: ++ return "performance"; ++ case TOPO_CPU_TYPE_EFFICIENCY: ++ return "efficiency"; ++ default: ++ return "unknown"; ++ } ++} ++ + static unsigned int __maybe_unused parse_num_cores_legacy(struct cpuinfo_x86 *c) + { + struct { +@@ -87,6 +118,7 @@ static void parse_topology(struct topo_s + .cu_id = 0xff, + .llc_id = BAD_APICID, + .l2c_id = BAD_APICID, ++ .cpu_type = TOPO_CPU_TYPE_UNKNOWN, + }; + struct cpuinfo_x86 *c = tscan->c; + struct { +@@ -132,6 +164,8 @@ static void parse_topology(struct topo_s + case X86_VENDOR_INTEL: + if (!IS_ENABLED(CONFIG_CPU_SUP_INTEL) || !cpu_parse_topology_ext(tscan)) + parse_legacy(tscan); ++ if (c->cpuid_level >= 0x1a) ++ c->topo.cpu_type = cpuid_eax(0x1a); + break; + case X86_VENDOR_HYGON: + if (IS_ENABLED(CONFIG_CPU_SUP_HYGON)) diff --git a/debian/patches/patchset-pf/amd-pstate/0022-cpufreq-amd-pstate-Use-nominal-perf-for-limits-when-.patch b/debian/patches/patchset-pf/amd-pstate/0022-cpufreq-amd-pstate-Use-nominal-perf-for-limits-when-.patch deleted file mode 100644 index e40ea02..0000000 --- a/debian/patches/patchset-pf/amd-pstate/0022-cpufreq-amd-pstate-Use-nominal-perf-for-limits-when-.patch +++ /dev/null @@ -1,57 +0,0 @@ -From c4fde0d177bdb33912f450914d84d6432391a8b5 Mon Sep 17 00:00:00 2001 -From: Mario Limonciello -Date: Sat, 12 Oct 2024 12:45:16 -0500 -Subject: cpufreq/amd-pstate: Use nominal perf for limits when boost is - disabled - -When boost has been disabled the limit for perf should be nominal perf not -the highest perf. Using the latter to do calculations will lead to -incorrect values that are still above nominal. - -Fixes: ad4caad58d91 ("cpufreq: amd-pstate: Merge amd_pstate_highest_perf_set() into amd_get_boost_ratio_numerator()") -Reported-by: Peter Jung -Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219348 -Signed-off-by: Mario Limonciello ---- - drivers/cpufreq/amd-pstate.c | 20 ++++++++++++++------ - 1 file changed, 14 insertions(+), 6 deletions(-) - ---- a/drivers/cpufreq/amd-pstate.c -+++ b/drivers/cpufreq/amd-pstate.c -@@ -566,11 +566,16 @@ static int amd_pstate_verify(struct cpuf - - static int amd_pstate_update_min_max_limit(struct cpufreq_policy *policy) - { -- u32 max_limit_perf, min_limit_perf, lowest_perf; -+ u32 max_limit_perf, min_limit_perf, lowest_perf, max_perf; - struct amd_cpudata *cpudata = policy->driver_data; - -- max_limit_perf = div_u64(policy->max * cpudata->highest_perf, cpudata->max_freq); -- min_limit_perf = div_u64(policy->min * cpudata->highest_perf, cpudata->max_freq); -+ if (cpudata->boost_supported && !policy->boost_enabled) -+ max_perf = READ_ONCE(cpudata->nominal_perf); -+ else -+ max_perf = READ_ONCE(cpudata->highest_perf); -+ -+ max_limit_perf = div_u64(policy->max * max_perf, policy->cpuinfo.max_freq); -+ min_limit_perf = div_u64(policy->min * max_perf, policy->cpuinfo.max_freq); - - lowest_perf = READ_ONCE(cpudata->lowest_perf); - if (min_limit_perf < lowest_perf) -@@ -1504,10 +1509,13 @@ static int amd_pstate_epp_update_limit(s - u64 value; - s16 epp; - -- max_perf = READ_ONCE(cpudata->highest_perf); -+ if (cpudata->boost_supported && !policy->boost_enabled) -+ max_perf = READ_ONCE(cpudata->nominal_perf); -+ else -+ max_perf = READ_ONCE(cpudata->highest_perf); - min_perf = READ_ONCE(cpudata->lowest_perf); -- max_limit_perf = div_u64(policy->max * cpudata->highest_perf, cpudata->max_freq); -- min_limit_perf = div_u64(policy->min * cpudata->highest_perf, cpudata->max_freq); -+ max_limit_perf = div_u64(policy->max * max_perf, policy->cpuinfo.max_freq); -+ min_limit_perf = div_u64(policy->min * max_perf, policy->cpuinfo.max_freq); - - if (min_limit_perf < min_perf) - min_limit_perf = min_perf; diff --git a/debian/patches/patchset-pf/amd-pstate/0022-x86-amd-Use-heterogeneous-core-topology-for-identify.patch b/debian/patches/patchset-pf/amd-pstate/0022-x86-amd-Use-heterogeneous-core-topology-for-identify.patch new file mode 100644 index 0000000..a86bc58 --- /dev/null +++ b/debian/patches/patchset-pf/amd-pstate/0022-x86-amd-Use-heterogeneous-core-topology-for-identify.patch @@ -0,0 +1,71 @@ +From ab9618cbe5e3d55b09b59f5e18e890be80ca1076 Mon Sep 17 00:00:00 2001 +From: Mario Limonciello +Date: Fri, 25 Oct 2024 12:14:59 -0500 +Subject: x86/amd: Use heterogeneous core topology for identifying boost + numerator + +AMD heterogeneous designs include two types of cores: + * Performance + * Efficiency + +Each core type has different highest performance values configured by the +platform. Drivers such as `amd_pstate` need to identify the type of +core to correctly set an appropriate boost numerator to calculate the +maximum frequency. + +X86_FEATURE_AMD_HETEROGENEOUS_CORES is used to identify whether the SoC +supports heterogeneous core type by reading CPUID leaf Fn_0x80000026. + +On performance cores the scaling factor of 196 is used. On efficiency +cores the scaling factor is the value reported as the highest perf. +Efficiency cores have the same preferred core rankings. + +Tested-by: Eric Naim +Tested-by: Peter Jung +Suggested-by: Perry Yuan +Signed-off-by: Mario Limonciello +--- + arch/x86/kernel/acpi/cppc.c | 23 +++++++++++++++++++++++ + 1 file changed, 23 insertions(+) + +--- a/arch/x86/kernel/acpi/cppc.c ++++ b/arch/x86/kernel/acpi/cppc.c +@@ -239,8 +239,10 @@ EXPORT_SYMBOL_GPL(amd_detect_prefcore); + */ + int amd_get_boost_ratio_numerator(unsigned int cpu, u64 *numerator) + { ++ enum x86_topology_cpu_type core_type = get_topology_cpu_type(&cpu_data(cpu)); + bool prefcore; + int ret; ++ u32 tmp; + + ret = amd_detect_prefcore(&prefcore); + if (ret) +@@ -266,6 +268,27 @@ int amd_get_boost_ratio_numerator(unsign + break; + } + } ++ ++ /* detect if running on heterogeneous design */ ++ if (cpu_feature_enabled(X86_FEATURE_AMD_HETEROGENEOUS_CORES)) { ++ switch (core_type) { ++ case TOPO_CPU_TYPE_UNKNOWN: ++ pr_warn("Undefined core type found for cpu %d\n", cpu); ++ break; ++ case TOPO_CPU_TYPE_PERFORMANCE: ++ /* use the max scale for performance cores */ ++ *numerator = CPPC_HIGHEST_PERF_PERFORMANCE; ++ return 0; ++ case TOPO_CPU_TYPE_EFFICIENCY: ++ /* use the highest perf value for efficiency cores */ ++ ret = amd_get_highest_perf(cpu, &tmp); ++ if (ret) ++ return ret; ++ *numerator = tmp; ++ return 0; ++ } ++ } ++ + *numerator = CPPC_HIGHEST_PERF_PREFCORE; + + return 0; diff --git a/debian/patches/patchset-pf/amd-pstate/0034-cpufreq-amd-pstate-Push-adjust_perf-vfunc-init-into-.patch b/debian/patches/patchset-pf/amd-pstate/0023-cpufreq-amd-pstate-Push-adjust_perf-vfunc-init-into-.patch similarity index 81% rename from debian/patches/patchset-pf/amd-pstate/0034-cpufreq-amd-pstate-Push-adjust_perf-vfunc-init-into-.patch rename to debian/patches/patchset-pf/amd-pstate/0023-cpufreq-amd-pstate-Push-adjust_perf-vfunc-init-into-.patch index f4f044b..09f1244 100644 --- a/debian/patches/patchset-pf/amd-pstate/0034-cpufreq-amd-pstate-Push-adjust_perf-vfunc-init-into-.patch +++ b/debian/patches/patchset-pf/amd-pstate/0023-cpufreq-amd-pstate-Push-adjust_perf-vfunc-init-into-.patch @@ -1,4 +1,4 @@ -From a4d255935a1ea6e4b10167df942ec641079bcdf7 Mon Sep 17 00:00:00 2001 +From f1a423d6cfc0888638642bea1b8ed5c64770888c Mon Sep 17 00:00:00 2001 From: Mario Limonciello Date: Mon, 28 Oct 2024 09:55:41 -0500 Subject: cpufreq/amd-pstate: Push adjust_perf vfunc init into cpu_init @@ -18,7 +18,7 @@ Signed-off-by: Mario Limonciello --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c -@@ -1528,6 +1528,8 @@ static int amd_pstate_epp_cpu_init(struc +@@ -1534,6 +1534,8 @@ static int amd_pstate_epp_cpu_init(struc WRITE_ONCE(cpudata->cppc_cap1_cached, value); } @@ -27,7 +27,7 @@ Signed-off-by: Mario Limonciello return 0; free_cpudata1: -@@ -1887,8 +1889,6 @@ static int __init amd_pstate_init(void) +@@ -1896,8 +1898,6 @@ static int __init amd_pstate_init(void) /* capability check */ if (cpu_feature_enabled(X86_FEATURE_CPPC)) { pr_debug("AMD CPPC MSR based functionality is supported\n"); @@ -35,4 +35,4 @@ Signed-off-by: Mario Limonciello - current_pstate_driver->adjust_perf = amd_pstate_adjust_perf; } else { pr_debug("AMD CPPC shared memory based functionality is supported\n"); - static_call_update(amd_pstate_enable, shmem_enable); + static_call_update(amd_pstate_cppc_enable, shmem_cppc_enable); diff --git a/debian/patches/patchset-pf/amd-pstate/0024-cpufreq-amd-pstate-Move-registration-after-static-fu.patch b/debian/patches/patchset-pf/amd-pstate/0024-cpufreq-amd-pstate-Move-registration-after-static-fu.patch new file mode 100644 index 0000000..974d552 --- /dev/null +++ b/debian/patches/patchset-pf/amd-pstate/0024-cpufreq-amd-pstate-Move-registration-after-static-fu.patch @@ -0,0 +1,47 @@ +From 242ffb086a15c8aec549096a6ad96d186b670fa9 Mon Sep 17 00:00:00 2001 +From: Mario Limonciello +Date: Mon, 28 Oct 2024 09:55:42 -0500 +Subject: cpufreq/amd-pstate: Move registration after static function call + update + +On shared memory designs the static functions need to work before +registration is done or the system can hang at bootup. + +Move the registration later in amd_pstate_init() to solve this. + +Fixes: e238968a2087 ("cpufreq/amd-pstate: Remove the redundant amd_pstate_set_driver() call") +Reported-by: Klara Modin +Closes: https://lore.kernel.org/linux-pm/cf9c146d-bacf-444e-92e2-15ebf513af96@gmail.com/#t +Signed-off-by: Mario Limonciello +--- + drivers/cpufreq/amd-pstate.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +--- a/drivers/cpufreq/amd-pstate.c ++++ b/drivers/cpufreq/amd-pstate.c +@@ -1889,12 +1889,6 @@ static int __init amd_pstate_init(void) + return -ENODEV; + } + +- ret = amd_pstate_register_driver(cppc_state); +- if (ret) { +- pr_err("failed to register with return %d\n", ret); +- return ret; +- } +- + /* capability check */ + if (cpu_feature_enabled(X86_FEATURE_CPPC)) { + pr_debug("AMD CPPC MSR based functionality is supported\n"); +@@ -1905,6 +1899,12 @@ static int __init amd_pstate_init(void) + static_call_update(amd_pstate_update_perf, shmem_update_perf); + } + ++ ret = amd_pstate_register_driver(cppc_state); ++ if (ret) { ++ pr_err("failed to register with return %d\n", ret); ++ return ret; ++ } ++ + if (amd_pstate_prefcore) { + ret = amd_detect_prefcore(&amd_pstate_prefcore); + if (ret) diff --git a/debian/patches/patchset-pf/amd-pstate/0025-cpufreq-amd-pstate-Convert-the-amd_pstate_get-set_ep.patch b/debian/patches/patchset-pf/amd-pstate/0025-cpufreq-amd-pstate-Convert-the-amd_pstate_get-set_ep.patch new file mode 100644 index 0000000..018a7f4 --- /dev/null +++ b/debian/patches/patchset-pf/amd-pstate/0025-cpufreq-amd-pstate-Convert-the-amd_pstate_get-set_ep.patch @@ -0,0 +1,152 @@ +From f6e6b4ebc5ef3ad05b291928d31f597210a2eb6e Mon Sep 17 00:00:00 2001 +From: Dhananjay Ugwekar +Date: Wed, 4 Dec 2024 14:48:38 +0000 +Subject: cpufreq/amd-pstate: Convert the amd_pstate_get/set_epp() to static + calls + +MSR and shared memory based systems have different mechanisms to get and +set the epp value. Split those mechanisms into different functions and +assign them appropriately to the static calls at boot time. This eliminates +the need for the "if(cpu_feature_enabled(X86_FEATURE_CPPC))" checks at +runtime. + +Also, propagate the error code from rdmsrl_on_cpu() and cppc_get_epp_perf() +to *_get_epp()'s caller, instead of returning -EIO unconditionally. + +Signed-off-by: Dhananjay Ugwekar +Reviewed-by: Gautham R. Shenoy +Reviewed-by: Mario Limonciello +--- + drivers/cpufreq/amd-pstate.c | 92 +++++++++++++++++++++++------------- + 1 file changed, 60 insertions(+), 32 deletions(-) + +--- a/drivers/cpufreq/amd-pstate.c ++++ b/drivers/cpufreq/amd-pstate.c +@@ -210,26 +210,40 @@ static inline int get_mode_idx_from_str( + static DEFINE_MUTEX(amd_pstate_limits_lock); + static DEFINE_MUTEX(amd_pstate_driver_lock); + +-static s16 amd_pstate_get_epp(struct amd_cpudata *cpudata, u64 cppc_req_cached) ++static s16 msr_get_epp(struct amd_cpudata *cpudata, u64 cppc_req_cached) + { + u64 epp; + int ret; + +- if (cpu_feature_enabled(X86_FEATURE_CPPC)) { +- if (!cppc_req_cached) { +- epp = rdmsrl_on_cpu(cpudata->cpu, MSR_AMD_CPPC_REQ, +- &cppc_req_cached); +- if (epp) +- return epp; +- } +- epp = (cppc_req_cached >> 24) & 0xFF; +- } else { +- ret = cppc_get_epp_perf(cpudata->cpu, &epp); ++ if (!cppc_req_cached) { ++ ret = rdmsrl_on_cpu(cpudata->cpu, MSR_AMD_CPPC_REQ, &cppc_req_cached); + if (ret < 0) { + pr_debug("Could not retrieve energy perf value (%d)\n", ret); +- return -EIO; ++ return ret; + } + } ++ epp = (cppc_req_cached >> 24) & 0xFF; ++ ++ return (s16)epp; ++} ++ ++DEFINE_STATIC_CALL(amd_pstate_get_epp, msr_get_epp); ++ ++static inline s16 amd_pstate_get_epp(struct amd_cpudata *cpudata, u64 cppc_req_cached) ++{ ++ return static_call(amd_pstate_get_epp)(cpudata, cppc_req_cached); ++} ++ ++static s16 shmem_get_epp(struct amd_cpudata *cpudata, u64 dummy) ++{ ++ u64 epp; ++ int ret; ++ ++ ret = cppc_get_epp_perf(cpudata->cpu, &epp); ++ if (ret < 0) { ++ pr_debug("Could not retrieve energy perf value (%d)\n", ret); ++ return ret; ++ } + + return (s16)(epp & 0xff); + } +@@ -283,33 +297,45 @@ static inline void amd_pstate_update_per + max_perf, fast_switch); + } + +-static int amd_pstate_set_epp(struct amd_cpudata *cpudata, u32 epp) ++static int msr_set_epp(struct amd_cpudata *cpudata, u32 epp) + { + int ret; +- struct cppc_perf_ctrls perf_ctrls; + +- if (cpu_feature_enabled(X86_FEATURE_CPPC)) { +- u64 value = READ_ONCE(cpudata->cppc_req_cached); ++ u64 value = READ_ONCE(cpudata->cppc_req_cached); + +- value &= ~GENMASK_ULL(31, 24); +- value |= (u64)epp << 24; +- WRITE_ONCE(cpudata->cppc_req_cached, value); +- +- ret = wrmsrl_on_cpu(cpudata->cpu, MSR_AMD_CPPC_REQ, value); +- if (!ret) +- cpudata->epp_cached = epp; +- } else { +- amd_pstate_update_perf(cpudata, cpudata->min_limit_perf, 0U, +- cpudata->max_limit_perf, false); ++ value &= ~GENMASK_ULL(31, 24); ++ value |= (u64)epp << 24; ++ WRITE_ONCE(cpudata->cppc_req_cached, value); + +- perf_ctrls.energy_perf = epp; +- ret = cppc_set_epp_perf(cpudata->cpu, &perf_ctrls, 1); +- if (ret) { +- pr_debug("failed to set energy perf value (%d)\n", ret); +- return ret; +- } ++ ret = wrmsrl_on_cpu(cpudata->cpu, MSR_AMD_CPPC_REQ, value); ++ if (!ret) + cpudata->epp_cached = epp; ++ ++ return ret; ++} ++ ++DEFINE_STATIC_CALL(amd_pstate_set_epp, msr_set_epp); ++ ++static inline int amd_pstate_set_epp(struct amd_cpudata *cpudata, u32 epp) ++{ ++ return static_call(amd_pstate_set_epp)(cpudata, epp); ++} ++ ++static int shmem_set_epp(struct amd_cpudata *cpudata, u32 epp) ++{ ++ int ret; ++ struct cppc_perf_ctrls perf_ctrls; ++ ++ amd_pstate_update_perf(cpudata, cpudata->min_limit_perf, 0U, ++ cpudata->max_limit_perf, false); ++ ++ perf_ctrls.energy_perf = epp; ++ ret = cppc_set_epp_perf(cpudata->cpu, &perf_ctrls, 1); ++ if (ret) { ++ pr_debug("failed to set energy perf value (%d)\n", ret); ++ return ret; + } ++ cpudata->epp_cached = epp; + + return ret; + } +@@ -1897,6 +1923,8 @@ static int __init amd_pstate_init(void) + static_call_update(amd_pstate_cppc_enable, shmem_cppc_enable); + static_call_update(amd_pstate_init_perf, shmem_init_perf); + static_call_update(amd_pstate_update_perf, shmem_update_perf); ++ static_call_update(amd_pstate_get_epp, shmem_get_epp); ++ static_call_update(amd_pstate_set_epp, shmem_set_epp); + } + + ret = amd_pstate_register_driver(cppc_state); diff --git a/debian/patches/patchset-pf/amd-pstate/0026-amd-pstate-6.11-update-setting-the-minimum-frequency.patch b/debian/patches/patchset-pf/amd-pstate/0026-amd-pstate-6.11-update-setting-the-minimum-frequency.patch deleted file mode 100644 index 9fe70c7..0000000 --- a/debian/patches/patchset-pf/amd-pstate/0026-amd-pstate-6.11-update-setting-the-minimum-frequency.patch +++ /dev/null @@ -1,228 +0,0 @@ -From 649d296be0c7f0df6e71b4fca25fdbe75cb3994e Mon Sep 17 00:00:00 2001 -From: Oleksandr Natalenko -Date: Thu, 17 Oct 2024 17:03:11 +0200 -Subject: amd-pstate-6.11: update setting the minimum frequency to - lowest_nonlinear_freq patchset to v3 - -Signed-off-by: Oleksandr Natalenko ---- - drivers/cpufreq/amd-pstate.c | 67 +++++++++++++++++++++--------------- - drivers/cpufreq/amd-pstate.h | 4 +-- - drivers/cpufreq/cpufreq.c | 6 +--- - include/linux/cpufreq.h | 6 ---- - 4 files changed, 43 insertions(+), 40 deletions(-) - ---- a/drivers/cpufreq/amd-pstate.c -+++ b/drivers/cpufreq/amd-pstate.c -@@ -557,9 +557,28 @@ cpufreq_policy_put: - cpufreq_cpu_put(policy); - } - --static int amd_pstate_verify(struct cpufreq_policy_data *policy) -+static int amd_pstate_verify(struct cpufreq_policy_data *policy_data) - { -- cpufreq_verify_within_cpu_limits(policy); -+ /* -+ * Initialize lower frequency limit (i.e.policy->min) with -+ * lowest_nonlinear_frequency which is the most energy efficient -+ * frequency. Override the initial value set by cpufreq core and -+ * amd-pstate qos_requests. -+ */ -+ if (policy_data->min == FREQ_QOS_MIN_DEFAULT_VALUE) { -+ struct cpufreq_policy *policy = cpufreq_cpu_get(policy_data->cpu); -+ struct amd_cpudata *cpudata; -+ -+ if (!policy) -+ return -EINVAL; -+ -+ cpudata = policy->driver_data; -+ policy_data->min = cpudata->lowest_nonlinear_freq; -+ cpufreq_cpu_put(policy); -+ } -+ -+ cpufreq_verify_within_cpu_limits(policy_data); -+ pr_debug("policy_max =%d, policy_min=%d\n", policy_data->max, policy_data->min); - - return 0; - } -@@ -709,7 +728,7 @@ static int amd_pstate_cpu_boost_update(s - policy->max = policy->cpuinfo.max_freq; - - if (cppc_state == AMD_PSTATE_PASSIVE) { -- ret = freq_qos_update_request(&cpudata->max_freq_req, policy->cpuinfo.max_freq); -+ ret = freq_qos_update_request(&cpudata->req[1], policy->cpuinfo.max_freq); - if (ret < 0) - pr_debug("Failed to update freq constraint: CPU%d\n", cpudata->cpu); - } -@@ -976,17 +995,17 @@ static int amd_pstate_cpu_init(struct cp - - ret = amd_pstate_init_perf(cpudata); - if (ret) -- goto free_cpudata; -+ goto free_cpudata1; - - amd_pstate_init_prefcore(cpudata); - - ret = amd_pstate_init_freq(cpudata); - if (ret) -- goto free_cpudata; -+ goto free_cpudata1; - - ret = amd_pstate_init_boost_support(cpudata); - if (ret) -- goto free_cpudata; -+ goto free_cpudata1; - - min_freq = READ_ONCE(cpudata->min_freq); - max_freq = READ_ONCE(cpudata->max_freq); -@@ -1008,11 +1027,18 @@ static int amd_pstate_cpu_init(struct cp - if (cpu_feature_enabled(X86_FEATURE_CPPC)) - policy->fast_switch_possible = true; - -- ret = freq_qos_add_request(&policy->constraints, &cpudata->max_freq_req, -+ ret = freq_qos_add_request(&policy->constraints, &cpudata->req[0], -+ FREQ_QOS_MIN, FREQ_QOS_MIN_DEFAULT_VALUE); -+ if (ret < 0) { -+ dev_err(dev, "Failed to add min-freq constraint (%d)\n", ret); -+ goto free_cpudata1; -+ } -+ -+ ret = freq_qos_add_request(&policy->constraints, &cpudata->req[1], - FREQ_QOS_MAX, policy->cpuinfo.max_freq); - if (ret < 0) { - dev_err(dev, "Failed to add max-freq constraint (%d)\n", ret); -- goto free_cpudata; -+ goto free_cpudata2; - } - - cpudata->max_limit_freq = max_freq; -@@ -1025,7 +1051,9 @@ static int amd_pstate_cpu_init(struct cp - - return 0; - --free_cpudata: -+free_cpudata2: -+ freq_qos_remove_request(&cpudata->req[0]); -+free_cpudata1: - kfree(cpudata); - return ret; - } -@@ -1034,7 +1062,8 @@ static void amd_pstate_cpu_exit(struct c - { - struct amd_cpudata *cpudata = policy->driver_data; - -- freq_qos_remove_request(&cpudata->max_freq_req); -+ freq_qos_remove_request(&cpudata->req[1]); -+ freq_qos_remove_request(&cpudata->req[0]); - policy->fast_switch_possible = false; - kfree(cpudata); - } -@@ -1658,13 +1687,6 @@ static int amd_pstate_epp_cpu_offline(st - return 0; - } - --static int amd_pstate_epp_verify_policy(struct cpufreq_policy_data *policy) --{ -- cpufreq_verify_within_cpu_limits(policy); -- pr_debug("policy_max =%d, policy_min=%d\n", policy->max, policy->min); -- return 0; --} -- - static int amd_pstate_epp_suspend(struct cpufreq_policy *policy) - { - struct amd_cpudata *cpudata = policy->driver_data; -@@ -1703,13 +1725,6 @@ static int amd_pstate_epp_resume(struct - return 0; - } - --static int amd_pstate_get_init_min_freq(struct cpufreq_policy *policy) --{ -- struct amd_cpudata *cpudata = policy->driver_data; -- -- return READ_ONCE(cpudata->lowest_nonlinear_freq); --} -- - static struct cpufreq_driver amd_pstate_driver = { - .flags = CPUFREQ_CONST_LOOPS | CPUFREQ_NEED_UPDATE_LIMITS, - .verify = amd_pstate_verify, -@@ -1723,12 +1738,11 @@ static struct cpufreq_driver amd_pstate_ - .update_limits = amd_pstate_update_limits, - .name = "amd-pstate", - .attr = amd_pstate_attr, -- .get_init_min_freq = amd_pstate_get_init_min_freq, - }; - - static struct cpufreq_driver amd_pstate_epp_driver = { - .flags = CPUFREQ_CONST_LOOPS, -- .verify = amd_pstate_epp_verify_policy, -+ .verify = amd_pstate_verify, - .setpolicy = amd_pstate_epp_set_policy, - .init = amd_pstate_epp_cpu_init, - .exit = amd_pstate_epp_cpu_exit, -@@ -1740,7 +1754,6 @@ static struct cpufreq_driver amd_pstate_ - .set_boost = amd_pstate_set_boost, - .name = "amd-pstate-epp", - .attr = amd_pstate_epp_attr, -- .get_init_min_freq = amd_pstate_get_init_min_freq, - }; - - static int __init amd_pstate_set_driver(int mode_idx) ---- a/drivers/cpufreq/amd-pstate.h -+++ b/drivers/cpufreq/amd-pstate.h -@@ -28,7 +28,7 @@ struct amd_aperf_mperf { - /** - * struct amd_cpudata - private CPU data for AMD P-State - * @cpu: CPU number -- * @max_freq_req: maximum frequency constraint request to apply -+ * @req: constraint request to apply - * @cppc_req_cached: cached performance request hints - * @highest_perf: the maximum performance an individual processor may reach, - * assuming ideal conditions -@@ -68,7 +68,7 @@ struct amd_aperf_mperf { - struct amd_cpudata { - int cpu; - -- struct freq_qos_request max_freq_req; -+ struct freq_qos_request req[2]; - u64 cppc_req_cached; - - u32 highest_perf; ---- a/drivers/cpufreq/cpufreq.c -+++ b/drivers/cpufreq/cpufreq.c -@@ -1380,7 +1380,6 @@ static int cpufreq_online(unsigned int c - bool new_policy; - unsigned long flags; - unsigned int j; -- u32 init_min_freq = FREQ_QOS_MIN_DEFAULT_VALUE; - int ret; - - pr_debug("%s: bringing CPU%u online\n", __func__, cpu); -@@ -1465,12 +1464,9 @@ static int cpufreq_online(unsigned int c - goto out_destroy_policy; - } - -- if (cpufreq_driver->get_init_min_freq) -- init_min_freq = cpufreq_driver->get_init_min_freq(policy); -- - ret = freq_qos_add_request(&policy->constraints, - policy->min_freq_req, FREQ_QOS_MIN, -- init_min_freq); -+ FREQ_QOS_MIN_DEFAULT_VALUE); - if (ret < 0) { - /* - * So we don't call freq_qos_remove_request() for an ---- a/include/linux/cpufreq.h -+++ b/include/linux/cpufreq.h -@@ -414,12 +414,6 @@ struct cpufreq_driver { - * policy is properly initialized, but before the governor is started. - */ - void (*register_em)(struct cpufreq_policy *policy); -- -- /* -- * Set by drivers that want to initialize the policy->min_freq_req with -- * a value different from the default value (0) in cpufreq core. -- */ -- int (*get_init_min_freq)(struct cpufreq_policy *policy); - }; - - /* flags */ diff --git a/debian/patches/patchset-pf/amd-pstate/0026-cpufreq-amd-pstate-Move-the-invocation-of-amd_pstate.patch b/debian/patches/patchset-pf/amd-pstate/0026-cpufreq-amd-pstate-Move-the-invocation-of-amd_pstate.patch new file mode 100644 index 0000000..922f8b3 --- /dev/null +++ b/debian/patches/patchset-pf/amd-pstate/0026-cpufreq-amd-pstate-Move-the-invocation-of-amd_pstate.patch @@ -0,0 +1,38 @@ +From e73d7f9cb6d8f0e79860788371c88f88057ae34b Mon Sep 17 00:00:00 2001 +From: Dhananjay Ugwekar +Date: Wed, 4 Dec 2024 14:48:39 +0000 +Subject: cpufreq/amd-pstate: Move the invocation of amd_pstate_update_perf() + +amd_pstate_update_perf() should not be a part of shmem_set_epp() function, +so move it to the amd_pstate_epp_update_limit() function, where it is needed. + +Signed-off-by: Dhananjay Ugwekar +Reviewed-by: Gautham R. Shenoy +Reviewed-by: Mario Limonciello +--- + drivers/cpufreq/amd-pstate.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +--- a/drivers/cpufreq/amd-pstate.c ++++ b/drivers/cpufreq/amd-pstate.c +@@ -326,9 +326,6 @@ static int shmem_set_epp(struct amd_cpud + int ret; + struct cppc_perf_ctrls perf_ctrls; + +- amd_pstate_update_perf(cpudata, cpudata->min_limit_perf, 0U, +- cpudata->max_limit_perf, false); +- + perf_ctrls.energy_perf = epp; + ret = cppc_set_epp_perf(cpudata->cpu, &perf_ctrls, 1); + if (ret) { +@@ -1628,6 +1625,10 @@ static int amd_pstate_epp_update_limit(s + epp = 0; + + WRITE_ONCE(cpudata->cppc_req_cached, value); ++ ++ amd_pstate_update_perf(cpudata, cpudata->min_limit_perf, 0U, ++ cpudata->max_limit_perf, false); ++ + return amd_pstate_set_epp(cpudata, epp); + } + diff --git a/debian/patches/patchset-pf/amd-pstate/0027-cpufreq-amd-pstate-Refactor-amd_pstate_epp_reenable-.patch b/debian/patches/patchset-pf/amd-pstate/0027-cpufreq-amd-pstate-Refactor-amd_pstate_epp_reenable-.patch new file mode 100644 index 0000000..90aec1c --- /dev/null +++ b/debian/patches/patchset-pf/amd-pstate/0027-cpufreq-amd-pstate-Refactor-amd_pstate_epp_reenable-.patch @@ -0,0 +1,82 @@ +From 021028e977fcd835ed92a4543f7977a8aa0c1dd6 Mon Sep 17 00:00:00 2001 +From: Dhananjay Ugwekar +Date: Wed, 4 Dec 2024 14:48:40 +0000 +Subject: cpufreq/amd-pstate: Refactor amd_pstate_epp_reenable() and + amd_pstate_epp_offline() + +Replace similar code chunks with amd_pstate_update_perf() and +amd_pstate_set_epp() function calls. + +Signed-off-by: Dhananjay Ugwekar +Reviewed-by: Gautham R. Shenoy +Reviewed-by: Mario Limonciello +--- + drivers/cpufreq/amd-pstate.c | 38 +++++++----------------------------- + 1 file changed, 7 insertions(+), 31 deletions(-) + +--- a/drivers/cpufreq/amd-pstate.c ++++ b/drivers/cpufreq/amd-pstate.c +@@ -1660,25 +1660,17 @@ static int amd_pstate_epp_set_policy(str + + static void amd_pstate_epp_reenable(struct amd_cpudata *cpudata) + { +- struct cppc_perf_ctrls perf_ctrls; +- u64 value, max_perf; ++ u64 max_perf; + int ret; + + ret = amd_pstate_cppc_enable(true); + if (ret) + pr_err("failed to enable amd pstate during resume, return %d\n", ret); + +- value = READ_ONCE(cpudata->cppc_req_cached); + max_perf = READ_ONCE(cpudata->highest_perf); + +- if (cpu_feature_enabled(X86_FEATURE_CPPC)) { +- wrmsrl_on_cpu(cpudata->cpu, MSR_AMD_CPPC_REQ, value); +- } else { +- perf_ctrls.max_perf = max_perf; +- cppc_set_perf(cpudata->cpu, &perf_ctrls); +- perf_ctrls.energy_perf = AMD_CPPC_ENERGY_PERF_PREF(cpudata->epp_cached); +- cppc_set_epp_perf(cpudata->cpu, &perf_ctrls, 1); +- } ++ amd_pstate_update_perf(cpudata, 0, 0, max_perf, false); ++ amd_pstate_set_epp(cpudata, cpudata->epp_cached); + } + + static int amd_pstate_epp_cpu_online(struct cpufreq_policy *policy) +@@ -1698,31 +1690,15 @@ static int amd_pstate_epp_cpu_online(str + static void amd_pstate_epp_offline(struct cpufreq_policy *policy) + { + struct amd_cpudata *cpudata = policy->driver_data; +- struct cppc_perf_ctrls perf_ctrls; + int min_perf; +- u64 value; + + min_perf = READ_ONCE(cpudata->lowest_perf); +- value = READ_ONCE(cpudata->cppc_req_cached); + + mutex_lock(&amd_pstate_limits_lock); +- if (cpu_feature_enabled(X86_FEATURE_CPPC)) { +- cpudata->epp_policy = CPUFREQ_POLICY_UNKNOWN; + +- /* Set max perf same as min perf */ +- value &= ~AMD_CPPC_MAX_PERF(~0L); +- value |= AMD_CPPC_MAX_PERF(min_perf); +- value &= ~AMD_CPPC_MIN_PERF(~0L); +- value |= AMD_CPPC_MIN_PERF(min_perf); +- wrmsrl_on_cpu(cpudata->cpu, MSR_AMD_CPPC_REQ, value); +- } else { +- perf_ctrls.desired_perf = 0; +- perf_ctrls.min_perf = min_perf; +- perf_ctrls.max_perf = min_perf; +- cppc_set_perf(cpudata->cpu, &perf_ctrls); +- perf_ctrls.energy_perf = AMD_CPPC_ENERGY_PERF_PREF(HWP_EPP_BALANCE_POWERSAVE); +- cppc_set_epp_perf(cpudata->cpu, &perf_ctrls, 1); +- } ++ amd_pstate_update_perf(cpudata, min_perf, 0, min_perf, false); ++ amd_pstate_set_epp(cpudata, AMD_CPPC_EPP_BALANCE_POWERSAVE); ++ + mutex_unlock(&amd_pstate_limits_lock); + } + diff --git a/debian/patches/patchset-pf/amd-pstate/0028-cpufreq-amd-pstate-Remove-the-cppc_state-check-in-of.patch b/debian/patches/patchset-pf/amd-pstate/0028-cpufreq-amd-pstate-Remove-the-cppc_state-check-in-of.patch new file mode 100644 index 0000000..9eed03d --- /dev/null +++ b/debian/patches/patchset-pf/amd-pstate/0028-cpufreq-amd-pstate-Remove-the-cppc_state-check-in-of.patch @@ -0,0 +1,43 @@ +From f94f6415c70f76d885dd542e8631f826f427941e Mon Sep 17 00:00:00 2001 +From: Dhananjay Ugwekar +Date: Wed, 4 Dec 2024 14:48:41 +0000 +Subject: cpufreq/amd-pstate: Remove the cppc_state check in offline/online + functions + +Only amd_pstate_epp driver (i.e. cppc_state = ACTIVE) enters the +amd_pstate_epp_offline() and amd_pstate_epp_cpu_online() functions, +so remove the unnecessary if condition checking if cppc_state is +equal to AMD_PSTATE_ACTIVE. + +Signed-off-by: Dhananjay Ugwekar +Reviewed-by: Mario Limonciello +Reviewed-by: Gautham R. Shenoy +--- + drivers/cpufreq/amd-pstate.c | 9 +++------ + 1 file changed, 3 insertions(+), 6 deletions(-) + +--- a/drivers/cpufreq/amd-pstate.c ++++ b/drivers/cpufreq/amd-pstate.c +@@ -1679,10 +1679,8 @@ static int amd_pstate_epp_cpu_online(str + + pr_debug("AMD CPU Core %d going online\n", cpudata->cpu); + +- if (cppc_state == AMD_PSTATE_ACTIVE) { +- amd_pstate_epp_reenable(cpudata); +- cpudata->suspended = false; +- } ++ amd_pstate_epp_reenable(cpudata); ++ cpudata->suspended = false; + + return 0; + } +@@ -1711,8 +1709,7 @@ static int amd_pstate_epp_cpu_offline(st + if (cpudata->suspended) + return 0; + +- if (cppc_state == AMD_PSTATE_ACTIVE) +- amd_pstate_epp_offline(policy); ++ amd_pstate_epp_offline(policy); + + return 0; + } diff --git a/debian/patches/patchset-pf/amd-pstate/0029-cpufreq-amd-pstate-Merge-amd_pstate_epp_cpu_offline-.patch b/debian/patches/patchset-pf/amd-pstate/0029-cpufreq-amd-pstate-Merge-amd_pstate_epp_cpu_offline-.patch new file mode 100644 index 0000000..a33f31e --- /dev/null +++ b/debian/patches/patchset-pf/amd-pstate/0029-cpufreq-amd-pstate-Merge-amd_pstate_epp_cpu_offline-.patch @@ -0,0 +1,56 @@ +From 5aea3e8c4255cb04876e3af714d58ed329376b7f Mon Sep 17 00:00:00 2001 +From: Dhananjay Ugwekar +Date: Wed, 4 Dec 2024 14:48:42 +0000 +Subject: cpufreq/amd-pstate: Merge amd_pstate_epp_cpu_offline() and + amd_pstate_epp_offline() + +amd_pstate_epp_offline() is only called from within +amd_pstate_epp_cpu_offline() and doesn't make much sense to have it at all. +Hence, remove it. + +Also remove the unncessary debug print in the offline path while at it. + +Signed-off-by: Dhananjay Ugwekar +Reviewed-by: Gautham R. Shenoy +Reviewed-by: Mario Limonciello +--- + drivers/cpufreq/amd-pstate.c | 17 ++++------------- + 1 file changed, 4 insertions(+), 13 deletions(-) + +--- a/drivers/cpufreq/amd-pstate.c ++++ b/drivers/cpufreq/amd-pstate.c +@@ -1685,11 +1685,14 @@ static int amd_pstate_epp_cpu_online(str + return 0; + } + +-static void amd_pstate_epp_offline(struct cpufreq_policy *policy) ++static int amd_pstate_epp_cpu_offline(struct cpufreq_policy *policy) + { + struct amd_cpudata *cpudata = policy->driver_data; + int min_perf; + ++ if (cpudata->suspended) ++ return 0; ++ + min_perf = READ_ONCE(cpudata->lowest_perf); + + mutex_lock(&amd_pstate_limits_lock); +@@ -1698,18 +1701,6 @@ static void amd_pstate_epp_offline(struc + amd_pstate_set_epp(cpudata, AMD_CPPC_EPP_BALANCE_POWERSAVE); + + mutex_unlock(&amd_pstate_limits_lock); +-} +- +-static int amd_pstate_epp_cpu_offline(struct cpufreq_policy *policy) +-{ +- struct amd_cpudata *cpudata = policy->driver_data; +- +- pr_debug("AMD CPU Core %d going offline\n", cpudata->cpu); +- +- if (cpudata->suspended) +- return 0; +- +- amd_pstate_epp_offline(policy); + + return 0; + } diff --git a/debian/patches/patchset-pf/amd-pstate/0030-cpufreq-amd-pstate-Add-trace-event-for-EPP-perf-upda.patch b/debian/patches/patchset-pf/amd-pstate/0030-cpufreq-amd-pstate-Add-trace-event-for-EPP-perf-upda.patch new file mode 100644 index 0000000..b066fb0 --- /dev/null +++ b/debian/patches/patchset-pf/amd-pstate/0030-cpufreq-amd-pstate-Add-trace-event-for-EPP-perf-upda.patch @@ -0,0 +1,132 @@ +From ea6b500eb38124a59e83254435340e0390117c54 Mon Sep 17 00:00:00 2001 +From: Mario Limonciello +Date: Thu, 5 Dec 2024 16:28:33 -0600 +Subject: cpufreq/amd-pstate: Add trace event for EPP perf updates + +In "active" mode the most important thing for debugging whether +an issue is hardware or software based is to look at what was the +last thing written to the CPPC request MSR or shared memory region. + +The 'amd_pstate_epp_perf' trace event shows the values being written +for all CPUs. + +Signed-off-by: Mario Limonciello +Reviewed-by: Perry Yuan +Reviewed-by: Gautham R. Shenoy +--- + drivers/cpufreq/amd-pstate-trace.h | 45 ++++++++++++++++++++++++++++++ + drivers/cpufreq/amd-pstate.c | 28 +++++++++++++++++++ + 2 files changed, 73 insertions(+) + +--- a/drivers/cpufreq/amd-pstate-trace.h ++++ b/drivers/cpufreq/amd-pstate-trace.h +@@ -88,6 +88,51 @@ TRACE_EVENT(amd_pstate_perf, + ) + ); + ++TRACE_EVENT(amd_pstate_epp_perf, ++ ++ TP_PROTO(unsigned int cpu_id, ++ unsigned int highest_perf, ++ unsigned int epp, ++ unsigned int min_perf, ++ unsigned int max_perf, ++ bool boost ++ ), ++ ++ TP_ARGS(cpu_id, ++ highest_perf, ++ epp, ++ min_perf, ++ max_perf, ++ boost), ++ ++ TP_STRUCT__entry( ++ __field(unsigned int, cpu_id) ++ __field(unsigned int, highest_perf) ++ __field(unsigned int, epp) ++ __field(unsigned int, min_perf) ++ __field(unsigned int, max_perf) ++ __field(bool, boost) ++ ), ++ ++ TP_fast_assign( ++ __entry->cpu_id = cpu_id; ++ __entry->highest_perf = highest_perf; ++ __entry->epp = epp; ++ __entry->min_perf = min_perf; ++ __entry->max_perf = max_perf; ++ __entry->boost = boost; ++ ), ++ ++ TP_printk("cpu%u: [%u<->%u]/%u, epp=%u, boost=%u", ++ (unsigned int)__entry->cpu_id, ++ (unsigned int)__entry->min_perf, ++ (unsigned int)__entry->max_perf, ++ (unsigned int)__entry->highest_perf, ++ (unsigned int)__entry->epp, ++ (bool)__entry->boost ++ ) ++); ++ + #endif /* _AMD_PSTATE_TRACE_H */ + + /* This part must be outside protection */ +--- a/drivers/cpufreq/amd-pstate.c ++++ b/drivers/cpufreq/amd-pstate.c +@@ -354,6 +354,14 @@ static int amd_pstate_set_energy_pref_in + return -EBUSY; + } + ++ if (trace_amd_pstate_epp_perf_enabled()) { ++ trace_amd_pstate_epp_perf(cpudata->cpu, cpudata->highest_perf, ++ epp, ++ AMD_CPPC_MIN_PERF(cpudata->cppc_req_cached), ++ AMD_CPPC_MAX_PERF(cpudata->cppc_req_cached), ++ cpudata->boost_state); ++ } ++ + ret = amd_pstate_set_epp(cpudata, epp); + + return ret; +@@ -1626,6 +1634,13 @@ static int amd_pstate_epp_update_limit(s + + WRITE_ONCE(cpudata->cppc_req_cached, value); + ++ if (trace_amd_pstate_epp_perf_enabled()) { ++ trace_amd_pstate_epp_perf(cpudata->cpu, cpudata->highest_perf, epp, ++ cpudata->min_limit_perf, ++ cpudata->max_limit_perf, ++ cpudata->boost_state); ++ } ++ + amd_pstate_update_perf(cpudata, cpudata->min_limit_perf, 0U, + cpudata->max_limit_perf, false); + +@@ -1669,6 +1684,13 @@ static void amd_pstate_epp_reenable(stru + + max_perf = READ_ONCE(cpudata->highest_perf); + ++ if (trace_amd_pstate_epp_perf_enabled()) { ++ trace_amd_pstate_epp_perf(cpudata->cpu, cpudata->highest_perf, ++ cpudata->epp_cached, ++ AMD_CPPC_MIN_PERF(cpudata->cppc_req_cached), ++ max_perf, cpudata->boost_state); ++ } ++ + amd_pstate_update_perf(cpudata, 0, 0, max_perf, false); + amd_pstate_set_epp(cpudata, cpudata->epp_cached); + } +@@ -1697,6 +1719,12 @@ static int amd_pstate_epp_cpu_offline(st + + mutex_lock(&amd_pstate_limits_lock); + ++ if (trace_amd_pstate_epp_perf_enabled()) { ++ trace_amd_pstate_epp_perf(cpudata->cpu, cpudata->highest_perf, ++ AMD_CPPC_EPP_BALANCE_POWERSAVE, ++ min_perf, min_perf, cpudata->boost_state); ++ } ++ + amd_pstate_update_perf(cpudata, min_perf, 0, min_perf, false); + amd_pstate_set_epp(cpudata, AMD_CPPC_EPP_BALANCE_POWERSAVE); + diff --git a/debian/patches/patchset-pf/amd-pstate/0031-cpufreq-amd-pstate-convert-mutex-use-to-guard.patch b/debian/patches/patchset-pf/amd-pstate/0031-cpufreq-amd-pstate-convert-mutex-use-to-guard.patch new file mode 100644 index 0000000..8d1f59a --- /dev/null +++ b/debian/patches/patchset-pf/amd-pstate/0031-cpufreq-amd-pstate-convert-mutex-use-to-guard.patch @@ -0,0 +1,123 @@ +From 57fdcf14dcd80808fc46edea6d31bb2a699c0fd1 Mon Sep 17 00:00:00 2001 +From: Mario Limonciello +Date: Thu, 5 Dec 2024 16:28:34 -0600 +Subject: cpufreq/amd-pstate: convert mutex use to guard() + +Using scoped guard declaration will unlock mutexes automatically. + +Signed-off-by: Mario Limonciello +Reviewed-by: Gautham R. Shenoy +--- + drivers/cpufreq/amd-pstate.c | 32 ++++++++++++-------------------- + 1 file changed, 12 insertions(+), 20 deletions(-) + +--- a/drivers/cpufreq/amd-pstate.c ++++ b/drivers/cpufreq/amd-pstate.c +@@ -782,12 +782,12 @@ static int amd_pstate_set_boost(struct c + pr_err("Boost mode is not supported by this processor or SBIOS\n"); + return -EOPNOTSUPP; + } +- mutex_lock(&amd_pstate_driver_lock); ++ guard(mutex)(&amd_pstate_driver_lock); ++ + ret = amd_pstate_cpu_boost_update(policy, state); + WRITE_ONCE(cpudata->boost_state, !ret ? state : false); + policy->boost_enabled = !ret ? state : false; + refresh_frequency_limits(policy); +- mutex_unlock(&amd_pstate_driver_lock); + + return ret; + } +@@ -878,7 +878,8 @@ static void amd_pstate_update_limits(uns + if (!amd_pstate_prefcore) + return; + +- mutex_lock(&amd_pstate_driver_lock); ++ guard(mutex)(&amd_pstate_driver_lock); ++ + ret = amd_get_highest_perf(cpu, &cur_high); + if (ret) + goto free_cpufreq_put; +@@ -898,7 +899,6 @@ free_cpufreq_put: + if (!highest_perf_changed) + cpufreq_update_policy(cpu); + +- mutex_unlock(&amd_pstate_driver_lock); + } + + /* +@@ -1231,11 +1231,11 @@ static ssize_t store_energy_performance_ + if (ret < 0) + return -EINVAL; + +- mutex_lock(&amd_pstate_limits_lock); ++ guard(mutex)(&amd_pstate_limits_lock); ++ + ret = amd_pstate_set_energy_pref_index(cpudata, ret); +- mutex_unlock(&amd_pstate_limits_lock); + +- return ret ?: count; ++ return ret ? ret : count; + } + + static ssize_t show_energy_performance_preference( +@@ -1399,13 +1399,10 @@ EXPORT_SYMBOL_GPL(amd_pstate_update_stat + static ssize_t status_show(struct device *dev, + struct device_attribute *attr, char *buf) + { +- ssize_t ret; + +- mutex_lock(&amd_pstate_driver_lock); +- ret = amd_pstate_show_status(buf); +- mutex_unlock(&amd_pstate_driver_lock); ++ guard(mutex)(&amd_pstate_driver_lock); + +- return ret; ++ return amd_pstate_show_status(buf); + } + + static ssize_t status_store(struct device *a, struct device_attribute *b, +@@ -1414,9 +1411,8 @@ static ssize_t status_store(struct devic + char *p = memchr(buf, '\n', count); + int ret; + +- mutex_lock(&amd_pstate_driver_lock); ++ guard(mutex)(&amd_pstate_driver_lock); + ret = amd_pstate_update_status(buf, p ? p - buf : count); +- mutex_unlock(&amd_pstate_driver_lock); + + return ret < 0 ? ret : count; + } +@@ -1717,7 +1713,7 @@ static int amd_pstate_epp_cpu_offline(st + + min_perf = READ_ONCE(cpudata->lowest_perf); + +- mutex_lock(&amd_pstate_limits_lock); ++ guard(mutex)(&amd_pstate_limits_lock); + + if (trace_amd_pstate_epp_perf_enabled()) { + trace_amd_pstate_epp_perf(cpudata->cpu, cpudata->highest_perf, +@@ -1728,8 +1724,6 @@ static int amd_pstate_epp_cpu_offline(st + amd_pstate_update_perf(cpudata, min_perf, 0, min_perf, false); + amd_pstate_set_epp(cpudata, AMD_CPPC_EPP_BALANCE_POWERSAVE); + +- mutex_unlock(&amd_pstate_limits_lock); +- + return 0; + } + +@@ -1758,13 +1752,11 @@ static int amd_pstate_epp_resume(struct + struct amd_cpudata *cpudata = policy->driver_data; + + if (cpudata->suspended) { +- mutex_lock(&amd_pstate_limits_lock); ++ guard(mutex)(&amd_pstate_limits_lock); + + /* enable amd pstate from suspend state*/ + amd_pstate_epp_reenable(cpudata); + +- mutex_unlock(&amd_pstate_limits_lock); +- + cpudata->suspended = false; + } + diff --git a/debian/patches/patchset-pf/amd-pstate/0032-cpufreq-amd-pstate-Drop-cached-epp_policy-variable.patch b/debian/patches/patchset-pf/amd-pstate/0032-cpufreq-amd-pstate-Drop-cached-epp_policy-variable.patch new file mode 100644 index 0000000..08cc8d5 --- /dev/null +++ b/debian/patches/patchset-pf/amd-pstate/0032-cpufreq-amd-pstate-Drop-cached-epp_policy-variable.patch @@ -0,0 +1,52 @@ +From 06c52df851256238253ec286682cafbd5bb832d8 Mon Sep 17 00:00:00 2001 +From: Mario Limonciello +Date: Thu, 5 Dec 2024 16:28:35 -0600 +Subject: cpufreq/amd-pstate: Drop cached epp_policy variable + +epp_policy is not used by any of the current code and there +is no need to cache it. + +Signed-off-by: Mario Limonciello +Reviewed-by: Gautham R. Shenoy +--- + drivers/cpufreq/amd-pstate.c | 3 --- + drivers/cpufreq/amd-pstate.h | 2 -- + 2 files changed, 5 deletions(-) + +--- a/drivers/cpufreq/amd-pstate.c ++++ b/drivers/cpufreq/amd-pstate.c +@@ -1506,7 +1506,6 @@ static int amd_pstate_epp_cpu_init(struc + return -ENOMEM; + + cpudata->cpu = policy->cpu; +- cpudata->epp_policy = 0; + + ret = amd_pstate_init_perf(cpudata); + if (ret) +@@ -1613,8 +1612,6 @@ static int amd_pstate_epp_update_limit(s + value &= ~AMD_CPPC_DES_PERF(~0L); + value |= AMD_CPPC_DES_PERF(0); + +- cpudata->epp_policy = cpudata->policy; +- + /* Get BIOS pre-defined epp value */ + epp = amd_pstate_get_epp(cpudata, value); + if (epp < 0) { +--- a/drivers/cpufreq/amd-pstate.h ++++ b/drivers/cpufreq/amd-pstate.h +@@ -57,7 +57,6 @@ struct amd_aperf_mperf { + * @hw_prefcore: check whether HW supports preferred core featue. + * Only when hw_prefcore and early prefcore param are true, + * AMD P-State driver supports preferred core featue. +- * @epp_policy: Last saved policy used to set energy-performance preference + * @epp_cached: Cached CPPC energy-performance preference value + * @policy: Cpufreq policy value + * @cppc_cap1_cached Cached MSR_AMD_CPPC_CAP1 register value +@@ -94,7 +93,6 @@ struct amd_cpudata { + bool hw_prefcore; + + /* EPP feature related attributes*/ +- s16 epp_policy; + s16 epp_cached; + u32 policy; + u64 cppc_cap1_cached; diff --git a/debian/patches/patchset-pf/amd-pstate/0033-cpufreq-amd-pstate-Use-FIELD_PREP-and-FIELD_GET-macr.patch b/debian/patches/patchset-pf/amd-pstate/0033-cpufreq-amd-pstate-Use-FIELD_PREP-and-FIELD_GET-macr.patch new file mode 100644 index 0000000..b3bebb1 --- /dev/null +++ b/debian/patches/patchset-pf/amd-pstate/0033-cpufreq-amd-pstate-Use-FIELD_PREP-and-FIELD_GET-macr.patch @@ -0,0 +1,117 @@ +From da3e84f3dd424c1b7fa6d86484ddcccac391e49c Mon Sep 17 00:00:00 2001 +From: Mario Limonciello +Date: Thu, 5 Dec 2024 16:28:36 -0600 +Subject: cpufreq/amd-pstate: Use FIELD_PREP and FIELD_GET macros + +The FIELD_PREP and FIELD_GET macros improve readability and help +to avoid shifting bugs. + +Signed-off-by: Mario Limonciello +Reviewed-by: Gautham R. Shenoy +--- + drivers/cpufreq/amd-pstate.c | 45 ++++++++++++++++-------------------- + 1 file changed, 20 insertions(+), 25 deletions(-) + +--- a/drivers/cpufreq/amd-pstate.c ++++ b/drivers/cpufreq/amd-pstate.c +@@ -22,6 +22,7 @@ + + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include + #include + #include + #include +@@ -88,6 +89,11 @@ static bool cppc_enabled; + static bool amd_pstate_prefcore = true; + static struct quirk_entry *quirks; + ++#define AMD_PSTATE_MAX_PERF_MASK GENMASK(7, 0) ++#define AMD_PSTATE_MIN_PERF_MASK GENMASK(15, 8) ++#define AMD_PSTATE_DES_PERF_MASK GENMASK(23, 16) ++#define AMD_PSTATE_EPP_PERF_MASK GENMASK(31, 24) ++ + /* + * AMD Energy Preference Performance (EPP) + * The EPP is used in the CCLK DPM controller to drive +@@ -212,7 +218,6 @@ static DEFINE_MUTEX(amd_pstate_driver_lo + + static s16 msr_get_epp(struct amd_cpudata *cpudata, u64 cppc_req_cached) + { +- u64 epp; + int ret; + + if (!cppc_req_cached) { +@@ -222,9 +227,8 @@ static s16 msr_get_epp(struct amd_cpudat + return ret; + } + } +- epp = (cppc_req_cached >> 24) & 0xFF; + +- return (s16)epp; ++ return FIELD_GET(AMD_PSTATE_EPP_PERF_MASK, cppc_req_cached); + } + + DEFINE_STATIC_CALL(amd_pstate_get_epp, msr_get_epp); +@@ -299,12 +303,11 @@ static inline void amd_pstate_update_per + + static int msr_set_epp(struct amd_cpudata *cpudata, u32 epp) + { +- int ret; +- + u64 value = READ_ONCE(cpudata->cppc_req_cached); ++ int ret; + +- value &= ~GENMASK_ULL(31, 24); +- value |= (u64)epp << 24; ++ value &= ~AMD_PSTATE_EPP_PERF_MASK; ++ value |= FIELD_PREP(AMD_PSTATE_EPP_PERF_MASK, epp); + WRITE_ONCE(cpudata->cppc_req_cached, value); + + ret = wrmsrl_on_cpu(cpudata->cpu, MSR_AMD_CPPC_REQ, value); +@@ -563,18 +566,15 @@ static void amd_pstate_update(struct amd + des_perf = 0; + } + +- value &= ~AMD_CPPC_MIN_PERF(~0L); +- value |= AMD_CPPC_MIN_PERF(min_perf); +- +- value &= ~AMD_CPPC_DES_PERF(~0L); +- value |= AMD_CPPC_DES_PERF(des_perf); +- + /* limit the max perf when core performance boost feature is disabled */ + if (!cpudata->boost_supported) + max_perf = min_t(unsigned long, nominal_perf, max_perf); + +- value &= ~AMD_CPPC_MAX_PERF(~0L); +- value |= AMD_CPPC_MAX_PERF(max_perf); ++ value &= ~(AMD_PSTATE_MAX_PERF_MASK | AMD_PSTATE_MIN_PERF_MASK | ++ AMD_PSTATE_DES_PERF_MASK); ++ value |= FIELD_PREP(AMD_PSTATE_MAX_PERF_MASK, max_perf); ++ value |= FIELD_PREP(AMD_PSTATE_DES_PERF_MASK, des_perf); ++ value |= FIELD_PREP(AMD_PSTATE_MIN_PERF_MASK, min_perf); + + if (trace_amd_pstate_perf_enabled() && amd_pstate_sample(cpudata)) { + trace_amd_pstate_perf(min_perf, des_perf, max_perf, cpudata->freq, +@@ -1601,16 +1601,11 @@ static int amd_pstate_epp_update_limit(s + if (cpudata->policy == CPUFREQ_POLICY_PERFORMANCE) + min_perf = min(cpudata->nominal_perf, max_perf); + +- /* Initial min/max values for CPPC Performance Controls Register */ +- value &= ~AMD_CPPC_MIN_PERF(~0L); +- value |= AMD_CPPC_MIN_PERF(min_perf); +- +- value &= ~AMD_CPPC_MAX_PERF(~0L); +- value |= AMD_CPPC_MAX_PERF(max_perf); +- +- /* CPPC EPP feature require to set zero to the desire perf bit */ +- value &= ~AMD_CPPC_DES_PERF(~0L); +- value |= AMD_CPPC_DES_PERF(0); ++ value &= ~(AMD_PSTATE_MAX_PERF_MASK | AMD_PSTATE_MIN_PERF_MASK | ++ AMD_PSTATE_DES_PERF_MASK); ++ value |= FIELD_PREP(AMD_PSTATE_MAX_PERF_MASK, max_perf); ++ value |= FIELD_PREP(AMD_PSTATE_DES_PERF_MASK, 0); ++ value |= FIELD_PREP(AMD_PSTATE_MIN_PERF_MASK, min_perf); + + /* Get BIOS pre-defined epp value */ + epp = amd_pstate_get_epp(cpudata, value); diff --git a/debian/patches/patchset-pf/amd-pstate/0034-cpufreq-amd-pstate-Store-the-boost-numerator-as-high.patch b/debian/patches/patchset-pf/amd-pstate/0034-cpufreq-amd-pstate-Store-the-boost-numerator-as-high.patch new file mode 100644 index 0000000..6498b14 --- /dev/null +++ b/debian/patches/patchset-pf/amd-pstate/0034-cpufreq-amd-pstate-Store-the-boost-numerator-as-high.patch @@ -0,0 +1,103 @@ +From b1e3f18eb18f9febe9f4e32a1ef55cf60c97892a Mon Sep 17 00:00:00 2001 +From: Mario Limonciello +Date: Thu, 5 Dec 2024 16:28:37 -0600 +Subject: cpufreq/amd-pstate: Store the boost numerator as highest perf again + +commit ad4caad58d91d ("cpufreq: amd-pstate: Merge +amd_pstate_highest_perf_set() into amd_get_boost_ratio_numerator()") +changed the semantics for highest perf and commit 18d9b52271213 +("cpufreq/amd-pstate: Use nominal perf for limits when boost is disabled") +worked around those semantic changes. + +This however is a confusing result and furthermore makes it awkward to +change frequency limits and boost due to the scaling differences. Restore +the boost numerator to highest perf again. + +Suggested-by: Dhananjay Ugwekar +Fixes: ad4caad58d91 ("cpufreq: amd-pstate: Merge amd_pstate_highest_perf_set() into amd_get_boost_ratio_numerator()") +Signed-off-by: Mario Limonciello +Reviewed-by: Gautham R. Shenoy +--- + Documentation/admin-guide/pm/amd-pstate.rst | 4 +--- + drivers/cpufreq/amd-pstate.c | 25 ++++++++++++--------- + 2 files changed, 16 insertions(+), 13 deletions(-) + +--- a/Documentation/admin-guide/pm/amd-pstate.rst ++++ b/Documentation/admin-guide/pm/amd-pstate.rst +@@ -251,9 +251,7 @@ performance supported in `AMD CPPC Perfo + In some ASICs, the highest CPPC performance is not the one in the ``_CPC`` + table, so we need to expose it to sysfs. If boost is not active, but + still supported, this maximum frequency will be larger than the one in +-``cpuinfo``. On systems that support preferred core, the driver will have +-different values for some cores than others and this will reflect the values +-advertised by the platform at bootup. ++``cpuinfo``. + This attribute is read-only. + + ``amd_pstate_lowest_nonlinear_freq`` +--- a/drivers/cpufreq/amd-pstate.c ++++ b/drivers/cpufreq/amd-pstate.c +@@ -438,15 +438,19 @@ static inline int amd_pstate_cppc_enable + + static int msr_init_perf(struct amd_cpudata *cpudata) + { +- u64 cap1; ++ u64 cap1, numerator; + + int ret = rdmsrl_safe_on_cpu(cpudata->cpu, MSR_AMD_CPPC_CAP1, + &cap1); + if (ret) + return ret; + +- WRITE_ONCE(cpudata->highest_perf, AMD_CPPC_HIGHEST_PERF(cap1)); +- WRITE_ONCE(cpudata->max_limit_perf, AMD_CPPC_HIGHEST_PERF(cap1)); ++ ret = amd_get_boost_ratio_numerator(cpudata->cpu, &numerator); ++ if (ret) ++ return ret; ++ ++ WRITE_ONCE(cpudata->highest_perf, numerator); ++ WRITE_ONCE(cpudata->max_limit_perf, numerator); + WRITE_ONCE(cpudata->nominal_perf, AMD_CPPC_NOMINAL_PERF(cap1)); + WRITE_ONCE(cpudata->lowest_nonlinear_perf, AMD_CPPC_LOWNONLIN_PERF(cap1)); + WRITE_ONCE(cpudata->lowest_perf, AMD_CPPC_LOWEST_PERF(cap1)); +@@ -458,13 +462,18 @@ static int msr_init_perf(struct amd_cpud + static int shmem_init_perf(struct amd_cpudata *cpudata) + { + struct cppc_perf_caps cppc_perf; ++ u64 numerator; + + int ret = cppc_get_perf_caps(cpudata->cpu, &cppc_perf); + if (ret) + return ret; + +- WRITE_ONCE(cpudata->highest_perf, cppc_perf.highest_perf); +- WRITE_ONCE(cpudata->max_limit_perf, cppc_perf.highest_perf); ++ ret = amd_get_boost_ratio_numerator(cpudata->cpu, &numerator); ++ if (ret) ++ return ret; ++ ++ WRITE_ONCE(cpudata->highest_perf, numerator); ++ WRITE_ONCE(cpudata->max_limit_perf, numerator); + WRITE_ONCE(cpudata->nominal_perf, cppc_perf.nominal_perf); + WRITE_ONCE(cpudata->lowest_nonlinear_perf, + cppc_perf.lowest_nonlinear_perf); +@@ -950,7 +959,6 @@ static int amd_pstate_init_freq(struct a + { + int ret; + u32 min_freq, max_freq; +- u64 numerator; + u32 nominal_perf, nominal_freq; + u32 lowest_nonlinear_perf, lowest_nonlinear_freq; + u32 boost_ratio, lowest_nonlinear_ratio; +@@ -972,10 +980,7 @@ static int amd_pstate_init_freq(struct a + + nominal_perf = READ_ONCE(cpudata->nominal_perf); + +- ret = amd_get_boost_ratio_numerator(cpudata->cpu, &numerator); +- if (ret) +- return ret; +- boost_ratio = div_u64(numerator << SCHED_CAPACITY_SHIFT, nominal_perf); ++ boost_ratio = div_u64(cpudata->highest_perf << SCHED_CAPACITY_SHIFT, nominal_perf); + max_freq = (nominal_freq * boost_ratio >> SCHED_CAPACITY_SHIFT) * 1000; + + lowest_nonlinear_perf = READ_ONCE(cpudata->lowest_nonlinear_perf); diff --git a/debian/patches/patchset-pf/amd-pstate/0035-ACPI-processor-Move-arch_init_invariance_cppc-call-l.patch b/debian/patches/patchset-pf/amd-pstate/0035-ACPI-processor-Move-arch_init_invariance_cppc-call-l.patch deleted file mode 100644 index f42926a..0000000 --- a/debian/patches/patchset-pf/amd-pstate/0035-ACPI-processor-Move-arch_init_invariance_cppc-call-l.patch +++ /dev/null @@ -1,183 +0,0 @@ -From 27b069b518f77fffc337286a2fad8a6305daa60f Mon Sep 17 00:00:00 2001 -From: Mario Limonciello -Date: Mon, 4 Nov 2024 16:28:55 -0600 -Subject: ACPI: processor: Move arch_init_invariance_cppc() call later - -arch_init_invariance_cppc() is called at the end of -acpi_cppc_processor_probe() in order to configure frequency invariance -based upon the values from _CPC. - -This however doesn't work on AMD CPPC shared memory designs that have -AMD preferred cores enabled because _CPC needs to be analyzed from all -cores to judge if preferred cores are enabled. - -This issue manifests to users as a warning since commit 21fb59ab4b97 -("ACPI: CPPC: Adjust debug messages in amd_set_max_freq_ratio() to warn"): -``` -Could not retrieve highest performance (-19) -``` - -However the warning isn't the cause of this, it was actually -commit 279f838a61f9 ("x86/amd: Detect preferred cores in -amd_get_boost_ratio_numerator()") which exposed the issue. - -To fix this problem, change arch_init_invariance_cppc() into a new weak -symbol that is called at the end of acpi_processor_driver_init(). -Each architecture that supports it can declare the symbol to override -the weak one. - -Fixes: 279f838a61f9 ("x86/amd: Detect preferred cores in amd_get_boost_ratio_numerator()") -Reported-by: Ivan Shapovalov -Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219431 -Tested-by: Oleksandr Natalenko -Signed-off-by: Mario Limonciello ---- - arch/arm64/include/asm/topology.h | 4 ---- - arch/x86/include/asm/topology.h | 5 ----- - arch/x86/kernel/acpi/cppc.c | 7 ++++++- - drivers/acpi/cppc_acpi.c | 6 ------ - drivers/acpi/processor_driver.c | 9 +++++++++ - drivers/base/arch_topology.c | 6 +++++- - include/acpi/processor.h | 2 ++ - include/linux/arch_topology.h | 4 ---- - 8 files changed, 22 insertions(+), 21 deletions(-) - ---- a/arch/arm64/include/asm/topology.h -+++ b/arch/arm64/include/asm/topology.h -@@ -25,10 +25,6 @@ void update_freq_counters_refs(void); - #define arch_scale_freq_invariant topology_scale_freq_invariant - #define arch_scale_freq_ref topology_get_freq_ref - --#ifdef CONFIG_ACPI_CPPC_LIB --#define arch_init_invariance_cppc topology_init_cpu_capacity_cppc --#endif -- - /* Replace task scheduler's default cpu-invariant accounting */ - #define arch_scale_cpu_capacity topology_get_cpu_scale - ---- a/arch/x86/include/asm/topology.h -+++ b/arch/x86/include/asm/topology.h -@@ -292,9 +292,4 @@ static inline void freq_invariance_set_p - extern void arch_scale_freq_tick(void); - #define arch_scale_freq_tick arch_scale_freq_tick - --#ifdef CONFIG_ACPI_CPPC_LIB --void init_freq_invariance_cppc(void); --#define arch_init_invariance_cppc init_freq_invariance_cppc --#endif -- - #endif /* _ASM_X86_TOPOLOGY_H */ ---- a/arch/x86/kernel/acpi/cppc.c -+++ b/arch/x86/kernel/acpi/cppc.c -@@ -110,7 +110,7 @@ static void amd_set_max_freq_ratio(void) - - static DEFINE_MUTEX(freq_invariance_lock); - --void init_freq_invariance_cppc(void) -+static inline void init_freq_invariance_cppc(void) - { - static bool init_done; - -@@ -127,6 +127,11 @@ void init_freq_invariance_cppc(void) - mutex_unlock(&freq_invariance_lock); - } - -+void acpi_processor_init_invariance_cppc(void) -+{ -+ init_freq_invariance_cppc(); -+} -+ - /* - * Get the highest performance register value. - * @cpu: CPU from which to get highest performance. ---- a/drivers/acpi/cppc_acpi.c -+++ b/drivers/acpi/cppc_acpi.c -@@ -671,10 +671,6 @@ static int pcc_data_alloc(int pcc_ss_id) - * ) - */ - --#ifndef arch_init_invariance_cppc --static inline void arch_init_invariance_cppc(void) { } --#endif -- - /** - * acpi_cppc_processor_probe - Search for per CPU _CPC objects. - * @pr: Ptr to acpi_processor containing this CPU's logical ID. -@@ -905,8 +901,6 @@ int acpi_cppc_processor_probe(struct acp - goto out_free; - } - -- arch_init_invariance_cppc(); -- - kfree(output.pointer); - return 0; - ---- a/drivers/acpi/processor_driver.c -+++ b/drivers/acpi/processor_driver.c -@@ -237,6 +237,9 @@ static struct notifier_block acpi_proces - .notifier_call = acpi_processor_notifier, - }; - -+void __weak acpi_processor_init_invariance_cppc(void) -+{ } -+ - /* - * We keep the driver loaded even when ACPI is not running. - * This is needed for the powernow-k8 driver, that works even without -@@ -270,6 +273,12 @@ static int __init acpi_processor_driver_ - NULL, acpi_soft_cpu_dead); - - acpi_processor_throttling_init(); -+ -+ /* -+ * Frequency invariance calculations on AMD platforms can't be run until -+ * after acpi_cppc_processor_probe() has been called for all online CPUs -+ */ -+ acpi_processor_init_invariance_cppc(); - return 0; - err: - driver_unregister(&acpi_processor_driver); ---- a/drivers/base/arch_topology.c -+++ b/drivers/base/arch_topology.c -@@ -366,7 +366,7 @@ void __weak freq_inv_set_max_ratio(int c - #ifdef CONFIG_ACPI_CPPC_LIB - #include - --void topology_init_cpu_capacity_cppc(void) -+static inline void topology_init_cpu_capacity_cppc(void) - { - u64 capacity, capacity_scale = 0; - struct cppc_perf_caps perf_caps; -@@ -417,6 +417,10 @@ void topology_init_cpu_capacity_cppc(voi - exit: - free_raw_capacity(); - } -+void acpi_processor_init_invariance_cppc(void) -+{ -+ topology_init_cpu_capacity_cppc(); -+} - #endif - - #ifdef CONFIG_CPU_FREQ ---- a/include/acpi/processor.h -+++ b/include/acpi/processor.h -@@ -465,4 +465,6 @@ extern int acpi_processor_ffh_lpi_probe( - extern int acpi_processor_ffh_lpi_enter(struct acpi_lpi_state *lpi); - #endif - -+void acpi_processor_init_invariance_cppc(void); -+ - #endif ---- a/include/linux/arch_topology.h -+++ b/include/linux/arch_topology.h -@@ -11,10 +11,6 @@ - void topology_normalize_cpu_scale(void); - int topology_update_cpu_topology(void); - --#ifdef CONFIG_ACPI_CPPC_LIB --void topology_init_cpu_capacity_cppc(void); --#endif -- - struct device_node; - bool topology_parse_cpu_capacity(struct device_node *cpu_node, int cpu); - diff --git a/debian/patches/patchset-pf/amd-pstate/0035-cpufreq-amd-pstate-Use-boost-numerator-for-upper-bou.patch b/debian/patches/patchset-pf/amd-pstate/0035-cpufreq-amd-pstate-Use-boost-numerator-for-upper-bou.patch new file mode 100644 index 0000000..f996c6a --- /dev/null +++ b/debian/patches/patchset-pf/amd-pstate/0035-cpufreq-amd-pstate-Use-boost-numerator-for-upper-bou.patch @@ -0,0 +1,45 @@ +From fab64249be63c384484cf82f4e08724577ad3b84 Mon Sep 17 00:00:00 2001 +From: Mario Limonciello +Date: Thu, 5 Dec 2024 16:28:38 -0600 +Subject: cpufreq/amd-pstate: Use boost numerator for upper bound of + frequencies + +commit 18d9b5227121 ("cpufreq/amd-pstate: Use nominal perf for limits +when boost is disabled") introduced different semantics for min/max limits +based upon whether the user turned off boost from sysfs. + +This however is not necessary when the highest perf value is the boost +numerator. + +Suggested-by: Dhananjay Ugwekar +Fixes: 18d9b5227121 ("cpufreq/amd-pstate: Use nominal perf for limits when boost is disabled") +Signed-off-by: Mario Limonciello +Reviewed-by: Gautham R. Shenoy +--- + drivers/cpufreq/amd-pstate.c | 13 +++++-------- + 1 file changed, 5 insertions(+), 8 deletions(-) + +--- a/drivers/cpufreq/amd-pstate.c ++++ b/drivers/cpufreq/amd-pstate.c +@@ -631,16 +631,13 @@ static int amd_pstate_verify(struct cpuf + + static int amd_pstate_update_min_max_limit(struct cpufreq_policy *policy) + { +- u32 max_limit_perf, min_limit_perf, lowest_perf, max_perf; ++ u32 max_limit_perf, min_limit_perf, lowest_perf, max_perf, max_freq; + struct amd_cpudata *cpudata = policy->driver_data; + +- if (cpudata->boost_supported && !policy->boost_enabled) +- max_perf = READ_ONCE(cpudata->nominal_perf); +- else +- max_perf = READ_ONCE(cpudata->highest_perf); +- +- max_limit_perf = div_u64(policy->max * max_perf, policy->cpuinfo.max_freq); +- min_limit_perf = div_u64(policy->min * max_perf, policy->cpuinfo.max_freq); ++ max_perf = READ_ONCE(cpudata->highest_perf); ++ max_freq = READ_ONCE(cpudata->max_freq); ++ max_limit_perf = div_u64(policy->max * max_perf, max_freq); ++ min_limit_perf = div_u64(policy->min * max_perf, max_freq); + + lowest_perf = READ_ONCE(cpudata->lowest_perf); + if (min_limit_perf < lowest_perf) diff --git a/debian/patches/patchset-pf/amd-pstate/0036-cpufreq-amd-pstate-Only-update-the-cached-value-in-m.patch b/debian/patches/patchset-pf/amd-pstate/0036-cpufreq-amd-pstate-Only-update-the-cached-value-in-m.patch new file mode 100644 index 0000000..659d33c --- /dev/null +++ b/debian/patches/patchset-pf/amd-pstate/0036-cpufreq-amd-pstate-Only-update-the-cached-value-in-m.patch @@ -0,0 +1,36 @@ +From a9b210306e861b7c2d3b8532c85e8cd54c3b322a Mon Sep 17 00:00:00 2001 +From: Mario Limonciello +Date: Thu, 5 Dec 2024 16:28:39 -0600 +Subject: cpufreq/amd-pstate: Only update the cached value in msr_set_epp() on + success + +If writing the MSR MSR_AMD_CPPC_REQ fails then the cached value in the +amd_cpudata structure should not be updated. + +Signed-off-by: Mario Limonciello +Reviewed-by: Gautham R. Shenoy +--- + drivers/cpufreq/amd-pstate.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +--- a/drivers/cpufreq/amd-pstate.c ++++ b/drivers/cpufreq/amd-pstate.c +@@ -308,11 +308,15 @@ static int msr_set_epp(struct amd_cpudat + + value &= ~AMD_PSTATE_EPP_PERF_MASK; + value |= FIELD_PREP(AMD_PSTATE_EPP_PERF_MASK, epp); +- WRITE_ONCE(cpudata->cppc_req_cached, value); + + ret = wrmsrl_on_cpu(cpudata->cpu, MSR_AMD_CPPC_REQ, value); +- if (!ret) +- cpudata->epp_cached = epp; ++ if (ret) { ++ pr_err("failed to set energy perf value (%d)\n", ret); ++ return ret; ++ } ++ ++ cpudata->epp_cached = epp; ++ WRITE_ONCE(cpudata->cppc_req_cached, value); + + return ret; + } diff --git a/debian/patches/patchset-pf/amd-pstate/0037-cpufreq-amd-pstate-store-all-values-in-cpudata-struc.patch b/debian/patches/patchset-pf/amd-pstate/0037-cpufreq-amd-pstate-store-all-values-in-cpudata-struc.patch new file mode 100644 index 0000000..ab759ae --- /dev/null +++ b/debian/patches/patchset-pf/amd-pstate/0037-cpufreq-amd-pstate-store-all-values-in-cpudata-struc.patch @@ -0,0 +1,134 @@ +From 27a3d0642a3d26ba54e8a21575e6d2cb0ada55b3 Mon Sep 17 00:00:00 2001 +From: Mario Limonciello +Date: Thu, 5 Dec 2024 16:28:40 -0600 +Subject: cpufreq/amd-pstate: store all values in cpudata struct in khz + +Storing values in the cpudata structure in different units leads +to confusion and hardcoded conversions elsewhere. After ratios are +calculated store everything in khz for any future use. Adjust all +relevant consumers for this change as well. + +Suggested-by: Dhananjay Ugwekar +Signed-off-by: Mario Limonciello +Reviewed-by: Gautham R. Shenoy +--- + drivers/cpufreq/amd-pstate-ut.c | 12 +++++------- + drivers/cpufreq/amd-pstate.c | 30 +++++++++++++++--------------- + 2 files changed, 20 insertions(+), 22 deletions(-) + +--- a/drivers/cpufreq/amd-pstate-ut.c ++++ b/drivers/cpufreq/amd-pstate-ut.c +@@ -207,7 +207,6 @@ static void amd_pstate_ut_check_freq(u32 + int cpu = 0; + struct cpufreq_policy *policy = NULL; + struct amd_cpudata *cpudata = NULL; +- u32 nominal_freq_khz; + + for_each_possible_cpu(cpu) { + policy = cpufreq_cpu_get(cpu); +@@ -215,14 +214,13 @@ static void amd_pstate_ut_check_freq(u32 + break; + cpudata = policy->driver_data; + +- nominal_freq_khz = cpudata->nominal_freq*1000; +- if (!((cpudata->max_freq >= nominal_freq_khz) && +- (nominal_freq_khz > cpudata->lowest_nonlinear_freq) && ++ if (!((cpudata->max_freq >= cpudata->nominal_freq) && ++ (cpudata->nominal_freq > cpudata->lowest_nonlinear_freq) && + (cpudata->lowest_nonlinear_freq > cpudata->min_freq) && + (cpudata->min_freq > 0))) { + amd_pstate_ut_cases[index].result = AMD_PSTATE_UT_RESULT_FAIL; + pr_err("%s cpu%d max=%d >= nominal=%d > lowest_nonlinear=%d > min=%d > 0, the formula is incorrect!\n", +- __func__, cpu, cpudata->max_freq, nominal_freq_khz, ++ __func__, cpu, cpudata->max_freq, cpudata->nominal_freq, + cpudata->lowest_nonlinear_freq, cpudata->min_freq); + goto skip_test; + } +@@ -236,13 +234,13 @@ static void amd_pstate_ut_check_freq(u32 + + if (cpudata->boost_supported) { + if ((policy->max == cpudata->max_freq) || +- (policy->max == nominal_freq_khz)) ++ (policy->max == cpudata->nominal_freq)) + amd_pstate_ut_cases[index].result = AMD_PSTATE_UT_RESULT_PASS; + else { + amd_pstate_ut_cases[index].result = AMD_PSTATE_UT_RESULT_FAIL; + pr_err("%s cpu%d policy_max=%d should be equal cpu_max=%d or cpu_nominal=%d !\n", + __func__, cpu, policy->max, cpudata->max_freq, +- nominal_freq_khz); ++ cpudata->nominal_freq); + goto skip_test; + } + } else { +--- a/drivers/cpufreq/amd-pstate.c ++++ b/drivers/cpufreq/amd-pstate.c +@@ -769,8 +769,8 @@ static int amd_pstate_cpu_boost_update(s + + if (on) + policy->cpuinfo.max_freq = max_freq; +- else if (policy->cpuinfo.max_freq > nominal_freq * 1000) +- policy->cpuinfo.max_freq = nominal_freq * 1000; ++ else if (policy->cpuinfo.max_freq > nominal_freq) ++ policy->cpuinfo.max_freq = nominal_freq; + + policy->max = policy->cpuinfo.max_freq; + +@@ -970,29 +970,29 @@ static int amd_pstate_init_freq(struct a + return ret; + + if (quirks && quirks->lowest_freq) +- min_freq = quirks->lowest_freq * 1000; ++ min_freq = quirks->lowest_freq; + else +- min_freq = cppc_perf.lowest_freq * 1000; ++ min_freq = cppc_perf.lowest_freq; + + if (quirks && quirks->nominal_freq) +- nominal_freq = quirks->nominal_freq ; ++ nominal_freq = quirks->nominal_freq; + else + nominal_freq = cppc_perf.nominal_freq; + + nominal_perf = READ_ONCE(cpudata->nominal_perf); + + boost_ratio = div_u64(cpudata->highest_perf << SCHED_CAPACITY_SHIFT, nominal_perf); +- max_freq = (nominal_freq * boost_ratio >> SCHED_CAPACITY_SHIFT) * 1000; ++ max_freq = (nominal_freq * boost_ratio >> SCHED_CAPACITY_SHIFT); + + lowest_nonlinear_perf = READ_ONCE(cpudata->lowest_nonlinear_perf); + lowest_nonlinear_ratio = div_u64(lowest_nonlinear_perf << SCHED_CAPACITY_SHIFT, + nominal_perf); +- lowest_nonlinear_freq = (nominal_freq * lowest_nonlinear_ratio >> SCHED_CAPACITY_SHIFT) * 1000; ++ lowest_nonlinear_freq = (nominal_freq * lowest_nonlinear_ratio >> SCHED_CAPACITY_SHIFT); + +- WRITE_ONCE(cpudata->min_freq, min_freq); +- WRITE_ONCE(cpudata->lowest_nonlinear_freq, lowest_nonlinear_freq); +- WRITE_ONCE(cpudata->nominal_freq, nominal_freq); +- WRITE_ONCE(cpudata->max_freq, max_freq); ++ WRITE_ONCE(cpudata->min_freq, min_freq * 1000); ++ WRITE_ONCE(cpudata->lowest_nonlinear_freq, lowest_nonlinear_freq * 1000); ++ WRITE_ONCE(cpudata->nominal_freq, nominal_freq * 1000); ++ WRITE_ONCE(cpudata->max_freq, max_freq * 1000); + + /** + * Below values need to be initialized correctly, otherwise driver will fail to load +@@ -1000,15 +1000,15 @@ static int amd_pstate_init_freq(struct a + * lowest_nonlinear_freq is a value between [min_freq, nominal_freq] + * Check _CPC in ACPI table objects if any values are incorrect + */ +- if (min_freq <= 0 || max_freq <= 0 || nominal_freq <= 0 || min_freq > max_freq) { ++ if (min_freq <= 0 || max_freq <= 0 || cpudata->nominal_freq <= 0 || min_freq > max_freq) { + pr_err("min_freq(%d) or max_freq(%d) or nominal_freq(%d) value is incorrect\n", +- min_freq, max_freq, nominal_freq * 1000); ++ min_freq, max_freq, cpudata->nominal_freq); + return -EINVAL; + } + +- if (lowest_nonlinear_freq <= min_freq || lowest_nonlinear_freq > nominal_freq * 1000) { ++ if (lowest_nonlinear_freq <= min_freq || lowest_nonlinear_freq > cpudata->nominal_freq) { + pr_err("lowest_nonlinear_freq(%d) value is out of range [min_freq(%d), nominal_freq(%d)]\n", +- lowest_nonlinear_freq, min_freq, nominal_freq * 1000); ++ lowest_nonlinear_freq, min_freq, cpudata->nominal_freq); + return -EINVAL; + } + diff --git a/debian/patches/patchset-pf/amd-pstate/0038-cpufreq-amd-pstate-Change-amd_pstate_update_perf-to-.patch b/debian/patches/patchset-pf/amd-pstate/0038-cpufreq-amd-pstate-Change-amd_pstate_update_perf-to-.patch new file mode 100644 index 0000000..4ee8e40 --- /dev/null +++ b/debian/patches/patchset-pf/amd-pstate/0038-cpufreq-amd-pstate-Change-amd_pstate_update_perf-to-.patch @@ -0,0 +1,69 @@ +From b2a0f625fa30dc907daf1b07bf94b15872da096b Mon Sep 17 00:00:00 2001 +From: Mario Limonciello +Date: Thu, 5 Dec 2024 16:28:41 -0600 +Subject: cpufreq/amd-pstate: Change amd_pstate_update_perf() to return an int + +As msr_update_perf() calls an MSR it's possible that it fails. Pass +this return code up to the caller. + +Signed-off-by: Mario Limonciello +Reviewed-by: Gautham R. Shenoy +--- + drivers/cpufreq/amd-pstate.c | 22 ++++++++++++---------- + 1 file changed, 12 insertions(+), 10 deletions(-) + +--- a/drivers/cpufreq/amd-pstate.c ++++ b/drivers/cpufreq/amd-pstate.c +@@ -281,24 +281,26 @@ static int amd_pstate_get_energy_pref_in + return index; + } + +-static void msr_update_perf(struct amd_cpudata *cpudata, u32 min_perf, ++static int msr_update_perf(struct amd_cpudata *cpudata, u32 min_perf, + u32 des_perf, u32 max_perf, bool fast_switch) + { +- if (fast_switch) ++ if (fast_switch) { + wrmsrl(MSR_AMD_CPPC_REQ, READ_ONCE(cpudata->cppc_req_cached)); +- else +- wrmsrl_on_cpu(cpudata->cpu, MSR_AMD_CPPC_REQ, +- READ_ONCE(cpudata->cppc_req_cached)); ++ return 0; ++ } ++ ++ return wrmsrl_on_cpu(cpudata->cpu, MSR_AMD_CPPC_REQ, ++ READ_ONCE(cpudata->cppc_req_cached)); + } + + DEFINE_STATIC_CALL(amd_pstate_update_perf, msr_update_perf); + +-static inline void amd_pstate_update_perf(struct amd_cpudata *cpudata, ++static inline int amd_pstate_update_perf(struct amd_cpudata *cpudata, + u32 min_perf, u32 des_perf, + u32 max_perf, bool fast_switch) + { +- static_call(amd_pstate_update_perf)(cpudata, min_perf, des_perf, +- max_perf, fast_switch); ++ return static_call(amd_pstate_update_perf)(cpudata, min_perf, des_perf, ++ max_perf, fast_switch); + } + + static int msr_set_epp(struct amd_cpudata *cpudata, u32 epp) +@@ -510,7 +512,7 @@ static inline int amd_pstate_init_perf(s + return static_call(amd_pstate_init_perf)(cpudata); + } + +-static void shmem_update_perf(struct amd_cpudata *cpudata, ++static int shmem_update_perf(struct amd_cpudata *cpudata, + u32 min_perf, u32 des_perf, + u32 max_perf, bool fast_switch) + { +@@ -520,7 +522,7 @@ static void shmem_update_perf(struct amd + perf_ctrls.min_perf = min_perf; + perf_ctrls.desired_perf = des_perf; + +- cppc_set_perf(cpudata->cpu, &perf_ctrls); ++ return cppc_set_perf(cpudata->cpu, &perf_ctrls); + } + + static inline bool amd_pstate_sample(struct amd_cpudata *cpudata) diff --git a/debian/patches/patchset-pf/amd-pstate/0039-cpufreq-amd-pstate-Move-limit-updating-code.patch b/debian/patches/patchset-pf/amd-pstate/0039-cpufreq-amd-pstate-Move-limit-updating-code.patch new file mode 100644 index 0000000..8e06482 --- /dev/null +++ b/debian/patches/patchset-pf/amd-pstate/0039-cpufreq-amd-pstate-Move-limit-updating-code.patch @@ -0,0 +1,85 @@ +From 8399d57cda79a662800a4cd01bd7db951355f451 Mon Sep 17 00:00:00 2001 +From: Mario Limonciello +Date: Thu, 5 Dec 2024 16:28:42 -0600 +Subject: cpufreq/amd-pstate: Move limit updating code + +The limit updating code in amd_pstate_epp_update_limit() should not +only apply to EPP updates. Move it to amd_pstate_update_min_max_limit() +so other callers can benefit as well. + +With this move it's not necessary to have clamp_t calls anymore because +the verify callback is called when setting limits. + +Signed-off-by: Mario Limonciello +--- + drivers/cpufreq/amd-pstate.c | 28 +++++----------------------- + 1 file changed, 5 insertions(+), 23 deletions(-) + +--- a/drivers/cpufreq/amd-pstate.c ++++ b/drivers/cpufreq/amd-pstate.c +@@ -567,10 +567,6 @@ static void amd_pstate_update(struct amd + u32 nominal_perf = READ_ONCE(cpudata->nominal_perf); + u64 value = prev; + +- min_perf = clamp_t(unsigned long, min_perf, cpudata->min_limit_perf, +- cpudata->max_limit_perf); +- max_perf = clamp_t(unsigned long, max_perf, cpudata->min_limit_perf, +- cpudata->max_limit_perf); + des_perf = clamp_t(unsigned long, des_perf, min_perf, max_perf); + + max_freq = READ_ONCE(cpudata->max_limit_freq); +@@ -637,7 +633,7 @@ static int amd_pstate_verify(struct cpuf + + static int amd_pstate_update_min_max_limit(struct cpufreq_policy *policy) + { +- u32 max_limit_perf, min_limit_perf, lowest_perf, max_perf, max_freq; ++ u32 max_limit_perf, min_limit_perf, max_perf, max_freq; + struct amd_cpudata *cpudata = policy->driver_data; + + max_perf = READ_ONCE(cpudata->highest_perf); +@@ -645,12 +641,8 @@ static int amd_pstate_update_min_max_lim + max_limit_perf = div_u64(policy->max * max_perf, max_freq); + min_limit_perf = div_u64(policy->min * max_perf, max_freq); + +- lowest_perf = READ_ONCE(cpudata->lowest_perf); +- if (min_limit_perf < lowest_perf) +- min_limit_perf = lowest_perf; +- +- if (max_limit_perf < min_limit_perf) +- max_limit_perf = min_limit_perf; ++ if (cpudata->policy == CPUFREQ_POLICY_PERFORMANCE) ++ min_limit_perf = min(cpudata->nominal_perf, max_limit_perf); + + WRITE_ONCE(cpudata->max_limit_perf, max_limit_perf); + WRITE_ONCE(cpudata->min_limit_perf, min_limit_perf); +@@ -1592,28 +1584,18 @@ static void amd_pstate_epp_cpu_exit(stru + static int amd_pstate_epp_update_limit(struct cpufreq_policy *policy) + { + struct amd_cpudata *cpudata = policy->driver_data; +- u32 max_perf, min_perf; + u64 value; + s16 epp; + +- max_perf = READ_ONCE(cpudata->highest_perf); +- min_perf = READ_ONCE(cpudata->lowest_perf); + amd_pstate_update_min_max_limit(policy); + +- max_perf = clamp_t(unsigned long, max_perf, cpudata->min_limit_perf, +- cpudata->max_limit_perf); +- min_perf = clamp_t(unsigned long, min_perf, cpudata->min_limit_perf, +- cpudata->max_limit_perf); + value = READ_ONCE(cpudata->cppc_req_cached); + +- if (cpudata->policy == CPUFREQ_POLICY_PERFORMANCE) +- min_perf = min(cpudata->nominal_perf, max_perf); +- + value &= ~(AMD_PSTATE_MAX_PERF_MASK | AMD_PSTATE_MIN_PERF_MASK | + AMD_PSTATE_DES_PERF_MASK); +- value |= FIELD_PREP(AMD_PSTATE_MAX_PERF_MASK, max_perf); ++ value |= FIELD_PREP(AMD_PSTATE_MAX_PERF_MASK, cpudata->max_limit_perf); + value |= FIELD_PREP(AMD_PSTATE_DES_PERF_MASK, 0); +- value |= FIELD_PREP(AMD_PSTATE_MIN_PERF_MASK, min_perf); ++ value |= FIELD_PREP(AMD_PSTATE_MIN_PERF_MASK, cpudata->min_limit_perf); + + /* Get BIOS pre-defined epp value */ + epp = amd_pstate_get_epp(cpudata, value); diff --git a/debian/patches/patchset-pf/amd-pstate/0040-cpufreq-amd-pstate-Cache-EPP-value-and-use-that-ever.patch b/debian/patches/patchset-pf/amd-pstate/0040-cpufreq-amd-pstate-Cache-EPP-value-and-use-that-ever.patch new file mode 100644 index 0000000..de93fa2 --- /dev/null +++ b/debian/patches/patchset-pf/amd-pstate/0040-cpufreq-amd-pstate-Cache-EPP-value-and-use-that-ever.patch @@ -0,0 +1,233 @@ +From fe7f993593ee1891acc875dfb1e091cf17a43f7a Mon Sep 17 00:00:00 2001 +From: Mario Limonciello +Date: Thu, 5 Dec 2024 16:28:43 -0600 +Subject: cpufreq/amd-pstate: Cache EPP value and use that everywhere + +Cache the value in cpudata->epp_cached, and use that for all callers. +As all callers use cached value merge amd_pstate_get_energy_pref_index() +into show_energy_performance_preference(). + +Check if the EPP value is changed before writing it to MSR or +shared memory region. + +Signed-off-by: Mario Limonciello +--- + drivers/cpufreq/amd-pstate.c | 107 +++++++++++++++-------------------- + 1 file changed, 45 insertions(+), 62 deletions(-) + +--- a/drivers/cpufreq/amd-pstate.c ++++ b/drivers/cpufreq/amd-pstate.c +@@ -216,29 +216,28 @@ static inline int get_mode_idx_from_str( + static DEFINE_MUTEX(amd_pstate_limits_lock); + static DEFINE_MUTEX(amd_pstate_driver_lock); + +-static s16 msr_get_epp(struct amd_cpudata *cpudata, u64 cppc_req_cached) ++static s16 msr_get_epp(struct amd_cpudata *cpudata) + { ++ u64 value; + int ret; + +- if (!cppc_req_cached) { +- ret = rdmsrl_on_cpu(cpudata->cpu, MSR_AMD_CPPC_REQ, &cppc_req_cached); +- if (ret < 0) { +- pr_debug("Could not retrieve energy perf value (%d)\n", ret); +- return ret; +- } ++ ret = rdmsrl_on_cpu(cpudata->cpu, MSR_AMD_CPPC_REQ, &value); ++ if (ret < 0) { ++ pr_debug("Could not retrieve energy perf value (%d)\n", ret); ++ return ret; + } + +- return FIELD_GET(AMD_PSTATE_EPP_PERF_MASK, cppc_req_cached); ++ return FIELD_GET(AMD_PSTATE_EPP_PERF_MASK, value); + } + + DEFINE_STATIC_CALL(amd_pstate_get_epp, msr_get_epp); + +-static inline s16 amd_pstate_get_epp(struct amd_cpudata *cpudata, u64 cppc_req_cached) ++static inline s16 amd_pstate_get_epp(struct amd_cpudata *cpudata) + { +- return static_call(amd_pstate_get_epp)(cpudata, cppc_req_cached); ++ return static_call(amd_pstate_get_epp)(cpudata); + } + +-static s16 shmem_get_epp(struct amd_cpudata *cpudata, u64 dummy) ++static s16 shmem_get_epp(struct amd_cpudata *cpudata) + { + u64 epp; + int ret; +@@ -252,35 +251,6 @@ static s16 shmem_get_epp(struct amd_cpud + return (s16)(epp & 0xff); + } + +-static int amd_pstate_get_energy_pref_index(struct amd_cpudata *cpudata) +-{ +- s16 epp; +- int index = -EINVAL; +- +- epp = amd_pstate_get_epp(cpudata, 0); +- if (epp < 0) +- return epp; +- +- switch (epp) { +- case AMD_CPPC_EPP_PERFORMANCE: +- index = EPP_INDEX_PERFORMANCE; +- break; +- case AMD_CPPC_EPP_BALANCE_PERFORMANCE: +- index = EPP_INDEX_BALANCE_PERFORMANCE; +- break; +- case AMD_CPPC_EPP_BALANCE_POWERSAVE: +- index = EPP_INDEX_BALANCE_POWERSAVE; +- break; +- case AMD_CPPC_EPP_POWERSAVE: +- index = EPP_INDEX_POWERSAVE; +- break; +- default: +- break; +- } +- +- return index; +-} +- + static int msr_update_perf(struct amd_cpudata *cpudata, u32 min_perf, + u32 des_perf, u32 max_perf, bool fast_switch) + { +@@ -305,19 +275,23 @@ static inline int amd_pstate_update_perf + + static int msr_set_epp(struct amd_cpudata *cpudata, u32 epp) + { +- u64 value = READ_ONCE(cpudata->cppc_req_cached); ++ u64 value, prev; + int ret; + ++ value = prev = READ_ONCE(cpudata->cppc_req_cached); + value &= ~AMD_PSTATE_EPP_PERF_MASK; + value |= FIELD_PREP(AMD_PSTATE_EPP_PERF_MASK, epp); + ++ if (value == prev) ++ return 0; ++ + ret = wrmsrl_on_cpu(cpudata->cpu, MSR_AMD_CPPC_REQ, value); + if (ret) { + pr_err("failed to set energy perf value (%d)\n", ret); + return ret; + } + +- cpudata->epp_cached = epp; ++ WRITE_ONCE(cpudata->epp_cached, epp); + WRITE_ONCE(cpudata->cppc_req_cached, value); + + return ret; +@@ -335,13 +309,16 @@ static int shmem_set_epp(struct amd_cpud + int ret; + struct cppc_perf_ctrls perf_ctrls; + ++ if (epp == cpudata->epp_cached) ++ return 0; ++ + perf_ctrls.energy_perf = epp; + ret = cppc_set_epp_perf(cpudata->cpu, &perf_ctrls, 1); + if (ret) { + pr_debug("failed to set energy perf value (%d)\n", ret); + return ret; + } +- cpudata->epp_cached = epp; ++ WRITE_ONCE(cpudata->epp_cached, epp); + + return ret; + } +@@ -1244,9 +1221,22 @@ static ssize_t show_energy_performance_p + struct amd_cpudata *cpudata = policy->driver_data; + int preference; + +- preference = amd_pstate_get_energy_pref_index(cpudata); +- if (preference < 0) +- return preference; ++ switch (cpudata->epp_cached) { ++ case AMD_CPPC_EPP_PERFORMANCE: ++ preference = EPP_INDEX_PERFORMANCE; ++ break; ++ case AMD_CPPC_EPP_BALANCE_PERFORMANCE: ++ preference = EPP_INDEX_BALANCE_PERFORMANCE; ++ break; ++ case AMD_CPPC_EPP_BALANCE_POWERSAVE: ++ preference = EPP_INDEX_BALANCE_POWERSAVE; ++ break; ++ case AMD_CPPC_EPP_POWERSAVE: ++ preference = EPP_INDEX_POWERSAVE; ++ break; ++ default: ++ return -EINVAL; ++ } + + return sysfs_emit(buf, "%s\n", energy_perf_strings[preference]); + } +@@ -1531,7 +1521,7 @@ static int amd_pstate_epp_cpu_init(struc + + policy->driver_data = cpudata; + +- cpudata->epp_cached = cpudata->epp_default = amd_pstate_get_epp(cpudata, 0); ++ cpudata->epp_cached = cpudata->epp_default = amd_pstate_get_epp(cpudata); + + policy->min = policy->cpuinfo.min_freq; + policy->max = policy->cpuinfo.max_freq; +@@ -1585,35 +1575,26 @@ static int amd_pstate_epp_update_limit(s + { + struct amd_cpudata *cpudata = policy->driver_data; + u64 value; +- s16 epp; + + amd_pstate_update_min_max_limit(policy); + + value = READ_ONCE(cpudata->cppc_req_cached); + + value &= ~(AMD_PSTATE_MAX_PERF_MASK | AMD_PSTATE_MIN_PERF_MASK | +- AMD_PSTATE_DES_PERF_MASK); ++ AMD_PSTATE_DES_PERF_MASK | AMD_PSTATE_EPP_PERF_MASK); + value |= FIELD_PREP(AMD_PSTATE_MAX_PERF_MASK, cpudata->max_limit_perf); + value |= FIELD_PREP(AMD_PSTATE_DES_PERF_MASK, 0); + value |= FIELD_PREP(AMD_PSTATE_MIN_PERF_MASK, cpudata->min_limit_perf); + +- /* Get BIOS pre-defined epp value */ +- epp = amd_pstate_get_epp(cpudata, value); +- if (epp < 0) { +- /** +- * This return value can only be negative for shared_memory +- * systems where EPP register read/write not supported. +- */ +- return epp; +- } +- + if (cpudata->policy == CPUFREQ_POLICY_PERFORMANCE) +- epp = 0; ++ WRITE_ONCE(cpudata->epp_cached, 0); ++ value |= FIELD_PREP(AMD_PSTATE_EPP_PERF_MASK, cpudata->epp_cached); + + WRITE_ONCE(cpudata->cppc_req_cached, value); + + if (trace_amd_pstate_epp_perf_enabled()) { +- trace_amd_pstate_epp_perf(cpudata->cpu, cpudata->highest_perf, epp, ++ trace_amd_pstate_epp_perf(cpudata->cpu, cpudata->highest_perf, ++ cpudata->epp_cached, + cpudata->min_limit_perf, + cpudata->max_limit_perf, + cpudata->boost_state); +@@ -1622,7 +1603,7 @@ static int amd_pstate_epp_update_limit(s + amd_pstate_update_perf(cpudata, cpudata->min_limit_perf, 0U, + cpudata->max_limit_perf, false); + +- return amd_pstate_set_epp(cpudata, epp); ++ return amd_pstate_set_epp(cpudata, READ_ONCE(cpudata->epp_cached)); + } + + static int amd_pstate_epp_set_policy(struct cpufreq_policy *policy) +@@ -1638,6 +1619,8 @@ static int amd_pstate_epp_set_policy(str + + cpudata->policy = policy->policy; + ++ guard(mutex)(&amd_pstate_limits_lock); ++ + ret = amd_pstate_epp_update_limit(policy); + if (ret) + return ret; diff --git a/debian/patches/patchset-pf/amd-pstate/0041-cpufreq-amd-pstate-Always-write-EPP-value-when-updat.patch b/debian/patches/patchset-pf/amd-pstate/0041-cpufreq-amd-pstate-Always-write-EPP-value-when-updat.patch new file mode 100644 index 0000000..5f609ce --- /dev/null +++ b/debian/patches/patchset-pf/amd-pstate/0041-cpufreq-amd-pstate-Always-write-EPP-value-when-updat.patch @@ -0,0 +1,182 @@ +From 98f0f9202cd0fc549f5beaaaf8750658d8ee2140 Mon Sep 17 00:00:00 2001 +From: Mario Limonciello +Date: Thu, 5 Dec 2024 16:28:44 -0600 +Subject: cpufreq/amd-pstate: Always write EPP value when updating perf + +For MSR systems the EPP value is in the same register as perf targets +and so divding them into two separate MSR writes is wasteful. + +In msr_update_perf(), update both EPP and perf values in one write to +MSR_AMD_CPPC_REQ, and cache them if successful. + +To accomplish this plumb the EPP value into the update_perf call and modify +all its callers to check the return value. + +Signed-off-by: Mario Limonciello +--- + drivers/cpufreq/amd-pstate.c | 71 ++++++++++++++++++++++-------------- + 1 file changed, 43 insertions(+), 28 deletions(-) + +--- a/drivers/cpufreq/amd-pstate.c ++++ b/drivers/cpufreq/amd-pstate.c +@@ -252,25 +252,36 @@ static s16 shmem_get_epp(struct amd_cpud + } + + static int msr_update_perf(struct amd_cpudata *cpudata, u32 min_perf, +- u32 des_perf, u32 max_perf, bool fast_switch) ++ u32 des_perf, u32 max_perf, u32 epp, bool fast_switch) + { ++ u64 value; ++ ++ value = READ_ONCE(cpudata->cppc_req_cached); + if (fast_switch) { + wrmsrl(MSR_AMD_CPPC_REQ, READ_ONCE(cpudata->cppc_req_cached)); + return 0; ++ } else { ++ int ret = wrmsrl_on_cpu(cpudata->cpu, MSR_AMD_CPPC_REQ, ++ READ_ONCE(cpudata->cppc_req_cached)); ++ if (ret) ++ return ret; + } + +- return wrmsrl_on_cpu(cpudata->cpu, MSR_AMD_CPPC_REQ, +- READ_ONCE(cpudata->cppc_req_cached)); ++ WRITE_ONCE(cpudata->cppc_req_cached, value); ++ WRITE_ONCE(cpudata->epp_cached, epp); ++ ++ return 0; + } + + DEFINE_STATIC_CALL(amd_pstate_update_perf, msr_update_perf); + + static inline int amd_pstate_update_perf(struct amd_cpudata *cpudata, + u32 min_perf, u32 des_perf, +- u32 max_perf, bool fast_switch) ++ u32 max_perf, u32 epp, ++ bool fast_switch) + { + return static_call(amd_pstate_update_perf)(cpudata, min_perf, des_perf, +- max_perf, fast_switch); ++ max_perf, epp, fast_switch); + } + + static int msr_set_epp(struct amd_cpudata *cpudata, u32 epp) +@@ -489,12 +500,19 @@ static inline int amd_pstate_init_perf(s + return static_call(amd_pstate_init_perf)(cpudata); + } + +-static int shmem_update_perf(struct amd_cpudata *cpudata, +- u32 min_perf, u32 des_perf, +- u32 max_perf, bool fast_switch) ++static int shmem_update_perf(struct amd_cpudata *cpudata, u32 min_perf, ++ u32 des_perf, u32 max_perf, u32 epp, bool fast_switch) + { + struct cppc_perf_ctrls perf_ctrls; + ++ if (cppc_state == AMD_PSTATE_ACTIVE) { ++ int ret = shmem_set_epp(cpudata, epp); ++ ++ if (ret) ++ return ret; ++ WRITE_ONCE(cpudata->epp_cached, epp); ++ } ++ + perf_ctrls.max_perf = max_perf; + perf_ctrls.min_perf = min_perf; + perf_ctrls.desired_perf = des_perf; +@@ -575,10 +593,10 @@ static void amd_pstate_update(struct amd + + WRITE_ONCE(cpudata->cppc_req_cached, value); + +- amd_pstate_update_perf(cpudata, min_perf, des_perf, +- max_perf, fast_switch); ++ amd_pstate_update_perf(cpudata, min_perf, des_perf, max_perf, 0, fast_switch); + + cpufreq_policy_put: ++ + cpufreq_cpu_put(policy); + } + +@@ -1575,6 +1593,7 @@ static int amd_pstate_epp_update_limit(s + { + struct amd_cpudata *cpudata = policy->driver_data; + u64 value; ++ u32 epp; + + amd_pstate_update_min_max_limit(policy); + +@@ -1587,23 +1606,19 @@ static int amd_pstate_epp_update_limit(s + value |= FIELD_PREP(AMD_PSTATE_MIN_PERF_MASK, cpudata->min_limit_perf); + + if (cpudata->policy == CPUFREQ_POLICY_PERFORMANCE) +- WRITE_ONCE(cpudata->epp_cached, 0); +- value |= FIELD_PREP(AMD_PSTATE_EPP_PERF_MASK, cpudata->epp_cached); +- +- WRITE_ONCE(cpudata->cppc_req_cached, value); ++ epp = 0; ++ else ++ epp = READ_ONCE(cpudata->epp_cached); + + if (trace_amd_pstate_epp_perf_enabled()) { +- trace_amd_pstate_epp_perf(cpudata->cpu, cpudata->highest_perf, +- cpudata->epp_cached, ++ trace_amd_pstate_epp_perf(cpudata->cpu, cpudata->highest_perf, epp, + cpudata->min_limit_perf, + cpudata->max_limit_perf, + cpudata->boost_state); + } + +- amd_pstate_update_perf(cpudata, cpudata->min_limit_perf, 0U, +- cpudata->max_limit_perf, false); +- +- return amd_pstate_set_epp(cpudata, READ_ONCE(cpudata->epp_cached)); ++ return amd_pstate_update_perf(cpudata, cpudata->min_limit_perf, 0U, ++ cpudata->max_limit_perf, epp, false); + } + + static int amd_pstate_epp_set_policy(struct cpufreq_policy *policy) +@@ -1634,7 +1649,7 @@ static int amd_pstate_epp_set_policy(str + return 0; + } + +-static void amd_pstate_epp_reenable(struct amd_cpudata *cpudata) ++static int amd_pstate_epp_reenable(struct amd_cpudata *cpudata) + { + u64 max_perf; + int ret; +@@ -1652,17 +1667,19 @@ static void amd_pstate_epp_reenable(stru + max_perf, cpudata->boost_state); + } + +- amd_pstate_update_perf(cpudata, 0, 0, max_perf, false); +- amd_pstate_set_epp(cpudata, cpudata->epp_cached); ++ return amd_pstate_update_perf(cpudata, 0, 0, max_perf, cpudata->epp_cached, false); + } + + static int amd_pstate_epp_cpu_online(struct cpufreq_policy *policy) + { + struct amd_cpudata *cpudata = policy->driver_data; ++ int ret; + + pr_debug("AMD CPU Core %d going online\n", cpudata->cpu); + +- amd_pstate_epp_reenable(cpudata); ++ ret = amd_pstate_epp_reenable(cpudata); ++ if (ret) ++ return ret; + cpudata->suspended = false; + + return 0; +@@ -1686,10 +1703,8 @@ static int amd_pstate_epp_cpu_offline(st + min_perf, min_perf, cpudata->boost_state); + } + +- amd_pstate_update_perf(cpudata, min_perf, 0, min_perf, false); +- amd_pstate_set_epp(cpudata, AMD_CPPC_EPP_BALANCE_POWERSAVE); +- +- return 0; ++ return amd_pstate_update_perf(cpudata, min_perf, 0, min_perf, ++ AMD_CPPC_EPP_BALANCE_POWERSAVE, false); + } + + static int amd_pstate_epp_suspend(struct cpufreq_policy *policy) diff --git a/debian/patches/patchset-pf/amd-pstate/0042-cpufreq-amd-pstate-Check-if-CPPC-request-has-changed.patch b/debian/patches/patchset-pf/amd-pstate/0042-cpufreq-amd-pstate-Check-if-CPPC-request-has-changed.patch new file mode 100644 index 0000000..aec7ed6 --- /dev/null +++ b/debian/patches/patchset-pf/amd-pstate/0042-cpufreq-amd-pstate-Check-if-CPPC-request-has-changed.patch @@ -0,0 +1,158 @@ +From acf3f432287638044e472501a1d5969abee15043 Mon Sep 17 00:00:00 2001 +From: Mario Limonciello +Date: Thu, 5 Dec 2024 16:28:45 -0600 +Subject: cpufreq/amd-pstate: Check if CPPC request has changed before writing + to the MSR or shared memory + +Move the common MSR field formatting code to msr_update_perf() from +its callers. + +Ensure that the MSR write is necessary before flushing a write out. +Also drop the comparison from the passive flow tracing. + +Signed-off-by: Mario Limonciello +--- + drivers/cpufreq/amd-pstate-trace.h | 7 +---- + drivers/cpufreq/amd-pstate.c | 47 +++++++++++------------------- + 2 files changed, 18 insertions(+), 36 deletions(-) + +--- a/drivers/cpufreq/amd-pstate-trace.h ++++ b/drivers/cpufreq/amd-pstate-trace.h +@@ -32,7 +32,6 @@ TRACE_EVENT(amd_pstate_perf, + u64 aperf, + u64 tsc, + unsigned int cpu_id, +- bool changed, + bool fast_switch + ), + +@@ -44,7 +43,6 @@ TRACE_EVENT(amd_pstate_perf, + aperf, + tsc, + cpu_id, +- changed, + fast_switch + ), + +@@ -57,7 +55,6 @@ TRACE_EVENT(amd_pstate_perf, + __field(unsigned long long, aperf) + __field(unsigned long long, tsc) + __field(unsigned int, cpu_id) +- __field(bool, changed) + __field(bool, fast_switch) + ), + +@@ -70,11 +67,10 @@ TRACE_EVENT(amd_pstate_perf, + __entry->aperf = aperf; + __entry->tsc = tsc; + __entry->cpu_id = cpu_id; +- __entry->changed = changed; + __entry->fast_switch = fast_switch; + ), + +- TP_printk("amd_min_perf=%lu amd_des_perf=%lu amd_max_perf=%lu freq=%llu mperf=%llu aperf=%llu tsc=%llu cpu_id=%u changed=%s fast_switch=%s", ++ TP_printk("amd_min_perf=%lu amd_des_perf=%lu amd_max_perf=%lu freq=%llu mperf=%llu aperf=%llu tsc=%llu cpu_id=%u fast_switch=%s", + (unsigned long)__entry->min_perf, + (unsigned long)__entry->target_perf, + (unsigned long)__entry->capacity, +@@ -83,7 +79,6 @@ TRACE_EVENT(amd_pstate_perf, + (unsigned long long)__entry->aperf, + (unsigned long long)__entry->tsc, + (unsigned int)__entry->cpu_id, +- (__entry->changed) ? "true" : "false", + (__entry->fast_switch) ? "true" : "false" + ) + ); +--- a/drivers/cpufreq/amd-pstate.c ++++ b/drivers/cpufreq/amd-pstate.c +@@ -254,15 +254,26 @@ static s16 shmem_get_epp(struct amd_cpud + static int msr_update_perf(struct amd_cpudata *cpudata, u32 min_perf, + u32 des_perf, u32 max_perf, u32 epp, bool fast_switch) + { +- u64 value; ++ u64 value, prev; ++ ++ value = prev = READ_ONCE(cpudata->cppc_req_cached); ++ ++ value &= ~(AMD_PSTATE_MAX_PERF_MASK | AMD_PSTATE_MIN_PERF_MASK | ++ AMD_PSTATE_DES_PERF_MASK | AMD_PSTATE_EPP_PERF_MASK); ++ value |= FIELD_PREP(AMD_PSTATE_MAX_PERF_MASK, max_perf); ++ value |= FIELD_PREP(AMD_PSTATE_DES_PERF_MASK, des_perf); ++ value |= FIELD_PREP(AMD_PSTATE_MIN_PERF_MASK, min_perf); ++ value |= FIELD_PREP(AMD_PSTATE_EPP_PERF_MASK, epp); ++ ++ if (value == prev) ++ return 0; + +- value = READ_ONCE(cpudata->cppc_req_cached); + if (fast_switch) { +- wrmsrl(MSR_AMD_CPPC_REQ, READ_ONCE(cpudata->cppc_req_cached)); ++ wrmsrl(MSR_AMD_CPPC_REQ, value); + return 0; + } else { +- int ret = wrmsrl_on_cpu(cpudata->cpu, MSR_AMD_CPPC_REQ, +- READ_ONCE(cpudata->cppc_req_cached)); ++ int ret = wrmsrl_on_cpu(cpudata->cpu, MSR_AMD_CPPC_REQ, value); ++ + if (ret) + return ret; + } +@@ -558,9 +569,7 @@ static void amd_pstate_update(struct amd + { + unsigned long max_freq; + struct cpufreq_policy *policy = cpufreq_cpu_get(cpudata->cpu); +- u64 prev = READ_ONCE(cpudata->cppc_req_cached); + u32 nominal_perf = READ_ONCE(cpudata->nominal_perf); +- u64 value = prev; + + des_perf = clamp_t(unsigned long, des_perf, min_perf, max_perf); + +@@ -576,27 +585,14 @@ static void amd_pstate_update(struct amd + if (!cpudata->boost_supported) + max_perf = min_t(unsigned long, nominal_perf, max_perf); + +- value &= ~(AMD_PSTATE_MAX_PERF_MASK | AMD_PSTATE_MIN_PERF_MASK | +- AMD_PSTATE_DES_PERF_MASK); +- value |= FIELD_PREP(AMD_PSTATE_MAX_PERF_MASK, max_perf); +- value |= FIELD_PREP(AMD_PSTATE_DES_PERF_MASK, des_perf); +- value |= FIELD_PREP(AMD_PSTATE_MIN_PERF_MASK, min_perf); +- + if (trace_amd_pstate_perf_enabled() && amd_pstate_sample(cpudata)) { + trace_amd_pstate_perf(min_perf, des_perf, max_perf, cpudata->freq, + cpudata->cur.mperf, cpudata->cur.aperf, cpudata->cur.tsc, +- cpudata->cpu, (value != prev), fast_switch); ++ cpudata->cpu, fast_switch); + } + +- if (value == prev) +- goto cpufreq_policy_put; +- +- WRITE_ONCE(cpudata->cppc_req_cached, value); +- + amd_pstate_update_perf(cpudata, min_perf, des_perf, max_perf, 0, fast_switch); + +-cpufreq_policy_put: +- + cpufreq_cpu_put(policy); + } + +@@ -1592,19 +1588,10 @@ static void amd_pstate_epp_cpu_exit(stru + static int amd_pstate_epp_update_limit(struct cpufreq_policy *policy) + { + struct amd_cpudata *cpudata = policy->driver_data; +- u64 value; + u32 epp; + + amd_pstate_update_min_max_limit(policy); + +- value = READ_ONCE(cpudata->cppc_req_cached); +- +- value &= ~(AMD_PSTATE_MAX_PERF_MASK | AMD_PSTATE_MIN_PERF_MASK | +- AMD_PSTATE_DES_PERF_MASK | AMD_PSTATE_EPP_PERF_MASK); +- value |= FIELD_PREP(AMD_PSTATE_MAX_PERF_MASK, cpudata->max_limit_perf); +- value |= FIELD_PREP(AMD_PSTATE_DES_PERF_MASK, 0); +- value |= FIELD_PREP(AMD_PSTATE_MIN_PERF_MASK, cpudata->min_limit_perf); +- + if (cpudata->policy == CPUFREQ_POLICY_PERFORMANCE) + epp = 0; + else diff --git a/debian/patches/patchset-pf/amd-pstate/0043-cpufreq-amd-pstate-Drop-ret-variable-from-amd_pstate.patch b/debian/patches/patchset-pf/amd-pstate/0043-cpufreq-amd-pstate-Drop-ret-variable-from-amd_pstate.patch new file mode 100644 index 0000000..facaf47 --- /dev/null +++ b/debian/patches/patchset-pf/amd-pstate/0043-cpufreq-amd-pstate-Drop-ret-variable-from-amd_pstate.patch @@ -0,0 +1,42 @@ +From 55bcae033b08b1b926f927616cca17242cfcfe59 Mon Sep 17 00:00:00 2001 +From: Mario Limonciello +Date: Thu, 5 Dec 2024 16:28:46 -0600 +Subject: cpufreq/amd-pstate: Drop ret variable from + amd_pstate_set_energy_pref_index() + +The ret variable is not necessary. + +Signed-off-by: Mario Limonciello +--- + drivers/cpufreq/amd-pstate.c | 10 +++------- + 1 file changed, 3 insertions(+), 7 deletions(-) + +--- a/drivers/cpufreq/amd-pstate.c ++++ b/drivers/cpufreq/amd-pstate.c +@@ -348,13 +348,11 @@ static int shmem_set_epp(struct amd_cpud + static int amd_pstate_set_energy_pref_index(struct amd_cpudata *cpudata, + int pref_index) + { +- int epp = -EINVAL; +- int ret; ++ int epp; + + if (!pref_index) + epp = cpudata->epp_default; +- +- if (epp == -EINVAL) ++ else + epp = epp_values[pref_index]; + + if (epp > 0 && cpudata->policy == CPUFREQ_POLICY_PERFORMANCE) { +@@ -370,9 +368,7 @@ static int amd_pstate_set_energy_pref_in + cpudata->boost_state); + } + +- ret = amd_pstate_set_epp(cpudata, epp); +- +- return ret; ++ return amd_pstate_set_epp(cpudata, epp); + } + + static inline int msr_cppc_enable(bool enable) diff --git a/debian/patches/patchset-pf/amd-pstate/0044-cpufreq-amd-pstate-Set-different-default-EPP-policy-.patch b/debian/patches/patchset-pf/amd-pstate/0044-cpufreq-amd-pstate-Set-different-default-EPP-policy-.patch new file mode 100644 index 0000000..ccbe418 --- /dev/null +++ b/debian/patches/patchset-pf/amd-pstate/0044-cpufreq-amd-pstate-Set-different-default-EPP-policy-.patch @@ -0,0 +1,58 @@ +From f1edcca6a96f087f5862a14012fafd4eb9738601 Mon Sep 17 00:00:00 2001 +From: Mario Limonciello +Date: Thu, 5 Dec 2024 16:28:47 -0600 +Subject: cpufreq/amd-pstate: Set different default EPP policy for Epyc and + Ryzen + +For Ryzen systems the EPP policy set by the BIOS is generally configured +to performance as this is the default register value for the CPPC request +MSR. + +If a user doesn't use additional software to configure EPP then the system +will default biased towards performance and consume extra battery. Instead +configure the default to "balanced_performance" for this case. + +Suggested-by: Artem S. Tashkinov +Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219526 +Signed-off-by: Mario Limonciello +--- + drivers/cpufreq/amd-pstate.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +--- a/drivers/cpufreq/amd-pstate.c ++++ b/drivers/cpufreq/amd-pstate.c +@@ -1531,8 +1531,6 @@ static int amd_pstate_epp_cpu_init(struc + + policy->driver_data = cpudata; + +- cpudata->epp_cached = cpudata->epp_default = amd_pstate_get_epp(cpudata); +- + policy->min = policy->cpuinfo.min_freq; + policy->max = policy->cpuinfo.max_freq; + +@@ -1543,10 +1541,13 @@ static int amd_pstate_epp_cpu_init(struc + * the default cpufreq governor is neither powersave nor performance. + */ + if (amd_pstate_acpi_pm_profile_server() || +- amd_pstate_acpi_pm_profile_undefined()) ++ amd_pstate_acpi_pm_profile_undefined()) { + policy->policy = CPUFREQ_POLICY_PERFORMANCE; +- else ++ cpudata->epp_default = amd_pstate_get_epp(cpudata); ++ } else { + policy->policy = CPUFREQ_POLICY_POWERSAVE; ++ cpudata->epp_default = AMD_CPPC_EPP_BALANCE_PERFORMANCE; ++ } + + if (cpu_feature_enabled(X86_FEATURE_CPPC)) { + ret = rdmsrl_on_cpu(cpudata->cpu, MSR_AMD_CPPC_REQ, &value); +@@ -1559,6 +1560,9 @@ static int amd_pstate_epp_cpu_init(struc + return ret; + WRITE_ONCE(cpudata->cppc_cap1_cached, value); + } ++ ret = amd_pstate_set_epp(cpudata, cpudata->epp_default); ++ if (ret) ++ return ret; + + current_pstate_driver->adjust_perf = NULL; + diff --git a/debian/patches/patchset-pf/amd-rapl/0001-perf-Generic-hotplug-support-for-a-PMU-with-a-scope.patch b/debian/patches/patchset-pf/amd-rapl/0001-perf-Generic-hotplug-support-for-a-PMU-with-a-scope.patch deleted file mode 100644 index 8c7f40f..0000000 --- a/debian/patches/patchset-pf/amd-rapl/0001-perf-Generic-hotplug-support-for-a-PMU-with-a-scope.patch +++ /dev/null @@ -1,321 +0,0 @@ -From 023d6b8aa8d8b346cfdcccf5ca4cb880c8d41d87 Mon Sep 17 00:00:00 2001 -From: Kan Liang -Date: Fri, 2 Aug 2024 08:16:37 -0700 -Subject: perf: Generic hotplug support for a PMU with a scope - -The perf subsystem assumes that the counters of a PMU are per-CPU. So -the user space tool reads a counter from each CPU in the system wide -mode. However, many PMUs don't have a per-CPU counter. The counter is -effective for a scope, e.g., a die or a socket. To address this, a -cpumask is exposed by the kernel driver to restrict to one CPU to stand -for a specific scope. In case the given CPU is removed, -the hotplug support has to be implemented for each such driver. - -The codes to support the cpumask and hotplug are very similar. -- Expose a cpumask into sysfs -- Pickup another CPU in the same scope if the given CPU is removed. -- Invoke the perf_pmu_migrate_context() to migrate to a new CPU. -- In event init, always set the CPU in the cpumask to event->cpu - -Similar duplicated codes are implemented for each such PMU driver. It -would be good to introduce a generic infrastructure to avoid such -duplication. - -5 popular scopes are implemented here, core, die, cluster, pkg, and -the system-wide. The scope can be set when a PMU is registered. If so, a -"cpumask" is automatically exposed for the PMU. - -The "cpumask" is from the perf_online__mask, which is to track -the active CPU for each scope. They are set when the first CPU of the -scope is online via the generic perf hotplug support. When a -corresponding CPU is removed, the perf_online__mask is updated -accordingly and the PMU will be moved to a new CPU from the same scope -if possible. - -Signed-off-by: Kan Liang ---- - include/linux/perf_event.h | 18 ++++ - kernel/events/core.c | 164 ++++++++++++++++++++++++++++++++++++- - 2 files changed, 180 insertions(+), 2 deletions(-) - ---- a/include/linux/perf_event.h -+++ b/include/linux/perf_event.h -@@ -292,6 +292,19 @@ struct perf_event_pmu_context; - #define PERF_PMU_CAP_AUX_OUTPUT 0x0080 - #define PERF_PMU_CAP_EXTENDED_HW_TYPE 0x0100 - -+/** -+ * pmu::scope -+ */ -+enum perf_pmu_scope { -+ PERF_PMU_SCOPE_NONE = 0, -+ PERF_PMU_SCOPE_CORE, -+ PERF_PMU_SCOPE_DIE, -+ PERF_PMU_SCOPE_CLUSTER, -+ PERF_PMU_SCOPE_PKG, -+ PERF_PMU_SCOPE_SYS_WIDE, -+ PERF_PMU_MAX_SCOPE, -+}; -+ - struct perf_output_handle; - - #define PMU_NULL_DEV ((void *)(~0UL)) -@@ -315,6 +328,11 @@ struct pmu { - */ - int capabilities; - -+ /* -+ * PMU scope -+ */ -+ unsigned int scope; -+ - int __percpu *pmu_disable_count; - struct perf_cpu_pmu_context __percpu *cpu_pmu_context; - atomic_t exclusive_cnt; /* < 0: cpu; > 0: tsk */ ---- a/kernel/events/core.c -+++ b/kernel/events/core.c -@@ -411,6 +411,11 @@ static LIST_HEAD(pmus); - static DEFINE_MUTEX(pmus_lock); - static struct srcu_struct pmus_srcu; - static cpumask_var_t perf_online_mask; -+static cpumask_var_t perf_online_core_mask; -+static cpumask_var_t perf_online_die_mask; -+static cpumask_var_t perf_online_cluster_mask; -+static cpumask_var_t perf_online_pkg_mask; -+static cpumask_var_t perf_online_sys_mask; - static struct kmem_cache *perf_event_cache; - - /* -@@ -11497,10 +11502,60 @@ perf_event_mux_interval_ms_store(struct - } - static DEVICE_ATTR_RW(perf_event_mux_interval_ms); - -+static inline const struct cpumask *perf_scope_cpu_topology_cpumask(unsigned int scope, int cpu) -+{ -+ switch (scope) { -+ case PERF_PMU_SCOPE_CORE: -+ return topology_sibling_cpumask(cpu); -+ case PERF_PMU_SCOPE_DIE: -+ return topology_die_cpumask(cpu); -+ case PERF_PMU_SCOPE_CLUSTER: -+ return topology_cluster_cpumask(cpu); -+ case PERF_PMU_SCOPE_PKG: -+ return topology_core_cpumask(cpu); -+ case PERF_PMU_SCOPE_SYS_WIDE: -+ return cpu_online_mask; -+ } -+ -+ return NULL; -+} -+ -+static inline struct cpumask *perf_scope_cpumask(unsigned int scope) -+{ -+ switch (scope) { -+ case PERF_PMU_SCOPE_CORE: -+ return perf_online_core_mask; -+ case PERF_PMU_SCOPE_DIE: -+ return perf_online_die_mask; -+ case PERF_PMU_SCOPE_CLUSTER: -+ return perf_online_cluster_mask; -+ case PERF_PMU_SCOPE_PKG: -+ return perf_online_pkg_mask; -+ case PERF_PMU_SCOPE_SYS_WIDE: -+ return perf_online_sys_mask; -+ } -+ -+ return NULL; -+} -+ -+static ssize_t cpumask_show(struct device *dev, struct device_attribute *attr, -+ char *buf) -+{ -+ struct pmu *pmu = dev_get_drvdata(dev); -+ struct cpumask *mask = perf_scope_cpumask(pmu->scope); -+ -+ if (mask) -+ return cpumap_print_to_pagebuf(true, buf, mask); -+ return 0; -+} -+ -+static DEVICE_ATTR_RO(cpumask); -+ - static struct attribute *pmu_dev_attrs[] = { - &dev_attr_type.attr, - &dev_attr_perf_event_mux_interval_ms.attr, - &dev_attr_nr_addr_filters.attr, -+ &dev_attr_cpumask.attr, - NULL, - }; - -@@ -11512,6 +11567,10 @@ static umode_t pmu_dev_is_visible(struct - if (n == 2 && !pmu->nr_addr_filters) - return 0; - -+ /* cpumask */ -+ if (n == 3 && pmu->scope == PERF_PMU_SCOPE_NONE) -+ return 0; -+ - return a->mode; - } - -@@ -11596,6 +11655,11 @@ int perf_pmu_register(struct pmu *pmu, c - goto free_pdc; - } - -+ if (WARN_ONCE(pmu->scope >= PERF_PMU_MAX_SCOPE, "Can not register a pmu with an invalid scope.\n")) { -+ ret = -EINVAL; -+ goto free_pdc; -+ } -+ - pmu->name = name; - - if (type >= 0) -@@ -11750,6 +11814,22 @@ static int perf_try_init_event(struct pm - event_has_any_exclude_flag(event)) - ret = -EINVAL; - -+ if (pmu->scope != PERF_PMU_SCOPE_NONE && event->cpu >= 0) { -+ const struct cpumask *cpumask = perf_scope_cpu_topology_cpumask(pmu->scope, event->cpu); -+ struct cpumask *pmu_cpumask = perf_scope_cpumask(pmu->scope); -+ int cpu; -+ -+ if (pmu_cpumask && cpumask) { -+ cpu = cpumask_any_and(pmu_cpumask, cpumask); -+ if (cpu >= nr_cpu_ids) -+ ret = -ENODEV; -+ else -+ event->cpu = cpu; -+ } else { -+ ret = -ENODEV; -+ } -+ } -+ - if (ret && event->destroy) - event->destroy(event); - } -@@ -13713,6 +13793,12 @@ static void __init perf_event_init_all_c - int cpu; - - zalloc_cpumask_var(&perf_online_mask, GFP_KERNEL); -+ zalloc_cpumask_var(&perf_online_core_mask, GFP_KERNEL); -+ zalloc_cpumask_var(&perf_online_die_mask, GFP_KERNEL); -+ zalloc_cpumask_var(&perf_online_cluster_mask, GFP_KERNEL); -+ zalloc_cpumask_var(&perf_online_pkg_mask, GFP_KERNEL); -+ zalloc_cpumask_var(&perf_online_sys_mask, GFP_KERNEL); -+ - - for_each_possible_cpu(cpu) { - swhash = &per_cpu(swevent_htable, cpu); -@@ -13762,6 +13848,40 @@ static void __perf_event_exit_context(vo - raw_spin_unlock(&ctx->lock); - } - -+static void perf_event_clear_cpumask(unsigned int cpu) -+{ -+ int target[PERF_PMU_MAX_SCOPE]; -+ unsigned int scope; -+ struct pmu *pmu; -+ -+ cpumask_clear_cpu(cpu, perf_online_mask); -+ -+ for (scope = PERF_PMU_SCOPE_NONE + 1; scope < PERF_PMU_MAX_SCOPE; scope++) { -+ const struct cpumask *cpumask = perf_scope_cpu_topology_cpumask(scope, cpu); -+ struct cpumask *pmu_cpumask = perf_scope_cpumask(scope); -+ -+ target[scope] = -1; -+ if (WARN_ON_ONCE(!pmu_cpumask || !cpumask)) -+ continue; -+ -+ if (!cpumask_test_and_clear_cpu(cpu, pmu_cpumask)) -+ continue; -+ target[scope] = cpumask_any_but(cpumask, cpu); -+ if (target[scope] < nr_cpu_ids) -+ cpumask_set_cpu(target[scope], pmu_cpumask); -+ } -+ -+ /* migrate */ -+ list_for_each_entry_rcu(pmu, &pmus, entry, lockdep_is_held(&pmus_srcu)) { -+ if (pmu->scope == PERF_PMU_SCOPE_NONE || -+ WARN_ON_ONCE(pmu->scope >= PERF_PMU_MAX_SCOPE)) -+ continue; -+ -+ if (target[pmu->scope] >= 0 && target[pmu->scope] < nr_cpu_ids) -+ perf_pmu_migrate_context(pmu, cpu, target[pmu->scope]); -+ } -+} -+ - static void perf_event_exit_cpu_context(int cpu) - { - struct perf_cpu_context *cpuctx; -@@ -13769,6 +13889,11 @@ static void perf_event_exit_cpu_context( - - // XXX simplify cpuctx->online - mutex_lock(&pmus_lock); -+ /* -+ * Clear the cpumasks, and migrate to other CPUs if possible. -+ * Must be invoked before the __perf_event_exit_context. -+ */ -+ perf_event_clear_cpumask(cpu); - cpuctx = per_cpu_ptr(&perf_cpu_context, cpu); - ctx = &cpuctx->ctx; - -@@ -13776,7 +13901,6 @@ static void perf_event_exit_cpu_context( - smp_call_function_single(cpu, __perf_event_exit_context, ctx, 1); - cpuctx->online = 0; - mutex_unlock(&ctx->mutex); -- cpumask_clear_cpu(cpu, perf_online_mask); - mutex_unlock(&pmus_lock); - } - #else -@@ -13785,6 +13909,42 @@ static void perf_event_exit_cpu_context( - - #endif - -+static void perf_event_setup_cpumask(unsigned int cpu) -+{ -+ struct cpumask *pmu_cpumask; -+ unsigned int scope; -+ -+ cpumask_set_cpu(cpu, perf_online_mask); -+ -+ /* -+ * Early boot stage, the cpumask hasn't been set yet. -+ * The perf_online__masks includes the first CPU of each domain. -+ * Always uncondifionally set the boot CPU for the perf_online__masks. -+ */ -+ if (!topology_sibling_cpumask(cpu)) { -+ for (scope = PERF_PMU_SCOPE_NONE + 1; scope < PERF_PMU_MAX_SCOPE; scope++) { -+ pmu_cpumask = perf_scope_cpumask(scope); -+ if (WARN_ON_ONCE(!pmu_cpumask)) -+ continue; -+ cpumask_set_cpu(cpu, pmu_cpumask); -+ } -+ return; -+ } -+ -+ for (scope = PERF_PMU_SCOPE_NONE + 1; scope < PERF_PMU_MAX_SCOPE; scope++) { -+ const struct cpumask *cpumask = perf_scope_cpu_topology_cpumask(scope, cpu); -+ -+ pmu_cpumask = perf_scope_cpumask(scope); -+ -+ if (WARN_ON_ONCE(!pmu_cpumask || !cpumask)) -+ continue; -+ -+ if (!cpumask_empty(cpumask) && -+ cpumask_any_and(pmu_cpumask, cpumask) >= nr_cpu_ids) -+ cpumask_set_cpu(cpu, pmu_cpumask); -+ } -+} -+ - int perf_event_init_cpu(unsigned int cpu) - { - struct perf_cpu_context *cpuctx; -@@ -13793,7 +13953,7 @@ int perf_event_init_cpu(unsigned int cpu - perf_swevent_init_cpu(cpu); - - mutex_lock(&pmus_lock); -- cpumask_set_cpu(cpu, perf_online_mask); -+ perf_event_setup_cpumask(cpu); - cpuctx = per_cpu_ptr(&perf_cpu_context, cpu); - ctx = &cpuctx->ctx; - diff --git a/debian/patches/patchset-pf/amd-rapl/0001-perf-x86-rapl-Move-the-pmu-allocation-out-of-CPU-hot.patch b/debian/patches/patchset-pf/amd-rapl/0001-perf-x86-rapl-Move-the-pmu-allocation-out-of-CPU-hot.patch new file mode 100644 index 0000000..bbc6c13 --- /dev/null +++ b/debian/patches/patchset-pf/amd-rapl/0001-perf-x86-rapl-Move-the-pmu-allocation-out-of-CPU-hot.patch @@ -0,0 +1,87 @@ +From 997fe7115fcb9392f31aa07f407675194452dc0a Mon Sep 17 00:00:00 2001 +From: Kan Liang +Date: Thu, 10 Oct 2024 07:26:03 -0700 +Subject: perf/x86/rapl: Move the pmu allocation out of CPU hotplug + +There are extra codes in the CPU hotplug function to allocate rapl pmus. +The generic PMU hotplug support is hard to be applied. + +As long as the rapl pmus can be allocated upfront for each die/socket, +the code doesn't need to be implemented in the CPU hotplug function. +Move the code to the init_rapl_pmus(), and allocate a PMU for each +possible die/socket. + +Tested-by: Oliver Sang +Signed-off-by: Kan Liang +Cc: Dhananjay Ugwekar +--- + arch/x86/events/rapl.c | 44 ++++++++++++++++++++++++++++-------------- + 1 file changed, 30 insertions(+), 14 deletions(-) + +--- a/arch/x86/events/rapl.c ++++ b/arch/x86/events/rapl.c +@@ -602,19 +602,8 @@ static int rapl_cpu_online(unsigned int + struct rapl_pmu *pmu = cpu_to_rapl_pmu(cpu); + int target; + +- if (!pmu) { +- pmu = kzalloc_node(sizeof(*pmu), GFP_KERNEL, cpu_to_node(cpu)); +- if (!pmu) +- return -ENOMEM; +- +- raw_spin_lock_init(&pmu->lock); +- INIT_LIST_HEAD(&pmu->active_list); +- pmu->pmu = &rapl_pmus->pmu; +- pmu->timer_interval = ms_to_ktime(rapl_timer_ms); +- rapl_hrtimer_init(pmu); +- +- rapl_pmus->pmus[rapl_pmu_idx] = pmu; +- } ++ if (!pmu) ++ return -ENOMEM; + + /* + * Check if there is an online cpu in the package which collects rapl +@@ -707,6 +696,32 @@ static const struct attribute_group *rap + NULL, + }; + ++static int __init init_rapl_pmu(void) ++{ ++ struct rapl_pmu *pmu; ++ int idx; ++ ++ for (idx = 0; idx < rapl_pmus->nr_rapl_pmu; idx++) { ++ pmu = kzalloc(sizeof(*pmu), GFP_KERNEL); ++ if (!pmu) ++ goto free; ++ ++ raw_spin_lock_init(&pmu->lock); ++ INIT_LIST_HEAD(&pmu->active_list); ++ pmu->pmu = &rapl_pmus->pmu; ++ pmu->timer_interval = ms_to_ktime(rapl_timer_ms); ++ rapl_hrtimer_init(pmu); ++ ++ rapl_pmus->pmus[idx] = pmu; ++ } ++ ++ return 0; ++free: ++ for (; idx > 0; idx--) ++ kfree(rapl_pmus->pmus[idx - 1]); ++ return -ENOMEM; ++} ++ + static int __init init_rapl_pmus(void) + { + int nr_rapl_pmu = topology_max_packages(); +@@ -730,7 +745,8 @@ static int __init init_rapl_pmus(void) + rapl_pmus->pmu.read = rapl_pmu_event_read; + rapl_pmus->pmu.module = THIS_MODULE; + rapl_pmus->pmu.capabilities = PERF_PMU_CAP_NO_EXCLUDE; +- return 0; ++ ++ return init_rapl_pmu(); + } + + static struct rapl_model model_snb = { diff --git a/debian/patches/patchset-pf/amd-rapl/0002-perf-Add-PERF_EV_CAP_READ_SCOPE.patch b/debian/patches/patchset-pf/amd-rapl/0002-perf-Add-PERF_EV_CAP_READ_SCOPE.patch deleted file mode 100644 index 3240af8..0000000 --- a/debian/patches/patchset-pf/amd-rapl/0002-perf-Add-PERF_EV_CAP_READ_SCOPE.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 8c7eb17e722a6a45c4436e5debb9336089b21d9b Mon Sep 17 00:00:00 2001 -From: Kan Liang -Date: Fri, 2 Aug 2024 08:16:38 -0700 -Subject: perf: Add PERF_EV_CAP_READ_SCOPE - -Usually, an event can be read from any CPU of the scope. It doesn't need -to be read from the advertised CPU. - -Add a new event cap, PERF_EV_CAP_READ_SCOPE. An event of a PMU with -scope can be read from any active CPU in the scope. - -Signed-off-by: Kan Liang ---- - include/linux/perf_event.h | 3 +++ - kernel/events/core.c | 14 +++++++++++--- - 2 files changed, 14 insertions(+), 3 deletions(-) - ---- a/include/linux/perf_event.h -+++ b/include/linux/perf_event.h -@@ -633,10 +633,13 @@ typedef void (*perf_overflow_handler_t)( - * PERF_EV_CAP_SIBLING: An event with this flag must be a group sibling and - * cannot be a group leader. If an event with this flag is detached from the - * group it is scheduled out and moved into an unrecoverable ERROR state. -+ * PERF_EV_CAP_READ_SCOPE: A CPU event that can be read from any CPU of the -+ * PMU scope where it is active. - */ - #define PERF_EV_CAP_SOFTWARE BIT(0) - #define PERF_EV_CAP_READ_ACTIVE_PKG BIT(1) - #define PERF_EV_CAP_SIBLING BIT(2) -+#define PERF_EV_CAP_READ_SCOPE BIT(3) - - #define SWEVENT_HLIST_BITS 8 - #define SWEVENT_HLIST_SIZE (1 << SWEVENT_HLIST_BITS) ---- a/kernel/events/core.c -+++ b/kernel/events/core.c -@@ -4477,16 +4477,24 @@ struct perf_read_data { - int ret; - }; - -+static inline const struct cpumask *perf_scope_cpu_topology_cpumask(unsigned int scope, int cpu); -+ - static int __perf_event_read_cpu(struct perf_event *event, int event_cpu) - { -+ int local_cpu = smp_processor_id(); - u16 local_pkg, event_pkg; - - if ((unsigned)event_cpu >= nr_cpu_ids) - return event_cpu; - -- if (event->group_caps & PERF_EV_CAP_READ_ACTIVE_PKG) { -- int local_cpu = smp_processor_id(); -+ if (event->group_caps & PERF_EV_CAP_READ_SCOPE) { -+ const struct cpumask *cpumask = perf_scope_cpu_topology_cpumask(event->pmu->scope, event_cpu); -+ -+ if (cpumask && cpumask_test_cpu(local_cpu, cpumask)) -+ return local_cpu; -+ } - -+ if (event->group_caps & PERF_EV_CAP_READ_ACTIVE_PKG) { - event_pkg = topology_physical_package_id(event_cpu); - local_pkg = topology_physical_package_id(local_cpu); - -@@ -11824,7 +11832,7 @@ static int perf_try_init_event(struct pm - if (cpu >= nr_cpu_ids) - ret = -ENODEV; - else -- event->cpu = cpu; -+ event->event_caps |= PERF_EV_CAP_READ_SCOPE; - } else { - ret = -ENODEV; - } diff --git a/debian/patches/patchset-pf/amd-rapl/0007-perf-x86-rapl-Clean-up-cpumask-and-hotplug.patch b/debian/patches/patchset-pf/amd-rapl/0002-perf-x86-rapl-Clean-up-cpumask-and-hotplug.patch similarity index 71% rename from debian/patches/patchset-pf/amd-rapl/0007-perf-x86-rapl-Clean-up-cpumask-and-hotplug.patch rename to debian/patches/patchset-pf/amd-rapl/0002-perf-x86-rapl-Clean-up-cpumask-and-hotplug.patch index 565c457..d5eb74f 100644 --- a/debian/patches/patchset-pf/amd-rapl/0007-perf-x86-rapl-Clean-up-cpumask-and-hotplug.patch +++ b/debian/patches/patchset-pf/amd-rapl/0002-perf-x86-rapl-Clean-up-cpumask-and-hotplug.patch @@ -1,6 +1,6 @@ -From 7b4f6ba1b1dc5f3120652bcb5921a697d5167bff Mon Sep 17 00:00:00 2001 +From 423bd96e0e4522b19e2dca083b70ebbebb639acd Mon Sep 17 00:00:00 2001 From: Kan Liang -Date: Fri, 2 Aug 2024 08:16:43 -0700 +Date: Thu, 10 Oct 2024 07:26:04 -0700 Subject: perf/x86/rapl: Clean up cpumask and hotplug The rapl pmu is die scope, which is supported by the generic perf_event @@ -9,16 +9,17 @@ subsystem now. Set the scope for the rapl PMU and remove all the cpumask and hotplug codes. +Tested-by: Oliver Sang Signed-off-by: Kan Liang Cc: Dhananjay Ugwekar --- - arch/x86/events/rapl.c | 80 +------------------------------------- + arch/x86/events/rapl.c | 90 +++----------------------------------- include/linux/cpuhotplug.h | 1 - - 2 files changed, 2 insertions(+), 79 deletions(-) + 2 files changed, 6 insertions(+), 85 deletions(-) --- a/arch/x86/events/rapl.c +++ b/arch/x86/events/rapl.c -@@ -135,7 +135,6 @@ struct rapl_model { +@@ -148,7 +148,6 @@ struct rapl_model { /* 1/2^hw_unit Joule */ static int rapl_hw_unit[NR_RAPL_DOMAINS] __read_mostly; static struct rapl_pmus *rapl_pmus; @@ -26,7 +27,7 @@ Cc: Dhananjay Ugwekar static unsigned int rapl_cntr_mask; static u64 rapl_timer_ms; static struct perf_msr *rapl_msrs; -@@ -340,8 +339,6 @@ static int rapl_pmu_event_init(struct pe +@@ -369,8 +368,6 @@ static int rapl_pmu_event_init(struct pe if (event->cpu < 0) return -EINVAL; @@ -35,7 +36,7 @@ Cc: Dhananjay Ugwekar if (!cfg || cfg >= NR_RAPL_DOMAINS + 1) return -EINVAL; -@@ -360,7 +357,6 @@ static int rapl_pmu_event_init(struct pe +@@ -389,7 +386,6 @@ static int rapl_pmu_event_init(struct pe pmu = cpu_to_rapl_pmu(event->cpu); if (!pmu) return -EINVAL; @@ -43,7 +44,7 @@ Cc: Dhananjay Ugwekar event->pmu_private = pmu; event->hw.event_base = rapl_msrs[bit].msr; event->hw.config = cfg; -@@ -374,23 +370,6 @@ static void rapl_pmu_event_read(struct p +@@ -403,23 +399,6 @@ static void rapl_pmu_event_read(struct p rapl_event_update(event); } @@ -67,7 +68,7 @@ Cc: Dhananjay Ugwekar RAPL_EVENT_ATTR_STR(energy-cores, rapl_cores, "event=0x01"); RAPL_EVENT_ATTR_STR(energy-pkg , rapl_pkg, "event=0x02"); RAPL_EVENT_ATTR_STR(energy-ram , rapl_ram, "event=0x03"); -@@ -438,7 +417,6 @@ static struct attribute_group rapl_pmu_f +@@ -467,7 +446,6 @@ static struct attribute_group rapl_pmu_f }; static const struct attribute_group *rapl_attr_groups[] = { @@ -75,7 +76,7 @@ Cc: Dhananjay Ugwekar &rapl_pmu_format_group, &rapl_pmu_events_group, NULL, -@@ -541,49 +519,6 @@ static struct perf_msr amd_rapl_msrs[] = +@@ -570,54 +548,6 @@ static struct perf_msr amd_rapl_msrs[] = [PERF_RAPL_PSYS] = { 0, &rapl_events_psys_group, NULL, false, 0 }, }; @@ -90,7 +91,7 @@ Cc: Dhananjay Ugwekar - - pmu->cpu = -1; - /* Find a new cpu to collect rapl events */ -- target = cpumask_any_but(topology_die_cpumask(cpu), cpu); +- target = cpumask_any_but(get_rapl_pmu_cpumask(cpu), cpu); - - /* Migrate rapl events to the new target */ - if (target < nr_cpu_ids) { @@ -103,6 +104,11 @@ Cc: Dhananjay Ugwekar - -static int rapl_cpu_online(unsigned int cpu) -{ +- s32 rapl_pmu_idx = get_rapl_pmu_idx(cpu); +- if (rapl_pmu_idx < 0) { +- pr_err("topology_logical_(package/die)_id() returned a negative value"); +- return -EINVAL; +- } - struct rapl_pmu *pmu = cpu_to_rapl_pmu(cpu); - int target; - @@ -113,7 +119,7 @@ Cc: Dhananjay Ugwekar - * Check if there is an online cpu in the package which collects rapl - * events already. - */ -- target = cpumask_any_and(&rapl_cpu_mask, topology_die_cpumask(cpu)); +- target = cpumask_any_and(&rapl_cpu_mask, get_rapl_pmu_cpumask(cpu)); - if (target < nr_cpu_ids) - return 0; - @@ -125,15 +131,29 @@ Cc: Dhananjay Ugwekar static int rapl_check_hw_unit(struct rapl_model *rm) { u64 msr_rapl_power_unit_bits; -@@ -707,6 +642,7 @@ static int __init init_rapl_pmus(void) +@@ -725,9 +655,12 @@ free: + static int __init init_rapl_pmus(void) + { + int nr_rapl_pmu = topology_max_packages(); ++ int rapl_pmu_scope = PERF_PMU_SCOPE_PKG; + +- if (!rapl_pmu_is_pkg_scope()) ++ if (!rapl_pmu_is_pkg_scope()) { + nr_rapl_pmu *= topology_max_dies_per_package(); ++ rapl_pmu_scope = PERF_PMU_SCOPE_DIE; ++ } + + rapl_pmus = kzalloc(struct_size(rapl_pmus, pmus, nr_rapl_pmu), GFP_KERNEL); + if (!rapl_pmus) +@@ -743,6 +676,7 @@ static int __init init_rapl_pmus(void) + rapl_pmus->pmu.start = rapl_pmu_event_start; rapl_pmus->pmu.stop = rapl_pmu_event_stop; rapl_pmus->pmu.read = rapl_pmu_event_read; ++ rapl_pmus->pmu.scope = rapl_pmu_scope; rapl_pmus->pmu.module = THIS_MODULE; -+ rapl_pmus->pmu.scope = PERF_PMU_SCOPE_DIE; rapl_pmus->pmu.capabilities = PERF_PMU_CAP_NO_EXCLUDE; - init_rapl_pmu(); -@@ -857,24 +793,13 @@ static int __init rapl_pmu_init(void) +@@ -892,24 +826,13 @@ static int __init rapl_pmu_init(void) if (ret) return ret; @@ -159,7 +179,7 @@ Cc: Dhananjay Ugwekar out: pr_warn("Initialization failed (%d), disabled\n", ret); cleanup_rapl_pmus(); -@@ -884,7 +809,6 @@ module_init(rapl_pmu_init); +@@ -919,7 +842,6 @@ module_init(rapl_pmu_init); static void __exit intel_rapl_exit(void) { @@ -169,7 +189,7 @@ Cc: Dhananjay Ugwekar } --- a/include/linux/cpuhotplug.h +++ b/include/linux/cpuhotplug.h -@@ -207,7 +207,6 @@ enum cpuhp_state { +@@ -208,7 +208,6 @@ enum cpuhp_state { CPUHP_AP_PERF_X86_UNCORE_ONLINE, CPUHP_AP_PERF_X86_AMD_UNCORE_ONLINE, CPUHP_AP_PERF_X86_AMD_POWER_ONLINE, diff --git a/debian/patches/patchset-pf/amd-rapl/0003-perf-x86-intel-cstate-Clean-up-cpumask-and-hotplug.patch b/debian/patches/patchset-pf/amd-rapl/0003-perf-x86-intel-cstate-Clean-up-cpumask-and-hotplug.patch deleted file mode 100644 index 299cac0..0000000 --- a/debian/patches/patchset-pf/amd-rapl/0003-perf-x86-intel-cstate-Clean-up-cpumask-and-hotplug.patch +++ /dev/null @@ -1,286 +0,0 @@ -From 09c1529eb102b486220c35546f2663ca858a2943 Mon Sep 17 00:00:00 2001 -From: Kan Liang -Date: Fri, 2 Aug 2024 08:16:39 -0700 -Subject: perf/x86/intel/cstate: Clean up cpumask and hotplug - -There are three cstate PMUs with different scopes, core, die and module. -The scopes are supported by the generic perf_event subsystem now. - -Set the scope for each PMU and remove all the cpumask and hotplug codes. - -Signed-off-by: Kan Liang ---- - arch/x86/events/intel/cstate.c | 142 ++------------------------------- - include/linux/cpuhotplug.h | 2 - - 2 files changed, 5 insertions(+), 139 deletions(-) - ---- a/arch/x86/events/intel/cstate.c -+++ b/arch/x86/events/intel/cstate.c -@@ -128,10 +128,6 @@ static ssize_t __cstate_##_var##_show(st - static struct device_attribute format_attr_##_var = \ - __ATTR(_name, 0444, __cstate_##_var##_show, NULL) - --static ssize_t cstate_get_attr_cpumask(struct device *dev, -- struct device_attribute *attr, -- char *buf); -- - /* Model -> events mapping */ - struct cstate_model { - unsigned long core_events; -@@ -206,22 +202,9 @@ static struct attribute_group cstate_for - .attrs = cstate_format_attrs, - }; - --static cpumask_t cstate_core_cpu_mask; --static DEVICE_ATTR(cpumask, S_IRUGO, cstate_get_attr_cpumask, NULL); -- --static struct attribute *cstate_cpumask_attrs[] = { -- &dev_attr_cpumask.attr, -- NULL, --}; -- --static struct attribute_group cpumask_attr_group = { -- .attrs = cstate_cpumask_attrs, --}; -- - static const struct attribute_group *cstate_attr_groups[] = { - &cstate_events_attr_group, - &cstate_format_attr_group, -- &cpumask_attr_group, - NULL, - }; - -@@ -269,8 +252,6 @@ static struct perf_msr pkg_msr[] = { - [PERF_CSTATE_PKG_C10_RES] = { MSR_PKG_C10_RESIDENCY, &group_cstate_pkg_c10, test_msr }, - }; - --static cpumask_t cstate_pkg_cpu_mask; -- - /* cstate_module PMU */ - static struct pmu cstate_module_pmu; - static bool has_cstate_module; -@@ -291,28 +272,9 @@ static struct perf_msr module_msr[] = { - [PERF_CSTATE_MODULE_C6_RES] = { MSR_MODULE_C6_RES_MS, &group_cstate_module_c6, test_msr }, - }; - --static cpumask_t cstate_module_cpu_mask; -- --static ssize_t cstate_get_attr_cpumask(struct device *dev, -- struct device_attribute *attr, -- char *buf) --{ -- struct pmu *pmu = dev_get_drvdata(dev); -- -- if (pmu == &cstate_core_pmu) -- return cpumap_print_to_pagebuf(true, buf, &cstate_core_cpu_mask); -- else if (pmu == &cstate_pkg_pmu) -- return cpumap_print_to_pagebuf(true, buf, &cstate_pkg_cpu_mask); -- else if (pmu == &cstate_module_pmu) -- return cpumap_print_to_pagebuf(true, buf, &cstate_module_cpu_mask); -- else -- return 0; --} -- - static int cstate_pmu_event_init(struct perf_event *event) - { - u64 cfg = event->attr.config; -- int cpu; - - if (event->attr.type != event->pmu->type) - return -ENOENT; -@@ -331,20 +293,13 @@ static int cstate_pmu_event_init(struct - if (!(core_msr_mask & (1 << cfg))) - return -EINVAL; - event->hw.event_base = core_msr[cfg].msr; -- cpu = cpumask_any_and(&cstate_core_cpu_mask, -- topology_sibling_cpumask(event->cpu)); - } else if (event->pmu == &cstate_pkg_pmu) { - if (cfg >= PERF_CSTATE_PKG_EVENT_MAX) - return -EINVAL; - cfg = array_index_nospec((unsigned long)cfg, PERF_CSTATE_PKG_EVENT_MAX); - if (!(pkg_msr_mask & (1 << cfg))) - return -EINVAL; -- -- event->event_caps |= PERF_EV_CAP_READ_ACTIVE_PKG; -- - event->hw.event_base = pkg_msr[cfg].msr; -- cpu = cpumask_any_and(&cstate_pkg_cpu_mask, -- topology_die_cpumask(event->cpu)); - } else if (event->pmu == &cstate_module_pmu) { - if (cfg >= PERF_CSTATE_MODULE_EVENT_MAX) - return -EINVAL; -@@ -352,16 +307,10 @@ static int cstate_pmu_event_init(struct - if (!(module_msr_mask & (1 << cfg))) - return -EINVAL; - event->hw.event_base = module_msr[cfg].msr; -- cpu = cpumask_any_and(&cstate_module_cpu_mask, -- topology_cluster_cpumask(event->cpu)); - } else { - return -ENOENT; - } - -- if (cpu >= nr_cpu_ids) -- return -ENODEV; -- -- event->cpu = cpu; - event->hw.config = cfg; - event->hw.idx = -1; - return 0; -@@ -412,84 +361,6 @@ static int cstate_pmu_event_add(struct p - return 0; - } - --/* -- * Check if exiting cpu is the designated reader. If so migrate the -- * events when there is a valid target available -- */ --static int cstate_cpu_exit(unsigned int cpu) --{ -- unsigned int target; -- -- if (has_cstate_core && -- cpumask_test_and_clear_cpu(cpu, &cstate_core_cpu_mask)) { -- -- target = cpumask_any_but(topology_sibling_cpumask(cpu), cpu); -- /* Migrate events if there is a valid target */ -- if (target < nr_cpu_ids) { -- cpumask_set_cpu(target, &cstate_core_cpu_mask); -- perf_pmu_migrate_context(&cstate_core_pmu, cpu, target); -- } -- } -- -- if (has_cstate_pkg && -- cpumask_test_and_clear_cpu(cpu, &cstate_pkg_cpu_mask)) { -- -- target = cpumask_any_but(topology_die_cpumask(cpu), cpu); -- /* Migrate events if there is a valid target */ -- if (target < nr_cpu_ids) { -- cpumask_set_cpu(target, &cstate_pkg_cpu_mask); -- perf_pmu_migrate_context(&cstate_pkg_pmu, cpu, target); -- } -- } -- -- if (has_cstate_module && -- cpumask_test_and_clear_cpu(cpu, &cstate_module_cpu_mask)) { -- -- target = cpumask_any_but(topology_cluster_cpumask(cpu), cpu); -- /* Migrate events if there is a valid target */ -- if (target < nr_cpu_ids) { -- cpumask_set_cpu(target, &cstate_module_cpu_mask); -- perf_pmu_migrate_context(&cstate_module_pmu, cpu, target); -- } -- } -- return 0; --} -- --static int cstate_cpu_init(unsigned int cpu) --{ -- unsigned int target; -- -- /* -- * If this is the first online thread of that core, set it in -- * the core cpu mask as the designated reader. -- */ -- target = cpumask_any_and(&cstate_core_cpu_mask, -- topology_sibling_cpumask(cpu)); -- -- if (has_cstate_core && target >= nr_cpu_ids) -- cpumask_set_cpu(cpu, &cstate_core_cpu_mask); -- -- /* -- * If this is the first online thread of that package, set it -- * in the package cpu mask as the designated reader. -- */ -- target = cpumask_any_and(&cstate_pkg_cpu_mask, -- topology_die_cpumask(cpu)); -- if (has_cstate_pkg && target >= nr_cpu_ids) -- cpumask_set_cpu(cpu, &cstate_pkg_cpu_mask); -- -- /* -- * If this is the first online thread of that cluster, set it -- * in the cluster cpu mask as the designated reader. -- */ -- target = cpumask_any_and(&cstate_module_cpu_mask, -- topology_cluster_cpumask(cpu)); -- if (has_cstate_module && target >= nr_cpu_ids) -- cpumask_set_cpu(cpu, &cstate_module_cpu_mask); -- -- return 0; --} -- - static const struct attribute_group *core_attr_update[] = { - &group_cstate_core_c1, - &group_cstate_core_c3, -@@ -526,6 +397,7 @@ static struct pmu cstate_core_pmu = { - .stop = cstate_pmu_event_stop, - .read = cstate_pmu_event_update, - .capabilities = PERF_PMU_CAP_NO_INTERRUPT | PERF_PMU_CAP_NO_EXCLUDE, -+ .scope = PERF_PMU_SCOPE_CORE, - .module = THIS_MODULE, - }; - -@@ -541,6 +413,7 @@ static struct pmu cstate_pkg_pmu = { - .stop = cstate_pmu_event_stop, - .read = cstate_pmu_event_update, - .capabilities = PERF_PMU_CAP_NO_INTERRUPT | PERF_PMU_CAP_NO_EXCLUDE, -+ .scope = PERF_PMU_SCOPE_PKG, - .module = THIS_MODULE, - }; - -@@ -556,6 +429,7 @@ static struct pmu cstate_module_pmu = { - .stop = cstate_pmu_event_stop, - .read = cstate_pmu_event_update, - .capabilities = PERF_PMU_CAP_NO_INTERRUPT | PERF_PMU_CAP_NO_EXCLUDE, -+ .scope = PERF_PMU_SCOPE_CLUSTER, - .module = THIS_MODULE, - }; - -@@ -810,9 +684,6 @@ static int __init cstate_probe(const str - - static inline void cstate_cleanup(void) - { -- cpuhp_remove_state_nocalls(CPUHP_AP_PERF_X86_CSTATE_ONLINE); -- cpuhp_remove_state_nocalls(CPUHP_AP_PERF_X86_CSTATE_STARTING); -- - if (has_cstate_core) - perf_pmu_unregister(&cstate_core_pmu); - -@@ -827,11 +698,6 @@ static int __init cstate_init(void) - { - int err; - -- cpuhp_setup_state(CPUHP_AP_PERF_X86_CSTATE_STARTING, -- "perf/x86/cstate:starting", cstate_cpu_init, NULL); -- cpuhp_setup_state(CPUHP_AP_PERF_X86_CSTATE_ONLINE, -- "perf/x86/cstate:online", NULL, cstate_cpu_exit); -- - if (has_cstate_core) { - err = perf_pmu_register(&cstate_core_pmu, cstate_core_pmu.name, -1); - if (err) { -@@ -844,6 +710,8 @@ static int __init cstate_init(void) - - if (has_cstate_pkg) { - if (topology_max_dies_per_package() > 1) { -+ /* CLX-AP is multi-die and the cstate is die-scope */ -+ cstate_pkg_pmu.scope = PERF_PMU_SCOPE_DIE; - err = perf_pmu_register(&cstate_pkg_pmu, - "cstate_die", -1); - } else { ---- a/include/linux/cpuhotplug.h -+++ b/include/linux/cpuhotplug.h -@@ -152,7 +152,6 @@ enum cpuhp_state { - CPUHP_AP_PERF_X86_AMD_UNCORE_STARTING, - CPUHP_AP_PERF_X86_STARTING, - CPUHP_AP_PERF_X86_AMD_IBS_STARTING, -- CPUHP_AP_PERF_X86_CSTATE_STARTING, - CPUHP_AP_PERF_XTENSA_STARTING, - CPUHP_AP_ARM_VFP_STARTING, - CPUHP_AP_ARM64_DEBUG_MONITORS_STARTING, -@@ -209,7 +208,6 @@ enum cpuhp_state { - CPUHP_AP_PERF_X86_AMD_UNCORE_ONLINE, - CPUHP_AP_PERF_X86_AMD_POWER_ONLINE, - CPUHP_AP_PERF_X86_RAPL_ONLINE, -- CPUHP_AP_PERF_X86_CSTATE_ONLINE, - CPUHP_AP_PERF_S390_CF_ONLINE, - CPUHP_AP_PERF_S390_SF_ONLINE, - CPUHP_AP_PERF_ARM_CCI_ONLINE, diff --git a/debian/patches/patchset-pf/amd-rapl/0003-perf-x86-rapl-Remove-the-unused-get_rapl_pmu_cpumask.patch b/debian/patches/patchset-pf/amd-rapl/0003-perf-x86-rapl-Remove-the-unused-get_rapl_pmu_cpumask.patch new file mode 100644 index 0000000..7f574af --- /dev/null +++ b/debian/patches/patchset-pf/amd-rapl/0003-perf-x86-rapl-Remove-the-unused-get_rapl_pmu_cpumask.patch @@ -0,0 +1,40 @@ +From 9e3190a0f75324a7dcb66da336584918243b2c77 Mon Sep 17 00:00:00 2001 +From: Dhananjay Ugwekar +Date: Fri, 15 Nov 2024 06:07:57 +0000 +Subject: perf/x86/rapl: Remove the unused get_rapl_pmu_cpumask() function + +commit 9e9af8bbb5f9 ("perf/x86/rapl: Clean up cpumask and hotplug") +removes the cpumask handling from rapl. Post that, we no longer need the +get_rapl_pmu_cpumask() function. So remove it. + +Signed-off-by: Dhananjay Ugwekar +Reviewed-by: Zhang Rui +Tested-by: Zhang Rui +--- + arch/x86/events/rapl.c | 8 +------- + 1 file changed, 1 insertion(+), 7 deletions(-) + +--- a/arch/x86/events/rapl.c ++++ b/arch/x86/events/rapl.c +@@ -153,7 +153,7 @@ static u64 rapl_timer_ms; + static struct perf_msr *rapl_msrs; + + /* +- * Helper functions to get the correct topology macros according to the ++ * Helper function to get the correct topology id according to the + * RAPL PMU scope. + */ + static inline unsigned int get_rapl_pmu_idx(int cpu) +@@ -162,12 +162,6 @@ static inline unsigned int get_rapl_pmu_ + topology_logical_die_id(cpu); + } + +-static inline const struct cpumask *get_rapl_pmu_cpumask(int cpu) +-{ +- return rapl_pmu_is_pkg_scope() ? topology_core_cpumask(cpu) : +- topology_die_cpumask(cpu); +-} +- + static inline struct rapl_pmu *cpu_to_rapl_pmu(unsigned int cpu) + { + unsigned int rapl_pmu_idx = get_rapl_pmu_idx(cpu); diff --git a/debian/patches/patchset-pf/amd-rapl/0004-iommu-vt-d-Clean-up-cpumask-and-hotplug-for-perfmon.patch b/debian/patches/patchset-pf/amd-rapl/0004-iommu-vt-d-Clean-up-cpumask-and-hotplug-for-perfmon.patch deleted file mode 100644 index 5ae825e..0000000 --- a/debian/patches/patchset-pf/amd-rapl/0004-iommu-vt-d-Clean-up-cpumask-and-hotplug-for-perfmon.patch +++ /dev/null @@ -1,188 +0,0 @@ -From f91da33af8295b4b3d73a2083225f69e1d5ff301 Mon Sep 17 00:00:00 2001 -From: Kan Liang -Date: Fri, 2 Aug 2024 08:16:40 -0700 -Subject: iommu/vt-d: Clean up cpumask and hotplug for perfmon - -The iommu PMU is system-wide scope, which is supported by the generic -perf_event subsystem now. - -Set the scope for the iommu PMU and remove all the cpumask and hotplug -codes. - -Reviewed-by: Lu Baolu -Signed-off-by: Kan Liang -Cc: David Woodhouse -Cc: Joerg Roedel -Cc: Will Deacon -Cc: iommu@lists.linux.dev ---- - drivers/iommu/intel/iommu.h | 2 - - drivers/iommu/intel/perfmon.c | 111 +--------------------------------- - 2 files changed, 2 insertions(+), 111 deletions(-) - ---- a/drivers/iommu/intel/iommu.h -+++ b/drivers/iommu/intel/iommu.h -@@ -687,8 +687,6 @@ struct iommu_pmu { - DECLARE_BITMAP(used_mask, IOMMU_PMU_IDX_MAX); - struct perf_event *event_list[IOMMU_PMU_IDX_MAX]; - unsigned char irq_name[16]; -- struct hlist_node cpuhp_node; -- int cpu; - }; - - #define IOMMU_IRQ_ID_OFFSET_PRQ (DMAR_UNITS_SUPPORTED) ---- a/drivers/iommu/intel/perfmon.c -+++ b/drivers/iommu/intel/perfmon.c -@@ -34,28 +34,9 @@ static struct attribute_group iommu_pmu_ - .attrs = attrs_empty, - }; - --static cpumask_t iommu_pmu_cpu_mask; -- --static ssize_t --cpumask_show(struct device *dev, struct device_attribute *attr, char *buf) --{ -- return cpumap_print_to_pagebuf(true, buf, &iommu_pmu_cpu_mask); --} --static DEVICE_ATTR_RO(cpumask); -- --static struct attribute *iommu_pmu_cpumask_attrs[] = { -- &dev_attr_cpumask.attr, -- NULL --}; -- --static struct attribute_group iommu_pmu_cpumask_attr_group = { -- .attrs = iommu_pmu_cpumask_attrs, --}; -- - static const struct attribute_group *iommu_pmu_attr_groups[] = { - &iommu_pmu_format_attr_group, - &iommu_pmu_events_attr_group, -- &iommu_pmu_cpumask_attr_group, - NULL - }; - -@@ -565,6 +546,7 @@ static int __iommu_pmu_register(struct i - iommu_pmu->pmu.attr_groups = iommu_pmu_attr_groups; - iommu_pmu->pmu.attr_update = iommu_pmu_attr_update; - iommu_pmu->pmu.capabilities = PERF_PMU_CAP_NO_EXCLUDE; -+ iommu_pmu->pmu.scope = PERF_PMU_SCOPE_SYS_WIDE; - iommu_pmu->pmu.module = THIS_MODULE; - - return perf_pmu_register(&iommu_pmu->pmu, iommu_pmu->pmu.name, -1); -@@ -773,89 +755,6 @@ static void iommu_pmu_unset_interrupt(st - iommu->perf_irq = 0; - } - --static int iommu_pmu_cpu_online(unsigned int cpu, struct hlist_node *node) --{ -- struct iommu_pmu *iommu_pmu = hlist_entry_safe(node, typeof(*iommu_pmu), cpuhp_node); -- -- if (cpumask_empty(&iommu_pmu_cpu_mask)) -- cpumask_set_cpu(cpu, &iommu_pmu_cpu_mask); -- -- if (cpumask_test_cpu(cpu, &iommu_pmu_cpu_mask)) -- iommu_pmu->cpu = cpu; -- -- return 0; --} -- --static int iommu_pmu_cpu_offline(unsigned int cpu, struct hlist_node *node) --{ -- struct iommu_pmu *iommu_pmu = hlist_entry_safe(node, typeof(*iommu_pmu), cpuhp_node); -- int target = cpumask_first(&iommu_pmu_cpu_mask); -- -- /* -- * The iommu_pmu_cpu_mask has been updated when offline the CPU -- * for the first iommu_pmu. Migrate the other iommu_pmu to the -- * new target. -- */ -- if (target < nr_cpu_ids && target != iommu_pmu->cpu) { -- perf_pmu_migrate_context(&iommu_pmu->pmu, cpu, target); -- iommu_pmu->cpu = target; -- return 0; -- } -- -- if (!cpumask_test_and_clear_cpu(cpu, &iommu_pmu_cpu_mask)) -- return 0; -- -- target = cpumask_any_but(cpu_online_mask, cpu); -- -- if (target < nr_cpu_ids) -- cpumask_set_cpu(target, &iommu_pmu_cpu_mask); -- else -- return 0; -- -- perf_pmu_migrate_context(&iommu_pmu->pmu, cpu, target); -- iommu_pmu->cpu = target; -- -- return 0; --} -- --static int nr_iommu_pmu; --static enum cpuhp_state iommu_cpuhp_slot; -- --static int iommu_pmu_cpuhp_setup(struct iommu_pmu *iommu_pmu) --{ -- int ret; -- -- if (!nr_iommu_pmu) { -- ret = cpuhp_setup_state_multi(CPUHP_AP_ONLINE_DYN, -- "driver/iommu/intel/perfmon:online", -- iommu_pmu_cpu_online, -- iommu_pmu_cpu_offline); -- if (ret < 0) -- return ret; -- iommu_cpuhp_slot = ret; -- } -- -- ret = cpuhp_state_add_instance(iommu_cpuhp_slot, &iommu_pmu->cpuhp_node); -- if (ret) { -- if (!nr_iommu_pmu) -- cpuhp_remove_multi_state(iommu_cpuhp_slot); -- return ret; -- } -- nr_iommu_pmu++; -- -- return 0; --} -- --static void iommu_pmu_cpuhp_free(struct iommu_pmu *iommu_pmu) --{ -- cpuhp_state_remove_instance(iommu_cpuhp_slot, &iommu_pmu->cpuhp_node); -- -- if (--nr_iommu_pmu) -- return; -- -- cpuhp_remove_multi_state(iommu_cpuhp_slot); --} -- - void iommu_pmu_register(struct intel_iommu *iommu) - { - struct iommu_pmu *iommu_pmu = iommu->pmu; -@@ -866,17 +765,12 @@ void iommu_pmu_register(struct intel_iom - if (__iommu_pmu_register(iommu)) - goto err; - -- if (iommu_pmu_cpuhp_setup(iommu_pmu)) -- goto unregister; -- - /* Set interrupt for overflow */ - if (iommu_pmu_set_interrupt(iommu)) -- goto cpuhp_free; -+ goto unregister; - - return; - --cpuhp_free: -- iommu_pmu_cpuhp_free(iommu_pmu); - unregister: - perf_pmu_unregister(&iommu_pmu->pmu); - err: -@@ -892,6 +786,5 @@ void iommu_pmu_unregister(struct intel_i - return; - - iommu_pmu_unset_interrupt(iommu); -- iommu_pmu_cpuhp_free(iommu_pmu); - perf_pmu_unregister(&iommu_pmu->pmu); - } diff --git a/debian/patches/patchset-pf/amd-rapl/0009-x86-topology-Introduce-topology_logical_core_id.patch b/debian/patches/patchset-pf/amd-rapl/0004-x86-topology-Introduce-topology_logical_core_id.patch similarity index 84% rename from debian/patches/patchset-pf/amd-rapl/0009-x86-topology-Introduce-topology_logical_core_id.patch rename to debian/patches/patchset-pf/amd-rapl/0004-x86-topology-Introduce-topology_logical_core_id.patch index 44994f6..9df7d5a 100644 --- a/debian/patches/patchset-pf/amd-rapl/0009-x86-topology-Introduce-topology_logical_core_id.patch +++ b/debian/patches/patchset-pf/amd-rapl/0004-x86-topology-Introduce-topology_logical_core_id.patch @@ -1,19 +1,21 @@ -From 9439067951f4d857272836b35812af26650d9c16 Mon Sep 17 00:00:00 2001 +From 947046055803695b05b1021893860c50412a8d7b Mon Sep 17 00:00:00 2001 From: K Prateek Nayak -Date: Fri, 13 Sep 2024 15:21:41 +0000 +Date: Fri, 15 Nov 2024 06:07:58 +0000 Subject: x86/topology: Introduce topology_logical_core_id() On x86, topology_core_id() returns a unique core ID within the PKG domain. Looking at match_smt() suggests that a core ID just needs to be -unique within a LLC domain. For use cases such as the per-core RAPL PMU, +unique within a LLC domain. For use cases such as the core RAPL PMU, there exists a need for a unique core ID across the entire system with multiple PKG domains. Introduce topology_logical_core_id() to derive a unique core ID across the system. Signed-off-by: K Prateek Nayak -Signed-off-by: Dhananjay Ugwekar Reviewed-by: Zhang Rui Tested-by: K Prateek Nayak +Tested-by: Oleksandr Natalenko +Signed-off-by: Dhananjay Ugwekar +Reviewed-by: Gautham R. Shenoy --- Documentation/arch/x86/topology.rst | 4 ++++ arch/x86/include/asm/processor.h | 1 + @@ -47,7 +49,7 @@ Tested-by: K Prateek Nayak u32 amd_node_id; --- a/arch/x86/include/asm/topology.h +++ b/arch/x86/include/asm/topology.h -@@ -137,6 +137,7 @@ extern const struct cpumask *cpu_cluster +@@ -143,6 +143,7 @@ extern const struct cpumask *cpu_cluster #define topology_logical_package_id(cpu) (cpu_data(cpu).topo.logical_pkg_id) #define topology_physical_package_id(cpu) (cpu_data(cpu).topo.pkg_id) #define topology_logical_die_id(cpu) (cpu_data(cpu).topo.logical_die_id) @@ -57,8 +59,8 @@ Tested-by: K Prateek Nayak #define topology_ppin(cpu) (cpu_data(cpu).ppin) --- a/arch/x86/kernel/cpu/debugfs.c +++ b/arch/x86/kernel/cpu/debugfs.c -@@ -24,6 +24,7 @@ static int cpu_debug_show(struct seq_fil - seq_printf(m, "core_id: %u\n", c->topo.core_id); +@@ -25,6 +25,7 @@ static int cpu_debug_show(struct seq_fil + seq_printf(m, "cpu_type: %s\n", get_topology_cpu_type_name(c)); seq_printf(m, "logical_pkg_id: %u\n", c->topo.logical_pkg_id); seq_printf(m, "logical_die_id: %u\n", c->topo.logical_die_id); + seq_printf(m, "logical_core_id: %u\n", c->topo.logical_core_id); @@ -67,7 +69,7 @@ Tested-by: K Prateek Nayak seq_printf(m, "amd_node_id: %u\n", c->topo.amd_node_id); --- a/arch/x86/kernel/cpu/topology_common.c +++ b/arch/x86/kernel/cpu/topology_common.c -@@ -151,6 +151,7 @@ static void topo_set_ids(struct topo_sca +@@ -185,6 +185,7 @@ static void topo_set_ids(struct topo_sca if (!early) { c->topo.logical_pkg_id = topology_get_logical_id(apicid, TOPO_PKG_DOMAIN); c->topo.logical_die_id = topology_get_logical_id(apicid, TOPO_DIE_DOMAIN); diff --git a/debian/patches/patchset-pf/amd-rapl/0005-dmaengine-idxd-Clean-up-cpumask-and-hotplug-for-perf.patch b/debian/patches/patchset-pf/amd-rapl/0005-dmaengine-idxd-Clean-up-cpumask-and-hotplug-for-perf.patch deleted file mode 100644 index df672f0..0000000 --- a/debian/patches/patchset-pf/amd-rapl/0005-dmaengine-idxd-Clean-up-cpumask-and-hotplug-for-perf.patch +++ /dev/null @@ -1,238 +0,0 @@ -From 76278bd3946d618ead2d9cc22612a75a4ab99ace Mon Sep 17 00:00:00 2001 -From: Kan Liang -Date: Fri, 2 Aug 2024 08:16:41 -0700 -Subject: dmaengine: idxd: Clean up cpumask and hotplug for perfmon - -The idxd PMU is system-wide scope, which is supported by the generic -perf_event subsystem now. - -Set the scope for the idxd PMU and remove all the cpumask and hotplug -codes. - -Signed-off-by: Kan Liang -Cc: Fenghua Yu -Cc: Dave Jiang -Cc: Vinod Koul -Cc: dmaengine@vger.kernel.org -Reviewed-by: Dave Jiang -Reviewed-by: Fenghua Yu ---- - drivers/dma/idxd/idxd.h | 7 --- - drivers/dma/idxd/init.c | 3 -- - drivers/dma/idxd/perfmon.c | 98 +------------------------------------- - 3 files changed, 1 insertion(+), 107 deletions(-) - ---- a/drivers/dma/idxd/idxd.h -+++ b/drivers/dma/idxd/idxd.h -@@ -124,7 +124,6 @@ struct idxd_pmu { - - struct pmu pmu; - char name[IDXD_NAME_SIZE]; -- int cpu; - - int n_counters; - int counter_width; -@@ -135,8 +134,6 @@ struct idxd_pmu { - - unsigned long supported_filters; - int n_filters; -- -- struct hlist_node cpuhp_node; - }; - - #define IDXD_MAX_PRIORITY 0xf -@@ -803,14 +800,10 @@ void idxd_user_counter_increment(struct - int perfmon_pmu_init(struct idxd_device *idxd); - void perfmon_pmu_remove(struct idxd_device *idxd); - void perfmon_counter_overflow(struct idxd_device *idxd); --void perfmon_init(void); --void perfmon_exit(void); - #else - static inline int perfmon_pmu_init(struct idxd_device *idxd) { return 0; } - static inline void perfmon_pmu_remove(struct idxd_device *idxd) {} - static inline void perfmon_counter_overflow(struct idxd_device *idxd) {} --static inline void perfmon_init(void) {} --static inline void perfmon_exit(void) {} - #endif - - /* debugfs */ ---- a/drivers/dma/idxd/init.c -+++ b/drivers/dma/idxd/init.c -@@ -878,8 +878,6 @@ static int __init idxd_init_module(void) - else - support_enqcmd = true; - -- perfmon_init(); -- - err = idxd_driver_register(&idxd_drv); - if (err < 0) - goto err_idxd_driver_register; -@@ -928,7 +926,6 @@ static void __exit idxd_exit_module(void - idxd_driver_unregister(&idxd_drv); - pci_unregister_driver(&idxd_pci_driver); - idxd_cdev_remove(); -- perfmon_exit(); - idxd_remove_debugfs(); - } - module_exit(idxd_exit_module); ---- a/drivers/dma/idxd/perfmon.c -+++ b/drivers/dma/idxd/perfmon.c -@@ -6,29 +6,6 @@ - #include "idxd.h" - #include "perfmon.h" - --static ssize_t cpumask_show(struct device *dev, struct device_attribute *attr, -- char *buf); -- --static cpumask_t perfmon_dsa_cpu_mask; --static bool cpuhp_set_up; --static enum cpuhp_state cpuhp_slot; -- --/* -- * perf userspace reads this attribute to determine which cpus to open -- * counters on. It's connected to perfmon_dsa_cpu_mask, which is -- * maintained by the cpu hotplug handlers. -- */ --static DEVICE_ATTR_RO(cpumask); -- --static struct attribute *perfmon_cpumask_attrs[] = { -- &dev_attr_cpumask.attr, -- NULL, --}; -- --static struct attribute_group cpumask_attr_group = { -- .attrs = perfmon_cpumask_attrs, --}; -- - /* - * These attributes specify the bits in the config word that the perf - * syscall uses to pass the event ids and categories to perfmon. -@@ -67,16 +44,9 @@ static struct attribute_group perfmon_fo - - static const struct attribute_group *perfmon_attr_groups[] = { - &perfmon_format_attr_group, -- &cpumask_attr_group, - NULL, - }; - --static ssize_t cpumask_show(struct device *dev, struct device_attribute *attr, -- char *buf) --{ -- return cpumap_print_to_pagebuf(true, buf, &perfmon_dsa_cpu_mask); --} -- - static bool is_idxd_event(struct idxd_pmu *idxd_pmu, struct perf_event *event) - { - return &idxd_pmu->pmu == event->pmu; -@@ -217,7 +187,6 @@ static int perfmon_pmu_event_init(struct - return -EINVAL; - - event->hw.event_base = ioread64(PERFMON_TABLE_OFFSET(idxd)); -- event->cpu = idxd->idxd_pmu->cpu; - event->hw.config = event->attr.config; - - if (event->group_leader != event) -@@ -488,6 +457,7 @@ static void idxd_pmu_init(struct idxd_pm - idxd_pmu->pmu.stop = perfmon_pmu_event_stop; - idxd_pmu->pmu.read = perfmon_pmu_event_update; - idxd_pmu->pmu.capabilities = PERF_PMU_CAP_NO_EXCLUDE; -+ idxd_pmu->pmu.scope = PERF_PMU_SCOPE_SYS_WIDE; - idxd_pmu->pmu.module = THIS_MODULE; - } - -@@ -496,47 +466,11 @@ void perfmon_pmu_remove(struct idxd_devi - if (!idxd->idxd_pmu) - return; - -- cpuhp_state_remove_instance(cpuhp_slot, &idxd->idxd_pmu->cpuhp_node); - perf_pmu_unregister(&idxd->idxd_pmu->pmu); - kfree(idxd->idxd_pmu); - idxd->idxd_pmu = NULL; - } - --static int perf_event_cpu_online(unsigned int cpu, struct hlist_node *node) --{ -- struct idxd_pmu *idxd_pmu; -- -- idxd_pmu = hlist_entry_safe(node, typeof(*idxd_pmu), cpuhp_node); -- -- /* select the first online CPU as the designated reader */ -- if (cpumask_empty(&perfmon_dsa_cpu_mask)) { -- cpumask_set_cpu(cpu, &perfmon_dsa_cpu_mask); -- idxd_pmu->cpu = cpu; -- } -- -- return 0; --} -- --static int perf_event_cpu_offline(unsigned int cpu, struct hlist_node *node) --{ -- struct idxd_pmu *idxd_pmu; -- unsigned int target; -- -- idxd_pmu = hlist_entry_safe(node, typeof(*idxd_pmu), cpuhp_node); -- -- if (!cpumask_test_and_clear_cpu(cpu, &perfmon_dsa_cpu_mask)) -- return 0; -- -- target = cpumask_any_but(cpu_online_mask, cpu); -- /* migrate events if there is a valid target */ -- if (target < nr_cpu_ids) { -- cpumask_set_cpu(target, &perfmon_dsa_cpu_mask); -- perf_pmu_migrate_context(&idxd_pmu->pmu, cpu, target); -- } -- -- return 0; --} -- - int perfmon_pmu_init(struct idxd_device *idxd) - { - union idxd_perfcap perfcap; -@@ -544,12 +478,6 @@ int perfmon_pmu_init(struct idxd_device - int rc = -ENODEV; - - /* -- * perfmon module initialization failed, nothing to do -- */ -- if (!cpuhp_set_up) -- return -ENODEV; -- -- /* - * If perfmon_offset or num_counters is 0, it means perfmon is - * not supported on this hardware. - */ -@@ -624,11 +552,6 @@ int perfmon_pmu_init(struct idxd_device - if (rc) - goto free; - -- rc = cpuhp_state_add_instance(cpuhp_slot, &idxd_pmu->cpuhp_node); -- if (rc) { -- perf_pmu_unregister(&idxd->idxd_pmu->pmu); -- goto free; -- } - out: - return rc; - free: -@@ -637,22 +560,3 @@ free: - - goto out; - } -- --void __init perfmon_init(void) --{ -- int rc = cpuhp_setup_state_multi(CPUHP_AP_ONLINE_DYN, -- "driver/dma/idxd/perf:online", -- perf_event_cpu_online, -- perf_event_cpu_offline); -- if (WARN_ON(rc < 0)) -- return; -- -- cpuhp_slot = rc; -- cpuhp_set_up = true; --} -- --void __exit perfmon_exit(void) --{ -- if (cpuhp_set_up) -- cpuhp_remove_multi_state(cpuhp_slot); --} diff --git a/debian/patches/patchset-pf/amd-rapl/0005-perf-x86-rapl-Remove-the-cpu_to_rapl_pmu-function.patch b/debian/patches/patchset-pf/amd-rapl/0005-perf-x86-rapl-Remove-the-cpu_to_rapl_pmu-function.patch new file mode 100644 index 0000000..980cbe8 --- /dev/null +++ b/debian/patches/patchset-pf/amd-rapl/0005-perf-x86-rapl-Remove-the-cpu_to_rapl_pmu-function.patch @@ -0,0 +1,69 @@ +From 8fd2da09b0c534e05a7b12eb578afae27ad20f7d Mon Sep 17 00:00:00 2001 +From: Dhananjay Ugwekar +Date: Fri, 15 Nov 2024 06:07:59 +0000 +Subject: perf/x86/rapl: Remove the cpu_to_rapl_pmu() function + +Prepare for the addition of RAPL core energy counter support. +Post which, one CPU might be mapped to more than one rapl_pmu +(package/die one and a core one). So, remove the cpu_to_rapl_pmu() +function. + +Signed-off-by: Dhananjay Ugwekar +Reviewed-by: Zhang Rui +Tested-by: Zhang Rui +--- + arch/x86/events/rapl.c | 24 +++++++++++------------- + 1 file changed, 11 insertions(+), 13 deletions(-) + +--- a/arch/x86/events/rapl.c ++++ b/arch/x86/events/rapl.c +@@ -157,22 +157,15 @@ static struct perf_msr *rapl_msrs; + * RAPL PMU scope. + */ + static inline unsigned int get_rapl_pmu_idx(int cpu) +-{ ++{ /* ++ * Returns unsigned int, which converts the '-1' return value ++ * (for non-existent mappings in topology map) to UINT_MAX, so ++ * the error check in the caller is simplified. ++ */ + return rapl_pmu_is_pkg_scope() ? topology_logical_package_id(cpu) : + topology_logical_die_id(cpu); + } + +-static inline struct rapl_pmu *cpu_to_rapl_pmu(unsigned int cpu) +-{ +- unsigned int rapl_pmu_idx = get_rapl_pmu_idx(cpu); +- +- /* +- * The unsigned check also catches the '-1' return value for non +- * existent mappings in the topology map. +- */ +- return rapl_pmu_idx < rapl_pmus->nr_rapl_pmu ? rapl_pmus->pmus[rapl_pmu_idx] : NULL; +-} +- + static inline u64 rapl_read_counter(struct perf_event *event) + { + u64 raw; +@@ -350,6 +343,7 @@ static int rapl_pmu_event_init(struct pe + u64 cfg = event->attr.config & RAPL_EVENT_MASK; + int bit, ret = 0; + struct rapl_pmu *pmu; ++ unsigned int rapl_pmu_idx; + + /* only look at RAPL events */ + if (event->attr.type != rapl_pmus->pmu.type) +@@ -376,8 +370,12 @@ static int rapl_pmu_event_init(struct pe + if (event->attr.sample_period) /* no sampling */ + return -EINVAL; + ++ rapl_pmu_idx = get_rapl_pmu_idx(event->cpu); ++ if (rapl_pmu_idx >= rapl_pmus->nr_rapl_pmu) ++ return -EINVAL; ++ + /* must be done before validate_group */ +- pmu = cpu_to_rapl_pmu(event->cpu); ++ pmu = rapl_pmus->pmus[rapl_pmu_idx]; + if (!pmu) + return -EINVAL; + event->pmu_private = pmu; diff --git a/debian/patches/patchset-pf/amd-rapl/0006-perf-x86-rapl-Move-the-pmu-allocation-out-of-CPU-hot.patch b/debian/patches/patchset-pf/amd-rapl/0006-perf-x86-rapl-Move-the-pmu-allocation-out-of-CPU-hot.patch deleted file mode 100644 index c78ed41..0000000 --- a/debian/patches/patchset-pf/amd-rapl/0006-perf-x86-rapl-Move-the-pmu-allocation-out-of-CPU-hot.patch +++ /dev/null @@ -1,84 +0,0 @@ -From fb0a3b5932882f02ed42fcaa6db73aba3eafd6d7 Mon Sep 17 00:00:00 2001 -From: Kan Liang -Date: Fri, 2 Aug 2024 08:16:42 -0700 -Subject: perf/x86/rapl: Move the pmu allocation out of CPU hotplug - -The rapl pmu just needs to be allocated once. It doesn't matter to be -allocated at each CPU hotplug, or the global init_rapl_pmus(). - -Move the pmu allocation to the init_rapl_pmus(). So the generic hotplug -supports can be applied. - -Signed-off-by: Kan Liang -Cc: Dhananjay Ugwekar ---- - arch/x86/events/rapl.c | 44 +++++++++++++++++++++++++++++------------- - 1 file changed, 31 insertions(+), 13 deletions(-) - ---- a/arch/x86/events/rapl.c -+++ b/arch/x86/events/rapl.c -@@ -568,19 +568,8 @@ static int rapl_cpu_online(unsigned int - struct rapl_pmu *pmu = cpu_to_rapl_pmu(cpu); - int target; - -- if (!pmu) { -- pmu = kzalloc_node(sizeof(*pmu), GFP_KERNEL, cpu_to_node(cpu)); -- if (!pmu) -- return -ENOMEM; -- -- raw_spin_lock_init(&pmu->lock); -- INIT_LIST_HEAD(&pmu->active_list); -- pmu->pmu = &rapl_pmus->pmu; -- pmu->timer_interval = ms_to_ktime(rapl_timer_ms); -- rapl_hrtimer_init(pmu); -- -- rapl_pmus->pmus[topology_logical_die_id(cpu)] = pmu; -- } -+ if (!pmu) -+ return -ENOMEM; - - /* - * Check if there is an online cpu in the package which collects rapl -@@ -673,6 +662,32 @@ static const struct attribute_group *rap - NULL, - }; - -+static void __init init_rapl_pmu(void) -+{ -+ struct rapl_pmu *pmu; -+ int cpu; -+ -+ cpus_read_lock(); -+ -+ for_each_cpu(cpu, cpu_online_mask) { -+ pmu = cpu_to_rapl_pmu(cpu); -+ if (pmu) -+ continue; -+ pmu = kzalloc_node(sizeof(*pmu), GFP_KERNEL, cpu_to_node(cpu)); -+ if (!pmu) -+ continue; -+ raw_spin_lock_init(&pmu->lock); -+ INIT_LIST_HEAD(&pmu->active_list); -+ pmu->pmu = &rapl_pmus->pmu; -+ pmu->timer_interval = ms_to_ktime(rapl_timer_ms); -+ rapl_hrtimer_init(pmu); -+ -+ rapl_pmus->pmus[topology_logical_die_id(cpu)] = pmu; -+ } -+ -+ cpus_read_unlock(); -+} -+ - static int __init init_rapl_pmus(void) - { - int nr_rapl_pmu = topology_max_packages() * topology_max_dies_per_package(); -@@ -693,6 +708,9 @@ static int __init init_rapl_pmus(void) - rapl_pmus->pmu.read = rapl_pmu_event_read; - rapl_pmus->pmu.module = THIS_MODULE; - rapl_pmus->pmu.capabilities = PERF_PMU_CAP_NO_EXCLUDE; -+ -+ init_rapl_pmu(); -+ - return 0; - } - diff --git a/debian/patches/patchset-pf/amd-rapl/0011-perf-x86-rapl-Rename-rapl_pmu-variables.patch b/debian/patches/patchset-pf/amd-rapl/0006-perf-x86-rapl-Rename-rapl_pmu-variables.patch similarity index 80% rename from debian/patches/patchset-pf/amd-rapl/0011-perf-x86-rapl-Rename-rapl_pmu-variables.patch rename to debian/patches/patchset-pf/amd-rapl/0006-perf-x86-rapl-Rename-rapl_pmu-variables.patch index 0846423..c93ee10 100644 --- a/debian/patches/patchset-pf/amd-rapl/0011-perf-x86-rapl-Rename-rapl_pmu-variables.patch +++ b/debian/patches/patchset-pf/amd-rapl/0006-perf-x86-rapl-Rename-rapl_pmu-variables.patch @@ -1,6 +1,6 @@ -From 07ec9f38cac6eb6e5b0b062ef99e9458ba567de8 Mon Sep 17 00:00:00 2001 +From 30e2cd787aeb9cb9c1148e07446aac76765f715e Mon Sep 17 00:00:00 2001 From: Dhananjay Ugwekar -Date: Fri, 13 Sep 2024 15:21:43 +0000 +Date: Fri, 15 Nov 2024 06:08:00 +0000 Subject: perf/x86/rapl: Rename rapl_pmu variables Rename struct rapl_pmu variables from "pmu" to "rapl_pmu", to @@ -15,13 +15,16 @@ Also rename "pmus" member in rapl_pmus struct, for same reason. No functional change. Signed-off-by: Dhananjay Ugwekar +Reviewed-by: Gautham R. Shenoy +Reviewed-by: Zhang Rui +Tested-by: Zhang Rui --- - arch/x86/events/rapl.c | 93 +++++++++++++++++++++--------------------- - 1 file changed, 47 insertions(+), 46 deletions(-) + arch/x86/events/rapl.c | 91 +++++++++++++++++++++--------------------- + 1 file changed, 46 insertions(+), 45 deletions(-) --- a/arch/x86/events/rapl.c +++ b/arch/x86/events/rapl.c -@@ -116,7 +116,7 @@ struct rapl_pmu { +@@ -129,7 +129,7 @@ struct rapl_pmu { struct rapl_pmus { struct pmu pmu; unsigned int nr_rapl_pmu; @@ -30,7 +33,7 @@ Signed-off-by: Dhananjay Ugwekar }; enum rapl_unit_quirk { -@@ -223,34 +223,34 @@ static void rapl_start_hrtimer(struct ra +@@ -227,34 +227,34 @@ static void rapl_start_hrtimer(struct ra static enum hrtimer_restart rapl_hrtimer_handle(struct hrtimer *hrtimer) { @@ -74,7 +77,7 @@ Signed-off-by: Dhananjay Ugwekar struct perf_event *event) { if (WARN_ON_ONCE(!(event->hw.state & PERF_HES_STOPPED))) -@@ -258,39 +258,39 @@ static void __rapl_pmu_event_start(struc +@@ -262,39 +262,39 @@ static void __rapl_pmu_event_start(struc event->hw.state = 0; @@ -128,7 +131,7 @@ Signed-off-by: Dhananjay Ugwekar list_del(&event->active_entry); -@@ -308,23 +308,23 @@ static void rapl_pmu_event_stop(struct p +@@ -312,23 +312,23 @@ static void rapl_pmu_event_stop(struct p hwc->state |= PERF_HES_UPTODATE; } @@ -157,16 +160,16 @@ Signed-off-by: Dhananjay Ugwekar return 0; } -@@ -338,7 +338,7 @@ static int rapl_pmu_event_init(struct pe +@@ -342,7 +342,7 @@ static int rapl_pmu_event_init(struct pe { u64 cfg = event->attr.config & RAPL_EVENT_MASK; - int bit, rapl_pmu_idx, ret = 0; + int bit, ret = 0; - struct rapl_pmu *pmu; + struct rapl_pmu *rapl_pmu; + unsigned int rapl_pmu_idx; /* only look at RAPL events */ - if (event->attr.type != rapl_pmus->pmu.type) -@@ -370,10 +370,11 @@ static int rapl_pmu_event_init(struct pe +@@ -375,10 +375,11 @@ static int rapl_pmu_event_init(struct pe return -EINVAL; /* must be done before validate_group */ @@ -181,7 +184,7 @@ Signed-off-by: Dhananjay Ugwekar event->hw.event_base = rapl_msrs[bit].msr; event->hw.config = cfg; event->hw.idx = bit; -@@ -600,7 +601,7 @@ static void cleanup_rapl_pmus(void) +@@ -605,7 +606,7 @@ static void cleanup_rapl_pmus(void) int i; for (i = 0; i < rapl_pmus->nr_rapl_pmu; i++) @@ -190,29 +193,21 @@ Signed-off-by: Dhananjay Ugwekar kfree(rapl_pmus); } -@@ -615,7 +616,7 @@ static const struct attribute_group *rap +@@ -620,27 +621,27 @@ static const struct attribute_group *rap - static void __init init_rapl_pmu(void) + static int __init init_rapl_pmu(void) { - struct rapl_pmu *pmu; + struct rapl_pmu *rapl_pmu; - int cpu, rapl_pmu_idx; + int idx; - cpus_read_lock(); -@@ -625,19 +626,19 @@ static void __init init_rapl_pmu(void) - if (rapl_pmu_idx >= rapl_pmus->nr_rapl_pmu) - continue; - -- pmu = rapl_pmus->pmus[rapl_pmu_idx]; -- if (pmu) -+ rapl_pmu = rapl_pmus->rapl_pmu[rapl_pmu_idx]; -+ if (rapl_pmu) - continue; -- pmu = kzalloc_node(sizeof(*pmu), GFP_KERNEL, cpu_to_node(cpu)); + for (idx = 0; idx < rapl_pmus->nr_rapl_pmu; idx++) { +- pmu = kzalloc(sizeof(*pmu), GFP_KERNEL); - if (!pmu) -+ rapl_pmu = kzalloc_node(sizeof(*rapl_pmu), GFP_KERNEL, cpu_to_node(cpu)); ++ rapl_pmu = kzalloc(sizeof(*rapl_pmu), GFP_KERNEL); + if (!rapl_pmu) - continue; + goto free; + - raw_spin_lock_init(&pmu->lock); - INIT_LIST_HEAD(&pmu->active_list); - pmu->pmu = &rapl_pmus->pmu; @@ -224,13 +219,20 @@ Signed-off-by: Dhananjay Ugwekar + rapl_pmu->timer_interval = ms_to_ktime(rapl_timer_ms); + rapl_hrtimer_init(rapl_pmu); -- rapl_pmus->pmus[rapl_pmu_idx] = pmu; -+ rapl_pmus->rapl_pmu[rapl_pmu_idx] = rapl_pmu; +- rapl_pmus->pmus[idx] = pmu; ++ rapl_pmus->rapl_pmu[idx] = rapl_pmu; } - cpus_read_unlock(); -@@ -653,7 +654,7 @@ static int __init init_rapl_pmus(void) - rapl_pmu_scope = PERF_PMU_SCOPE_PKG; + return 0; + free: + for (; idx > 0; idx--) +- kfree(rapl_pmus->pmus[idx - 1]); ++ kfree(rapl_pmus->rapl_pmu[idx - 1]); + return -ENOMEM; + } + +@@ -654,7 +655,7 @@ static int __init init_rapl_pmus(void) + rapl_pmu_scope = PERF_PMU_SCOPE_DIE; } - rapl_pmus = kzalloc(struct_size(rapl_pmus, pmus, nr_rapl_pmu), GFP_KERNEL); diff --git a/debian/patches/patchset-pf/amd-rapl/0012-perf-x86-rapl-Make-rapl_model-struct-global.patch b/debian/patches/patchset-pf/amd-rapl/0007-perf-x86-rapl-Make-rapl_model-struct-global.patch similarity index 77% rename from debian/patches/patchset-pf/amd-rapl/0012-perf-x86-rapl-Make-rapl_model-struct-global.patch rename to debian/patches/patchset-pf/amd-rapl/0007-perf-x86-rapl-Make-rapl_model-struct-global.patch index 9bc67dc..6ad282a 100644 --- a/debian/patches/patchset-pf/amd-rapl/0012-perf-x86-rapl-Make-rapl_model-struct-global.patch +++ b/debian/patches/patchset-pf/amd-rapl/0007-perf-x86-rapl-Make-rapl_model-struct-global.patch @@ -1,9 +1,9 @@ -From 68614752b9fd6b6bae6f9ab7b02fc28350c5a541 Mon Sep 17 00:00:00 2001 +From 0f84d3bd0af2c300fe13d9f0f5131d0747a13f9e Mon Sep 17 00:00:00 2001 From: Dhananjay Ugwekar -Date: Fri, 13 Sep 2024 15:47:56 +0000 +Date: Fri, 15 Nov 2024 06:08:01 +0000 Subject: perf/x86/rapl: Make rapl_model struct global -Preparation for per-core energy counter support addition for AMD CPUs. +Prepare for the addition of RAPL core energy counter support. As there will always be just one rapl_model variable on a system, make it global, to make it easier to access it from any function. @@ -11,21 +11,24 @@ global, to make it easier to access it from any function. No functional change. Signed-off-by: Dhananjay Ugwekar +Reviewed-by: Zhang Rui +Tested-by: Zhang Rui +Reviewed-by: Gautham R. Shenoy --- arch/x86/events/rapl.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) --- a/arch/x86/events/rapl.c +++ b/arch/x86/events/rapl.c -@@ -138,6 +138,7 @@ static struct rapl_pmus *rapl_pmus; +@@ -151,6 +151,7 @@ static struct rapl_pmus *rapl_pmus; static unsigned int rapl_cntr_mask; static u64 rapl_timer_ms; static struct perf_msr *rapl_msrs; +static struct rapl_model *rapl_model; /* - * RAPL Package energy counter scope: -@@ -536,18 +537,18 @@ static struct perf_msr amd_rapl_msrs[] = + * Helper function to get the correct topology id according to the +@@ -541,18 +542,18 @@ static struct perf_msr amd_rapl_msrs[] = [PERF_RAPL_PSYS] = { 0, &rapl_events_psys_group, NULL, false, 0 }, }; @@ -47,7 +50,7 @@ Signed-off-by: Dhananjay Ugwekar /* * DRAM domain on HSW server and KNL has fixed energy unit which can be * different than the unit from power unit MSR. See -@@ -798,21 +799,20 @@ MODULE_DEVICE_TABLE(x86cpu, rapl_model_m +@@ -797,21 +798,20 @@ MODULE_DEVICE_TABLE(x86cpu, rapl_model_m static int __init rapl_pmu_init(void) { const struct x86_cpu_id *id; diff --git a/debian/patches/patchset-pf/amd-rapl/0013-perf-x86-rapl-Add-arguments-to-the-cleanup-and-init-.patch b/debian/patches/patchset-pf/amd-rapl/0008-perf-x86-rapl-Add-arguments-to-the-init-and-cleanup-.patch similarity index 51% rename from debian/patches/patchset-pf/amd-rapl/0013-perf-x86-rapl-Add-arguments-to-the-cleanup-and-init-.patch rename to debian/patches/patchset-pf/amd-rapl/0008-perf-x86-rapl-Add-arguments-to-the-init-and-cleanup-.patch index 9fb5743..4013e12 100644 --- a/debian/patches/patchset-pf/amd-rapl/0013-perf-x86-rapl-Add-arguments-to-the-cleanup-and-init-.patch +++ b/debian/patches/patchset-pf/amd-rapl/0008-perf-x86-rapl-Add-arguments-to-the-init-and-cleanup-.patch @@ -1,20 +1,26 @@ -From b10b887510ccb0b6bc7294888982b862703c9c32 Mon Sep 17 00:00:00 2001 +From 395cf3513aaf79c95c611ce97ba451eaf6470c44 Mon Sep 17 00:00:00 2001 From: Dhananjay Ugwekar -Date: Fri, 13 Sep 2024 15:47:57 +0000 -Subject: perf/x86/rapl: Add arguments to the cleanup and init functions +Date: Fri, 15 Nov 2024 06:08:02 +0000 +Subject: perf/x86/rapl: Add arguments to the init and cleanup functions -Prep for per-core RAPL PMU addition. +Prepare for the addition of RAPL core energy counter support. + +Add arguments to the init and cleanup functions, which will help in +initialization and cleaning up of two separate PMUs. No functional change. Signed-off-by: Dhananjay Ugwekar +Reviewed-by: Gautham R. Shenoy +Reviewed-by: Zhang Rui +Tested-by: Zhang Rui --- - arch/x86/events/rapl.c | 32 +++++++++++++++++++------------- - 1 file changed, 19 insertions(+), 13 deletions(-) + arch/x86/events/rapl.c | 28 ++++++++++++++++------------ + 1 file changed, 16 insertions(+), 12 deletions(-) --- a/arch/x86/events/rapl.c +++ b/arch/x86/events/rapl.c -@@ -597,7 +597,7 @@ static void __init rapl_advertise(void) +@@ -602,7 +602,7 @@ static void __init rapl_advertise(void) } } @@ -23,35 +29,32 @@ Signed-off-by: Dhananjay Ugwekar { int i; -@@ -615,7 +615,7 @@ static const struct attribute_group *rap +@@ -620,7 +620,7 @@ static const struct attribute_group *rap NULL, }; --static void __init init_rapl_pmu(void) -+static void __init init_rapl_pmu(struct rapl_pmus *rapl_pmus) +-static int __init init_rapl_pmu(void) ++static int __init init_rapl_pmu(struct rapl_pmus *rapl_pmus) { struct rapl_pmu *rapl_pmu; - int cpu, rapl_pmu_idx; -@@ -645,20 +645,22 @@ static void __init init_rapl_pmu(void) - cpus_read_unlock(); + int idx; +@@ -646,20 +646,20 @@ free: + return -ENOMEM; } -static int __init init_rapl_pmus(void) +static int __init init_rapl_pmus(struct rapl_pmus **rapl_pmus_ptr, int rapl_pmu_scope) { -- int nr_rapl_pmu = topology_max_packages() * topology_max_dies_per_package(); -- int rapl_pmu_scope = PERF_PMU_SCOPE_DIE; -+ int nr_rapl_pmu; + int nr_rapl_pmu = topology_max_packages(); +- int rapl_pmu_scope = PERF_PMU_SCOPE_PKG; + struct rapl_pmus *rapl_pmus; -- if (rapl_pmu_is_pkg_scope()) { -- nr_rapl_pmu = topology_max_packages(); -- rapl_pmu_scope = PERF_PMU_SCOPE_PKG; +- if (!rapl_pmu_is_pkg_scope()) { +- nr_rapl_pmu *= topology_max_dies_per_package(); +- rapl_pmu_scope = PERF_PMU_SCOPE_DIE; - } -+ if (rapl_pmu_scope == PERF_PMU_SCOPE_PKG) -+ nr_rapl_pmu = topology_max_packages(); -+ else -+ nr_rapl_pmu = topology_max_packages() * topology_max_dies_per_package(); ++ if (rapl_pmu_scope == PERF_PMU_SCOPE_DIE) ++ nr_rapl_pmu *= topology_max_dies_per_package(); rapl_pmus = kzalloc(struct_size(rapl_pmus, rapl_pmu, nr_rapl_pmu), GFP_KERNEL); if (!rapl_pmus) @@ -62,16 +65,16 @@ Signed-off-by: Dhananjay Ugwekar rapl_pmus->nr_rapl_pmu = nr_rapl_pmu; rapl_pmus->pmu.attr_groups = rapl_attr_groups; rapl_pmus->pmu.attr_update = rapl_attr_update; -@@ -673,7 +675,7 @@ static int __init init_rapl_pmus(void) +@@ -674,7 +674,7 @@ static int __init init_rapl_pmus(void) rapl_pmus->pmu.module = THIS_MODULE; rapl_pmus->pmu.capabilities = PERF_PMU_CAP_NO_EXCLUDE; -- init_rapl_pmu(); -+ init_rapl_pmu(rapl_pmus); - - return 0; +- return init_rapl_pmu(); ++ return init_rapl_pmu(rapl_pmus); } -@@ -799,8 +801,12 @@ MODULE_DEVICE_TABLE(x86cpu, rapl_model_m + + static struct rapl_model model_snb = { +@@ -798,8 +798,12 @@ MODULE_DEVICE_TABLE(x86cpu, rapl_model_m static int __init rapl_pmu_init(void) { const struct x86_cpu_id *id; @@ -84,7 +87,7 @@ Signed-off-by: Dhananjay Ugwekar id = x86_match_cpu(rapl_model_match); if (!id) return -ENODEV; -@@ -816,7 +822,7 @@ static int __init rapl_pmu_init(void) +@@ -815,7 +819,7 @@ static int __init rapl_pmu_init(void) if (ret) return ret; @@ -93,7 +96,7 @@ Signed-off-by: Dhananjay Ugwekar if (ret) return ret; -@@ -829,7 +835,7 @@ static int __init rapl_pmu_init(void) +@@ -828,7 +832,7 @@ static int __init rapl_pmu_init(void) out: pr_warn("Initialization failed (%d), disabled\n", ret); @@ -102,7 +105,7 @@ Signed-off-by: Dhananjay Ugwekar return ret; } module_init(rapl_pmu_init); -@@ -837,6 +843,6 @@ module_init(rapl_pmu_init); +@@ -836,6 +840,6 @@ module_init(rapl_pmu_init); static void __exit intel_rapl_exit(void) { perf_pmu_unregister(&rapl_pmus->pmu); diff --git a/debian/patches/patchset-pf/amd-rapl/0008-perf-x86-rapl-Fix-the-energy-pkg-event-for-AMD-CPUs.patch b/debian/patches/patchset-pf/amd-rapl/0008-perf-x86-rapl-Fix-the-energy-pkg-event-for-AMD-CPUs.patch deleted file mode 100644 index e535abd..0000000 --- a/debian/patches/patchset-pf/amd-rapl/0008-perf-x86-rapl-Fix-the-energy-pkg-event-for-AMD-CPUs.patch +++ /dev/null @@ -1,101 +0,0 @@ -From f1525664ff9da3241b3556594dc0b67506ae1ddd Mon Sep 17 00:00:00 2001 -From: Dhananjay Ugwekar -Date: Tue, 10 Sep 2024 14:25:05 +0530 -Subject: perf/x86/rapl: Fix the energy-pkg event for AMD CPUs - -After commit ("x86/cpu/topology: Add support for the AMD 0x80000026 leaf"), -on AMD processors that support extended CPUID leaf 0x80000026, the -topology_die_cpumask() and topology_logical_die_id() macros, no longer -return the package cpumask and package id, instead they return the CCD -(Core Complex Die) mask and id respectively. This leads to the energy-pkg -event scope to be modified to CCD instead of package. - -So, change the PMU scope for AMD and Hygon back to package. - -On a 12 CCD 1 Package AMD Zen4 Genoa machine: - -Before: -$ cat /sys/devices/power/cpumask -0,8,16,24,32,40,48,56,64,72,80,88. - -The expected cpumask here is supposed to be just "0", as it is a package -scope event, only one CPU will be collecting the event for all the CPUs in -the package. - -After: -$ cat /sys/devices/power/cpumask -0 - -Signed-off-by: Dhananjay Ugwekar ---- - arch/x86/events/rapl.c | 35 ++++++++++++++++++++++++++++++++--- - 1 file changed, 32 insertions(+), 3 deletions(-) - ---- a/arch/x86/events/rapl.c -+++ b/arch/x86/events/rapl.c -@@ -139,9 +139,32 @@ static unsigned int rapl_cntr_mask; - static u64 rapl_timer_ms; - static struct perf_msr *rapl_msrs; - -+/* -+ * RAPL Package energy counter scope: -+ * 1. AMD/HYGON platforms have a per-PKG package energy counter -+ * 2. For Intel platforms -+ * 2.1. CLX-AP is multi-die and its RAPL MSRs are die-scope -+ * 2.2. Other Intel platforms are single die systems so the scope can be -+ * considered as either pkg-scope or die-scope, and we are considering -+ * them as die-scope. -+ */ -+#define rapl_pmu_is_pkg_scope() \ -+ (boot_cpu_data.x86_vendor == X86_VENDOR_AMD || \ -+ boot_cpu_data.x86_vendor == X86_VENDOR_HYGON) -+ -+/* -+ * Helper function to get the correct topology id according to the -+ * RAPL PMU scope. -+ */ -+static inline unsigned int get_rapl_pmu_idx(int cpu) -+{ -+ return rapl_pmu_is_pkg_scope() ? topology_logical_package_id(cpu) : -+ topology_logical_die_id(cpu); -+} -+ - static inline struct rapl_pmu *cpu_to_rapl_pmu(unsigned int cpu) - { -- unsigned int rapl_pmu_idx = topology_logical_die_id(cpu); -+ unsigned int rapl_pmu_idx = get_rapl_pmu_idx(cpu); - - /* - * The unsigned check also catches the '-1' return value for non -@@ -617,7 +640,7 @@ static void __init init_rapl_pmu(void) - pmu->timer_interval = ms_to_ktime(rapl_timer_ms); - rapl_hrtimer_init(pmu); - -- rapl_pmus->pmus[topology_logical_die_id(cpu)] = pmu; -+ rapl_pmus->pmus[get_rapl_pmu_idx(cpu)] = pmu; - } - - cpus_read_unlock(); -@@ -626,6 +649,12 @@ static void __init init_rapl_pmu(void) - static int __init init_rapl_pmus(void) - { - int nr_rapl_pmu = topology_max_packages() * topology_max_dies_per_package(); -+ int rapl_pmu_scope = PERF_PMU_SCOPE_DIE; -+ -+ if (rapl_pmu_is_pkg_scope()) { -+ nr_rapl_pmu = topology_max_packages(); -+ rapl_pmu_scope = PERF_PMU_SCOPE_PKG; -+ } - - rapl_pmus = kzalloc(struct_size(rapl_pmus, pmus, nr_rapl_pmu), GFP_KERNEL); - if (!rapl_pmus) -@@ -641,8 +670,8 @@ static int __init init_rapl_pmus(void) - rapl_pmus->pmu.start = rapl_pmu_event_start; - rapl_pmus->pmu.stop = rapl_pmu_event_stop; - rapl_pmus->pmu.read = rapl_pmu_event_read; -+ rapl_pmus->pmu.scope = rapl_pmu_scope; - rapl_pmus->pmu.module = THIS_MODULE; -- rapl_pmus->pmu.scope = PERF_PMU_SCOPE_DIE; - rapl_pmus->pmu.capabilities = PERF_PMU_CAP_NO_EXCLUDE; - - init_rapl_pmu(); diff --git a/debian/patches/patchset-pf/amd-rapl/0014-perf-x86-rapl-Modify-the-generic-variable-names-to-_.patch b/debian/patches/patchset-pf/amd-rapl/0009-perf-x86-rapl-Modify-the-generic-variable-names-to-_.patch similarity index 83% rename from debian/patches/patchset-pf/amd-rapl/0014-perf-x86-rapl-Modify-the-generic-variable-names-to-_.patch rename to debian/patches/patchset-pf/amd-rapl/0009-perf-x86-rapl-Modify-the-generic-variable-names-to-_.patch index 198598b..078737c 100644 --- a/debian/patches/patchset-pf/amd-rapl/0014-perf-x86-rapl-Modify-the-generic-variable-names-to-_.patch +++ b/debian/patches/patchset-pf/amd-rapl/0009-perf-x86-rapl-Modify-the-generic-variable-names-to-_.patch @@ -1,20 +1,22 @@ -From b5c83c40540298a39f8314034b705f1236b17a9f Mon Sep 17 00:00:00 2001 +From 98d0cb818ba4695b9a41ab83b7c00ec1cbdf1b35 Mon Sep 17 00:00:00 2001 From: Dhananjay Ugwekar -Date: Fri, 13 Sep 2024 15:47:58 +0000 +Date: Fri, 15 Nov 2024 06:08:03 +0000 Subject: perf/x86/rapl: Modify the generic variable names to *_pkg* -Prep for addition of power_per_core PMU to handle core scope energy -consumption for AMD CPUs. +Prepare for the addition of RAPL core energy counter support. -Replace the generic names with *_pkg*, to differentiate between the -scopes of the two different PMUs and their variables. +Replace the generic names with *_pkg*, to later on differentiate between +the scopes of the two different PMUs and their variables. No functional change. Signed-off-by: Dhananjay Ugwekar +Reviewed-by: Gautham R. Shenoy +Reviewed-by: Zhang Rui +Tested-by: Zhang Rui --- - arch/x86/events/rapl.c | 118 ++++++++++++++++++++--------------------- - 1 file changed, 59 insertions(+), 59 deletions(-) + arch/x86/events/rapl.c | 120 ++++++++++++++++++++--------------------- + 1 file changed, 60 insertions(+), 60 deletions(-) --- a/arch/x86/events/rapl.c +++ b/arch/x86/events/rapl.c @@ -41,7 +43,16 @@ Signed-off-by: Dhananjay Ugwekar "pp0-core", "package", "dram", -@@ -126,16 +126,16 @@ enum rapl_unit_quirk { +@@ -112,7 +112,7 @@ static struct perf_pmu_events_attr event + * considered as either pkg-scope or die-scope, and we are considering + * them as die-scope. + */ +-#define rapl_pmu_is_pkg_scope() \ ++#define rapl_pkg_pmu_is_pkg_scope() \ + (boot_cpu_data.x86_vendor == X86_VENDOR_AMD || \ + boot_cpu_data.x86_vendor == X86_VENDOR_HYGON) + +@@ -139,16 +139,16 @@ enum rapl_unit_quirk { }; struct rapl_model { @@ -63,25 +74,18 @@ Signed-off-by: Dhananjay Ugwekar static u64 rapl_timer_ms; static struct perf_msr *rapl_msrs; static struct rapl_model *rapl_model; -@@ -149,7 +149,7 @@ static struct rapl_model *rapl_model; - * considered as either pkg-scope or die-scope, and we are considering - * them as die-scope. - */ --#define rapl_pmu_is_pkg_scope() \ -+#define rapl_pkg_pmu_is_pkg_scope() \ - (boot_cpu_data.x86_vendor == X86_VENDOR_AMD || \ - boot_cpu_data.x86_vendor == X86_VENDOR_HYGON) - -@@ -159,7 +159,7 @@ static struct rapl_model *rapl_model; - */ - static inline unsigned int get_rapl_pmu_idx(int cpu) - { +@@ -163,8 +163,8 @@ static inline unsigned int get_rapl_pmu_ + * (for non-existent mappings in topology map) to UINT_MAX, so + * the error check in the caller is simplified. + */ - return rapl_pmu_is_pkg_scope() ? topology_logical_package_id(cpu) : +- topology_logical_die_id(cpu); + return rapl_pkg_pmu_is_pkg_scope() ? topology_logical_package_id(cpu) : - topology_logical_die_id(cpu); ++ topology_logical_die_id(cpu); } -@@ -172,7 +172,7 @@ static inline u64 rapl_read_counter(stru + static inline u64 rapl_read_counter(struct perf_event *event) +@@ -176,7 +176,7 @@ static inline u64 rapl_read_counter(stru static inline u64 rapl_scale(u64 v, int cfg) { @@ -90,7 +94,7 @@ Signed-off-by: Dhananjay Ugwekar pr_warn("Invalid domain %d, failed to scale data\n", cfg); return v; } -@@ -182,7 +182,7 @@ static inline u64 rapl_scale(u64 v, int +@@ -186,7 +186,7 @@ static inline u64 rapl_scale(u64 v, int * or use ldexp(count, -32). * Watts = Joules/Time delta */ @@ -99,8 +103,8 @@ Signed-off-by: Dhananjay Ugwekar } static u64 rapl_event_update(struct perf_event *event) -@@ -342,7 +342,7 @@ static int rapl_pmu_event_init(struct pe - struct rapl_pmu *rapl_pmu; +@@ -347,7 +347,7 @@ static int rapl_pmu_event_init(struct pe + unsigned int rapl_pmu_idx; /* only look at RAPL events */ - if (event->attr.type != rapl_pmus->pmu.type) @@ -108,7 +112,7 @@ Signed-off-by: Dhananjay Ugwekar return -ENOENT; /* check only supported bits are set */ -@@ -352,14 +352,14 @@ static int rapl_pmu_event_init(struct pe +@@ -357,14 +357,14 @@ static int rapl_pmu_event_init(struct pe if (event->cpu < 0) return -EINVAL; @@ -126,7 +130,7 @@ Signed-off-by: Dhananjay Ugwekar return -EINVAL; /* unsupported modes and filters */ -@@ -367,11 +367,11 @@ static int rapl_pmu_event_init(struct pe +@@ -372,11 +372,11 @@ static int rapl_pmu_event_init(struct pe return -EINVAL; rapl_pmu_idx = get_rapl_pmu_idx(event->cpu); @@ -140,7 +144,7 @@ Signed-off-by: Dhananjay Ugwekar if (!rapl_pmu) return -EINVAL; -@@ -525,11 +525,11 @@ static struct perf_msr intel_rapl_spr_ms +@@ -530,11 +530,11 @@ static struct perf_msr intel_rapl_spr_ms }; /* @@ -155,7 +159,7 @@ Signed-off-by: Dhananjay Ugwekar [PERF_RAPL_PP0] = { 0, &rapl_events_cores_group, NULL, false, 0 }, [PERF_RAPL_PKG] = { MSR_AMD_PKG_ENERGY_STATUS, &rapl_events_pkg_group, test_msr, false, RAPL_MSR_MASK }, [PERF_RAPL_RAM] = { 0, &rapl_events_ram_group, NULL, false, 0 }, -@@ -545,8 +545,8 @@ static int rapl_check_hw_unit(void) +@@ -550,8 +550,8 @@ static int rapl_check_hw_unit(void) /* protect rdmsrl() to handle virtualization */ if (rdmsrl_safe(rapl_model->msr_power_unit, &msr_rapl_power_unit_bits)) return -1; @@ -166,7 +170,7 @@ Signed-off-by: Dhananjay Ugwekar switch (rapl_model->unit_quirk) { /* -@@ -556,11 +556,11 @@ static int rapl_check_hw_unit(void) +@@ -561,11 +561,11 @@ static int rapl_check_hw_unit(void) * of 2. Datasheet, September 2014, Reference Number: 330784-001 " */ case RAPL_UNIT_QUIRK_INTEL_HSW: @@ -180,7 +184,7 @@ Signed-off-by: Dhananjay Ugwekar break; default: break; -@@ -575,9 +575,9 @@ static int rapl_check_hw_unit(void) +@@ -580,9 +580,9 @@ static int rapl_check_hw_unit(void) * if hw unit is 32, then we use 2 ms 1/200/2 */ rapl_timer_ms = 2; @@ -192,7 +196,7 @@ Signed-off-by: Dhananjay Ugwekar } return 0; } -@@ -587,12 +587,12 @@ static void __init rapl_advertise(void) +@@ -592,12 +592,12 @@ static void __init rapl_advertise(void) int i; pr_info("API unit is 2^-32 Joules, %d fixed counters, %llu ms ovfl timer\n", @@ -209,7 +213,7 @@ Signed-off-by: Dhananjay Ugwekar } } } -@@ -681,71 +681,71 @@ static int __init init_rapl_pmus(struct +@@ -678,71 +678,71 @@ static int __init init_rapl_pmus(struct } static struct rapl_model model_snb = { @@ -297,7 +301,7 @@ Signed-off-by: Dhananjay Ugwekar }; static const struct x86_cpu_id rapl_model_match[] __initconst = { -@@ -801,11 +801,11 @@ MODULE_DEVICE_TABLE(x86cpu, rapl_model_m +@@ -798,11 +798,11 @@ MODULE_DEVICE_TABLE(x86cpu, rapl_model_m static int __init rapl_pmu_init(void) { const struct x86_cpu_id *id; @@ -312,7 +316,7 @@ Signed-off-by: Dhananjay Ugwekar id = x86_match_cpu(rapl_model_match); if (!id) -@@ -813,20 +813,20 @@ static int __init rapl_pmu_init(void) +@@ -810,20 +810,20 @@ static int __init rapl_pmu_init(void) rapl_model = (struct rapl_model *) id->driver_data; @@ -338,7 +342,7 @@ Signed-off-by: Dhananjay Ugwekar if (ret) goto out; -@@ -835,14 +835,14 @@ static int __init rapl_pmu_init(void) +@@ -832,14 +832,14 @@ static int __init rapl_pmu_init(void) out: pr_warn("Initialization failed (%d), disabled\n", ret); diff --git a/debian/patches/patchset-pf/amd-rapl/0010-perf-x86-rapl-Remove-the-cpu_to_rapl_pmu-function.patch b/debian/patches/patchset-pf/amd-rapl/0010-perf-x86-rapl-Remove-the-cpu_to_rapl_pmu-function.patch deleted file mode 100644 index 75276ef..0000000 --- a/debian/patches/patchset-pf/amd-rapl/0010-perf-x86-rapl-Remove-the-cpu_to_rapl_pmu-function.patch +++ /dev/null @@ -1,87 +0,0 @@ -From b8e1231d5f78314de8f9066baba7b1fdd5e59218 Mon Sep 17 00:00:00 2001 -From: Dhananjay Ugwekar -Date: Fri, 13 Sep 2024 15:21:42 +0000 -Subject: perf/x86/rapl: Remove the cpu_to_rapl_pmu() function - -Preparation for the addition of per-core RAPL energy counter support for -AMD CPUs. Post which, one cpu might be mapped to more than one rapl_pmu -(package/die one or per-core one), also makes sense to use the -get_rapl_pmu_idx macro which is anyway used to index into the -rapl_pmus->pmus[] array. - -Signed-off-by: Dhananjay Ugwekar ---- - arch/x86/events/rapl.c | 29 +++++++++++++---------------- - 1 file changed, 13 insertions(+), 16 deletions(-) - ---- a/arch/x86/events/rapl.c -+++ b/arch/x86/events/rapl.c -@@ -162,17 +162,6 @@ static inline unsigned int get_rapl_pmu_ - topology_logical_die_id(cpu); - } - --static inline struct rapl_pmu *cpu_to_rapl_pmu(unsigned int cpu) --{ -- unsigned int rapl_pmu_idx = get_rapl_pmu_idx(cpu); -- -- /* -- * The unsigned check also catches the '-1' return value for non -- * existent mappings in the topology map. -- */ -- return rapl_pmu_idx < rapl_pmus->nr_rapl_pmu ? rapl_pmus->pmus[rapl_pmu_idx] : NULL; --} -- - static inline u64 rapl_read_counter(struct perf_event *event) - { - u64 raw; -@@ -348,7 +337,7 @@ static void rapl_pmu_event_del(struct pe - static int rapl_pmu_event_init(struct perf_event *event) - { - u64 cfg = event->attr.config & RAPL_EVENT_MASK; -- int bit, ret = 0; -+ int bit, rapl_pmu_idx, ret = 0; - struct rapl_pmu *pmu; - - /* only look at RAPL events */ -@@ -376,8 +365,12 @@ static int rapl_pmu_event_init(struct pe - if (event->attr.sample_period) /* no sampling */ - return -EINVAL; - -+ rapl_pmu_idx = get_rapl_pmu_idx(event->cpu); -+ if (rapl_pmu_idx >= rapl_pmus->nr_rapl_pmu) -+ return -EINVAL; -+ - /* must be done before validate_group */ -- pmu = cpu_to_rapl_pmu(event->cpu); -+ pmu = rapl_pmus->pmus[rapl_pmu_idx]; - if (!pmu) - return -EINVAL; - event->pmu_private = pmu; -@@ -623,12 +616,16 @@ static const struct attribute_group *rap - static void __init init_rapl_pmu(void) - { - struct rapl_pmu *pmu; -- int cpu; -+ int cpu, rapl_pmu_idx; - - cpus_read_lock(); - - for_each_cpu(cpu, cpu_online_mask) { -- pmu = cpu_to_rapl_pmu(cpu); -+ rapl_pmu_idx = get_rapl_pmu_idx(cpu); -+ if (rapl_pmu_idx >= rapl_pmus->nr_rapl_pmu) -+ continue; -+ -+ pmu = rapl_pmus->pmus[rapl_pmu_idx]; - if (pmu) - continue; - pmu = kzalloc_node(sizeof(*pmu), GFP_KERNEL, cpu_to_node(cpu)); -@@ -640,7 +637,7 @@ static void __init init_rapl_pmu(void) - pmu->timer_interval = ms_to_ktime(rapl_timer_ms); - rapl_hrtimer_init(pmu); - -- rapl_pmus->pmus[get_rapl_pmu_idx(cpu)] = pmu; -+ rapl_pmus->pmus[rapl_pmu_idx] = pmu; - } - - cpus_read_unlock(); diff --git a/debian/patches/patchset-pf/amd-rapl/0015-perf-x86-rapl-Remove-the-global-variable-rapl_msrs.patch b/debian/patches/patchset-pf/amd-rapl/0010-perf-x86-rapl-Remove-the-global-variable-rapl_msrs.patch similarity index 70% rename from debian/patches/patchset-pf/amd-rapl/0015-perf-x86-rapl-Remove-the-global-variable-rapl_msrs.patch rename to debian/patches/patchset-pf/amd-rapl/0010-perf-x86-rapl-Remove-the-global-variable-rapl_msrs.patch index bce1965..69404a9 100644 --- a/debian/patches/patchset-pf/amd-rapl/0015-perf-x86-rapl-Remove-the-global-variable-rapl_msrs.patch +++ b/debian/patches/patchset-pf/amd-rapl/0010-perf-x86-rapl-Remove-the-global-variable-rapl_msrs.patch @@ -1,23 +1,24 @@ -From dbc0343069c8f86fad0d8d9075f70f79114ef10a Mon Sep 17 00:00:00 2001 +From ea8de8012d6d6ef2c24c45a56f230e3a7fcb8ce7 Mon Sep 17 00:00:00 2001 From: Dhananjay Ugwekar -Date: Fri, 13 Sep 2024 15:47:59 +0000 +Date: Fri, 15 Nov 2024 06:08:04 +0000 Subject: perf/x86/rapl: Remove the global variable rapl_msrs +Prepare for the addition of RAPL core energy counter support. + After making the rapl_model struct global, the rapl_msrs global variable isn't needed, so remove it. -Also it will be cleaner when new per-core scope PMU is added. As we will -need to maintain two rapl_msrs array(one for per-core scope and one for -package scope PMU), inside the rapl_model struct. - Signed-off-by: Dhananjay Ugwekar +Reviewed-by: Gautham R. Shenoy +Reviewed-by: Zhang Rui +Tested-by: Zhang Rui --- arch/x86/events/rapl.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) --- a/arch/x86/events/rapl.c +++ b/arch/x86/events/rapl.c -@@ -137,7 +137,6 @@ static int rapl_pkg_hw_unit[NR_RAPL_PKG_ +@@ -150,7 +150,6 @@ static int rapl_pkg_hw_unit[NR_RAPL_PKG_ static struct rapl_pmus *rapl_pmus_pkg; static unsigned int rapl_pkg_cntr_mask; static u64 rapl_timer_ms; @@ -25,7 +26,7 @@ Signed-off-by: Dhananjay Ugwekar static struct rapl_model *rapl_model; /* -@@ -376,7 +375,7 @@ static int rapl_pmu_event_init(struct pe +@@ -381,7 +380,7 @@ static int rapl_pmu_event_init(struct pe return -EINVAL; event->pmu_private = rapl_pmu; @@ -34,7 +35,7 @@ Signed-off-by: Dhananjay Ugwekar event->hw.config = cfg; event->hw.idx = bit; -@@ -813,9 +812,7 @@ static int __init rapl_pmu_init(void) +@@ -810,9 +809,7 @@ static int __init rapl_pmu_init(void) rapl_model = (struct rapl_model *) id->driver_data; diff --git a/debian/patches/patchset-pf/amd-rapl/0016-perf-x86-rapl-Move-the-cntr_mask-to-rapl_pmus-struct.patch b/debian/patches/patchset-pf/amd-rapl/0011-perf-x86-rapl-Move-the-cntr_mask-to-rapl_pmus-struct.patch similarity index 69% rename from debian/patches/patchset-pf/amd-rapl/0016-perf-x86-rapl-Move-the-cntr_mask-to-rapl_pmus-struct.patch rename to debian/patches/patchset-pf/amd-rapl/0011-perf-x86-rapl-Move-the-cntr_mask-to-rapl_pmus-struct.patch index 606ef19..59f0d9b 100644 --- a/debian/patches/patchset-pf/amd-rapl/0016-perf-x86-rapl-Move-the-cntr_mask-to-rapl_pmus-struct.patch +++ b/debian/patches/patchset-pf/amd-rapl/0011-perf-x86-rapl-Move-the-cntr_mask-to-rapl_pmus-struct.patch @@ -1,24 +1,26 @@ -From d6a5a28382558b896767a78db795d421015831a7 Mon Sep 17 00:00:00 2001 +From 8cbd0e18e5b36bbfdb5ca8931a7668c7963be8e5 Mon Sep 17 00:00:00 2001 From: Dhananjay Ugwekar -Date: Fri, 13 Sep 2024 15:48:00 +0000 +Date: Fri, 15 Nov 2024 06:08:05 +0000 Subject: perf/x86/rapl: Move the cntr_mask to rapl_pmus struct -Preparation for the addition of per-core RAPL energy counter for AMD -CPUs. +Prepare for the addition of RAPL core energy counter support. -Moving cntr_mask to rapl_pmus struct instead of adding a new global -cntr_mask for the per-core RAPL energy counter, will ensure that the -"per_core_cntr_mask" is only created if needed (i.e. in case of AMD -CPUs). +Move cntr_mask to rapl_pmus struct instead of adding a new global +cntr_mask for the new RAPL power_core PMU. This will also ensure that +the second "core_cntr_mask" is only created if needed (i.e. in case of +AMD CPUs). Signed-off-by: Dhananjay Ugwekar +Reviewed-by: Gautham R. Shenoy +Reviewed-by: Zhang Rui +Tested-by: Zhang Rui --- arch/x86/events/rapl.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) --- a/arch/x86/events/rapl.c +++ b/arch/x86/events/rapl.c -@@ -116,6 +116,7 @@ struct rapl_pmu { +@@ -129,6 +129,7 @@ struct rapl_pmu { struct rapl_pmus { struct pmu pmu; unsigned int nr_rapl_pmu; @@ -26,7 +28,7 @@ Signed-off-by: Dhananjay Ugwekar struct rapl_pmu *rapl_pmu[] __counted_by(nr_rapl_pmu); }; -@@ -135,7 +136,6 @@ struct rapl_model { +@@ -148,7 +149,6 @@ struct rapl_model { /* 1/2^hw_unit Joule */ static int rapl_pkg_hw_unit[NR_RAPL_PKG_DOMAINS] __read_mostly; static struct rapl_pmus *rapl_pmus_pkg; @@ -34,7 +36,7 @@ Signed-off-by: Dhananjay Ugwekar static u64 rapl_timer_ms; static struct rapl_model *rapl_model; -@@ -358,7 +358,7 @@ static int rapl_pmu_event_init(struct pe +@@ -363,7 +363,7 @@ static int rapl_pmu_event_init(struct pe bit = cfg - 1; /* check event supported */ @@ -43,7 +45,7 @@ Signed-off-by: Dhananjay Ugwekar return -EINVAL; /* unsupported modes and filters */ -@@ -586,10 +586,10 @@ static void __init rapl_advertise(void) +@@ -591,10 +591,10 @@ static void __init rapl_advertise(void) int i; pr_info("API unit is 2^-32 Joules, %d fixed counters, %llu ms ovfl timer\n", @@ -56,7 +58,7 @@ Signed-off-by: Dhananjay Ugwekar pr_info("hw unit of domain %s 2^-%d Joules\n", rapl_pkg_domain_names[i], rapl_pkg_hw_unit[i]); } -@@ -812,9 +812,6 @@ static int __init rapl_pmu_init(void) +@@ -809,9 +809,6 @@ static int __init rapl_pmu_init(void) rapl_model = (struct rapl_model *) id->driver_data; @@ -66,7 +68,7 @@ Signed-off-by: Dhananjay Ugwekar ret = rapl_check_hw_unit(); if (ret) return ret; -@@ -823,6 +820,10 @@ static int __init rapl_pmu_init(void) +@@ -820,6 +817,10 @@ static int __init rapl_pmu_init(void) if (ret) return ret; diff --git a/debian/patches/patchset-pf/amd-rapl/0017-perf-x86-rapl-Add-per-core-energy-counter-support-fo.patch b/debian/patches/patchset-pf/amd-rapl/0012-perf-x86-rapl-Add-core-energy-counter-support-for-AM.patch similarity index 65% rename from debian/patches/patchset-pf/amd-rapl/0017-perf-x86-rapl-Add-per-core-energy-counter-support-fo.patch rename to debian/patches/patchset-pf/amd-rapl/0012-perf-x86-rapl-Add-core-energy-counter-support-for-AM.patch index 55f7a3c..7ff93c1 100644 --- a/debian/patches/patchset-pf/amd-rapl/0017-perf-x86-rapl-Add-per-core-energy-counter-support-fo.patch +++ b/debian/patches/patchset-pf/amd-rapl/0012-perf-x86-rapl-Add-core-energy-counter-support-for-AM.patch @@ -1,39 +1,43 @@ -From 3cb480ec2950f4c6351c602552fc4f9a8e524b89 Mon Sep 17 00:00:00 2001 +From 27bdf22a4c7815831d38acd1cb08e5aa6ce95ea0 Mon Sep 17 00:00:00 2001 From: Dhananjay Ugwekar -Date: Fri, 13 Sep 2024 15:48:01 +0000 -Subject: perf/x86/rapl: Add per-core energy counter support for AMD CPUs +Date: Fri, 15 Nov 2024 06:08:06 +0000 +Subject: perf/x86/rapl: Add core energy counter support for AMD CPUs -Add a new "power_per_core" PMU and "energy-per-core" event for -monitoring energy consumption by each core. The existing energy-cores -event aggregates the energy consumption at the package level. -This new event aligns with the AMD's per_core energy counters. +Add a new "power_core" PMU and "energy-core" event for monitoring +energy consumption by each individual core. The existing energy-cores +event aggregates the energy consumption of CPU cores at the package level. +This new event aligns with the AMD's per-core energy counters. Tested the package level and core level PMU counters with workloads pinned to different CPUs. -Results with workload pinned to CPU 1 in core 1 on a AMD Zen4 Genoa +Results with workload pinned to CPU 4 in core 4 on an AMD Zen4 Genoa machine: -$ perf stat -a --per-core -e power_per_core/energy-per-core/ sleep 1 +$ sudo perf stat --per-core -e power_core/energy-core/ -- taskset -c 4 stress-ng --matrix 1 --timeout 5s +stress-ng: info: [21250] setting to a 5 second run per stressor +stress-ng: info: [21250] dispatching hogs: 1 matrix +stress-ng: info: [21250] successful run completed in 5.00s Performance counter stats for 'system wide': -S0-D0-C0 1 0.02 Joules power_per_core/energy-per-core/ -S0-D0-C1 1 5.72 Joules power_per_core/energy-per-core/ -S0-D0-C2 1 0.02 Joules power_per_core/energy-per-core/ -S0-D0-C3 1 0.02 Joules power_per_core/energy-per-core/ -S0-D0-C4 1 0.02 Joules power_per_core/energy-per-core/ -S0-D0-C5 1 0.02 Joules power_per_core/energy-per-core/ -S0-D0-C6 1 0.02 Joules power_per_core/energy-per-core/ -S0-D0-C7 1 0.02 Joules power_per_core/energy-per-core/ -S0-D0-C8 1 0.02 Joules power_per_core/energy-per-core/ -S0-D0-C9 1 0.02 Joules power_per_core/energy-per-core/ -S0-D0-C10 1 0.02 Joules power_per_core/energy-per-core/ +S0-D0-C0 1 0.00 Joules power_core/energy-core/ +S0-D0-C1 1 0.00 Joules power_core/energy-core/ +S0-D0-C2 1 0.00 Joules power_core/energy-core/ +S0-D0-C3 1 0.00 Joules power_core/energy-core/ +S0-D0-C4 1 8.43 Joules power_core/energy-core/ +S0-D0-C5 1 0.00 Joules power_core/energy-core/ +S0-D0-C6 1 0.00 Joules power_core/energy-core/ +S0-D0-C7 1 0.00 Joules power_core/energy-core/ +S0-D1-C8 1 0.00 Joules power_core/energy-core/ +S0-D1-C9 1 0.00 Joules power_core/energy-core/ +S0-D1-C10 1 0.00 Joules power_core/energy-core/ Signed-off-by: Dhananjay Ugwekar +Reviewed-by: Gautham R. Shenoy --- - arch/x86/events/rapl.c | 178 +++++++++++++++++++++++++++++++++-------- - 1 file changed, 143 insertions(+), 35 deletions(-) + arch/x86/events/rapl.c | 185 +++++++++++++++++++++++++++++++++-------- + 1 file changed, 152 insertions(+), 33 deletions(-) --- a/arch/x86/events/rapl.c +++ b/arch/x86/events/rapl.c @@ -41,8 +45,8 @@ Signed-off-by: Dhananjay Ugwekar * event: rapl_energy_psys * perf code: 0x5 * -+ * per_core counter: consumption of a single physical core -+ * event: rapl_energy_per_core (power_per_core PMU) ++ * core counter: consumption of a single physical core ++ * event: rapl_energy_core (power_core PMU) + * perf code: 0x1 + * * We manage those counters as free running (read-only). They may be @@ -52,7 +56,7 @@ Signed-off-by: Dhananjay Ugwekar NR_RAPL_PKG_DOMAINS = PERF_RAPL_PKG_EVENTS_MAX, }; -+#define PERF_RAPL_PER_CORE 0 /* per-core */ ++#define PERF_RAPL_CORE 0 /* single core */ +#define PERF_RAPL_CORE_EVENTS_MAX 1 +#define NR_RAPL_CORE_DOMAINS PERF_RAPL_CORE_EVENTS_MAX + @@ -63,12 +67,12 @@ Signed-off-by: Dhananjay Ugwekar "psys", }; -+static const char *const rapl_core_domain_name __initconst = "per-core"; ++static const char *const rapl_core_domain_name __initconst = "core"; + /* * event code: LSB 8 bits, passed in attr->config * any other bit is reserved -@@ -128,14 +138,18 @@ enum rapl_unit_quirk { +@@ -141,14 +151,18 @@ enum rapl_unit_quirk { struct rapl_model { struct perf_msr *rapl_pkg_msrs; @@ -87,25 +91,35 @@ Signed-off-by: Dhananjay Ugwekar static u64 rapl_timer_ms; static struct rapl_model *rapl_model; -@@ -156,10 +170,14 @@ static struct rapl_model *rapl_model; +@@ -156,14 +170,23 @@ static struct rapl_model *rapl_model; * Helper function to get the correct topology id according to the * RAPL PMU scope. */ -static inline unsigned int get_rapl_pmu_idx(int cpu) +-{ /* +static inline unsigned int get_rapl_pmu_idx(int cpu, int scope) - { ++{ ++ /* + * Returns unsigned int, which converts the '-1' return value + * (for non-existent mappings in topology map) to UINT_MAX, so + * the error check in the caller is simplified. + */ - return rapl_pkg_pmu_is_pkg_scope() ? topology_logical_package_id(cpu) : -- topology_logical_die_id(cpu); -+ if (scope == PERF_PMU_SCOPE_PKG) +- topology_logical_die_id(cpu); ++ switch (scope) { ++ case PERF_PMU_SCOPE_PKG: + return topology_logical_package_id(cpu); -+ else if (scope == PERF_PMU_SCOPE_DIE) ++ case PERF_PMU_SCOPE_DIE: + return topology_logical_die_id(cpu); -+ else ++ case PERF_PMU_SCOPE_CORE: + return topology_logical_core_id(cpu); ++ default: ++ return -EINVAL; ++ } } static inline u64 rapl_read_counter(struct perf_event *event) -@@ -169,19 +187,20 @@ static inline u64 rapl_read_counter(stru +@@ -173,19 +196,20 @@ static inline u64 rapl_read_counter(stru return raw; } @@ -132,7 +146,7 @@ Signed-off-by: Dhananjay Ugwekar } static u64 rapl_event_update(struct perf_event *event) -@@ -208,7 +227,7 @@ static u64 rapl_event_update(struct perf +@@ -212,7 +236,7 @@ static u64 rapl_event_update(struct perf delta = (new_raw_count << shift) - (prev_raw_count << shift); delta >>= shift; @@ -141,13 +155,14 @@ Signed-off-by: Dhananjay Ugwekar local64_add(sdelta, &event->count); -@@ -337,12 +356,13 @@ static void rapl_pmu_event_del(struct pe +@@ -341,13 +365,14 @@ static void rapl_pmu_event_del(struct pe static int rapl_pmu_event_init(struct perf_event *event) { u64 cfg = event->attr.config & RAPL_EVENT_MASK; -- int bit, rapl_pmu_idx, ret = 0; -+ int bit, rapl_pmus_scope, rapl_pmu_idx, ret = 0; +- int bit, ret = 0; ++ int bit, rapl_pmus_scope, ret = 0; struct rapl_pmu *rapl_pmu; + unsigned int rapl_pmu_idx; + struct rapl_pmus *rapl_pmus; - /* only look at RAPL events */ @@ -159,7 +174,7 @@ Signed-off-by: Dhananjay Ugwekar /* check only supported bits are set */ if (event->attr.config & ~RAPL_EVENT_MASK) -@@ -351,31 +371,49 @@ static int rapl_pmu_event_init(struct pe +@@ -356,31 +381,49 @@ static int rapl_pmu_event_init(struct pe if (event->cpu < 0) return -EINVAL; @@ -186,7 +201,7 @@ Signed-off-by: Dhananjay Ugwekar + bit = cfg - 1; + event->hw.event_base = rapl_model->rapl_pkg_msrs[bit].msr; + } else if (rapl_pmus_scope == PERF_PMU_SCOPE_CORE) { -+ /* only look at RAPL per-core events */ ++ /* only look at RAPL core events */ + if (event->attr.type != rapl_pmus_core->pmu.type) + return -ENOENT; + @@ -222,34 +237,34 @@ Signed-off-by: Dhananjay Ugwekar event->hw.config = cfg; event->hw.idx = bit; -@@ -392,12 +430,14 @@ RAPL_EVENT_ATTR_STR(energy-pkg , rapl +@@ -397,12 +440,14 @@ RAPL_EVENT_ATTR_STR(energy-pkg , rapl RAPL_EVENT_ATTR_STR(energy-ram , rapl_ram, "event=0x03"); RAPL_EVENT_ATTR_STR(energy-gpu , rapl_gpu, "event=0x04"); RAPL_EVENT_ATTR_STR(energy-psys, rapl_psys, "event=0x05"); -+RAPL_EVENT_ATTR_STR(energy-per-core, rapl_per_core, "event=0x01"); ++RAPL_EVENT_ATTR_STR(energy-core, rapl_core, "event=0x01"); RAPL_EVENT_ATTR_STR(energy-cores.unit, rapl_cores_unit, "Joules"); RAPL_EVENT_ATTR_STR(energy-pkg.unit , rapl_pkg_unit, "Joules"); RAPL_EVENT_ATTR_STR(energy-ram.unit , rapl_ram_unit, "Joules"); RAPL_EVENT_ATTR_STR(energy-gpu.unit , rapl_gpu_unit, "Joules"); RAPL_EVENT_ATTR_STR(energy-psys.unit, rapl_psys_unit, "Joules"); -+RAPL_EVENT_ATTR_STR(energy-per-core.unit, rapl_per_core_unit, "Joules"); ++RAPL_EVENT_ATTR_STR(energy-core.unit, rapl_core_unit, "Joules"); /* * we compute in 0.23 nJ increments regardless of MSR -@@ -407,6 +447,7 @@ RAPL_EVENT_ATTR_STR(energy-pkg.scale, +@@ -412,6 +457,7 @@ RAPL_EVENT_ATTR_STR(energy-pkg.scale, RAPL_EVENT_ATTR_STR(energy-ram.scale, rapl_ram_scale, "2.3283064365386962890625e-10"); RAPL_EVENT_ATTR_STR(energy-gpu.scale, rapl_gpu_scale, "2.3283064365386962890625e-10"); RAPL_EVENT_ATTR_STR(energy-psys.scale, rapl_psys_scale, "2.3283064365386962890625e-10"); -+RAPL_EVENT_ATTR_STR(energy-per-core.scale, rapl_per_core_scale, "2.3283064365386962890625e-10"); ++RAPL_EVENT_ATTR_STR(energy-core.scale, rapl_core_scale, "2.3283064365386962890625e-10"); /* * There are no default events, but we need to create -@@ -439,6 +480,12 @@ static const struct attribute_group *rap +@@ -444,6 +490,12 @@ static const struct attribute_group *rap NULL, }; -+static const struct attribute_group *rapl_per_core_attr_groups[] = { ++static const struct attribute_group *rapl_core_attr_groups[] = { + &rapl_pmu_format_group, + &rapl_pmu_events_group, + NULL, @@ -258,38 +273,38 @@ Signed-off-by: Dhananjay Ugwekar static struct attribute *rapl_events_cores[] = { EVENT_PTR(rapl_cores), EVENT_PTR(rapl_cores_unit), -@@ -499,6 +546,18 @@ static struct attribute_group rapl_event +@@ -504,6 +556,18 @@ static struct attribute_group rapl_event .attrs = rapl_events_psys, }; -+static struct attribute *rapl_events_per_core[] = { -+ EVENT_PTR(rapl_per_core), -+ EVENT_PTR(rapl_per_core_unit), -+ EVENT_PTR(rapl_per_core_scale), ++static struct attribute *rapl_events_core[] = { ++ EVENT_PTR(rapl_core), ++ EVENT_PTR(rapl_core_unit), ++ EVENT_PTR(rapl_core_scale), + NULL, +}; + -+static struct attribute_group rapl_events_per_core_group = { ++static struct attribute_group rapl_events_core_group = { + .name = "events", -+ .attrs = rapl_events_per_core, ++ .attrs = rapl_events_core, +}; + static bool test_msr(int idx, void *data) { return test_bit(idx, (unsigned long *) data); -@@ -536,6 +595,11 @@ static struct perf_msr amd_rapl_pkg_msrs +@@ -541,6 +605,11 @@ static struct perf_msr amd_rapl_pkg_msrs [PERF_RAPL_PSYS] = { 0, &rapl_events_psys_group, NULL, false, 0 }, }; +static struct perf_msr amd_rapl_core_msrs[] = { -+ [PERF_RAPL_PER_CORE] = { MSR_AMD_CORE_ENERGY_STATUS, &rapl_events_per_core_group, ++ [PERF_RAPL_CORE] = { MSR_AMD_CORE_ENERGY_STATUS, &rapl_events_core_group, + test_msr, false, RAPL_MSR_MASK }, +}; + static int rapl_check_hw_unit(void) { u64 msr_rapl_power_unit_bits; -@@ -547,6 +611,8 @@ static int rapl_check_hw_unit(void) +@@ -552,6 +621,8 @@ static int rapl_check_hw_unit(void) for (i = 0; i < NR_RAPL_PKG_DOMAINS; i++) rapl_pkg_hw_unit[i] = (msr_rapl_power_unit_bits >> 8) & 0x1FULL; @@ -298,7 +313,7 @@ Signed-off-by: Dhananjay Ugwekar switch (rapl_model->unit_quirk) { /* * DRAM domain on HSW server and KNL has fixed energy unit which can be -@@ -565,7 +631,6 @@ static int rapl_check_hw_unit(void) +@@ -570,7 +641,6 @@ static int rapl_check_hw_unit(void) break; } @@ -306,7 +321,7 @@ Signed-off-by: Dhananjay Ugwekar /* * Calculate the timer rate: * Use reference of 200W for scaling the timeout to avoid counter -@@ -584,9 +649,13 @@ static int rapl_check_hw_unit(void) +@@ -589,9 +659,13 @@ static int rapl_check_hw_unit(void) static void __init rapl_advertise(void) { int i; @@ -321,42 +336,30 @@ Signed-off-by: Dhananjay Ugwekar for (i = 0; i < NR_RAPL_PKG_DOMAINS; i++) { if (rapl_pmus_pkg->cntr_mask & (1 << i)) { -@@ -594,6 +663,10 @@ static void __init rapl_advertise(void) +@@ -599,6 +673,10 @@ static void __init rapl_advertise(void) rapl_pkg_domain_names[i], rapl_pkg_hw_unit[i]); } } + -+ if (rapl_pmus_core && (rapl_pmus_core->cntr_mask & (1 << PERF_RAPL_PER_CORE))) ++ if (rapl_pmus_core && (rapl_pmus_core->cntr_mask & (1 << PERF_RAPL_CORE))) + pr_info("hw unit of domain %s 2^-%d Joules\n", + rapl_core_domain_name, rapl_core_hw_unit); } static void cleanup_rapl_pmus(struct rapl_pmus *rapl_pmus) -@@ -614,6 +687,10 @@ static const struct attribute_group *rap +@@ -619,6 +697,10 @@ static const struct attribute_group *rap NULL, }; -+static const struct attribute_group *rapl_per_core_attr_update[] = { -+ &rapl_events_per_core_group, ++static const struct attribute_group *rapl_core_attr_update[] = { ++ &rapl_events_core_group, +}; + - static void __init init_rapl_pmu(struct rapl_pmus *rapl_pmus) + static int __init init_rapl_pmu(struct rapl_pmus *rapl_pmus) { struct rapl_pmu *rapl_pmu; -@@ -622,10 +699,9 @@ static void __init init_rapl_pmu(struct - cpus_read_lock(); - - for_each_cpu(cpu, cpu_online_mask) { -- rapl_pmu_idx = get_rapl_pmu_idx(cpu); -+ rapl_pmu_idx = get_rapl_pmu_idx(cpu, rapl_pmus->pmu.scope); - if (rapl_pmu_idx >= rapl_pmus->nr_rapl_pmu) - continue; -- - rapl_pmu = rapl_pmus->rapl_pmu[rapl_pmu_idx]; - if (rapl_pmu) - continue; -@@ -644,15 +720,19 @@ static void __init init_rapl_pmu(struct - cpus_read_unlock(); +@@ -645,13 +727,22 @@ free: + return -ENOMEM; } -static int __init init_rapl_pmus(struct rapl_pmus **rapl_pmus_ptr, int rapl_pmu_scope) @@ -364,31 +367,33 @@ Signed-off-by: Dhananjay Ugwekar + const struct attribute_group **rapl_attr_groups, + const struct attribute_group **rapl_attr_update) { - int nr_rapl_pmu; + int nr_rapl_pmu = topology_max_packages(); struct rapl_pmus *rapl_pmus; - if (rapl_pmu_scope == PERF_PMU_SCOPE_PKG) - nr_rapl_pmu = topology_max_packages(); -- else -+ else if (rapl_pmu_scope == PERF_PMU_SCOPE_DIE) - nr_rapl_pmu = topology_max_packages() * topology_max_dies_per_package(); -+ else -+ nr_rapl_pmu = topology_max_packages() * topology_num_cores_per_package(); ++ /* ++ * rapl_pmu_scope must be either PKG, DIE or CORE ++ */ + if (rapl_pmu_scope == PERF_PMU_SCOPE_DIE) + nr_rapl_pmu *= topology_max_dies_per_package(); ++ else if (rapl_pmu_scope == PERF_PMU_SCOPE_CORE) ++ nr_rapl_pmu *= topology_num_cores_per_package(); ++ else if (rapl_pmu_scope != PERF_PMU_SCOPE_PKG) ++ return -EINVAL; rapl_pmus = kzalloc(struct_size(rapl_pmus, rapl_pmu, nr_rapl_pmu), GFP_KERNEL); if (!rapl_pmus) -@@ -743,8 +823,10 @@ static struct rapl_model model_spr = { +@@ -740,8 +831,10 @@ static struct rapl_model model_spr = { static struct rapl_model model_amd_hygon = { .pkg_events = BIT(PERF_RAPL_PKG), -+ .core_events = BIT(PERF_RAPL_PER_CORE), ++ .core_events = BIT(PERF_RAPL_CORE), .msr_power_unit = MSR_AMD_RAPL_POWER_UNIT, .rapl_pkg_msrs = amd_rapl_pkg_msrs, + .rapl_core_msrs = amd_rapl_core_msrs, }; static const struct x86_cpu_id rapl_model_match[] __initconst = { -@@ -816,7 +898,8 @@ static int __init rapl_pmu_init(void) +@@ -813,7 +906,8 @@ static int __init rapl_pmu_init(void) if (ret) return ret; @@ -398,35 +403,35 @@ Signed-off-by: Dhananjay Ugwekar if (ret) return ret; -@@ -828,6 +911,27 @@ static int __init rapl_pmu_init(void) +@@ -825,6 +919,27 @@ static int __init rapl_pmu_init(void) if (ret) goto out; + if (rapl_model->core_events) { + ret = init_rapl_pmus(&rapl_pmus_core, PERF_PMU_SCOPE_CORE, -+ rapl_per_core_attr_groups, -+ rapl_per_core_attr_update); ++ rapl_core_attr_groups, ++ rapl_core_attr_update); + if (ret) { -+ pr_warn("Per-core PMU initialization failed (%d)\n", ret); -+ goto per_core_init_failed; ++ pr_warn("power-core PMU initialization failed (%d)\n", ret); ++ goto core_init_failed; + } + + rapl_pmus_core->cntr_mask = perf_msr_probe(rapl_model->rapl_core_msrs, + PERF_RAPL_CORE_EVENTS_MAX, false, + (void *) &rapl_model->core_events); + -+ ret = perf_pmu_register(&rapl_pmus_core->pmu, "power_per_core", -1); ++ ret = perf_pmu_register(&rapl_pmus_core->pmu, "power_core", -1); + if (ret) { -+ pr_warn("Per-core PMU registration failed (%d)\n", ret); ++ pr_warn("power-core PMU registration failed (%d)\n", ret); + cleanup_rapl_pmus(rapl_pmus_core); + } + } + -+per_core_init_failed: ++core_init_failed: rapl_advertise(); return 0; -@@ -840,6 +944,10 @@ module_init(rapl_pmu_init); +@@ -837,6 +952,10 @@ module_init(rapl_pmu_init); static void __exit intel_rapl_exit(void) { diff --git a/debian/patches/patchset-pf/amd-rapl/0013-amd-rapl-6.12-fix-clang-built-kernel-not-booting.patch b/debian/patches/patchset-pf/amd-rapl/0013-amd-rapl-6.12-fix-clang-built-kernel-not-booting.patch new file mode 100644 index 0000000..cbf371e --- /dev/null +++ b/debian/patches/patchset-pf/amd-rapl/0013-amd-rapl-6.12-fix-clang-built-kernel-not-booting.patch @@ -0,0 +1,21 @@ +From c66779234fa7ba71cefa1c4eb283db53a3cb5303 Mon Sep 17 00:00:00 2001 +From: Oleksandr Natalenko +Date: Sat, 23 Nov 2024 12:45:28 +0100 +Subject: amd-rapl-6.12: fix clang-built kernel not booting + +Link: https://lore.kernel.org/lkml/7eaf557d-7e85-4fd3-abee-f84ac01d92c1@amd.com/ +Signed-off-by: Oleksandr Natalenko +--- + arch/x86/events/rapl.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/x86/events/rapl.c ++++ b/arch/x86/events/rapl.c +@@ -699,6 +699,7 @@ static const struct attribute_group *rap + + static const struct attribute_group *rapl_core_attr_update[] = { + &rapl_events_core_group, ++ NULL, + }; + + static int __init init_rapl_pmu(struct rapl_pmus *rapl_pmus) diff --git a/debian/patches/patchset-pf/cpuidle/0001-cpuidle-menu-Remove-iowait-influence.patch b/debian/patches/patchset-pf/cpuidle/0001-cpuidle-menu-Remove-iowait-influence.patch index 01dacc3..85c5208 100644 --- a/debian/patches/patchset-pf/cpuidle/0001-cpuidle-menu-Remove-iowait-influence.patch +++ b/debian/patches/patchset-pf/cpuidle/0001-cpuidle-menu-Remove-iowait-influence.patch @@ -1,26 +1,35 @@ -From d31e903a364802c068ff23bdd448cc70eda71a7c Mon Sep 17 00:00:00 2001 +From 3d722d5259babc1650ab6cb1a8bbf27863af75f2 Mon Sep 17 00:00:00 2001 From: Christian Loehle Date: Thu, 5 Sep 2024 10:26:38 +0100 Subject: cpuidle: menu: Remove iowait influence Remove CPU iowaiters influence on idle state selection. + Remove the menu notion of performance multiplier which increased with the number of tasks that went to iowait sleep on this CPU and haven't woken up yet. Relying on iowait for cpuidle is problematic for a few reasons: -1. There is no guarantee that an iowaiting task will wake up on the -same CPU. -2. The task being in iowait says nothing about the idle duration, we -could be selecting shallower states for a long time. -3. The task being in iowait doesn't always imply a performance hit -with increased latency. -4. If there is such a performance hit, the number of iowaiting tasks -doesn't directly correlate. -5. The definition of iowait altogether is vague at best, it is -sprinkled across kernel code. + + 1. There is no guarantee that an iowaiting task will wake up on the + same CPU. + + 2. The task being in iowait says nothing about the idle duration, we + could be selecting shallower states for a long time. + + 3. The task being in iowait doesn't always imply a performance hit + with increased latency. + + 4. If there is such a performance hit, the number of iowaiting tasks + doesn't directly correlate. + + 5. The definition of iowait altogether is vague at best, it is + sprinkled across kernel code. Signed-off-by: Christian Loehle +Link: https://patch.msgid.link/20240905092645.2885200-2-christian.loehle@arm.com +[ rjw: Minor edits in the changelog ] +Signed-off-by: Rafael J. Wysocki --- drivers/cpuidle/governors/menu.c | 76 ++++---------------------------- 1 file changed, 9 insertions(+), 67 deletions(-) diff --git a/debian/patches/patchset-pf/cpuidle/0002-cpuidle-Prefer-teo-over-menu-governor.patch b/debian/patches/patchset-pf/cpuidle/0002-cpuidle-Prefer-teo-over-menu-governor.patch index d32e22a..2cda6f9 100644 --- a/debian/patches/patchset-pf/cpuidle/0002-cpuidle-Prefer-teo-over-menu-governor.patch +++ b/debian/patches/patchset-pf/cpuidle/0002-cpuidle-Prefer-teo-over-menu-governor.patch @@ -1,4 +1,4 @@ -From 3f840a42780323a4437dd1a417488d141c33af15 Mon Sep 17 00:00:00 2001 +From 4c13cc86a7d9f1e88e8090a94c792eb45d7ef1ef Mon Sep 17 00:00:00 2001 From: Christian Loehle Date: Thu, 5 Sep 2024 10:26:39 +0100 Subject: cpuidle: Prefer teo over menu governor diff --git a/debian/patches/patchset-pf/cpuidle/0003-TEST-cpufreq-schedutil-Linear-iowait-boost-step.patch b/debian/patches/patchset-pf/cpuidle/0003-TEST-cpufreq-schedutil-Linear-iowait-boost-step.patch deleted file mode 100644 index cc7e290..0000000 --- a/debian/patches/patchset-pf/cpuidle/0003-TEST-cpufreq-schedutil-Linear-iowait-boost-step.patch +++ /dev/null @@ -1,39 +0,0 @@ -From ca8c9368b6f28ef625716b03aa930acfb8afe158 Mon Sep 17 00:00:00 2001 -From: Christian Loehle -Date: Thu, 5 Sep 2024 10:26:40 +0100 -Subject: TEST: cpufreq/schedutil: Linear iowait boost step - -In preparation for capping iowait boost make the steps linear as -opposed to doubling. - -Signed-off-by: Christian Loehle ---- - kernel/sched/cpufreq_schedutil.c | 9 ++++----- - 1 file changed, 4 insertions(+), 5 deletions(-) - ---- a/kernel/sched/cpufreq_schedutil.c -+++ b/kernel/sched/cpufreq_schedutil.c -@@ -267,7 +267,8 @@ static void sugov_iowait_boost(struct su - /* Double the boost at each request */ - if (sg_cpu->iowait_boost) { - sg_cpu->iowait_boost = -- min_t(unsigned int, sg_cpu->iowait_boost << 1, SCHED_CAPACITY_SCALE); -+ min_t(unsigned int, -+ sg_cpu->iowait_boost + IOWAIT_BOOST_MIN, SCHED_CAPACITY_SCALE); - return; - } - -@@ -308,11 +309,9 @@ static unsigned long sugov_iowait_apply( - /* - * No boost pending; reduce the boost value. - */ -- sg_cpu->iowait_boost >>= 1; -- if (sg_cpu->iowait_boost < IOWAIT_BOOST_MIN) { -- sg_cpu->iowait_boost = 0; -+ sg_cpu->iowait_boost -= IOWAIT_BOOST_MIN; -+ if (!sg_cpu->iowait_boost) - return 0; -- } - } - - sg_cpu->iowait_boost_pending = false; diff --git a/debian/patches/patchset-pf/cpuidle/0004-TEST-cpufreq-schedutil-iowait-boost-cap-sysfs.patch b/debian/patches/patchset-pf/cpuidle/0004-TEST-cpufreq-schedutil-iowait-boost-cap-sysfs.patch deleted file mode 100644 index 288c7e9..0000000 --- a/debian/patches/patchset-pf/cpuidle/0004-TEST-cpufreq-schedutil-iowait-boost-cap-sysfs.patch +++ /dev/null @@ -1,106 +0,0 @@ -From 33f05bd16a4ac2f6f36c9eb88016e2375dcb597c Mon Sep 17 00:00:00 2001 -From: Christian Loehle -Date: Thu, 5 Sep 2024 10:26:41 +0100 -Subject: TEST: cpufreq/schedutil: iowait boost cap sysfs - -Add a knob to cap applied iowait_boost per sysfs. -This is to test for potential regressions. - -Signed-off-by: Christian Loehle ---- - kernel/sched/cpufreq_schedutil.c | 38 ++++++++++++++++++++++++++++++++ - 1 file changed, 38 insertions(+) - ---- a/kernel/sched/cpufreq_schedutil.c -+++ b/kernel/sched/cpufreq_schedutil.c -@@ -11,6 +11,7 @@ - struct sugov_tunables { - struct gov_attr_set attr_set; - unsigned int rate_limit_us; -+ unsigned int iowait_boost_cap; - }; - - struct sugov_policy { -@@ -35,6 +36,8 @@ struct sugov_policy { - - bool limits_changed; - bool need_freq_update; -+ -+ unsigned int iowait_boost_cap; - }; - - struct sugov_cpu { -@@ -316,6 +319,9 @@ static unsigned long sugov_iowait_apply( - - sg_cpu->iowait_boost_pending = false; - -+ if (sg_cpu->iowait_boost > sg_cpu->sg_policy->iowait_boost_cap) -+ sg_cpu->iowait_boost = sg_cpu->sg_policy->iowait_boost_cap; -+ - /* - * sg_cpu->util is already in capacity scale; convert iowait_boost - * into the same scale so we can compare. -@@ -554,6 +560,14 @@ static ssize_t rate_limit_us_show(struct - return sprintf(buf, "%u\n", tunables->rate_limit_us); - } - -+ -+static ssize_t iowait_boost_cap_show(struct gov_attr_set *attr_set, char *buf) -+{ -+ struct sugov_tunables *tunables = to_sugov_tunables(attr_set); -+ -+ return sprintf(buf, "%u\n", tunables->iowait_boost_cap); -+} -+ - static ssize_t - rate_limit_us_store(struct gov_attr_set *attr_set, const char *buf, size_t count) - { -@@ -572,10 +586,30 @@ rate_limit_us_store(struct gov_attr_set - return count; - } - -+static ssize_t -+iowait_boost_cap_store(struct gov_attr_set *attr_set, const char *buf, size_t count) -+{ -+ struct sugov_tunables *tunables = to_sugov_tunables(attr_set); -+ struct sugov_policy *sg_policy; -+ unsigned int iowait_boost_cap; -+ -+ if (kstrtouint(buf, 10, &iowait_boost_cap)) -+ return -EINVAL; -+ -+ tunables->iowait_boost_cap = iowait_boost_cap; -+ -+ list_for_each_entry(sg_policy, &attr_set->policy_list, tunables_hook) -+ sg_policy->iowait_boost_cap = iowait_boost_cap; -+ -+ return count; -+} -+ - static struct governor_attr rate_limit_us = __ATTR_RW(rate_limit_us); -+static struct governor_attr iowait_boost_cap = __ATTR_RW(iowait_boost_cap); - - static struct attribute *sugov_attrs[] = { - &rate_limit_us.attr, -+ &iowait_boost_cap.attr, - NULL - }; - ATTRIBUTE_GROUPS(sugov); -@@ -765,6 +799,8 @@ static int sugov_init(struct cpufreq_pol - - tunables->rate_limit_us = cpufreq_policy_transition_delay_us(policy); - -+ tunables->iowait_boost_cap = SCHED_CAPACITY_SCALE; -+ - policy->governor_data = sg_policy; - sg_policy->tunables = tunables; - -@@ -833,6 +869,8 @@ static int sugov_start(struct cpufreq_po - sg_policy->limits_changed = false; - sg_policy->cached_raw_freq = 0; - -+ sg_policy->iowait_boost_cap = SCHED_CAPACITY_SCALE; -+ - sg_policy->need_freq_update = cpufreq_driver_test_flags(CPUFREQ_NEED_UPDATE_LIMITS); - - if (policy_is_shared(policy)) diff --git a/debian/patches/patchset-pf/cpuidle/0005-cpufreq-schedutil-Remove-iowait-boost.patch b/debian/patches/patchset-pf/cpuidle/0005-cpufreq-schedutil-Remove-iowait-boost.patch deleted file mode 100644 index 365699b..0000000 --- a/debian/patches/patchset-pf/cpuidle/0005-cpufreq-schedutil-Remove-iowait-boost.patch +++ /dev/null @@ -1,325 +0,0 @@ -From 33eb6c08d7c615fad308001921c7b1148cbccfde Mon Sep 17 00:00:00 2001 -From: Christian Loehle -Date: Thu, 5 Sep 2024 10:26:42 +0100 -Subject: cpufreq/schedutil: Remove iowait boost - -iowait boost in schedutil was introduced by -commit ("21ca6d2c52f8 cpufreq: schedutil: Add iowait boosting"). -with it more or less following intel_pstate's approach to increase -frequency after an iowait wakeup. -Behaviour that is piggy-backed onto iowait boost is problematic -due to a lot of reasons, so remove it. - -For schedutil specifically these are some of the reasons: -1. Boosting is applied even in scenarios where it doesn't improve -throughput. -2. The boost is not accounted for in EAS: a) feec() will only consider - the actual task utilization for task placement, but another CPU might - be more energy-efficient at that capacity than the boosted one.) - b) When placing a non-IO task while a CPU is boosted compute_energy() - assumes a lower OPP than what is actually applied. This leads to - wrong EAS decisions. -3. Actual IO heavy workloads are hardly distinguished from infrequent -in_iowait wakeups. -4. The boost isn't accounted for in task placement. -5. The boost isn't associated with a task, it therefore lingers on the -rq even after the responsible task has migrated / stopped. -6. The boost isn't associated with a task, it therefore needs to ramp -up again when migrated. -7. Since schedutil doesn't know which task is getting woken up, -multiple unrelated in_iowait tasks lead to boosting. -8. Boosting is hard to control with UCLAMP_MAX (which is only active -when the task is on the rq, which for boosted tasks is usually not -the case for most of the time). - -One benefit of schedutil specifically is the reliance on the -scheduler's utilization signals, which have evolved a lot since it's -original introduction. Some cases that benefitted from iowait boosting -in the past can now be covered by e.g. util_est. - -Signed-off-by: Christian Loehle ---- - kernel/sched/cpufreq_schedutil.c | 181 +------------------------------ - 1 file changed, 3 insertions(+), 178 deletions(-) - ---- a/kernel/sched/cpufreq_schedutil.c -+++ b/kernel/sched/cpufreq_schedutil.c -@@ -6,12 +6,9 @@ - * Author: Rafael J. Wysocki - */ - --#define IOWAIT_BOOST_MIN (SCHED_CAPACITY_SCALE / 8) -- - struct sugov_tunables { - struct gov_attr_set attr_set; - unsigned int rate_limit_us; -- unsigned int iowait_boost_cap; - }; - - struct sugov_policy { -@@ -36,8 +33,6 @@ struct sugov_policy { - - bool limits_changed; - bool need_freq_update; -- -- unsigned int iowait_boost_cap; - }; - - struct sugov_cpu { -@@ -45,10 +40,6 @@ struct sugov_cpu { - struct sugov_policy *sg_policy; - unsigned int cpu; - -- bool iowait_boost_pending; -- unsigned int iowait_boost; -- u64 last_update; -- - unsigned long util; - unsigned long bw_min; - -@@ -198,137 +189,15 @@ unsigned long sugov_effective_cpu_perf(i - return max(min, max); - } - --static void sugov_get_util(struct sugov_cpu *sg_cpu, unsigned long boost) -+static void sugov_get_util(struct sugov_cpu *sg_cpu) - { - unsigned long min, max, util = cpu_util_cfs_boost(sg_cpu->cpu); - - util = effective_cpu_util(sg_cpu->cpu, util, &min, &max); -- util = max(util, boost); - sg_cpu->bw_min = min; - sg_cpu->util = sugov_effective_cpu_perf(sg_cpu->cpu, util, min, max); - } - --/** -- * sugov_iowait_reset() - Reset the IO boost status of a CPU. -- * @sg_cpu: the sugov data for the CPU to boost -- * @time: the update time from the caller -- * @set_iowait_boost: true if an IO boost has been requested -- * -- * The IO wait boost of a task is disabled after a tick since the last update -- * of a CPU. If a new IO wait boost is requested after more then a tick, then -- * we enable the boost starting from IOWAIT_BOOST_MIN, which improves energy -- * efficiency by ignoring sporadic wakeups from IO. -- */ --static bool sugov_iowait_reset(struct sugov_cpu *sg_cpu, u64 time, -- bool set_iowait_boost) --{ -- s64 delta_ns = time - sg_cpu->last_update; -- -- /* Reset boost only if a tick has elapsed since last request */ -- if (delta_ns <= TICK_NSEC) -- return false; -- -- sg_cpu->iowait_boost = set_iowait_boost ? IOWAIT_BOOST_MIN : 0; -- sg_cpu->iowait_boost_pending = set_iowait_boost; -- -- return true; --} -- --/** -- * sugov_iowait_boost() - Updates the IO boost status of a CPU. -- * @sg_cpu: the sugov data for the CPU to boost -- * @time: the update time from the caller -- * @flags: SCHED_CPUFREQ_IOWAIT if the task is waking up after an IO wait -- * -- * Each time a task wakes up after an IO operation, the CPU utilization can be -- * boosted to a certain utilization which doubles at each "frequent and -- * successive" wakeup from IO, ranging from IOWAIT_BOOST_MIN to the utilization -- * of the maximum OPP. -- * -- * To keep doubling, an IO boost has to be requested at least once per tick, -- * otherwise we restart from the utilization of the minimum OPP. -- */ --static void sugov_iowait_boost(struct sugov_cpu *sg_cpu, u64 time, -- unsigned int flags) --{ -- bool set_iowait_boost = flags & SCHED_CPUFREQ_IOWAIT; -- -- /* Reset boost if the CPU appears to have been idle enough */ -- if (sg_cpu->iowait_boost && -- sugov_iowait_reset(sg_cpu, time, set_iowait_boost)) -- return; -- -- /* Boost only tasks waking up after IO */ -- if (!set_iowait_boost) -- return; -- -- /* Ensure boost doubles only one time at each request */ -- if (sg_cpu->iowait_boost_pending) -- return; -- sg_cpu->iowait_boost_pending = true; -- -- /* Double the boost at each request */ -- if (sg_cpu->iowait_boost) { -- sg_cpu->iowait_boost = -- min_t(unsigned int, -- sg_cpu->iowait_boost + IOWAIT_BOOST_MIN, SCHED_CAPACITY_SCALE); -- return; -- } -- -- /* First wakeup after IO: start with minimum boost */ -- sg_cpu->iowait_boost = IOWAIT_BOOST_MIN; --} -- --/** -- * sugov_iowait_apply() - Apply the IO boost to a CPU. -- * @sg_cpu: the sugov data for the cpu to boost -- * @time: the update time from the caller -- * @max_cap: the max CPU capacity -- * -- * A CPU running a task which woken up after an IO operation can have its -- * utilization boosted to speed up the completion of those IO operations. -- * The IO boost value is increased each time a task wakes up from IO, in -- * sugov_iowait_apply(), and it's instead decreased by this function, -- * each time an increase has not been requested (!iowait_boost_pending). -- * -- * A CPU which also appears to have been idle for at least one tick has also -- * its IO boost utilization reset. -- * -- * This mechanism is designed to boost high frequently IO waiting tasks, while -- * being more conservative on tasks which does sporadic IO operations. -- */ --static unsigned long sugov_iowait_apply(struct sugov_cpu *sg_cpu, u64 time, -- unsigned long max_cap) --{ -- /* No boost currently required */ -- if (!sg_cpu->iowait_boost) -- return 0; -- -- /* Reset boost if the CPU appears to have been idle enough */ -- if (sugov_iowait_reset(sg_cpu, time, false)) -- return 0; -- -- if (!sg_cpu->iowait_boost_pending) { -- /* -- * No boost pending; reduce the boost value. -- */ -- sg_cpu->iowait_boost -= IOWAIT_BOOST_MIN; -- if (!sg_cpu->iowait_boost) -- return 0; -- } -- -- sg_cpu->iowait_boost_pending = false; -- -- if (sg_cpu->iowait_boost > sg_cpu->sg_policy->iowait_boost_cap) -- sg_cpu->iowait_boost = sg_cpu->sg_policy->iowait_boost_cap; -- -- /* -- * sg_cpu->util is already in capacity scale; convert iowait_boost -- * into the same scale so we can compare. -- */ -- return (sg_cpu->iowait_boost * max_cap) >> SCHED_CAPACITY_SHIFT; --} -- - #ifdef CONFIG_NO_HZ_COMMON - static bool sugov_cpu_is_busy(struct sugov_cpu *sg_cpu) - { -@@ -356,18 +225,12 @@ static inline bool sugov_update_single_c - u64 time, unsigned long max_cap, - unsigned int flags) - { -- unsigned long boost; -- -- sugov_iowait_boost(sg_cpu, time, flags); -- sg_cpu->last_update = time; -- - ignore_dl_rate_limit(sg_cpu); - - if (!sugov_should_update_freq(sg_cpu->sg_policy, time)) - return false; - -- boost = sugov_iowait_apply(sg_cpu, time, max_cap); -- sugov_get_util(sg_cpu, boost); -+ sugov_get_util(sg_cpu); - - return true; - } -@@ -468,11 +331,8 @@ static unsigned int sugov_next_freq_shar - - for_each_cpu(j, policy->cpus) { - struct sugov_cpu *j_sg_cpu = &per_cpu(sugov_cpu, j); -- unsigned long boost; -- -- boost = sugov_iowait_apply(j_sg_cpu, time, max_cap); -- sugov_get_util(j_sg_cpu, boost); - -+ sugov_get_util(j_sg_cpu); - util = max(j_sg_cpu->util, util); - } - -@@ -488,9 +348,6 @@ sugov_update_shared(struct update_util_d - - raw_spin_lock(&sg_policy->update_lock); - -- sugov_iowait_boost(sg_cpu, time, flags); -- sg_cpu->last_update = time; -- - ignore_dl_rate_limit(sg_cpu); - - if (sugov_should_update_freq(sg_policy, time)) { -@@ -560,14 +417,6 @@ static ssize_t rate_limit_us_show(struct - return sprintf(buf, "%u\n", tunables->rate_limit_us); - } - -- --static ssize_t iowait_boost_cap_show(struct gov_attr_set *attr_set, char *buf) --{ -- struct sugov_tunables *tunables = to_sugov_tunables(attr_set); -- -- return sprintf(buf, "%u\n", tunables->iowait_boost_cap); --} -- - static ssize_t - rate_limit_us_store(struct gov_attr_set *attr_set, const char *buf, size_t count) - { -@@ -586,30 +435,10 @@ rate_limit_us_store(struct gov_attr_set - return count; - } - --static ssize_t --iowait_boost_cap_store(struct gov_attr_set *attr_set, const char *buf, size_t count) --{ -- struct sugov_tunables *tunables = to_sugov_tunables(attr_set); -- struct sugov_policy *sg_policy; -- unsigned int iowait_boost_cap; -- -- if (kstrtouint(buf, 10, &iowait_boost_cap)) -- return -EINVAL; -- -- tunables->iowait_boost_cap = iowait_boost_cap; -- -- list_for_each_entry(sg_policy, &attr_set->policy_list, tunables_hook) -- sg_policy->iowait_boost_cap = iowait_boost_cap; -- -- return count; --} -- - static struct governor_attr rate_limit_us = __ATTR_RW(rate_limit_us); --static struct governor_attr iowait_boost_cap = __ATTR_RW(iowait_boost_cap); - - static struct attribute *sugov_attrs[] = { - &rate_limit_us.attr, -- &iowait_boost_cap.attr, - NULL - }; - ATTRIBUTE_GROUPS(sugov); -@@ -799,8 +628,6 @@ static int sugov_init(struct cpufreq_pol - - tunables->rate_limit_us = cpufreq_policy_transition_delay_us(policy); - -- tunables->iowait_boost_cap = SCHED_CAPACITY_SCALE; -- - policy->governor_data = sg_policy; - sg_policy->tunables = tunables; - -@@ -869,8 +696,6 @@ static int sugov_start(struct cpufreq_po - sg_policy->limits_changed = false; - sg_policy->cached_raw_freq = 0; - -- sg_policy->iowait_boost_cap = SCHED_CAPACITY_SCALE; -- - sg_policy->need_freq_update = cpufreq_driver_test_flags(CPUFREQ_NEED_UPDATE_LIMITS); - - if (policy_is_shared(policy)) diff --git a/debian/patches/patchset-pf/cpuidle/0006-cpufreq-intel_pstate-Remove-iowait-boost.patch b/debian/patches/patchset-pf/cpuidle/0006-cpufreq-intel_pstate-Remove-iowait-boost.patch deleted file mode 100644 index c255931..0000000 --- a/debian/patches/patchset-pf/cpuidle/0006-cpufreq-intel_pstate-Remove-iowait-boost.patch +++ /dev/null @@ -1,113 +0,0 @@ -From af7bbb59c2411e985a5d79173af5686337b4af9b Mon Sep 17 00:00:00 2001 -From: Christian Loehle -Date: Thu, 5 Sep 2024 10:26:43 +0100 -Subject: cpufreq: intel_pstate: Remove iowait boost - -Analogous to schedutil, remove iowait boost for the same reasons. - -Signed-off-by: Christian Loehle ---- - drivers/cpufreq/intel_pstate.c | 50 ++-------------------------------- - 1 file changed, 3 insertions(+), 47 deletions(-) - ---- a/drivers/cpufreq/intel_pstate.c -+++ b/drivers/cpufreq/intel_pstate.c -@@ -191,7 +191,6 @@ struct global_params { - * @policy: CPUFreq policy value - * @update_util: CPUFreq utility callback information - * @update_util_set: CPUFreq utility callback is set -- * @iowait_boost: iowait-related boost fraction - * @last_update: Time of the last update. - * @pstate: Stores P state limits for this CPU - * @vid: Stores VID limits for this CPU -@@ -245,7 +244,6 @@ struct cpudata { - struct acpi_processor_performance acpi_perf_data; - bool valid_pss_table; - #endif -- unsigned int iowait_boost; - s16 epp_powersave; - s16 epp_policy; - s16 epp_default; -@@ -2136,28 +2134,7 @@ static inline void intel_pstate_update_u - { - cpu->sample.time = time; - -- if (cpu->sched_flags & SCHED_CPUFREQ_IOWAIT) { -- bool do_io = false; -- -- cpu->sched_flags = 0; -- /* -- * Set iowait_boost flag and update time. Since IO WAIT flag -- * is set all the time, we can't just conclude that there is -- * some IO bound activity is scheduled on this CPU with just -- * one occurrence. If we receive at least two in two -- * consecutive ticks, then we treat as boost candidate. -- */ -- if (time_before64(time, cpu->last_io_update + 2 * TICK_NSEC)) -- do_io = true; -- -- cpu->last_io_update = time; -- -- if (do_io) -- intel_pstate_hwp_boost_up(cpu); -- -- } else { -- intel_pstate_hwp_boost_down(cpu); -- } -+ intel_pstate_hwp_boost_down(cpu); - } - - static inline void intel_pstate_update_util_hwp(struct update_util_data *data, -@@ -2240,9 +2217,6 @@ static inline int32_t get_target_pstate( - busy_frac = div_fp(sample->mperf << cpu->aperf_mperf_shift, - sample->tsc); - -- if (busy_frac < cpu->iowait_boost) -- busy_frac = cpu->iowait_boost; -- - sample->busy_scaled = busy_frac * 100; - - target = READ_ONCE(global.no_turbo) ? -@@ -2303,7 +2277,7 @@ static void intel_pstate_adjust_pstate(s - sample->aperf, - sample->tsc, - get_avg_frequency(cpu), -- fp_toint(cpu->iowait_boost * 100)); -+ 0); - } - - static void intel_pstate_update_util(struct update_util_data *data, u64 time, -@@ -2317,24 +2291,6 @@ static void intel_pstate_update_util(str - return; - - delta_ns = time - cpu->last_update; -- if (flags & SCHED_CPUFREQ_IOWAIT) { -- /* Start over if the CPU may have been idle. */ -- if (delta_ns > TICK_NSEC) { -- cpu->iowait_boost = ONE_EIGHTH_FP; -- } else if (cpu->iowait_boost >= ONE_EIGHTH_FP) { -- cpu->iowait_boost <<= 1; -- if (cpu->iowait_boost > int_tofp(1)) -- cpu->iowait_boost = int_tofp(1); -- } else { -- cpu->iowait_boost = ONE_EIGHTH_FP; -- } -- } else if (cpu->iowait_boost) { -- /* Clear iowait_boost if the CPU may have been idle. */ -- if (delta_ns > TICK_NSEC) -- cpu->iowait_boost = 0; -- else -- cpu->iowait_boost >>= 1; -- } - cpu->last_update = time; - delta_ns = time - cpu->sample.time; - if ((s64)delta_ns < INTEL_PSTATE_SAMPLING_INTERVAL) -@@ -2832,7 +2788,7 @@ static void intel_cpufreq_trace(struct c - sample->aperf, - sample->tsc, - get_avg_frequency(cpu), -- fp_toint(cpu->iowait_boost * 100)); -+ 0); - } - - static void intel_cpufreq_hwp_update(struct cpudata *cpu, u32 min, u32 max, diff --git a/debian/patches/patchset-pf/cpuidle/0007-cpufreq-Remove-SCHED_CPUFREQ_IOWAIT-update.patch b/debian/patches/patchset-pf/cpuidle/0007-cpufreq-Remove-SCHED_CPUFREQ_IOWAIT-update.patch deleted file mode 100644 index 238f3b0..0000000 --- a/debian/patches/patchset-pf/cpuidle/0007-cpufreq-Remove-SCHED_CPUFREQ_IOWAIT-update.patch +++ /dev/null @@ -1,42 +0,0 @@ -From fd1e0723b0a7ad140d2bf7cd9154997d5ece2b37 Mon Sep 17 00:00:00 2001 -From: Christian Loehle -Date: Thu, 5 Sep 2024 10:26:44 +0100 -Subject: cpufreq: Remove SCHED_CPUFREQ_IOWAIT update - -Neither intel_pstate nor schedutil care for the flag anymore, so -remove the update and flag definition. - -Signed-off-by: Christian Loehle ---- - include/linux/sched/cpufreq.h | 2 -- - kernel/sched/fair.c | 8 -------- - 2 files changed, 10 deletions(-) - ---- a/include/linux/sched/cpufreq.h -+++ b/include/linux/sched/cpufreq.h -@@ -8,8 +8,6 @@ - * Interface between cpufreq drivers and the scheduler: - */ - --#define SCHED_CPUFREQ_IOWAIT (1U << 0) -- - #ifdef CONFIG_CPU_FREQ - struct cpufreq_policy; - ---- a/kernel/sched/fair.c -+++ b/kernel/sched/fair.c -@@ -6768,14 +6768,6 @@ enqueue_task_fair(struct rq *rq, struct - */ - util_est_enqueue(&rq->cfs, p); - -- /* -- * If in_iowait is set, the code below may not trigger any cpufreq -- * utilization updates, so do it here explicitly with the IOWAIT flag -- * passed. -- */ -- if (p->in_iowait) -- cpufreq_update_util(rq, SCHED_CPUFREQ_IOWAIT); -- - for_each_sched_entity(se) { - if (se->on_rq) - break; diff --git a/debian/patches/patchset-pf/cpuidle/0008-io_uring-Do-not-set-iowait-before-sleeping.patch b/debian/patches/patchset-pf/cpuidle/0008-io_uring-Do-not-set-iowait-before-sleeping.patch deleted file mode 100644 index 6a2d4c4..0000000 --- a/debian/patches/patchset-pf/cpuidle/0008-io_uring-Do-not-set-iowait-before-sleeping.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 30cdb8d7d06f51bb86142c537ea05bd01c31bb40 Mon Sep 17 00:00:00 2001 -From: Christian Loehle -Date: Thu, 5 Sep 2024 10:26:45 +0100 -Subject: io_uring: Do not set iowait before sleeping - -Setting in_iowait was introduced in commit -8a796565cec3 ("io_uring: Use io_schedule* in cqring wait") -to tackle a perf regression that was caused by menu taking iowait into -account for synchronous IO and thus not selecting deeper states like in -the io_uring counterpart. -That behaviour is gone, so the workaround can be removed. - -Signed-off-by: Christian Loehle ---- - io_uring/io_uring.c | 17 ----------------- - 1 file changed, 17 deletions(-) - ---- a/io_uring/io_uring.c -+++ b/io_uring/io_uring.c -@@ -2359,15 +2359,6 @@ int io_run_task_work_sig(struct io_ring_ - return 0; - } - --static bool current_pending_io(void) --{ -- struct io_uring_task *tctx = current->io_uring; -- -- if (!tctx) -- return false; -- return percpu_counter_read_positive(&tctx->inflight); --} -- - /* when returns >0, the caller should retry */ - static inline int io_cqring_wait_schedule(struct io_ring_ctx *ctx, - struct io_wait_queue *iowq) -@@ -2385,19 +2376,11 @@ static inline int io_cqring_wait_schedul - if (unlikely(io_should_wake(iowq))) - return 0; - -- /* -- * Mark us as being in io_wait if we have pending requests, so cpufreq -- * can take into account that the task is waiting for IO - turns out -- * to be important for low QD IO. -- */ -- if (current_pending_io()) -- current->in_iowait = 1; - ret = 0; - if (iowq->timeout == KTIME_MAX) - schedule(); - else if (!schedule_hrtimeout(&iowq->timeout, HRTIMER_MODE_ABS)) - ret = -ETIME; -- current->in_iowait = 0; - return ret; - } - diff --git a/debian/patches/patchset-pf/crypto/0001-crypto-x86-crc32c-simplify-code-for-handling-fewer-t.patch b/debian/patches/patchset-pf/crypto/0001-crypto-x86-crc32c-simplify-code-for-handling-fewer-t.patch index 7fd04a8..d20cf05 100644 --- a/debian/patches/patchset-pf/crypto/0001-crypto-x86-crc32c-simplify-code-for-handling-fewer-t.patch +++ b/debian/patches/patchset-pf/crypto/0001-crypto-x86-crc32c-simplify-code-for-handling-fewer-t.patch @@ -1,4 +1,4 @@ -From e6b67a8d14e86d63062e6f1f234c5afc235561d4 Mon Sep 17 00:00:00 2001 +From 0a957679a29a06fb2e3971615ff9f05f6becb941 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sun, 13 Oct 2024 21:06:49 -0700 Subject: crypto: x86/crc32c - simplify code for handling fewer than 200 bytes diff --git a/debian/patches/patchset-pf/crypto/0002-crypto-x86-crc32c-access-32-bit-arguments-as-32-bit.patch b/debian/patches/patchset-pf/crypto/0002-crypto-x86-crc32c-access-32-bit-arguments-as-32-bit.patch index b3e564c..422a48f 100644 --- a/debian/patches/patchset-pf/crypto/0002-crypto-x86-crc32c-access-32-bit-arguments-as-32-bit.patch +++ b/debian/patches/patchset-pf/crypto/0002-crypto-x86-crc32c-access-32-bit-arguments-as-32-bit.patch @@ -1,4 +1,4 @@ -From 430478d63b1403878f2fd4b12de2cd21ee502184 Mon Sep 17 00:00:00 2001 +From 3ed4205afe9305d71d055554ba27e7b8923865dc Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sun, 13 Oct 2024 21:06:49 -0700 Subject: crypto: x86/crc32c - access 32-bit arguments as 32-bit diff --git a/debian/patches/patchset-pf/crypto/0003-crypto-x86-crc32c-eliminate-jump-table-and-excessive.patch b/debian/patches/patchset-pf/crypto/0003-crypto-x86-crc32c-eliminate-jump-table-and-excessive.patch index faaae59..2ad2abe 100644 --- a/debian/patches/patchset-pf/crypto/0003-crypto-x86-crc32c-eliminate-jump-table-and-excessive.patch +++ b/debian/patches/patchset-pf/crypto/0003-crypto-x86-crc32c-eliminate-jump-table-and-excessive.patch @@ -1,4 +1,4 @@ -From 8706bf3e3cba8c708f9933f0d1c6a23f9c2c8c33 Mon Sep 17 00:00:00 2001 +From 5ffad9b234995f73548763a8487ecd256bba8d8d Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sun, 13 Oct 2024 21:06:49 -0700 Subject: crypto: x86/crc32c - eliminate jump table and excessive unrolling diff --git a/debian/patches/patchset-pf/fixes/0001-arch-Kconfig-Default-to-maximum-amount-of-ASLR-bits.patch b/debian/patches/patchset-pf/fixes/0001-arch-Kconfig-Default-to-maximum-amount-of-ASLR-bits.patch index 1fb3740..b0ca8a2 100644 --- a/debian/patches/patchset-pf/fixes/0001-arch-Kconfig-Default-to-maximum-amount-of-ASLR-bits.patch +++ b/debian/patches/patchset-pf/fixes/0001-arch-Kconfig-Default-to-maximum-amount-of-ASLR-bits.patch @@ -11,7 +11,7 @@ avoid having to enable `CONFIG_EXPERT`. --- a/arch/Kconfig +++ b/arch/Kconfig -@@ -1050,7 +1050,7 @@ config ARCH_MMAP_RND_BITS +@@ -1089,7 +1089,7 @@ config ARCH_MMAP_RND_BITS int "Number of bits to use for ASLR of mmap base address" if EXPERT range ARCH_MMAP_RND_BITS_MIN ARCH_MMAP_RND_BITS_MAX default ARCH_MMAP_RND_BITS_DEFAULT if ARCH_MMAP_RND_BITS_DEFAULT @@ -20,7 +20,7 @@ avoid having to enable `CONFIG_EXPERT`. depends on HAVE_ARCH_MMAP_RND_BITS help This value can be used to select the number of bits to use to -@@ -1084,7 +1084,7 @@ config ARCH_MMAP_RND_COMPAT_BITS +@@ -1123,7 +1123,7 @@ config ARCH_MMAP_RND_COMPAT_BITS int "Number of bits to use for ASLR of mmap base address for compatible applications" if EXPERT range ARCH_MMAP_RND_COMPAT_BITS_MIN ARCH_MMAP_RND_COMPAT_BITS_MAX default ARCH_MMAP_RND_COMPAT_BITS_DEFAULT if ARCH_MMAP_RND_COMPAT_BITS_DEFAULT diff --git a/debian/patches/patchset-pf/fixes/0002-cpufreq-Remove-LATENCY_MULTIPLIER.patch b/debian/patches/patchset-pf/fixes/0002-cpufreq-Remove-LATENCY_MULTIPLIER.patch deleted file mode 100644 index 8b422f7..0000000 --- a/debian/patches/patchset-pf/fixes/0002-cpufreq-Remove-LATENCY_MULTIPLIER.patch +++ /dev/null @@ -1,112 +0,0 @@ -From b7d96c1f19ef15ea431a8d5d7ab2cad22c35edba Mon Sep 17 00:00:00 2001 -From: Qais Yousef -Date: Sun, 28 Jul 2024 20:26:59 +0100 -Subject: cpufreq: Remove LATENCY_MULTIPLIER - -The current LATENCY_MULTIPLIER which has been around for nearly 20 years -causes rate_limit_us to be always in ms range. - -On M1 mac mini I get 50 and 56us transition latency, but due to the 1000 -multiplier we end up setting rate_limit_us to 50 and 56ms, which gets -capped into 2ms and was 10ms before e13aa799c2a6 ("cpufreq: Change -default transition delay to 2ms") - -On Intel I5 system transition latency is 20us but due to the multiplier -we end up with 20ms that again is capped to 2ms. - -Given how good modern hardware and how modern workloads require systems -to be more responsive to cater for sudden changes in workload (tasks -sleeping/wakeup/migrating, uclamp causing a sudden boost or cap) and -that 2ms is quarter of the time of 120Hz refresh rate system, drop the -old logic in favour of providing 50% headroom. - - rate_limit_us = 1.5 * latency. - -I considered not adding any headroom which could mean that we can end up -with infinite back-to-back requests. - -I also considered providing a constant headroom (e.g: 100us) assuming -that any h/w or f/w dealing with the request shouldn't require a large -headroom when transition_latency is actually high. - -But for both cases I wasn't sure if h/w or f/w can end up being -overwhelmed dealing with the freq requests in a potentially busy system. -So I opted for providing 50% breathing room. - -This is expected to impact schedutil only as the other user, -dbs_governor, takes the max(2*tick, transition_delay_us) and the former -was at least 2ms on 1ms TICK, which is equivalent to the max_delay_us -before applying this patch. For systems with TICK of 4ms, this value -would have almost always ended up with 8ms sampling rate. - -For systems that report 0 transition latency, we still default to -returning 1ms as transition delay. - -This helps in eliminating a source of latency for applying requests as -mentioned in [1]. For example if we have a 1ms tick, most systems will -miss sending an update at tick when updating the util_avg for a task/CPU -(rate_limit_us will be 2ms for most systems). - -Link: https://lore.kernel.org/lkml/20240724212255.mfr2ybiv2j2uqek7@airbuntu/ # [1] -Link: https://lore.kernel.org/lkml/20240205022500.2232124-1-qyousef@layalina.io/ -Signed-off-by: Qais Yousef -Link: https://patch.msgid.link/20240728192659.58115-1-qyousef@layalina.io -[ rjw: Subject edits ] -Signed-off-by: Rafael J. Wysocki ---- - drivers/cpufreq/cpufreq.c | 27 ++++----------------------- - include/linux/cpufreq.h | 6 ------ - 2 files changed, 4 insertions(+), 29 deletions(-) - ---- a/drivers/cpufreq/cpufreq.c -+++ b/drivers/cpufreq/cpufreq.c -@@ -575,30 +575,11 @@ unsigned int cpufreq_policy_transition_d - return policy->transition_delay_us; - - latency = policy->cpuinfo.transition_latency / NSEC_PER_USEC; -- if (latency) { -- unsigned int max_delay_us = 2 * MSEC_PER_SEC; -+ if (latency) -+ /* Give a 50% breathing room between updates */ -+ return latency + (latency >> 1); - -- /* -- * If the platform already has high transition_latency, use it -- * as-is. -- */ -- if (latency > max_delay_us) -- return latency; -- -- /* -- * For platforms that can change the frequency very fast (< 2 -- * us), the above formula gives a decent transition delay. But -- * for platforms where transition_latency is in milliseconds, it -- * ends up giving unrealistic values. -- * -- * Cap the default transition delay to 2 ms, which seems to be -- * a reasonable amount of time after which we should reevaluate -- * the frequency. -- */ -- return min(latency * LATENCY_MULTIPLIER, max_delay_us); -- } -- -- return LATENCY_MULTIPLIER; -+ return USEC_PER_MSEC; - } - EXPORT_SYMBOL_GPL(cpufreq_policy_transition_delay_us); - ---- a/include/linux/cpufreq.h -+++ b/include/linux/cpufreq.h -@@ -577,12 +577,6 @@ static inline unsigned long cpufreq_scal - #define CPUFREQ_POLICY_POWERSAVE (1) - #define CPUFREQ_POLICY_PERFORMANCE (2) - --/* -- * The polling frequency depends on the capability of the processor. Default -- * polling frequency is 1000 times the transition latency of the processor. -- */ --#define LATENCY_MULTIPLIER (1000) -- - struct cpufreq_governor { - char name[CPUFREQ_NAME_LEN]; - int (*init)(struct cpufreq_policy *policy); diff --git a/debian/patches/patchset-pf/fixes/0003-drivers-firmware-skip-simpledrm-if-nvidia-drm.modese.patch b/debian/patches/patchset-pf/fixes/0002-drivers-firmware-skip-simpledrm-if-nvidia-drm.modese.patch similarity index 100% rename from debian/patches/patchset-pf/fixes/0003-drivers-firmware-skip-simpledrm-if-nvidia-drm.modese.patch rename to debian/patches/patchset-pf/fixes/0002-drivers-firmware-skip-simpledrm-if-nvidia-drm.modese.patch diff --git a/debian/patches/patchset-pf/fixes/0004-nfsd-add-more-info-to-WARN_ON_ONCE-on-failed-callbac.patch b/debian/patches/patchset-pf/fixes/0004-nfsd-add-more-info-to-WARN_ON_ONCE-on-failed-callbac.patch deleted file mode 100644 index 9086a94..0000000 --- a/debian/patches/patchset-pf/fixes/0004-nfsd-add-more-info-to-WARN_ON_ONCE-on-failed-callbac.patch +++ /dev/null @@ -1,26 +0,0 @@ -From b97d21a0aa65a6f7a7bb17bbc696b136688c96ed Mon Sep 17 00:00:00 2001 -From: Jeff Layton -Date: Mon, 26 Aug 2024 08:50:11 -0400 -Subject: nfsd: add more info to WARN_ON_ONCE on failed callbacks - -Currently, you get the warning and stack trace, but nothing is printed -about the relevant error codes. Add that in. - -Signed-off-by: Jeff Layton -Signed-off-by: Chuck Lever ---- - fs/nfsd/nfs4callback.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - ---- a/fs/nfsd/nfs4callback.c -+++ b/fs/nfsd/nfs4callback.c -@@ -1333,7 +1333,8 @@ static void nfsd4_cb_done(struct rpc_tas - return; - - if (cb->cb_status) { -- WARN_ON_ONCE(task->tk_status); -+ WARN_ONCE(task->tk_status, "cb_status=%d tk_status=%d", -+ cb->cb_status, task->tk_status); - task->tk_status = cb->cb_status; - } - diff --git a/debian/patches/patchset-pf/fixes/0005-btrfs-also-add-stripe-entries-for-NOCOW-writes.patch b/debian/patches/patchset-pf/fixes/0005-btrfs-also-add-stripe-entries-for-NOCOW-writes.patch deleted file mode 100644 index 44112eb..0000000 --- a/debian/patches/patchset-pf/fixes/0005-btrfs-also-add-stripe-entries-for-NOCOW-writes.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 8ea93b01558ea7a752e478ad25862e7441d6053a Mon Sep 17 00:00:00 2001 -From: Johannes Thumshirn -Date: Thu, 19 Sep 2024 12:16:38 +0200 -Subject: btrfs: also add stripe entries for NOCOW writes - -NOCOW writes do not generate stripe_extent entries in the RAID stripe -tree, as the RAID stripe-tree feature initially was designed with a -zoned filesystem in mind and on a zoned filesystem, we do not allow NOCOW -writes. But the RAID stripe-tree feature is independent from the zoned -feature, so we must also do NOCOW writes for RAID stripe-tree filesystems. - -Reviewed-by: Naohiro Aota -Signed-off-by: Johannes Thumshirn -Signed-off-by: David Sterba ---- - fs/btrfs/inode.c | 5 +++++ - 1 file changed, 5 insertions(+) - ---- a/fs/btrfs/inode.c -+++ b/fs/btrfs/inode.c -@@ -3087,6 +3087,11 @@ int btrfs_finish_one_ordered(struct btrf - ret = btrfs_update_inode_fallback(trans, inode); - if (ret) /* -ENOMEM or corruption */ - btrfs_abort_transaction(trans, ret); -+ -+ ret = btrfs_insert_raid_extent(trans, ordered_extent); -+ if (ret) -+ btrfs_abort_transaction(trans, ret); -+ - goto out; - } - diff --git a/debian/patches/patchset-pf/ksm/0002-mm-process_ksm-use-pidfd_get_task-instead-of-pidfd_g.patch b/debian/patches/patchset-pf/ksm/0002-mm-process_ksm-use-pidfd_get_task-instead-of-pidfd_g.patch deleted file mode 100644 index 1213043..0000000 --- a/debian/patches/patchset-pf/ksm/0002-mm-process_ksm-use-pidfd_get_task-instead-of-pidfd_g.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 9308d03bfeb941469da17e2903ca06254b110b25 Mon Sep 17 00:00:00 2001 -From: Oleksandr Natalenko -Date: Tue, 24 Sep 2024 11:58:41 +0200 -Subject: mm/process_ksm: use pidfd_get_task() instead of - pidfd_get_pid()+get_pid_task() - -Link: https://git.kernel.org/linus/ee9955d61a0a -Signed-off-by: Oleksandr Natalenko ---- - kernel/sys.c | 15 +++------------ - 1 file changed, 3 insertions(+), 12 deletions(-) - ---- a/kernel/sys.c -+++ b/kernel/sys.c -@@ -2799,23 +2799,16 @@ enum pkc_action { - static long do_process_ksm_control(int pidfd, enum pkc_action action) - { - long ret; -- struct pid *pid; - struct task_struct *task; - struct mm_struct *mm; - unsigned int f_flags; - -- pid = pidfd_get_pid(pidfd, &f_flags); -- if (IS_ERR(pid)) { -- ret = PTR_ERR(pid); -+ task = pidfd_get_task(pidfd, &f_flags); -+ if (IS_ERR(task)) { -+ ret = PTR_ERR(task); - goto out; - } - -- task = get_pid_task(pid, PIDTYPE_PID); -- if (!task) { -- ret = -ESRCH; -- goto put_pid; -- } -- - /* Require PTRACE_MODE_READ to avoid leaking ASLR metadata. */ - mm = mm_access(task, PTRACE_MODE_READ_FSCREDS); - if (IS_ERR_OR_NULL(mm)) { -@@ -2852,8 +2845,6 @@ release_mm: - mmput(mm); - release_task: - put_task_struct(task); --put_pid: -- put_pid(pid); - out: - return ret; - } diff --git a/debian/patches/patchset-pf/ksm/0001-mm-expose-per-process-KSM-control-via-syscalls.patch b/debian/patches/patchset-pf/pksm/0001-mm-expose-per-process-KSM-control-via-syscalls.patch similarity index 96% rename from debian/patches/patchset-pf/ksm/0001-mm-expose-per-process-KSM-control-via-syscalls.patch rename to debian/patches/patchset-pf/pksm/0001-mm-expose-per-process-KSM-control-via-syscalls.patch index 18a27a7..db78a6b 100644 --- a/debian/patches/patchset-pf/ksm/0001-mm-expose-per-process-KSM-control-via-syscalls.patch +++ b/debian/patches/patchset-pf/pksm/0001-mm-expose-per-process-KSM-control-via-syscalls.patch @@ -1,6 +1,6 @@ -From 88362669534c70bbc7036f45bb23e63a30d4adfb Mon Sep 17 00:00:00 2001 +From 4eb6615c1498cb8bff76c31e9596b585410f507d Mon Sep 17 00:00:00 2001 From: Oleksandr Natalenko -Date: Mon, 29 Jul 2024 00:38:24 +0200 +Date: Mon, 30 Sep 2024 08:58:38 +0200 Subject: mm: expose per-process KSM control via syscalls d7597f59d1d3 added a new API to enable per-process KSM control. It @@ -34,12 +34,12 @@ Signed-off-by: Oleksandr Natalenko arch/xtensa/kernel/syscalls/syscall.tbl | 3 + include/linux/syscalls.h | 3 + include/uapi/asm-generic/unistd.h | 9 +- - kernel/sys.c | 147 ++++++++++++++++++ + kernel/sys.c | 138 ++++++++++++++++++ kernel/sys_ni.c | 3 + scripts/syscall.tbl | 3 + .../arch/powerpc/entry/syscalls/syscall.tbl | 3 + .../perf/arch/s390/entry/syscalls/syscall.tbl | 3 + - 22 files changed, 215 insertions(+), 1 deletion(-) + 22 files changed, 206 insertions(+), 1 deletion(-) --- a/arch/alpha/kernel/syscalls/syscall.tbl +++ b/arch/alpha/kernel/syscalls/syscall.tbl @@ -212,7 +212,7 @@ Signed-off-by: Oleksandr Natalenko * 32 bit systems traditionally used different --- a/kernel/sys.c +++ b/kernel/sys.c -@@ -2789,6 +2789,153 @@ SYSCALL_DEFINE5(prctl, int, option, unsi +@@ -2791,6 +2791,144 @@ SYSCALL_DEFINE5(prctl, int, option, unsi return error; } @@ -226,23 +226,16 @@ Signed-off-by: Oleksandr Natalenko +static long do_process_ksm_control(int pidfd, enum pkc_action action) +{ + long ret; -+ struct pid *pid; + struct task_struct *task; + struct mm_struct *mm; + unsigned int f_flags; + -+ pid = pidfd_get_pid(pidfd, &f_flags); -+ if (IS_ERR(pid)) { -+ ret = PTR_ERR(pid); ++ task = pidfd_get_task(pidfd, &f_flags); ++ if (IS_ERR(task)) { ++ ret = PTR_ERR(task); + goto out; + } + -+ task = get_pid_task(pid, PIDTYPE_PID); -+ if (!task) { -+ ret = -ESRCH; -+ goto put_pid; -+ } -+ + /* Require PTRACE_MODE_READ to avoid leaking ASLR metadata. */ + mm = mm_access(task, PTRACE_MODE_READ_FSCREDS); + if (IS_ERR_OR_NULL(mm)) { @@ -279,8 +272,6 @@ Signed-off-by: Oleksandr Natalenko + mmput(mm); +release_task: + put_task_struct(task); -+put_pid: -+ put_pid(pid); +out: + return ret; +} diff --git a/debian/patches/patchset-pf/xfs/0001-xfs-fix-chown-with-rt-quota.patch b/debian/patches/patchset-pf/xfs/0001-xfs-fix-chown-with-rt-quota.patch new file mode 100644 index 0000000..4fdaf7c --- /dev/null +++ b/debian/patches/patchset-pf/xfs/0001-xfs-fix-chown-with-rt-quota.patch @@ -0,0 +1,178 @@ +From 6fe0d820b76da3a4f1f8d1fd605b2afc9edcb3f8 Mon Sep 17 00:00:00 2001 +From: "Darrick J. Wong" +Date: Sun, 3 Nov 2024 20:19:39 -0800 +Subject: xfs: fix chown with rt quota + +Make chown's quota adjustments work with realtime files. This is mostly +a matter of calling xfs_inode_count_blocks on a given file to figure out +the number of blocks allocated to the data device and to the realtime +device, and using those quantities to update the quota accounting when +the id changes. Delayed allocation reservations are moved from the old +dquot's incore reservation to the new dquot's incore reservation. + +Note that there was a missing ILOCK bug in xfs_qm_dqusage_adjust that we +must fix before calling xfs_iread_extents. Prior to 2.6.37 the locking +was correct, but then someone removed the ILOCK as part of a cleanup. +Nobody noticed because nowhere in the git history have we ever supported +rt+quota so nobody can use this. + +I'm leaving git breadcrumbs in case anyone is desperate enough to try to +backport the rtquota code to old kernels. + +Not-Cc: # v2.6.37 +Fixes: 52fda114249578 ("xfs: simplify xfs_qm_dqusage_adjust") +Signed-off-by: Darrick J. Wong +Reviewed-by: Christoph Hellwig +--- + fs/xfs/xfs_qm.c | 44 +++++++++++++++++++++++++++----------------- + fs/xfs/xfs_trans.c | 31 +++++++++++++++++++++++++++++-- + 2 files changed, 56 insertions(+), 19 deletions(-) + +--- a/fs/xfs/xfs_qm.c ++++ b/fs/xfs/xfs_qm.c +@@ -1153,8 +1153,8 @@ xfs_qm_dqusage_adjust( + void *data) + { + struct xfs_inode *ip; +- xfs_qcnt_t nblks; +- xfs_filblks_t rtblks = 0; /* total rt blks */ ++ xfs_filblks_t nblks, rtblks; ++ unsigned int lock_mode; + int error; + + ASSERT(XFS_IS_QUOTA_ON(mp)); +@@ -1191,18 +1191,17 @@ xfs_qm_dqusage_adjust( + + ASSERT(ip->i_delayed_blks == 0); + ++ lock_mode = xfs_ilock_data_map_shared(ip); + if (XFS_IS_REALTIME_INODE(ip)) { +- struct xfs_ifork *ifp = xfs_ifork_ptr(ip, XFS_DATA_FORK); +- + error = xfs_iread_extents(tp, ip, XFS_DATA_FORK); +- if (error) ++ if (error) { ++ xfs_iunlock(ip, lock_mode); + goto error0; +- +- xfs_bmap_count_leaves(ifp, &rtblks); ++ } + } +- +- nblks = (xfs_qcnt_t)ip->i_nblocks - rtblks; ++ xfs_inode_count_blocks(tp, ip, &nblks, &rtblks); + xfs_iflags_clear(ip, XFS_IQUOTAUNCHECKED); ++ xfs_iunlock(ip, lock_mode); + + /* + * Add the (disk blocks and inode) resources occupied by this +@@ -1858,9 +1857,8 @@ xfs_qm_vop_chown( + struct xfs_dquot *newdq) + { + struct xfs_dquot *prevdq; +- uint bfield = XFS_IS_REALTIME_INODE(ip) ? +- XFS_TRANS_DQ_RTBCOUNT : XFS_TRANS_DQ_BCOUNT; +- ++ xfs_filblks_t dblocks, rblocks; ++ bool isrt = XFS_IS_REALTIME_INODE(ip); + + xfs_assert_ilocked(ip, XFS_ILOCK_EXCL); + ASSERT(XFS_IS_QUOTA_ON(ip->i_mount)); +@@ -1870,11 +1868,17 @@ xfs_qm_vop_chown( + ASSERT(prevdq); + ASSERT(prevdq != newdq); + +- xfs_trans_mod_ino_dquot(tp, ip, prevdq, bfield, -(ip->i_nblocks)); ++ xfs_inode_count_blocks(tp, ip, &dblocks, &rblocks); ++ ++ xfs_trans_mod_ino_dquot(tp, ip, prevdq, XFS_TRANS_DQ_BCOUNT, ++ -(xfs_qcnt_t)dblocks); ++ xfs_trans_mod_ino_dquot(tp, ip, prevdq, XFS_TRANS_DQ_RTBCOUNT, ++ -(xfs_qcnt_t)rblocks); + xfs_trans_mod_ino_dquot(tp, ip, prevdq, XFS_TRANS_DQ_ICOUNT, -1); + + /* the sparkling new dquot */ +- xfs_trans_mod_ino_dquot(tp, ip, newdq, bfield, ip->i_nblocks); ++ xfs_trans_mod_ino_dquot(tp, ip, newdq, XFS_TRANS_DQ_BCOUNT, dblocks); ++ xfs_trans_mod_ino_dquot(tp, ip, newdq, XFS_TRANS_DQ_RTBCOUNT, rblocks); + xfs_trans_mod_ino_dquot(tp, ip, newdq, XFS_TRANS_DQ_ICOUNT, 1); + + /* +@@ -1884,7 +1888,8 @@ xfs_qm_vop_chown( + * (having already bumped up the real counter) so that we don't have + * any reservation to give back when we commit. + */ +- xfs_trans_mod_dquot(tp, newdq, XFS_TRANS_DQ_RES_BLKS, ++ xfs_trans_mod_dquot(tp, newdq, ++ isrt ? XFS_TRANS_DQ_RES_RTBLKS : XFS_TRANS_DQ_RES_BLKS, + -ip->i_delayed_blks); + + /* +@@ -1896,8 +1901,13 @@ xfs_qm_vop_chown( + */ + tp->t_flags |= XFS_TRANS_DIRTY; + xfs_dqlock(prevdq); +- ASSERT(prevdq->q_blk.reserved >= ip->i_delayed_blks); +- prevdq->q_blk.reserved -= ip->i_delayed_blks; ++ if (isrt) { ++ ASSERT(prevdq->q_rtb.reserved >= ip->i_delayed_blks); ++ prevdq->q_rtb.reserved -= ip->i_delayed_blks; ++ } else { ++ ASSERT(prevdq->q_blk.reserved >= ip->i_delayed_blks); ++ prevdq->q_blk.reserved -= ip->i_delayed_blks; ++ } + xfs_dqunlock(prevdq); + + /* +--- a/fs/xfs/xfs_trans.c ++++ b/fs/xfs/xfs_trans.c +@@ -1262,11 +1262,26 @@ retry: + gdqp = (new_gdqp != ip->i_gdquot) ? new_gdqp : NULL; + pdqp = (new_pdqp != ip->i_pdquot) ? new_pdqp : NULL; + if (udqp || gdqp || pdqp) { ++ xfs_filblks_t dblocks, rblocks; + unsigned int qflags = XFS_QMOPT_RES_REGBLKS; ++ bool isrt = XFS_IS_REALTIME_INODE(ip); + + if (force) + qflags |= XFS_QMOPT_FORCE_RES; + ++ if (isrt) { ++ error = xfs_iread_extents(tp, ip, XFS_DATA_FORK); ++ if (error) ++ goto out_cancel; ++ } ++ ++ xfs_inode_count_blocks(tp, ip, &dblocks, &rblocks); ++ ++ if (isrt) ++ rblocks += ip->i_delayed_blks; ++ else ++ dblocks += ip->i_delayed_blks; ++ + /* + * Reserve enough quota to handle blocks on disk and reserved + * for a delayed allocation. We'll actually transfer the +@@ -1274,8 +1289,20 @@ retry: + * though that part is only semi-transactional. + */ + error = xfs_trans_reserve_quota_bydquots(tp, mp, udqp, gdqp, +- pdqp, ip->i_nblocks + ip->i_delayed_blks, +- 1, qflags); ++ pdqp, dblocks, 1, qflags); ++ if ((error == -EDQUOT || error == -ENOSPC) && !retried) { ++ xfs_trans_cancel(tp); ++ xfs_blockgc_free_dquots(mp, udqp, gdqp, pdqp, 0); ++ retried = true; ++ goto retry; ++ } ++ if (error) ++ goto out_cancel; ++ ++ /* Do the same for realtime. */ ++ qflags = XFS_QMOPT_RES_RTBLKS | (qflags & XFS_QMOPT_FORCE_RES); ++ error = xfs_trans_reserve_quota_bydquots(tp, mp, udqp, gdqp, ++ pdqp, rblocks, 0, qflags); + if ((error == -EDQUOT || error == -ENOSPC) && !retried) { + xfs_trans_cancel(tp); + xfs_blockgc_free_dquots(mp, udqp, gdqp, pdqp, 0); diff --git a/debian/patches/patchset-pf/zstd/0001-zstd-import-upstream-v1.5.6.patch b/debian/patches/patchset-pf/zstd/0001-zstd-import-upstream-v1.5.6.patch index 7b94907..feb072e 100644 --- a/debian/patches/patchset-pf/zstd/0001-zstd-import-upstream-v1.5.6.patch +++ b/debian/patches/patchset-pf/zstd/0001-zstd-import-upstream-v1.5.6.patch @@ -1,4 +1,4 @@ -From 9b2b1b2e996c06793bc975dd66dccaadb0c0d637 Mon Sep 17 00:00:00 2001 +From 444b8286e00345a68fecc43eaa0aabdb10d7b39b Mon Sep 17 00:00:00 2001 From: Oleksandr Natalenko Date: Mon, 29 Jul 2024 00:42:23 +0200 Subject: zstd: import upstream v1.5.6 @@ -7960,16 +7960,16 @@ Signed-off-by: Oleksandr Natalenko FORWARD_IF_ERROR(dictID, "ZSTD_compress_insertDictionary failed"); assert(dictID <= (size_t)(U32)-1); cdict->dictID = (U32)dictID; -@@ -4811,7 +5450,7 @@ ZSTD_CDict* ZSTD_createCDict_advanced2( - cctxParams.useRowMatchFinder, cctxParams.enableDedicatedDictSearch, - customMem); +@@ -4813,7 +5452,7 @@ ZSTD_CDict* ZSTD_createCDict_advanced2( + if (!cdict) + return NULL; - if (ZSTD_isError( ZSTD_initCDict_internal(cdict, + if (!cdict || ZSTD_isError( ZSTD_initCDict_internal(cdict, dict, dictSize, dictLoadMethod, dictContentType, cctxParams) )) { -@@ -4906,6 +5545,7 @@ const ZSTD_CDict* ZSTD_initStaticCDict( +@@ -4908,6 +5547,7 @@ const ZSTD_CDict* ZSTD_initStaticCDict( params.cParams = cParams; params.useRowMatchFinder = useRowMatchFinder; cdict->useRowMatchFinder = useRowMatchFinder; @@ -7977,7 +7977,7 @@ Signed-off-by: Oleksandr Natalenko if (ZSTD_isError( ZSTD_initCDict_internal(cdict, dict, dictSize, -@@ -4985,12 +5625,17 @@ size_t ZSTD_compressBegin_usingCDict_adv +@@ -4987,12 +5627,17 @@ size_t ZSTD_compressBegin_usingCDict_adv /* ZSTD_compressBegin_usingCDict() : * cdict must be != NULL */ @@ -7996,7 +7996,7 @@ Signed-off-by: Oleksandr Natalenko /*! ZSTD_compress_usingCDict_internal(): * Implementation of various ZSTD_compress_usingCDict* functions. */ -@@ -5000,7 +5645,7 @@ static size_t ZSTD_compress_usingCDict_i +@@ -5002,7 +5647,7 @@ static size_t ZSTD_compress_usingCDict_i const ZSTD_CDict* cdict, ZSTD_frameParameters fParams) { FORWARD_IF_ERROR(ZSTD_compressBegin_usingCDict_internal(cctx, cdict, fParams, srcSize), ""); /* will check if cdict != NULL */ @@ -8005,7 +8005,7 @@ Signed-off-by: Oleksandr Natalenko } /*! ZSTD_compress_usingCDict_advanced(): -@@ -5197,30 +5842,41 @@ size_t ZSTD_initCStream(ZSTD_CStream* zc +@@ -5199,30 +5844,41 @@ size_t ZSTD_initCStream(ZSTD_CStream* zc static size_t ZSTD_nextInputSizeHint(const ZSTD_CCtx* cctx) { @@ -8059,7 +8059,7 @@ Signed-off-by: Oleksandr Natalenko if (zcs->appliedParams.inBufferMode == ZSTD_bm_buffered) { assert(zcs->inBuff != NULL); assert(zcs->inBuffSize > 0); -@@ -5229,8 +5885,10 @@ static size_t ZSTD_compressStream_generi +@@ -5231,8 +5887,10 @@ static size_t ZSTD_compressStream_generi assert(zcs->outBuff != NULL); assert(zcs->outBuffSize > 0); } @@ -8071,7 +8071,7 @@ Signed-off-by: Oleksandr Natalenko assert((U32)flushMode <= (U32)ZSTD_e_end); while (someMoreWork) { -@@ -5245,7 +5903,7 @@ static size_t ZSTD_compressStream_generi +@@ -5247,7 +5905,7 @@ static size_t ZSTD_compressStream_generi || zcs->appliedParams.outBufferMode == ZSTD_bm_stable) /* OR we are allowed to return dstSizeTooSmall */ && (zcs->inBuffPos == 0) ) { /* shortcut to compression pass directly into output buffer */ @@ -8080,7 +8080,7 @@ Signed-off-by: Oleksandr Natalenko op, oend-op, ip, iend-ip); DEBUGLOG(4, "ZSTD_compressEnd : cSize=%u", (unsigned)cSize); FORWARD_IF_ERROR(cSize, "ZSTD_compressEnd failed"); -@@ -5262,8 +5920,7 @@ static size_t ZSTD_compressStream_generi +@@ -5264,8 +5922,7 @@ static size_t ZSTD_compressStream_generi zcs->inBuff + zcs->inBuffPos, toLoad, ip, iend-ip); zcs->inBuffPos += loaded; @@ -8090,7 +8090,7 @@ Signed-off-by: Oleksandr Natalenko if ( (flushMode == ZSTD_e_continue) && (zcs->inBuffPos < zcs->inBuffTarget) ) { /* not enough input to fill full block : stop here */ -@@ -5274,6 +5931,20 @@ static size_t ZSTD_compressStream_generi +@@ -5276,6 +5933,20 @@ static size_t ZSTD_compressStream_generi /* empty */ someMoreWork = 0; break; } @@ -8111,7 +8111,7 @@ Signed-off-by: Oleksandr Natalenko } /* compress current block (note : this stage cannot be stopped in the middle) */ DEBUGLOG(5, "stream compression stage (flushMode==%u)", flushMode); -@@ -5281,9 +5952,8 @@ static size_t ZSTD_compressStream_generi +@@ -5283,9 +5954,8 @@ static size_t ZSTD_compressStream_generi void* cDst; size_t cSize; size_t oSize = oend-op; @@ -8123,7 +8123,7 @@ Signed-off-by: Oleksandr Natalenko if (oSize >= ZSTD_compressBound(iSize) || zcs->appliedParams.outBufferMode == ZSTD_bm_stable) cDst = op; /* compress into output buffer, to skip flush stage */ else -@@ -5291,9 +5961,9 @@ static size_t ZSTD_compressStream_generi +@@ -5293,9 +5963,9 @@ static size_t ZSTD_compressStream_generi if (inputBuffered) { unsigned const lastBlock = (flushMode == ZSTD_e_end) && (ip==iend); cSize = lastBlock ? @@ -8135,7 +8135,7 @@ Signed-off-by: Oleksandr Natalenko zcs->inBuff + zcs->inToCompress, iSize); FORWARD_IF_ERROR(cSize, "%s", lastBlock ? "ZSTD_compressEnd failed" : "ZSTD_compressContinue failed"); zcs->frameEnded = lastBlock; -@@ -5306,19 +5976,16 @@ static size_t ZSTD_compressStream_generi +@@ -5308,19 +5978,16 @@ static size_t ZSTD_compressStream_generi if (!lastBlock) assert(zcs->inBuffTarget <= zcs->inBuffSize); zcs->inToCompress = zcs->inBuffPos; @@ -8161,7 +8161,7 @@ Signed-off-by: Oleksandr Natalenko } if (cDst == op) { /* no need to flush */ op += cSize; -@@ -5388,8 +6055,10 @@ size_t ZSTD_compressStream(ZSTD_CStream* +@@ -5390,8 +6057,10 @@ size_t ZSTD_compressStream(ZSTD_CStream* /* After a compression call set the expected input/output buffer. * This is validated at the start of the next compression call. */ @@ -8173,7 +8173,7 @@ Signed-off-by: Oleksandr Natalenko if (cctx->appliedParams.inBufferMode == ZSTD_bm_stable) { cctx->expectedInBuffer = *input; } -@@ -5408,22 +6077,22 @@ static size_t ZSTD_checkBufferStability( +@@ -5410,22 +6079,22 @@ static size_t ZSTD_checkBufferStability( { if (cctx->appliedParams.inBufferMode == ZSTD_bm_stable) { ZSTD_inBuffer const expect = cctx->expectedInBuffer; @@ -8202,7 +8202,7 @@ Signed-off-by: Oleksandr Natalenko ZSTD_CCtx_params params = cctx->requestedParams; ZSTD_prefixDict const prefixDict = cctx->prefixDict; FORWARD_IF_ERROR( ZSTD_initLocalDict(cctx) , ""); /* Init the local dict if present. */ -@@ -5437,9 +6106,9 @@ static size_t ZSTD_CCtx_init_compressStr +@@ -5439,9 +6108,9 @@ static size_t ZSTD_CCtx_init_compressStr params.compressionLevel = cctx->cdict->compressionLevel; } DEBUGLOG(4, "ZSTD_compressStream2 : transparent init stage"); @@ -8215,7 +8215,7 @@ Signed-off-by: Oleksandr Natalenko ? prefixDict.dictSize : (cctx->cdict ? cctx->cdict->dictContentSize : 0); ZSTD_cParamMode_e const mode = ZSTD_getCParamMode(cctx->cdict, ¶ms, cctx->pledgedSrcSizePlusOne - 1); -@@ -5451,6 +6120,9 @@ static size_t ZSTD_CCtx_init_compressStr +@@ -5453,6 +6122,9 @@ static size_t ZSTD_CCtx_init_compressStr params.useBlockSplitter = ZSTD_resolveBlockSplitterMode(params.useBlockSplitter, ¶ms.cParams); params.ldmParams.enableLdm = ZSTD_resolveEnableLdm(params.ldmParams.enableLdm, ¶ms.cParams); params.useRowMatchFinder = ZSTD_resolveRowMatchFinderMode(params.useRowMatchFinder, ¶ms.cParams); @@ -8225,7 +8225,7 @@ Signed-off-by: Oleksandr Natalenko { U64 const pledgedSrcSize = cctx->pledgedSrcSizePlusOne - 1; assert(!ZSTD_isError(ZSTD_checkCParams(params.cParams))); -@@ -5477,6 +6149,8 @@ static size_t ZSTD_CCtx_init_compressStr +@@ -5479,6 +6151,8 @@ static size_t ZSTD_CCtx_init_compressStr return 0; } @@ -8234,7 +8234,7 @@ Signed-off-by: Oleksandr Natalenko size_t ZSTD_compressStream2( ZSTD_CCtx* cctx, ZSTD_outBuffer* output, ZSTD_inBuffer* input, -@@ -5491,8 +6165,27 @@ size_t ZSTD_compressStream2( ZSTD_CCtx* +@@ -5493,8 +6167,27 @@ size_t ZSTD_compressStream2( ZSTD_CCtx* /* transparent initialization stage */ if (cctx->streamStage == zcss_init) { @@ -8264,7 +8264,7 @@ Signed-off-by: Oleksandr Natalenko } /* end of transparent initialization stage */ -@@ -5510,13 +6203,20 @@ size_t ZSTD_compressStream2_simpleArgs ( +@@ -5512,13 +6205,20 @@ size_t ZSTD_compressStream2_simpleArgs ( const void* src, size_t srcSize, size_t* srcPos, ZSTD_EndDirective endOp) { @@ -8291,7 +8291,7 @@ Signed-off-by: Oleksandr Natalenko } size_t ZSTD_compress2(ZSTD_CCtx* cctx, -@@ -5539,6 +6239,7 @@ size_t ZSTD_compress2(ZSTD_CCtx* cctx, +@@ -5541,6 +6241,7 @@ size_t ZSTD_compress2(ZSTD_CCtx* cctx, /* Reset to the original values. */ cctx->requestedParams.inBufferMode = originalInBufferMode; cctx->requestedParams.outBufferMode = originalOutBufferMode; @@ -8299,7 +8299,7 @@ Signed-off-by: Oleksandr Natalenko FORWARD_IF_ERROR(result, "ZSTD_compressStream2_simpleArgs failed"); if (result != 0) { /* compression not completed, due to lack of output space */ assert(oPos == dstCapacity); -@@ -5549,64 +6250,61 @@ size_t ZSTD_compress2(ZSTD_CCtx* cctx, +@@ -5551,64 +6252,61 @@ size_t ZSTD_compress2(ZSTD_CCtx* cctx, } } @@ -8384,7 +8384,7 @@ Signed-off-by: Oleksandr Natalenko if (cctx->cdict) { dictSize = (U32)cctx->cdict->dictContentSize; } else if (cctx->prefixDict.dict) { -@@ -5615,25 +6313,55 @@ ZSTD_copySequencesToSeqStoreExplicitBloc +@@ -5617,25 +6315,55 @@ ZSTD_copySequencesToSeqStoreExplicitBloc dictSize = 0; } ZSTD_memcpy(updatedRepcodes.rep, cctx->blockState.prevCBlock->rep, sizeof(repcodes_t)); @@ -8449,7 +8449,7 @@ Signed-off-by: Oleksandr Natalenko ZSTD_memcpy(cctx->blockState.nextCBlock->rep, updatedRepcodes.rep, sizeof(repcodes_t)); if (inSeqs[idx].litLength) { -@@ -5642,26 +6370,15 @@ ZSTD_copySequencesToSeqStoreExplicitBloc +@@ -5644,26 +6372,15 @@ ZSTD_copySequencesToSeqStoreExplicitBloc ip += inSeqs[idx].litLength; seqPos->posInSrc += inSeqs[idx].litLength; } @@ -8479,7 +8479,7 @@ Signed-off-by: Oleksandr Natalenko { U32 idx = seqPos->idx; U32 startPosInSequence = seqPos->posInSequence; -@@ -5673,6 +6390,9 @@ ZSTD_copySequencesToSeqStoreNoBlockDelim +@@ -5675,6 +6392,9 @@ ZSTD_copySequencesToSeqStoreNoBlockDelim U32 bytesAdjustment = 0; U32 finalMatchSplit = 0; @@ -8489,7 +8489,7 @@ Signed-off-by: Oleksandr Natalenko if (cctx->cdict) { dictSize = cctx->cdict->dictContentSize; } else if (cctx->prefixDict.dict) { -@@ -5680,7 +6400,7 @@ ZSTD_copySequencesToSeqStoreNoBlockDelim +@@ -5682,7 +6402,7 @@ ZSTD_copySequencesToSeqStoreNoBlockDelim } else { dictSize = 0; } @@ -8498,7 +8498,7 @@ Signed-off-by: Oleksandr Natalenko DEBUGLOG(5, "Start seq: idx: %u (of: %u ml: %u ll: %u)", idx, inSeqs[idx].offset, inSeqs[idx].matchLength, inSeqs[idx].litLength); ZSTD_memcpy(updatedRepcodes.rep, cctx->blockState.prevCBlock->rep, sizeof(repcodes_t)); while (endPosInSequence && idx < inSeqsSize && !finalMatchSplit) { -@@ -5688,7 +6408,7 @@ ZSTD_copySequencesToSeqStoreNoBlockDelim +@@ -5690,7 +6410,7 @@ ZSTD_copySequencesToSeqStoreNoBlockDelim U32 litLength = currSeq.litLength; U32 matchLength = currSeq.matchLength; U32 const rawOffset = currSeq.offset; @@ -8507,7 +8507,7 @@ Signed-off-by: Oleksandr Natalenko /* Modify the sequence depending on where endPosInSequence lies */ if (endPosInSequence >= currSeq.litLength + currSeq.matchLength) { -@@ -5702,7 +6422,6 @@ ZSTD_copySequencesToSeqStoreNoBlockDelim +@@ -5704,7 +6424,6 @@ ZSTD_copySequencesToSeqStoreNoBlockDelim /* Move to the next sequence */ endPosInSequence -= currSeq.litLength + currSeq.matchLength; startPosInSequence = 0; @@ -8515,7 +8515,7 @@ Signed-off-by: Oleksandr Natalenko } else { /* This is the final (partial) sequence we're adding from inSeqs, and endPosInSequence does not reach the end of the match. So, we have to split the sequence */ -@@ -5742,21 +6461,23 @@ ZSTD_copySequencesToSeqStoreNoBlockDelim +@@ -5744,21 +6463,23 @@ ZSTD_copySequencesToSeqStoreNoBlockDelim } /* Check if this offset can be represented with a repcode */ { U32 const ll0 = (litLength == 0); @@ -8546,7 +8546,7 @@ Signed-off-by: Oleksandr Natalenko } DEBUGLOG(5, "Ending seq: idx: %u (of: %u ml: %u ll: %u)", idx, inSeqs[idx].offset, inSeqs[idx].matchLength, inSeqs[idx].litLength); assert(idx == inSeqsSize || endPosInSequence <= inSeqs[idx].litLength + inSeqs[idx].matchLength); -@@ -5779,7 +6500,7 @@ ZSTD_copySequencesToSeqStoreNoBlockDelim +@@ -5781,7 +6502,7 @@ ZSTD_copySequencesToSeqStoreNoBlockDelim typedef size_t (*ZSTD_sequenceCopier) (ZSTD_CCtx* cctx, ZSTD_sequencePosition* seqPos, const ZSTD_Sequence* const inSeqs, size_t inSeqsSize, @@ -8555,7 +8555,7 @@ Signed-off-by: Oleksandr Natalenko static ZSTD_sequenceCopier ZSTD_selectSequenceCopier(ZSTD_sequenceFormat_e mode) { ZSTD_sequenceCopier sequenceCopier = NULL; -@@ -5793,6 +6514,57 @@ static ZSTD_sequenceCopier ZSTD_selectSe +@@ -5795,6 +6516,57 @@ static ZSTD_sequenceCopier ZSTD_selectSe return sequenceCopier; } @@ -8613,7 +8613,7 @@ Signed-off-by: Oleksandr Natalenko /* Compress, block-by-block, all of the sequences given. * * Returns the cumulative size of all compressed blocks (including their headers), -@@ -5805,9 +6577,6 @@ ZSTD_compressSequences_internal(ZSTD_CCt +@@ -5807,9 +6579,6 @@ ZSTD_compressSequences_internal(ZSTD_CCt const void* src, size_t srcSize) { size_t cSize = 0; @@ -8623,7 +8623,7 @@ Signed-off-by: Oleksandr Natalenko size_t remaining = srcSize; ZSTD_sequencePosition seqPos = {0, 0, 0}; -@@ -5827,22 +6596,29 @@ ZSTD_compressSequences_internal(ZSTD_CCt +@@ -5829,22 +6598,29 @@ ZSTD_compressSequences_internal(ZSTD_CCt } while (remaining) { @@ -8659,7 +8659,7 @@ Signed-off-by: Oleksandr Natalenko cSize += cBlockSize; ip += blockSize; op += cBlockSize; -@@ -5851,6 +6627,7 @@ ZSTD_compressSequences_internal(ZSTD_CCt +@@ -5853,6 +6629,7 @@ ZSTD_compressSequences_internal(ZSTD_CCt continue; } @@ -8667,7 +8667,7 @@ Signed-off-by: Oleksandr Natalenko compressedSeqsSize = ZSTD_entropyCompressSeqStore(&cctx->seqStore, &cctx->blockState.prevCBlock->entropy, &cctx->blockState.nextCBlock->entropy, &cctx->appliedParams, -@@ -5859,11 +6636,11 @@ ZSTD_compressSequences_internal(ZSTD_CCt +@@ -5861,11 +6638,11 @@ ZSTD_compressSequences_internal(ZSTD_CCt cctx->entropyWorkspace, ENTROPY_WORKSPACE_SIZE /* statically allocated in resetCCtx */, cctx->bmi2); FORWARD_IF_ERROR(compressedSeqsSize, "Compressing sequences of block failed"); @@ -8681,7 +8681,7 @@ Signed-off-by: Oleksandr Natalenko /* We don't want to emit our first block as a RLE even if it qualifies because * doing so will cause the decoder (cli only) to throw a "should consume all input error." * This is only an issue for zstd <= v1.4.3 -@@ -5874,12 +6651,12 @@ ZSTD_compressSequences_internal(ZSTD_CCt +@@ -5876,12 +6653,12 @@ ZSTD_compressSequences_internal(ZSTD_CCt if (compressedSeqsSize == 0) { /* ZSTD_noCompressBlock writes the block header as well */ cBlockSize = ZSTD_noCompressBlock(op, dstCapacity, ip, blockSize, lastBlock); @@ -8698,7 +8698,7 @@ Signed-off-by: Oleksandr Natalenko } else { U32 cBlockHeader; /* Error checking and repcodes update */ -@@ -5891,11 +6668,10 @@ ZSTD_compressSequences_internal(ZSTD_CCt +@@ -5893,11 +6670,10 @@ ZSTD_compressSequences_internal(ZSTD_CCt cBlockHeader = lastBlock + (((U32)bt_compressed)<<1) + (U32)(compressedSeqsSize << 3); MEM_writeLE24(op, cBlockHeader); cBlockSize = ZSTD_blockHeaderSize + compressedSeqsSize; @@ -8711,7 +8711,7 @@ Signed-off-by: Oleksandr Natalenko if (lastBlock) { break; -@@ -5906,12 +6682,15 @@ ZSTD_compressSequences_internal(ZSTD_CCt +@@ -5908,12 +6684,15 @@ ZSTD_compressSequences_internal(ZSTD_CCt dstCapacity -= cBlockSize; cctx->isFirstBlock = 0; } @@ -8728,7 +8728,7 @@ Signed-off-by: Oleksandr Natalenko const ZSTD_Sequence* inSeqs, size_t inSeqsSize, const void* src, size_t srcSize) { -@@ -5921,7 +6700,7 @@ size_t ZSTD_compressSequences(ZSTD_CCtx* +@@ -5923,7 +6702,7 @@ size_t ZSTD_compressSequences(ZSTD_CCtx* size_t frameHeaderSize = 0; /* Transparent initialization stage, same as compressStream2() */ @@ -8737,7 +8737,7 @@ Signed-off-by: Oleksandr Natalenko assert(cctx != NULL); FORWARD_IF_ERROR(ZSTD_CCtx_init_compressStream2(cctx, ZSTD_e_end, srcSize), "CCtx initialization failed"); /* Begin writing output, starting with frame header */ -@@ -5949,26 +6728,34 @@ size_t ZSTD_compressSequences(ZSTD_CCtx* +@@ -5951,26 +6730,34 @@ size_t ZSTD_compressSequences(ZSTD_CCtx* cSize += 4; } @@ -8776,7 +8776,7 @@ Signed-off-by: Oleksandr Natalenko if (zcs->appliedParams.nbWorkers > 0) return remainingToFlush; /* minimal estimation */ /* single thread mode : attempt to calculate remaining to flush more precisely */ { size_t const lastBlockSize = zcs->frameEnded ? 0 : ZSTD_BLOCKHEADERSIZE; -@@ -6090,7 +6877,7 @@ static ZSTD_compressionParameters ZSTD_g +@@ -6092,7 +6879,7 @@ static ZSTD_compressionParameters ZSTD_g cp.targetLength = (unsigned)(-clampedCompressionLevel); } /* refine parameters based on srcSize & dictSize */ @@ -8785,7 +8785,7 @@ Signed-off-by: Oleksandr Natalenko } } -@@ -6125,3 +6912,29 @@ ZSTD_parameters ZSTD_getParams(int compr +@@ -6127,3 +6914,29 @@ ZSTD_parameters ZSTD_getParams(int compr if (srcSizeHint == 0) srcSizeHint = ZSTD_CONTENTSIZE_UNKNOWN; return ZSTD_getParams_internal(compressionLevel, srcSizeHint, dictSize, ZSTD_cpm_unknown); } @@ -18522,7 +18522,7 @@ Signed-off-by: Oleksandr Natalenko * All rights reserved. * * This source code is licensed under both the BSD-style license (found in the -@@ -77,7 +77,7 @@ EXPORT_SYMBOL(zstd_init_dstream); +@@ -113,7 +113,7 @@ EXPORT_SYMBOL(zstd_init_dstream); size_t zstd_reset_dstream(zstd_dstream *dstream) { diff --git a/debian/patches/patchset-pf/zstd/0002-lib-zstd-Refactor-intentional-wrap-around-test.patch b/debian/patches/patchset-pf/zstd/0002-lib-zstd-Refactor-intentional-wrap-around-test.patch index 3b837a1..2cd625d 100644 --- a/debian/patches/patchset-pf/zstd/0002-lib-zstd-Refactor-intentional-wrap-around-test.patch +++ b/debian/patches/patchset-pf/zstd/0002-lib-zstd-Refactor-intentional-wrap-around-test.patch @@ -1,4 +1,4 @@ -From c09f361b41027ca073de5631c66dfe0e7275c3a4 Mon Sep 17 00:00:00 2001 +From 3dacd15edbed579d6966a884ce04aab95f1dfdeb Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Mon, 22 Jan 2024 16:27:56 -0800 Subject: lib: zstd: Refactor intentional wrap-around test diff --git a/debian/patches/patchset-xanmod/amd/0001-platform-x86-amd-amd_3d_vcache-Add-AMD-3D-V-Cache-op.patch b/debian/patches/patchset-xanmod/amd/0001-platform-x86-amd-amd_3d_vcache-Add-AMD-3D-V-Cache-op.patch new file mode 100644 index 0000000..9ee1fb7 --- /dev/null +++ b/debian/patches/patchset-xanmod/amd/0001-platform-x86-amd-amd_3d_vcache-Add-AMD-3D-V-Cache-op.patch @@ -0,0 +1,266 @@ +From d2589889bf6001daef33479d29680fa3f991fae9 Mon Sep 17 00:00:00 2001 +From: Basavaraj Natikar +Date: Tue, 12 Nov 2024 22:33:06 +0530 +Subject: [PATCH 1/2] platform/x86/amd: amd_3d_vcache: Add AMD 3D V-Cache + optimizer driver +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +AMD X3D processors, also known as AMD 3D V-Cache, feature dual Core +Complex Dies (CCDs) and enlarged L3 cache, enabling dynamic mode +switching between Frequency and Cache modes. To optimize performance, +implement the AMD 3D V-Cache Optimizer, which allows selecting either: + +Frequency mode: cores within the faster CCD are prioritized before +those in the slower CCD. + +Cache mode: cores within the larger L3 CCD are prioritized before +those in the smaller L3 CCD. + +Co-developed-by: Perry Yuan +Signed-off-by: Perry Yuan +Co-developed-by: Mario Limonciello +Signed-off-by: Mario Limonciello +Reviewed-by: Shyam Sundar S K +Reviewed-by: Armin Wolf +Signed-off-by: Basavaraj Natikar +Link: https://lore.kernel.org/r/20241112170307.3745777-2-Basavaraj.Natikar@amd.com +Reviewed-by: Ilpo Järvinen +Signed-off-by: Ilpo Järvinen +Signed-off-by: Alexandre Frade +--- + MAINTAINERS | 7 + + drivers/platform/x86/amd/Kconfig | 12 ++ + drivers/platform/x86/amd/Makefile | 2 + + drivers/platform/x86/amd/x3d_vcache.c | 176 ++++++++++++++++++++++++++ + 4 files changed, 197 insertions(+) + create mode 100644 drivers/platform/x86/amd/x3d_vcache.c + +--- a/MAINTAINERS ++++ b/MAINTAINERS +@@ -965,6 +965,13 @@ Q: https://patchwork.kernel.org/project/ + F: drivers/infiniband/hw/efa/ + F: include/uapi/rdma/efa-abi.h + ++AMD 3D V-CACHE PERFORMANCE OPTIMIZER DRIVER ++M: Basavaraj Natikar ++R: Mario Limonciello ++L: platform-driver-x86@vger.kernel.org ++S: Supported ++F: drivers/platform/x86/amd/x3d_vcache.c ++ + AMD ADDRESS TRANSLATION LIBRARY (ATL) + M: Yazen Ghannam + L: linux-edac@vger.kernel.org +--- a/drivers/platform/x86/amd/Kconfig ++++ b/drivers/platform/x86/amd/Kconfig +@@ -19,6 +19,18 @@ config AMD_HSMP + If you choose to compile this driver as a module the module will be + called amd_hsmp. + ++config AMD_3D_VCACHE ++ tristate "AMD 3D V-Cache Performance Optimizer Driver" ++ depends on X86_64 && ACPI ++ help ++ The driver provides a sysfs interface, enabling the setting of a bias ++ that alters CPU core reordering. This bias prefers cores with higher ++ frequencies or larger L3 caches on processors supporting AMD 3D V-Cache ++ technology. ++ ++ If you choose to compile this driver as a module the module will be ++ called amd_3d_vcache. ++ + config AMD_WBRF + bool "AMD Wifi RF Band mitigations (WBRF)" + depends on ACPI +--- a/drivers/platform/x86/amd/Makefile ++++ b/drivers/platform/x86/amd/Makefile +@@ -4,6 +4,8 @@ + # AMD x86 Platform-Specific Drivers + # + ++obj-$(CONFIG_AMD_3D_VCACHE) += amd_3d_vcache.o ++amd_3d_vcache-objs := x3d_vcache.o + obj-$(CONFIG_AMD_PMC) += pmc/ + amd_hsmp-y := hsmp.o + obj-$(CONFIG_AMD_HSMP) += amd_hsmp.o +--- /dev/null ++++ b/drivers/platform/x86/amd/x3d_vcache.c +@@ -0,0 +1,176 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later ++/* ++ * AMD 3D V-Cache Performance Optimizer Driver ++ * ++ * Copyright (c) 2024, Advanced Micro Devices, Inc. ++ * All Rights Reserved. ++ * ++ * Authors: Basavaraj Natikar ++ * Perry Yuan ++ * Mario Limonciello ++ */ ++ ++#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++static char *x3d_mode = "frequency"; ++module_param(x3d_mode, charp, 0); ++MODULE_PARM_DESC(x3d_mode, "Initial 3D-VCache mode; 'frequency' (default) or 'cache'"); ++ ++#define DSM_REVISION_ID 0 ++#define DSM_SET_X3D_MODE 1 ++ ++static guid_t x3d_guid = GUID_INIT(0xdff8e55f, 0xbcfd, 0x46fb, 0xba, 0x0a, ++ 0xef, 0xd0, 0x45, 0x0f, 0x34, 0xee); ++ ++enum amd_x3d_mode_type { ++ MODE_INDEX_FREQ, ++ MODE_INDEX_CACHE, ++}; ++ ++static const char * const amd_x3d_mode_strings[] = { ++ [MODE_INDEX_FREQ] = "frequency", ++ [MODE_INDEX_CACHE] = "cache", ++}; ++ ++struct amd_x3d_dev { ++ struct device *dev; ++ acpi_handle ahandle; ++ /* To protect x3d mode setting */ ++ struct mutex lock; ++ enum amd_x3d_mode_type curr_mode; ++}; ++ ++static int amd_x3d_get_mode(struct amd_x3d_dev *data) ++{ ++ guard(mutex)(&data->lock); ++ ++ return data->curr_mode; ++} ++ ++static int amd_x3d_mode_switch(struct amd_x3d_dev *data, int new_state) ++{ ++ union acpi_object *out, argv; ++ ++ guard(mutex)(&data->lock); ++ argv.type = ACPI_TYPE_INTEGER; ++ argv.integer.value = new_state; ++ ++ out = acpi_evaluate_dsm(data->ahandle, &x3d_guid, DSM_REVISION_ID, ++ DSM_SET_X3D_MODE, &argv); ++ if (!out) { ++ dev_err(data->dev, "failed to evaluate _DSM\n"); ++ return -EINVAL; ++ } ++ ++ data->curr_mode = new_state; ++ ++ kfree(out); ++ ++ return 0; ++} ++ ++static ssize_t amd_x3d_mode_store(struct device *dev, struct device_attribute *attr, ++ const char *buf, size_t count) ++{ ++ struct amd_x3d_dev *data = dev_get_drvdata(dev); ++ int ret; ++ ++ ret = sysfs_match_string(amd_x3d_mode_strings, buf); ++ if (ret < 0) ++ return ret; ++ ++ ret = amd_x3d_mode_switch(data, ret); ++ if (ret < 0) ++ return ret; ++ ++ return count; ++} ++ ++static ssize_t amd_x3d_mode_show(struct device *dev, struct device_attribute *attr, char *buf) ++{ ++ struct amd_x3d_dev *data = dev_get_drvdata(dev); ++ int mode = amd_x3d_get_mode(data); ++ ++ return sysfs_emit(buf, "%s\n", amd_x3d_mode_strings[mode]); ++} ++static DEVICE_ATTR_RW(amd_x3d_mode); ++ ++static struct attribute *amd_x3d_attrs[] = { ++ &dev_attr_amd_x3d_mode.attr, ++ NULL ++}; ++ATTRIBUTE_GROUPS(amd_x3d); ++ ++static int amd_x3d_resume_handler(struct device *dev) ++{ ++ struct amd_x3d_dev *data = dev_get_drvdata(dev); ++ int ret = amd_x3d_get_mode(data); ++ ++ return amd_x3d_mode_switch(data, ret); ++} ++ ++static DEFINE_SIMPLE_DEV_PM_OPS(amd_x3d_pm, NULL, amd_x3d_resume_handler); ++ ++static const struct acpi_device_id amd_x3d_acpi_ids[] = { ++ {"AMDI0101"}, ++ { }, ++}; ++MODULE_DEVICE_TABLE(acpi, amd_x3d_acpi_ids); ++ ++static int amd_x3d_probe(struct platform_device *pdev) ++{ ++ struct amd_x3d_dev *data; ++ acpi_handle handle; ++ int ret; ++ ++ handle = ACPI_HANDLE(&pdev->dev); ++ if (!handle) ++ return -ENODEV; ++ ++ if (!acpi_check_dsm(handle, &x3d_guid, DSM_REVISION_ID, BIT(DSM_SET_X3D_MODE))) ++ return -ENODEV; ++ ++ data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); ++ if (!data) ++ return -ENOMEM; ++ ++ data->dev = &pdev->dev; ++ ++ ret = devm_mutex_init(data->dev, &data->lock); ++ if (ret) ++ return ret; ++ ++ data->ahandle = handle; ++ platform_set_drvdata(pdev, data); ++ ++ ret = match_string(amd_x3d_mode_strings, ARRAY_SIZE(amd_x3d_mode_strings), x3d_mode); ++ if (ret < 0) ++ return dev_err_probe(&pdev->dev, -EINVAL, "invalid mode %s\n", x3d_mode); ++ ++ return amd_x3d_mode_switch(data, ret); ++} ++ ++static struct platform_driver amd_3d_vcache_driver = { ++ .driver = { ++ .name = "amd_x3d_vcache", ++ .dev_groups = amd_x3d_groups, ++ .acpi_match_table = amd_x3d_acpi_ids, ++ .pm = pm_sleep_ptr(&amd_x3d_pm), ++ }, ++ .probe = amd_x3d_probe, ++}; ++module_platform_driver(amd_3d_vcache_driver); ++ ++MODULE_DESCRIPTION("AMD 3D V-Cache Performance Optimizer Driver"); ++MODULE_LICENSE("GPL"); diff --git a/debian/patches/patchset-xanmod/amd/0002-platform-x86-amd-amd_3d_vcache-Add-sysfs-ABI-documen.patch b/debian/patches/patchset-xanmod/amd/0002-platform-x86-amd-amd_3d_vcache-Add-sysfs-ABI-documen.patch new file mode 100644 index 0000000..196157c --- /dev/null +++ b/debian/patches/patchset-xanmod/amd/0002-platform-x86-amd-amd_3d_vcache-Add-sysfs-ABI-documen.patch @@ -0,0 +1,55 @@ +From edf899b17950e1b926889b501e06c86dd867bac0 Mon Sep 17 00:00:00 2001 +From: Basavaraj Natikar +Date: Tue, 12 Nov 2024 22:33:07 +0530 +Subject: [PATCH 2/2] platform/x86/amd: amd_3d_vcache: Add sysfs ABI + documentation +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Add documentation for the amd_3d_vcache sysfs bus platform driver +interface so that userspace applications can use it to change mode +preferences, either frequency or cache. + +Co-developed-by: Perry Yuan +Signed-off-by: Perry Yuan +Co-developed-by: Mario Limonciello +Signed-off-by: Mario Limonciello +Reviewed-by: Shyam Sundar S K +Reviewed-by: Armin Wolf +Reviewed-by: Ilpo Järvinen +Signed-off-by: Basavaraj Natikar +Link: https://lore.kernel.org/r/20241112170307.3745777-3-Basavaraj.Natikar@amd.com +Signed-off-by: Ilpo Järvinen +Signed-off-by: Alexandre Frade +--- + .../sysfs-bus-platform-drivers-amd_x3d_vcache | 12 ++++++++++++ + MAINTAINERS | 1 + + 2 files changed, 13 insertions(+) + create mode 100644 Documentation/ABI/testing/sysfs-bus-platform-drivers-amd_x3d_vcache + +--- /dev/null ++++ b/Documentation/ABI/testing/sysfs-bus-platform-drivers-amd_x3d_vcache +@@ -0,0 +1,12 @@ ++What: /sys/bus/platform/drivers/amd_x3d_vcache/AMDI0101:00/amd_x3d_mode ++Date: November 2024 ++KernelVersion: 6.13 ++Contact: Basavaraj Natikar ++Description: (RW) AMD 3D V-Cache optimizer allows users to switch CPU core ++ rankings dynamically. ++ ++ This file switches between these two modes: ++ - "frequency" cores within the faster CCD are prioritized before ++ those in the slower CCD. ++ - "cache" cores within the larger L3 CCD are prioritized before ++ those in the smaller L3 CCD. +--- a/MAINTAINERS ++++ b/MAINTAINERS +@@ -970,6 +970,7 @@ M: Basavaraj Natikar + L: platform-driver-x86@vger.kernel.org + S: Supported ++F: Documentation/ABI/testing/sysfs-bus-platform-drivers-amd_x3d_vcache + F: drivers/platform/x86/amd/x3d_vcache.c + + AMD ADDRESS TRANSLATION LIBRARY (ATL) diff --git a/debian/patches/patchset-xanmod/binder/0001-binder-turn-into-module.patch b/debian/patches/patchset-xanmod/binder/0001-binder-turn-into-module.patch index 208de2c..c6a559a 100644 --- a/debian/patches/patchset-xanmod/binder/0001-binder-turn-into-module.patch +++ b/debian/patches/patchset-xanmod/binder/0001-binder-turn-into-module.patch @@ -1,4 +1,4 @@ -From 0bbb6450b1ba362c1c2e7d8d752b39ec9844629b Mon Sep 17 00:00:00 2001 +From b492213c96ded86e7800b320706ad15bd31c7c1b Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Wed, 16 Jan 2019 23:13:25 +0100 Subject: [PATCH 1/4] binder: turn into module @@ -29,21 +29,6 @@ Signed-off-by: Seth Forshee [ arighi: zap_page_range() has been dropped, export zap_page_range_single() in 6.3 ] Signed-off-by: Andrea Righi Signed-off-by: Alexandre Frade ---- - drivers/android/Kconfig | 6 +++--- - drivers/android/binder.c | 17 ++++++++++++++--- - drivers/android/binder_alloc.h | 3 ++- - drivers/android/binder_internal.h | 5 +++-- - drivers/android/binderfs.c | 6 +++--- - fs/file.c | 1 + - include/linux/ipc_namespace.h | 3 +++ - ipc/namespace.c | 17 +++++++++++++++++ - kernel/sched/syscalls.c | 1 + - kernel/task_work.c | 1 + - mm/memory.c | 1 + - mm/vmalloc.c | 1 + - security/security.c | 4 ++++ - 14 files changed, 61 insertions(+), 15 deletions(-) --- a/drivers/android/Kconfig +++ b/drivers/android/Kconfig @@ -60,7 +45,7 @@ Signed-off-by: Alexandre Frade Binderfs is a pseudo-filesystem for the Android Binder IPC driver --- a/drivers/android/binder.c +++ b/drivers/android/binder.c -@@ -6713,9 +6713,20 @@ err_alloc_device_names_failed: +@@ -7027,9 +7027,20 @@ err_alloc_device_names_failed: return ret; } @@ -133,7 +118,7 @@ Signed-off-by: Alexandre Frade static inline int __init init_binderfs(void) --- a/drivers/android/binderfs.c +++ b/drivers/android/binderfs.c -@@ -120,7 +120,7 @@ static int binderfs_binder_device_create +@@ -122,7 +122,7 @@ static int binderfs_binder_device_create struct super_block *sb = ref_inode->i_sb; struct binderfs_info *info = sb->s_fs_info; #if defined(CONFIG_IPC_NS) @@ -142,7 +127,7 @@ Signed-off-by: Alexandre Frade #else bool use_reserve = true; #endif -@@ -397,7 +397,7 @@ static int binderfs_binder_ctl_create(st +@@ -399,7 +399,7 @@ static int binderfs_binder_ctl_create(st struct dentry *root = sb->s_root; struct binderfs_info *info = sb->s_fs_info; #if defined(CONFIG_IPC_NS) @@ -151,7 +136,7 @@ Signed-off-by: Alexandre Frade #else bool use_reserve = true; #endif -@@ -683,7 +683,7 @@ static int binderfs_fill_super(struct su +@@ -691,7 +691,7 @@ static int binderfs_fill_super(struct su return -ENOMEM; info = sb->s_fs_info; @@ -199,7 +184,7 @@ Signed-off-by: Alexandre Frade return container_of(ns, struct ipc_namespace, ns); --- a/mm/vmalloc.c +++ b/mm/vmalloc.c -@@ -3166,6 +3166,7 @@ struct vm_struct *get_vm_area(unsigned l +@@ -3176,6 +3176,7 @@ struct vm_struct *get_vm_area(unsigned l NUMA_NO_NODE, GFP_KERNEL, __builtin_return_address(0)); } diff --git a/debian/patches/patchset-xanmod/clearlinux/0001-sched-wait-Do-accept-in-LIFO-order-for-cache-efficie.patch b/debian/patches/patchset-xanmod/clearlinux/0001-sched-wait-Do-accept-in-LIFO-order-for-cache-efficie.patch index e9f5aca..87f003a 100644 --- a/debian/patches/patchset-xanmod/clearlinux/0001-sched-wait-Do-accept-in-LIFO-order-for-cache-efficie.patch +++ b/debian/patches/patchset-xanmod/clearlinux/0001-sched-wait-Do-accept-in-LIFO-order-for-cache-efficie.patch @@ -1,4 +1,4 @@ -From 1e2892b83e6c4062623f9aec06eba27884d47059 Mon Sep 17 00:00:00 2001 +From cdcc9fde68f01d86d8f9ff0baaf0e9fbd15fa8ba Mon Sep 17 00:00:00 2001 From: Arjan van de Ven Date: Thu, 13 Dec 2018 01:00:49 +0000 Subject: [PATCH 1/4] sched/wait: Do accept() in LIFO order for cache diff --git a/debian/patches/patchset-xanmod/clearlinux/0002-firmware-Enable-stateless-firmware-loading.patch b/debian/patches/patchset-xanmod/clearlinux/0002-firmware-Enable-stateless-firmware-loading.patch index b9342a8..c4989b8 100644 --- a/debian/patches/patchset-xanmod/clearlinux/0002-firmware-Enable-stateless-firmware-loading.patch +++ b/debian/patches/patchset-xanmod/clearlinux/0002-firmware-Enable-stateless-firmware-loading.patch @@ -1,4 +1,4 @@ -From 52caaf4af0242cc3ac1ddaf9791c4c08a4b7226d Mon Sep 17 00:00:00 2001 +From c6f8d4723c8185d7096cdea7f5e499184f22426e Mon Sep 17 00:00:00 2001 From: William Douglas Date: Wed, 20 Jun 2018 17:23:21 +0000 Subject: [PATCH 2/4] firmware: Enable stateless firmware loading diff --git a/debian/patches/patchset-xanmod/clearlinux/0003-locking-rwsem-spin-faster.patch b/debian/patches/patchset-xanmod/clearlinux/0003-locking-rwsem-spin-faster.patch index 79cbb57..56bb85e 100644 --- a/debian/patches/patchset-xanmod/clearlinux/0003-locking-rwsem-spin-faster.patch +++ b/debian/patches/patchset-xanmod/clearlinux/0003-locking-rwsem-spin-faster.patch @@ -1,4 +1,4 @@ -From f57e26428b29ddcdf58b35659002293bde1bf281 Mon Sep 17 00:00:00 2001 +From 78a04a7536d68fa0d8e7dc2955d37aa7f592fca5 Mon Sep 17 00:00:00 2001 From: Arjan van de Ven Date: Sun, 18 Feb 2018 23:35:41 +0000 Subject: [PATCH 3/4] locking: rwsem: spin faster @@ -12,7 +12,7 @@ Signed-off-by: Alexandre Frade --- a/kernel/locking/rwsem.c +++ b/kernel/locking/rwsem.c -@@ -749,6 +749,7 @@ rwsem_spin_on_owner(struct rw_semaphore +@@ -747,6 +747,7 @@ rwsem_spin_on_owner(struct rw_semaphore struct task_struct *new, *owner; unsigned long flags, new_flags; enum owner_state state; @@ -20,7 +20,7 @@ Signed-off-by: Alexandre Frade lockdep_assert_preemption_disabled(); -@@ -785,7 +786,8 @@ rwsem_spin_on_owner(struct rw_semaphore +@@ -783,7 +784,8 @@ rwsem_spin_on_owner(struct rw_semaphore break; } diff --git a/debian/patches/patchset-xanmod/net/netfilter/0001-netfilter-Add-netfilter-nf_tables-fullcone-support.patch b/debian/patches/patchset-xanmod/net/netfilter/0001-netfilter-Add-netfilter-nf_tables-fullcone-support.patch index a6c2e65..6b75adc 100644 --- a/debian/patches/patchset-xanmod/net/netfilter/0001-netfilter-Add-netfilter-nf_tables-fullcone-support.patch +++ b/debian/patches/patchset-xanmod/net/netfilter/0001-netfilter-Add-netfilter-nf_tables-fullcone-support.patch @@ -1,4 +1,4 @@ -From f68a84ded01d688aa58a973788f507899fbe191f Mon Sep 17 00:00:00 2001 +From 2099f9c57216c836e445d2f6ba65f04131267f47 Mon Sep 17 00:00:00 2001 From: Alexandre Frade Date: Mon, 27 Feb 2023 01:38:18 +0000 Subject: [PATCH 1/2] netfilter: Add netfilter nf_tables fullcone support @@ -1819,7 +1819,7 @@ Signed-off-by: Alexandre Frade +MODULE_DESCRIPTION("Netfilter fullcone expression support library of RFC3489 full cone NAT"); --- /dev/null +++ b/net/netfilter/nft_ext_fullcone.c -@@ -0,0 +1,466 @@ +@@ -0,0 +1,470 @@ +// SPDX-License-Identifier: GPL-2.0-only + +/* @@ -1947,7 +1947,11 @@ Signed-off-by: Alexandre Frade +} +#endif + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0) ++static int nft_fullcone_validate(const struct nft_ctx *ctx, const struct nft_expr *expr) ++#else +static int nft_fullcone_validate(const struct nft_ctx *ctx, const struct nft_expr *expr, const struct nft_data **data) ++#endif +{ + int err; + diff --git a/debian/patches/patchset-xanmod/net/netfilter/0002-netfilter-add-xt_FLOWOFFLOAD-target.patch b/debian/patches/patchset-xanmod/net/netfilter/0002-netfilter-add-xt_FLOWOFFLOAD-target.patch index ca309c3..c165b36 100644 --- a/debian/patches/patchset-xanmod/net/netfilter/0002-netfilter-add-xt_FLOWOFFLOAD-target.patch +++ b/debian/patches/patchset-xanmod/net/netfilter/0002-netfilter-add-xt_FLOWOFFLOAD-target.patch @@ -1,4 +1,4 @@ -From 9a066610b055315bf155a99b2ea0a58245ef11e2 Mon Sep 17 00:00:00 2001 +From 6fbfabdc4e5ef8a186c27e4ed2db28ee1ddf4b4e Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 20 Feb 2018 15:56:02 +0100 Subject: [PATCH 2/2] netfilter: add xt_FLOWOFFLOAD target diff --git a/debian/patches/patchset-xanmod/net/tcp/cloudflare/0001-tcp-Add-a-sysctl-to-skip-tcp-collapse-processing-whe.patch b/debian/patches/patchset-xanmod/net/tcp/cloudflare/0001-tcp-Add-a-sysctl-to-skip-tcp-collapse-processing-whe.patch index 06f4c22..8f1cd81 100644 --- a/debian/patches/patchset-xanmod/net/tcp/cloudflare/0001-tcp-Add-a-sysctl-to-skip-tcp-collapse-processing-whe.patch +++ b/debian/patches/patchset-xanmod/net/tcp/cloudflare/0001-tcp-Add-a-sysctl-to-skip-tcp-collapse-processing-whe.patch @@ -1,4 +1,4 @@ -From 772c6e460211ac740b2550fa75be36b8a49731fe Mon Sep 17 00:00:00 2001 +From 2b4dc54edd1589e720e5b27e4536fd549c31f34e Mon Sep 17 00:00:00 2001 From: "mfreemon@cloudflare.com" Date: Tue, 1 Mar 2022 17:06:02 -0600 Subject: [PATCH] tcp: Add a sysctl to skip tcp collapse processing when the @@ -41,7 +41,7 @@ Signed-off-by: Alexandre Frade --- a/include/net/netns/ipv4.h +++ b/include/net/netns/ipv4.h -@@ -223,6 +223,7 @@ struct netns_ipv4 { +@@ -226,6 +226,7 @@ struct netns_ipv4 { u8 sysctl_fib_notify_on_flag_change; u8 sysctl_tcp_syn_linear_timeouts; @@ -83,7 +83,7 @@ Signed-off-by: Alexandre Frade .maxlen = sizeof(u8), --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c -@@ -5645,6 +5645,7 @@ static bool tcp_prune_ofo_queue(struct s +@@ -5652,6 +5652,7 @@ static bool tcp_prune_ofo_queue(struct s static int tcp_prune_queue(struct sock *sk, const struct sk_buff *in_skb) { struct tcp_sock *tp = tcp_sk(sk); @@ -91,7 +91,7 @@ Signed-off-by: Alexandre Frade NET_INC_STATS(sock_net(sk), LINUX_MIB_PRUNECALLED); -@@ -5656,6 +5657,39 @@ static int tcp_prune_queue(struct sock * +@@ -5663,6 +5664,39 @@ static int tcp_prune_queue(struct sock * if (atomic_read(&sk->sk_rmem_alloc) <= sk->sk_rcvbuf) return 0; @@ -131,7 +131,7 @@ Signed-off-by: Alexandre Frade tcp_collapse_ofo_queue(sk); if (!skb_queue_empty(&sk->sk_receive_queue)) tcp_collapse(sk, &sk->sk_receive_queue, NULL, -@@ -5674,6 +5708,8 @@ static int tcp_prune_queue(struct sock * +@@ -5681,6 +5715,8 @@ static int tcp_prune_queue(struct sock * if (atomic_read(&sk->sk_rmem_alloc) <= sk->sk_rcvbuf) return 0; @@ -142,7 +142,7 @@ Signed-off-by: Alexandre Frade * and hopefully then we'll have sufficient space. --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c -@@ -3508,6 +3508,7 @@ static int __net_init tcp_sk_init(struct +@@ -3524,6 +3524,7 @@ static int __net_init tcp_sk_init(struct net->ipv4.sysctl_tcp_syn_linear_timeouts = 4; net->ipv4.sysctl_tcp_shrink_window = 0; diff --git a/debian/patches/patchset-xanmod/pci_acso/0001-PCI-Enable-overrides-for-missing-ACS-capabilities.patch b/debian/patches/patchset-xanmod/pci_acso/0001-PCI-Enable-overrides-for-missing-ACS-capabilities.patch index 4581564..043c552 100644 --- a/debian/patches/patchset-xanmod/pci_acso/0001-PCI-Enable-overrides-for-missing-ACS-capabilities.patch +++ b/debian/patches/patchset-xanmod/pci_acso/0001-PCI-Enable-overrides-for-missing-ACS-capabilities.patch @@ -1,4 +1,4 @@ -From 454d96573eea54fcb7714a4a455d13173dfb9768 Mon Sep 17 00:00:00 2001 +From d79c32bd2a17e206d1c198570ef705549d0f644b Mon Sep 17 00:00:00 2001 From: Mark Weiman Date: Sun, 12 Aug 2018 11:36:21 -0400 Subject: [PATCH] PCI: Enable overrides for missing ACS capabilities @@ -55,7 +55,7 @@ Signed-off-by: Alexandre Frade --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt -@@ -4414,6 +4414,15 @@ +@@ -4475,6 +4475,15 @@ nomsi [MSI] If the PCI_MSI kernel config parameter is enabled, this kernel boot option can be used to disable the use of MSI interrupts system-wide. diff --git a/debian/patches/patchset-xanmod/valve/0001-extcon-Add-driver-for-Steam-Deck.patch b/debian/patches/patchset-xanmod/valve/0001-extcon-Add-driver-for-Steam-Deck.patch index a32e0d3..591609e 100644 --- a/debian/patches/patchset-xanmod/valve/0001-extcon-Add-driver-for-Steam-Deck.patch +++ b/debian/patches/patchset-xanmod/valve/0001-extcon-Add-driver-for-Steam-Deck.patch @@ -1,4 +1,4 @@ -From e054b70adebd85ed4ab62b458ee6ec3e902d970f Mon Sep 17 00:00:00 2001 +From e914b6a0d571a92db04869a02e06dc83ec7c0700 Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Sun, 27 Feb 2022 14:46:08 -0800 Subject: [PATCH 1/6] extcon: Add driver for Steam Deck @@ -15,7 +15,7 @@ Signed-off-by: Alexandre Frade --- a/drivers/extcon/Kconfig +++ b/drivers/extcon/Kconfig -@@ -203,4 +203,11 @@ config EXTCON_RTK_TYPE_C +@@ -214,4 +214,11 @@ config EXTCON_RTK_TYPE_C The DHC (Digital Home Hub) RTD series SoC contains a type c module. This driver will detect the status of the type-c port. @@ -29,7 +29,7 @@ Signed-off-by: Alexandre Frade endif --- a/drivers/extcon/Makefile +++ b/drivers/extcon/Makefile -@@ -26,3 +26,4 @@ obj-$(CONFIG_EXTCON_USB_GPIO) += extcon- +@@ -27,3 +27,4 @@ obj-$(CONFIG_EXTCON_USB_GPIO) += extcon- obj-$(CONFIG_EXTCON_USBC_CROS_EC) += extcon-usbc-cros-ec.o obj-$(CONFIG_EXTCON_USBC_TUSB320) += extcon-usbc-tusb320.o obj-$(CONFIG_EXTCON_RTK_TYPE_C) += extcon-rtk-type-c.o diff --git a/debian/patches/patchset-xanmod/valve/0002-hwmon-Add-driver-for-Steam-Deck-s-EC-sensors.patch b/debian/patches/patchset-xanmod/valve/0002-hwmon-Add-driver-for-Steam-Deck-s-EC-sensors.patch index ec80cc4..5604c53 100644 --- a/debian/patches/patchset-xanmod/valve/0002-hwmon-Add-driver-for-Steam-Deck-s-EC-sensors.patch +++ b/debian/patches/patchset-xanmod/valve/0002-hwmon-Add-driver-for-Steam-Deck-s-EC-sensors.patch @@ -1,4 +1,4 @@ -From be312a466f817a38a48668f93bb07a75ff9fa875 Mon Sep 17 00:00:00 2001 +From 8fe7bb2680d3e1201fdf3329e51078831f32fe12 Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Sat, 19 Feb 2022 16:09:45 -0800 Subject: [PATCH 2/6] hwmon: Add driver for Steam Deck's EC sensors @@ -17,7 +17,7 @@ Signed-off-by: Alexandre Frade --- a/drivers/hwmon/Kconfig +++ b/drivers/hwmon/Kconfig -@@ -2050,6 +2050,17 @@ config SENSORS_SCH5636 +@@ -2053,6 +2053,17 @@ config SENSORS_SCH5636 This driver can also be built as a module. If so, the module will be called sch5636. @@ -37,14 +37,14 @@ Signed-off-by: Alexandre Frade depends on I2C --- a/drivers/hwmon/Makefile +++ b/drivers/hwmon/Makefile -@@ -207,6 +207,7 @@ obj-$(CONFIG_SENSORS_SMSC47M1) += smsc47 +@@ -208,6 +208,7 @@ obj-$(CONFIG_SENSORS_SMSC47M1) += smsc47 obj-$(CONFIG_SENSORS_SMSC47M192)+= smsc47m192.o obj-$(CONFIG_SENSORS_SPARX5) += sparx5-temp.o obj-$(CONFIG_SENSORS_SPD5118) += spd5118.o +obj-$(CONFIG_SENSORS_STEAMDECK) += steamdeck-hwmon.o obj-$(CONFIG_SENSORS_STTS751) += stts751.o obj-$(CONFIG_SENSORS_SURFACE_FAN)+= surface_fan.o - obj-$(CONFIG_SENSORS_SY7636A) += sy7636a-hwmon.o + obj-$(CONFIG_SENSORS_SURFACE_TEMP)+= surface_temp.o --- /dev/null +++ b/drivers/hwmon/steamdeck-hwmon.c @@ -0,0 +1,224 @@ diff --git a/debian/patches/patchset-xanmod/valve/0003-hwmon-steamdeck-hwmon-Add-support-for-max-battery-le.patch b/debian/patches/patchset-xanmod/valve/0003-hwmon-steamdeck-hwmon-Add-support-for-max-battery-le.patch index 874d5b9..d8e9782 100644 --- a/debian/patches/patchset-xanmod/valve/0003-hwmon-steamdeck-hwmon-Add-support-for-max-battery-le.patch +++ b/debian/patches/patchset-xanmod/valve/0003-hwmon-steamdeck-hwmon-Add-support-for-max-battery-le.patch @@ -1,4 +1,4 @@ -From efe7b80f8a7448265d238c13ed1b6e327a9c739e Mon Sep 17 00:00:00 2001 +From 8181870b30687aa9351d919d082bc2b671a9c4cb Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Sat, 15 Jul 2023 12:58:54 -0700 Subject: [PATCH 3/6] hwmon: steamdeck-hwmon: Add support for max battery diff --git a/debian/patches/patchset-xanmod/valve/0004-leds-steamdeck-Add-support-for-Steam-Deck-LED.patch b/debian/patches/patchset-xanmod/valve/0004-leds-steamdeck-Add-support-for-Steam-Deck-LED.patch index 98c746a..eb94a72 100644 --- a/debian/patches/patchset-xanmod/valve/0004-leds-steamdeck-Add-support-for-Steam-Deck-LED.patch +++ b/debian/patches/patchset-xanmod/valve/0004-leds-steamdeck-Add-support-for-Steam-Deck-LED.patch @@ -1,4 +1,4 @@ -From e76032abd59b7d2b15c8106630423e3091b298ce Mon Sep 17 00:00:00 2001 +From 4df11ab1bd9ad50e6ed928d1c2f3a8404775837b Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Sun, 27 Feb 2022 12:58:05 -0800 Subject: [PATCH 4/6] leds: steamdeck: Add support for Steam Deck LED @@ -15,7 +15,7 @@ Signed-off-by: Alexandre Frade --- a/drivers/leds/Kconfig +++ b/drivers/leds/Kconfig -@@ -951,6 +951,13 @@ config LEDS_ACER_A500 +@@ -959,6 +959,13 @@ config LEDS_ACER_A500 This option enables support for the Power Button LED of Acer Iconia Tab A500. diff --git a/debian/patches/patchset-xanmod/valve/0005-mfd-Add-MFD-core-driver-for-Steam-Deck.patch b/debian/patches/patchset-xanmod/valve/0005-mfd-Add-MFD-core-driver-for-Steam-Deck.patch index 8227294..71fb5ea 100644 --- a/debian/patches/patchset-xanmod/valve/0005-mfd-Add-MFD-core-driver-for-Steam-Deck.patch +++ b/debian/patches/patchset-xanmod/valve/0005-mfd-Add-MFD-core-driver-for-Steam-Deck.patch @@ -1,4 +1,4 @@ -From c3cf089a9da1216d3e1e047eba2ec46e0febe457 Mon Sep 17 00:00:00 2001 +From 947c953bf24af62c58e9eb0bab533816882b83a3 Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Sat, 19 Feb 2022 16:08:36 -0800 Subject: [PATCH 5/6] mfd: Add MFD core driver for Steam Deck @@ -19,7 +19,7 @@ Signed-off-by: Alexandre Frade --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig -@@ -2390,5 +2390,16 @@ config MFD_RSMU_SPI +@@ -2402,5 +2402,16 @@ config MFD_RSMU_SPI Additional drivers must be enabled in order to use the functionality of the device. @@ -38,7 +38,7 @@ Signed-off-by: Alexandre Frade endif --- a/drivers/mfd/Makefile +++ b/drivers/mfd/Makefile -@@ -288,3 +288,5 @@ obj-$(CONFIG_MFD_ATC260X_I2C) += atc260x +@@ -289,3 +289,5 @@ obj-$(CONFIG_MFD_ATC260X_I2C) += atc260x obj-$(CONFIG_MFD_RSMU_I2C) += rsmu_i2c.o rsmu_core.o obj-$(CONFIG_MFD_RSMU_SPI) += rsmu_spi.o rsmu_core.o diff --git a/debian/patches/patchset-xanmod/valve/0006-mfd-steamdeck-Expose-controller-board-power-in-sysfs.patch b/debian/patches/patchset-xanmod/valve/0006-mfd-steamdeck-Expose-controller-board-power-in-sysfs.patch index 7153da1..f4ca45d 100644 --- a/debian/patches/patchset-xanmod/valve/0006-mfd-steamdeck-Expose-controller-board-power-in-sysfs.patch +++ b/debian/patches/patchset-xanmod/valve/0006-mfd-steamdeck-Expose-controller-board-power-in-sysfs.patch @@ -1,4 +1,4 @@ -From c24abd65482a08109e756c612e83c8c8450a263b Mon Sep 17 00:00:00 2001 +From 2f8a2543aa33103cf237853d5f2ca8999261dd0d Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Sun, 24 Sep 2023 15:02:33 -0700 Subject: [PATCH 6/6] mfd: steamdeck: Expose controller board power in sysfs diff --git a/debian/patches/patchset-xanmod/xanmod/0002-kbuild-Remove-GCC-minimal-function-alignment.patch b/debian/patches/patchset-xanmod/xanmod/0001-kbuild-Remove-GCC-minimal-function-alignment.patch similarity index 92% rename from debian/patches/patchset-xanmod/xanmod/0002-kbuild-Remove-GCC-minimal-function-alignment.patch rename to debian/patches/patchset-xanmod/xanmod/0001-kbuild-Remove-GCC-minimal-function-alignment.patch index 4bf2185..62b3550 100644 --- a/debian/patches/patchset-xanmod/xanmod/0002-kbuild-Remove-GCC-minimal-function-alignment.patch +++ b/debian/patches/patchset-xanmod/xanmod/0001-kbuild-Remove-GCC-minimal-function-alignment.patch @@ -1,7 +1,7 @@ -From 867a311f231e89b4c9194579e40718f751761ffc Mon Sep 17 00:00:00 2001 +From 67e174927705e71b0d254ab6fab5af40193376a4 Mon Sep 17 00:00:00 2001 From: Alexandre Frade Date: Sat, 31 Aug 2024 16:57:41 +0000 -Subject: [PATCH 04/19] kbuild: Remove GCC minimal function alignment +Subject: [PATCH 03/18] kbuild: Remove GCC minimal function alignment Signed-off-by: Alexandre Frade --- @@ -12,7 +12,7 @@ Signed-off-by: Alexandre Frade --- a/Makefile +++ b/Makefile -@@ -981,15 +981,8 @@ export CC_FLAGS_FPU +@@ -996,15 +996,8 @@ export CC_FLAGS_FPU export CC_FLAGS_NO_FPU ifneq ($(CONFIG_FUNCTION_ALIGNMENT),0) @@ -30,7 +30,7 @@ Signed-off-by: Alexandre Frade NOSTDINC_FLAGS += -nostdinc --- a/arch/Kconfig +++ b/arch/Kconfig -@@ -1628,18 +1628,6 @@ config FUNCTION_ALIGNMENT +@@ -1667,18 +1667,6 @@ config FUNCTION_ALIGNMENT default 4 if FUNCTION_ALIGNMENT_4B default 0 diff --git a/debian/patches/patchset-xanmod/xanmod/0003-XANMOD-fair-Set-scheduler-tunable-latencies-to-unsca.patch b/debian/patches/patchset-xanmod/xanmod/0002-XANMOD-fair-Set-scheduler-tunable-latencies-to-unsca.patch similarity index 81% rename from debian/patches/patchset-xanmod/xanmod/0003-XANMOD-fair-Set-scheduler-tunable-latencies-to-unsca.patch rename to debian/patches/patchset-xanmod/xanmod/0002-XANMOD-fair-Set-scheduler-tunable-latencies-to-unsca.patch index bcbb768..eea1a0c 100644 --- a/debian/patches/patchset-xanmod/xanmod/0003-XANMOD-fair-Set-scheduler-tunable-latencies-to-unsca.patch +++ b/debian/patches/patchset-xanmod/xanmod/0002-XANMOD-fair-Set-scheduler-tunable-latencies-to-unsca.patch @@ -1,7 +1,7 @@ -From e98005253085b5a00881c085fab388a4742e700b Mon Sep 17 00:00:00 2001 +From 43c0eb6ded02d18daa26e0186ae2f92bec5bfb8f Mon Sep 17 00:00:00 2001 From: Alexandre Frade Date: Thu, 11 May 2023 19:41:41 +0000 -Subject: [PATCH 05/19] XANMOD: fair: Set scheduler tunable latencies to +Subject: [PATCH 04/18] XANMOD: fair: Set scheduler tunable latencies to unscaled Signed-off-by: Alexandre Frade diff --git a/debian/patches/patchset-xanmod/xanmod/0004-XANMOD-sched-Add-yield_type-sysctl-to-reduce-or-disa.patch b/debian/patches/patchset-xanmod/xanmod/0003-XANMOD-sched-Add-yield_type-sysctl-to-reduce-or-disa.patch similarity index 89% rename from debian/patches/patchset-xanmod/xanmod/0004-XANMOD-sched-Add-yield_type-sysctl-to-reduce-or-disa.patch rename to debian/patches/patchset-xanmod/xanmod/0003-XANMOD-sched-Add-yield_type-sysctl-to-reduce-or-disa.patch index 2f6063e..23027f5 100644 --- a/debian/patches/patchset-xanmod/xanmod/0004-XANMOD-sched-Add-yield_type-sysctl-to-reduce-or-disa.patch +++ b/debian/patches/patchset-xanmod/xanmod/0003-XANMOD-sched-Add-yield_type-sysctl-to-reduce-or-disa.patch @@ -1,7 +1,7 @@ -From 07341955b471371f5414f94814c49289de9319cf Mon Sep 17 00:00:00 2001 +From b20c46d59b4102165248167bd5911c2d695679cc Mon Sep 17 00:00:00 2001 From: Alexandre Frade Date: Sun, 15 Sep 2024 23:03:38 +0000 -Subject: [PATCH 06/19] XANMOD: sched: Add yield_type sysctl to reduce or +Subject: [PATCH 05/18] XANMOD: sched: Add yield_type sysctl to reduce or disable sched_yield Signed-off-by: Alexandre Frade @@ -12,7 +12,7 @@ Signed-off-by: Alexandre Frade --- a/kernel/sched/syscalls.c +++ b/kernel/sched/syscalls.c -@@ -1457,15 +1457,29 @@ SYSCALL_DEFINE3(sched_getaffinity, pid_t +@@ -1391,15 +1391,29 @@ SYSCALL_DEFINE3(sched_getaffinity, pid_t return ret; } diff --git a/debian/patches/patchset-xanmod/xanmod/0005-XANMOD-block-mq-deadline-Increase-write-priority-to-.patch b/debian/patches/patchset-xanmod/xanmod/0004-XANMOD-block-mq-deadline-Increase-write-priority-to-.patch similarity index 91% rename from debian/patches/patchset-xanmod/xanmod/0005-XANMOD-block-mq-deadline-Increase-write-priority-to-.patch rename to debian/patches/patchset-xanmod/xanmod/0004-XANMOD-block-mq-deadline-Increase-write-priority-to-.patch index 5c5c68e..c254688 100644 --- a/debian/patches/patchset-xanmod/xanmod/0005-XANMOD-block-mq-deadline-Increase-write-priority-to-.patch +++ b/debian/patches/patchset-xanmod/xanmod/0004-XANMOD-block-mq-deadline-Increase-write-priority-to-.patch @@ -1,7 +1,7 @@ -From 9d6ba825d8c8635e217f7596fb4401c9ef9d408a Mon Sep 17 00:00:00 2001 +From d23f0554f1b381f082dc81a6f3c523b90043b941 Mon Sep 17 00:00:00 2001 From: Alexandre Frade Date: Wed, 11 May 2022 18:56:51 +0000 -Subject: [PATCH 07/19] XANMOD: block/mq-deadline: Increase write priority to +Subject: [PATCH 06/18] XANMOD: block/mq-deadline: Increase write priority to improve responsiveness Signed-off-by: Alexandre Frade diff --git a/debian/patches/patchset-xanmod/xanmod/0006-XANMOD-block-mq-deadline-Disable-front_merges-by-def.patch b/debian/patches/patchset-xanmod/xanmod/0005-XANMOD-block-mq-deadline-Disable-front_merges-by-def.patch similarity index 83% rename from debian/patches/patchset-xanmod/xanmod/0006-XANMOD-block-mq-deadline-Disable-front_merges-by-def.patch rename to debian/patches/patchset-xanmod/xanmod/0005-XANMOD-block-mq-deadline-Disable-front_merges-by-def.patch index 00b1d78..ae21210 100644 --- a/debian/patches/patchset-xanmod/xanmod/0006-XANMOD-block-mq-deadline-Disable-front_merges-by-def.patch +++ b/debian/patches/patchset-xanmod/xanmod/0005-XANMOD-block-mq-deadline-Disable-front_merges-by-def.patch @@ -1,7 +1,7 @@ -From f4b45e0e5444254caf5992cde662236867ac388b Mon Sep 17 00:00:00 2001 +From 8c3035b22be106d8659d85c2651e589f53e89cc5 Mon Sep 17 00:00:00 2001 From: Alexandre Frade Date: Thu, 6 Jan 2022 16:59:01 +0000 -Subject: [PATCH 08/19] XANMOD: block/mq-deadline: Disable front_merges by +Subject: [PATCH 07/18] XANMOD: block/mq-deadline: Disable front_merges by default Signed-off-by: Alexandre Frade diff --git a/debian/patches/patchset-xanmod/xanmod/0007-XANMOD-block-Set-rq_affinity-to-force-complete-I-O-r.patch b/debian/patches/patchset-xanmod/xanmod/0006-XANMOD-block-Set-rq_affinity-to-force-complete-I-O-r.patch similarity index 84% rename from debian/patches/patchset-xanmod/xanmod/0007-XANMOD-block-Set-rq_affinity-to-force-complete-I-O-r.patch rename to debian/patches/patchset-xanmod/xanmod/0006-XANMOD-block-Set-rq_affinity-to-force-complete-I-O-r.patch index d26d787..d8902e8 100644 --- a/debian/patches/patchset-xanmod/xanmod/0007-XANMOD-block-Set-rq_affinity-to-force-complete-I-O-r.patch +++ b/debian/patches/patchset-xanmod/xanmod/0006-XANMOD-block-Set-rq_affinity-to-force-complete-I-O-r.patch @@ -1,7 +1,7 @@ -From 08580ad4d8ffb10cb30a228361d2d914a1502e3c Mon Sep 17 00:00:00 2001 +From 3d1e3f450e9ca926a899a0502fd34df6d483efae Mon Sep 17 00:00:00 2001 From: Alexandre Frade Date: Mon, 16 Sep 2024 15:36:01 +0000 -Subject: [PATCH 09/19] XANMOD: block: Set rq_affinity to force complete I/O +Subject: [PATCH 08/18] XANMOD: block: Set rq_affinity to force complete I/O requests on same CPU Signed-off-by: Alexandre Frade diff --git a/debian/patches/patchset-xanmod/xanmod/0008-XANMOD-blk-wbt-Set-wbt_default_latency_nsec-to-2msec.patch b/debian/patches/patchset-xanmod/xanmod/0007-XANMOD-blk-wbt-Set-wbt_default_latency_nsec-to-2msec.patch similarity index 84% rename from debian/patches/patchset-xanmod/xanmod/0008-XANMOD-blk-wbt-Set-wbt_default_latency_nsec-to-2msec.patch rename to debian/patches/patchset-xanmod/xanmod/0007-XANMOD-blk-wbt-Set-wbt_default_latency_nsec-to-2msec.patch index 10bf8f8..e06428f 100644 --- a/debian/patches/patchset-xanmod/xanmod/0008-XANMOD-blk-wbt-Set-wbt_default_latency_nsec-to-2msec.patch +++ b/debian/patches/patchset-xanmod/xanmod/0007-XANMOD-blk-wbt-Set-wbt_default_latency_nsec-to-2msec.patch @@ -1,7 +1,7 @@ -From 278088038e8259faf193e23ac16b48b0350da6fb Mon Sep 17 00:00:00 2001 +From 80e2bd58a4f13d1a946c6616e18d124b1291f2a7 Mon Sep 17 00:00:00 2001 From: Alexandre Frade Date: Mon, 15 Jul 2024 04:50:34 +0000 -Subject: [PATCH 10/19] XANMOD: blk-wbt: Set wbt_default_latency_nsec() to +Subject: [PATCH 09/18] XANMOD: blk-wbt: Set wbt_default_latency_nsec() to 2msec Signed-off-by: Alexandre Frade diff --git a/debian/patches/patchset-xanmod/xanmod/0009-XANMOD-kconfig-add-500Hz-timer-interrupt-kernel-conf.patch b/debian/patches/patchset-xanmod/xanmod/0008-XANMOD-kconfig-add-500Hz-timer-interrupt-kernel-conf.patch similarity index 87% rename from debian/patches/patchset-xanmod/xanmod/0009-XANMOD-kconfig-add-500Hz-timer-interrupt-kernel-conf.patch rename to debian/patches/patchset-xanmod/xanmod/0008-XANMOD-kconfig-add-500Hz-timer-interrupt-kernel-conf.patch index 1b9156c..e03b5e6 100644 --- a/debian/patches/patchset-xanmod/xanmod/0009-XANMOD-kconfig-add-500Hz-timer-interrupt-kernel-conf.patch +++ b/debian/patches/patchset-xanmod/xanmod/0008-XANMOD-kconfig-add-500Hz-timer-interrupt-kernel-conf.patch @@ -1,7 +1,7 @@ -From 1637fbf551572f4578ed5644ae485b8da659b509 Mon Sep 17 00:00:00 2001 +From 74767b639b4e9141b1961764655111a4fd62a5ab Mon Sep 17 00:00:00 2001 From: Alexandre Frade Date: Mon, 29 Jan 2018 17:26:15 +0000 -Subject: [PATCH 11/19] XANMOD: kconfig: add 500Hz timer interrupt kernel +Subject: [PATCH 10/18] XANMOD: kconfig: add 500Hz timer interrupt kernel config option Signed-off-by: Alexandre Frade diff --git a/debian/patches/patchset-xanmod/xanmod/0010-XANMOD-dcache-cache_pressure-50-decreases-the-rate-a.patch b/debian/patches/patchset-xanmod/xanmod/0009-XANMOD-dcache-cache_pressure-50-decreases-the-rate-a.patch similarity index 82% rename from debian/patches/patchset-xanmod/xanmod/0010-XANMOD-dcache-cache_pressure-50-decreases-the-rate-a.patch rename to debian/patches/patchset-xanmod/xanmod/0009-XANMOD-dcache-cache_pressure-50-decreases-the-rate-a.patch index 0cee4de..ff618ae 100644 --- a/debian/patches/patchset-xanmod/xanmod/0010-XANMOD-dcache-cache_pressure-50-decreases-the-rate-a.patch +++ b/debian/patches/patchset-xanmod/xanmod/0009-XANMOD-dcache-cache_pressure-50-decreases-the-rate-a.patch @@ -1,7 +1,7 @@ -From 53a8dc8afb62674acc347ac7d9ebb46338ab7d64 Mon Sep 17 00:00:00 2001 +From a047058c64e9d75db8e714a8c1202057920e21c7 Mon Sep 17 00:00:00 2001 From: Alexandre Frade Date: Mon, 29 Jan 2018 16:59:22 +0000 -Subject: [PATCH 12/19] XANMOD: dcache: cache_pressure = 50 decreases the rate +Subject: [PATCH 11/18] XANMOD: dcache: cache_pressure = 50 decreases the rate at which VFS caches are reclaimed Signed-off-by: Alexandre Frade diff --git a/debian/patches/patchset-xanmod/xanmod/0010-XANMOD-mm-Raise-max_map_count-default-value.patch b/debian/patches/patchset-xanmod/xanmod/0010-XANMOD-mm-Raise-max_map_count-default-value.patch new file mode 100644 index 0000000..fd6228c --- /dev/null +++ b/debian/patches/patchset-xanmod/xanmod/0010-XANMOD-mm-Raise-max_map_count-default-value.patch @@ -0,0 +1,48 @@ +From 910bd8c627ea16ea9bcf70c153197aaba473b6b9 Mon Sep 17 00:00:00 2001 +From: Alexandre Frade +Date: Sun, 28 Apr 2024 09:06:54 +0000 +Subject: [PATCH 12/18] XANMOD: mm: Raise max_map_count default value + +Signed-off-by: Alexandre Frade +--- + Documentation/admin-guide/sysctl/vm.rst | 2 +- + include/linux/mm.h | 11 ++++++----- + 2 files changed, 7 insertions(+), 6 deletions(-) + +--- a/Documentation/admin-guide/sysctl/vm.rst ++++ b/Documentation/admin-guide/sysctl/vm.rst +@@ -461,7 +461,7 @@ While most applications need less than a + programs, particularly malloc debuggers, may consume lots of them, + e.g., up to one or two maps per allocation. + +-The default value is 65530. ++The XanMod default value is 2147483642. + + + mem_profiling +--- a/include/linux/mm.h ++++ b/include/linux/mm.h +@@ -191,17 +191,18 @@ static inline void __mm_zero_struct_page + * + * When a program's coredump is generated as ELF format, a section is created + * per a vma. In ELF, the number of sections is represented in unsigned short. +- * This means the number of sections should be smaller than 65535 at coredump. ++ * This means the number of sections should be smaller than 2147483647 at ++ * coredump. + * Because the kernel adds some informative sections to a image of program at + * generating coredump, we need some margin. The number of extra sections is + * 1-3 now and depends on arch. We use "5" as safe margin, here. + * +- * ELF extended numbering allows more than 65535 sections, so 16-bit bound is +- * not a hard limit any more. Although some userspace tools can be surprised by +- * that. ++ * ELF extended numbering allows more than 2147483647 sections, so 16-bit bound ++ * is not a hard limit any more. Although some userspace tools can be surprised ++ * by that. + */ + #define MAPCOUNT_ELF_CORE_MARGIN (5) +-#define DEFAULT_MAX_MAP_COUNT (USHRT_MAX - MAPCOUNT_ELF_CORE_MARGIN) ++#define DEFAULT_MAX_MAP_COUNT (INT_MAX - MAPCOUNT_ELF_CORE_MARGIN) + + extern int sysctl_max_map_count; + diff --git a/debian/patches/patchset-xanmod/xanmod/0011-XANMOD-mm-vmscan-Set-minimum-amount-of-swapping.patch b/debian/patches/patchset-xanmod/xanmod/0011-XANMOD-mm-vmscan-Set-minimum-amount-of-swapping.patch index cade3be..0c7d7c1 100644 --- a/debian/patches/patchset-xanmod/xanmod/0011-XANMOD-mm-vmscan-Set-minimum-amount-of-swapping.patch +++ b/debian/patches/patchset-xanmod/xanmod/0011-XANMOD-mm-vmscan-Set-minimum-amount-of-swapping.patch @@ -1,7 +1,7 @@ -From 73df371934a8b28f57030858965f6869c3705836 Mon Sep 17 00:00:00 2001 +From 1ad86d993666c2d74ed6fd97e143b073e4b2c4c9 Mon Sep 17 00:00:00 2001 From: Alexandre Frade Date: Wed, 14 Aug 2024 18:54:53 +0000 -Subject: [PATCH 14/19] XANMOD: mm/vmscan: Set minimum amount of swapping +Subject: [PATCH 13/18] XANMOD: mm/vmscan: Set minimum amount of swapping Signed-off-by: Alexandre Frade --- diff --git a/debian/patches/patchset-xanmod/xanmod/0012-XANMOD-sched-autogroup-Add-kernel-parameter-and-conf.patch b/debian/patches/patchset-xanmod/xanmod/0012-XANMOD-sched-autogroup-Add-kernel-parameter-and-conf.patch index 35532a1..b0c9ba7 100644 --- a/debian/patches/patchset-xanmod/xanmod/0012-XANMOD-sched-autogroup-Add-kernel-parameter-and-conf.patch +++ b/debian/patches/patchset-xanmod/xanmod/0012-XANMOD-sched-autogroup-Add-kernel-parameter-and-conf.patch @@ -1,7 +1,7 @@ -From 8b42012dc4aa0008ad10cf7575f684ebc3a587cf Mon Sep 17 00:00:00 2001 +From a24ca4c968092cf419821aaaa57b070c088e74e7 Mon Sep 17 00:00:00 2001 From: Alexandre Frade Date: Wed, 15 Jun 2022 17:07:29 +0000 -Subject: [PATCH 15/19] XANMOD: sched/autogroup: Add kernel parameter and +Subject: [PATCH 14/18] XANMOD: sched/autogroup: Add kernel parameter and config option to enable/disable autogroup feature by default Signed-off-by: Alexandre Frade @@ -13,7 +13,7 @@ Signed-off-by: Alexandre Frade --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt -@@ -493,6 +493,10 @@ +@@ -498,6 +498,10 @@ Format: (must be >=0) Default: 64 @@ -24,7 +24,7 @@ Signed-off-by: Alexandre Frade bau= [X86_UV] Enable the BAU on SGI UV. The default behavior is to disable the BAU (i.e. bau=0). Format: { "0" | "1" } -@@ -3835,8 +3839,6 @@ +@@ -3881,8 +3885,6 @@ noapic [SMP,APIC,EARLY] Tells the kernel to not make use of any IOAPICs that may be present in the system. @@ -35,7 +35,7 @@ Signed-off-by: Alexandre Frade no_console_suspend --- a/init/Kconfig +++ b/init/Kconfig -@@ -1318,6 +1318,18 @@ config SCHED_AUTOGROUP +@@ -1353,6 +1353,18 @@ config SCHED_AUTOGROUP desktop applications. Task group autogeneration is currently based upon task session. diff --git a/debian/patches/patchset-xanmod/xanmod/0013-XANMOD-cpufreq-tunes-ondemand-and-conservative-gover.patch b/debian/patches/patchset-xanmod/xanmod/0013-XANMOD-cpufreq-tunes-ondemand-and-conservative-gover.patch index b8f9198..86b7862 100644 --- a/debian/patches/patchset-xanmod/xanmod/0013-XANMOD-cpufreq-tunes-ondemand-and-conservative-gover.patch +++ b/debian/patches/patchset-xanmod/xanmod/0013-XANMOD-cpufreq-tunes-ondemand-and-conservative-gover.patch @@ -1,7 +1,7 @@ -From f41037c4ee33dd201c1750727daa390a3f652516 Mon Sep 17 00:00:00 2001 +From 4664b97efde786ff28f2eb234c1d59c9da30c3b4 Mon Sep 17 00:00:00 2001 From: Alexandre Frade Date: Tue, 31 Mar 2020 13:32:08 -0300 -Subject: [PATCH 16/19] XANMOD: cpufreq: tunes ondemand and conservative +Subject: [PATCH 15/18] XANMOD: cpufreq: tunes ondemand and conservative governor for performance Signed-off-by: Alexandre Frade diff --git a/debian/patches/patchset-xanmod/xanmod/0014-XANMOD-lib-kconfig.debug-disable-default-SYMBOLIC_ER.patch b/debian/patches/patchset-xanmod/xanmod/0014-XANMOD-lib-kconfig.debug-disable-default-SYMBOLIC_ER.patch index 9a2d7f8..a74c187 100644 --- a/debian/patches/patchset-xanmod/xanmod/0014-XANMOD-lib-kconfig.debug-disable-default-SYMBOLIC_ER.patch +++ b/debian/patches/patchset-xanmod/xanmod/0014-XANMOD-lib-kconfig.debug-disable-default-SYMBOLIC_ER.patch @@ -1,7 +1,7 @@ -From 000614733021b6723cfd78a4908b9b2e869ea001 Mon Sep 17 00:00:00 2001 +From 444f831f229a418b4865d11940b3987f55ab151f Mon Sep 17 00:00:00 2001 From: Alexandre Frade Date: Mon, 16 Sep 2024 08:09:56 +0000 -Subject: [PATCH 17/19] XANMOD: lib/kconfig.debug: disable default +Subject: [PATCH 16/18] XANMOD: lib/kconfig.debug: disable default SYMBOLIC_ERRNAME and DEBUG_BUGVERBOSE Signed-off-by: Alexandre Frade diff --git a/debian/patches/patchset-xanmod/xanmod/0015-XANMOD-scripts-setlocalversion-remove-tag-for-git-re.patch b/debian/patches/patchset-xanmod/xanmod/0015-XANMOD-scripts-setlocalversion-remove-tag-for-git-re.patch index 86c8375..7112826 100644 --- a/debian/patches/patchset-xanmod/xanmod/0015-XANMOD-scripts-setlocalversion-remove-tag-for-git-re.patch +++ b/debian/patches/patchset-xanmod/xanmod/0015-XANMOD-scripts-setlocalversion-remove-tag-for-git-re.patch @@ -1,7 +1,7 @@ -From bea9f2e6b80582dc36b5693e08633546b14b2a4e Mon Sep 17 00:00:00 2001 +From 3536b212b829712a928b03cf513f3da87e15b3ef Mon Sep 17 00:00:00 2001 From: Alexandre Frade Date: Sun, 29 May 2022 00:57:40 +0000 -Subject: [PATCH 18/19] XANMOD: scripts/setlocalversion: remove "+" tag for git +Subject: [PATCH 17/18] XANMOD: scripts/setlocalversion: remove "+" tag for git repo short version Signed-off-by: Alexandre Frade diff --git a/debian/patches/patchset-xanmod/xanmod/0016-XANMOD-scripts-setlocalversion-Move-localversion-fil.patch b/debian/patches/patchset-xanmod/xanmod/0016-XANMOD-scripts-setlocalversion-Move-localversion-fil.patch index 148106e..6251e2c 100644 --- a/debian/patches/patchset-xanmod/xanmod/0016-XANMOD-scripts-setlocalversion-Move-localversion-fil.patch +++ b/debian/patches/patchset-xanmod/xanmod/0016-XANMOD-scripts-setlocalversion-Move-localversion-fil.patch @@ -1,7 +1,7 @@ -From eb42d6c8411f9a70472e6f3632051e2e44910843 Mon Sep 17 00:00:00 2001 +From 857de795e16a927cf251e5ede247b6e96938916e Mon Sep 17 00:00:00 2001 From: Alexandre Frade Date: Mon, 24 Apr 2023 04:50:34 +0000 -Subject: [PATCH 19/19] XANMOD: scripts/setlocalversion: Move localversion* +Subject: [PATCH 18/18] XANMOD: scripts/setlocalversion: Move localversion* files to the end Signed-off-by: Alexandre Frade diff --git a/debian/patches/patchset-zen/fixes/0001-Partially-revert-drm-amd-amdgpu-add-pipe1-hardware-s.patch b/debian/patches/patchset-zen/fixes/0001-Partially-revert-drm-amd-amdgpu-add-pipe1-hardware-s.patch deleted file mode 100644 index b43efe5..0000000 --- a/debian/patches/patchset-zen/fixes/0001-Partially-revert-drm-amd-amdgpu-add-pipe1-hardware-s.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 2b70fecae5eabc439190c435be020db8afd3bd33 Mon Sep 17 00:00:00 2001 -From: Alex Deucher -Date: Wed, 7 Aug 2024 17:04:02 -0400 -Subject: Partially revert "drm/amd/amdgpu: add pipe1 hardware support" - -This partially reverts commit b7a1a0ef12b81957584fef7b61e2d5ec049c7209. - -A user reported stuttering under heavy gfx load with this commit. -I suspect it's due to the fact that the gfx contexts are shared -between the pipes so if there is alot of load on one pipe, we could -end up stalling waiting for a context. - -That said, having both pipes is useful in some contexts and -this patch was actually enabled mainly to support some SR-IOV -use cases, so leave it enabled for SR-IOV. - -Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3519 -Signed-off-by: Alex Deucher -Cc: ZhenGuo Yin -Cc: Alex Deucher ---- - drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - ---- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c -+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c -@@ -4711,7 +4711,10 @@ static int gfx_v10_0_sw_init(void *handl - case IP_VERSION(10, 3, 3): - case IP_VERSION(10, 3, 7): - adev->gfx.me.num_me = 1; -- adev->gfx.me.num_pipe_per_me = 2; -+ if (amdgpu_sriov_vf(adev)) -+ adev->gfx.me.num_pipe_per_me = 2; -+ else -+ adev->gfx.me.num_pipe_per_me = 1; - adev->gfx.me.num_queue_per_pipe = 1; - adev->gfx.mec.num_mec = 2; - adev->gfx.mec.num_pipe_per_mec = 4; diff --git a/debian/patches/patchset-zen/fixes/0001-futex-improve-user-space-accesses.patch b/debian/patches/patchset-zen/fixes/0001-futex-improve-user-space-accesses.patch new file mode 100644 index 0000000..d5e6202 --- /dev/null +++ b/debian/patches/patchset-zen/fixes/0001-futex-improve-user-space-accesses.patch @@ -0,0 +1,162 @@ +From 3c32c0d457a2c4b2817f57e1e2c9cbba4624639e Mon Sep 17 00:00:00 2001 +From: Linus Torvalds +Date: Fri, 22 Nov 2024 11:33:05 -0800 +Subject: futex: improve user space accesses + +Josh Poimboeuf reports that he got a "will-it-scale.per_process_ops 1.9% +improvement" report for his patch that changed __get_user() to use +pointer masking instead of the explicit speculation barrier. However, +that patch doesn't actually work in the general case, because some (very +bad) architecture-specific code actually depends on __get_user() also +working on kernel addresses. + +A profile showed that the offending __get_user() was the futex code, +which really should be fixed up to not use that horrid legacy case. +Rewrite futex_get_value_locked() to use the modern user acccess helpers, +and inline it so that the compiler not only avoids the function call for +a few instructions, but can do CSE on the address masking. + +It also turns out the x86 futex functions have unnecessary barriers in +other places, so let's fix those up too. + +Link: https://lore.kernel.org/all/20241115230653.hfvzyf3aqqntgp63@jpoimboe/ +Reported-by: Josh Poimboeuf +Signed-off-by: Linus Torvalds +--- + arch/x86/include/asm/futex.h | 8 +++-- + kernel/futex/core.c | 22 -------------- + kernel/futex/futex.h | 59 ++++++++++++++++++++++++++++++++++-- + 3 files changed, 63 insertions(+), 26 deletions(-) + +--- a/arch/x86/include/asm/futex.h ++++ b/arch/x86/include/asm/futex.h +@@ -48,7 +48,9 @@ do { \ + static __always_inline int arch_futex_atomic_op_inuser(int op, int oparg, int *oval, + u32 __user *uaddr) + { +- if (!user_access_begin(uaddr, sizeof(u32))) ++ if (can_do_masked_user_access()) ++ uaddr = masked_user_access_begin(uaddr); ++ else if (!user_access_begin(uaddr, sizeof(u32))) + return -EFAULT; + + switch (op) { +@@ -84,7 +86,9 @@ static inline int futex_atomic_cmpxchg_i + { + int ret = 0; + +- if (!user_access_begin(uaddr, sizeof(u32))) ++ if (can_do_masked_user_access()) ++ uaddr = masked_user_access_begin(uaddr); ++ else if (!user_access_begin(uaddr, sizeof(u32))) + return -EFAULT; + asm volatile("\n" + "1:\t" LOCK_PREFIX "cmpxchgl %3, %2\n" +--- a/kernel/futex/core.c ++++ b/kernel/futex/core.c +@@ -451,28 +451,6 @@ struct futex_q *futex_top_waiter(struct + return NULL; + } + +-int futex_cmpxchg_value_locked(u32 *curval, u32 __user *uaddr, u32 uval, u32 newval) +-{ +- int ret; +- +- pagefault_disable(); +- ret = futex_atomic_cmpxchg_inatomic(curval, uaddr, uval, newval); +- pagefault_enable(); +- +- return ret; +-} +- +-int futex_get_value_locked(u32 *dest, u32 __user *from) +-{ +- int ret; +- +- pagefault_disable(); +- ret = __get_user(*dest, from); +- pagefault_enable(); +- +- return ret ? -EFAULT : 0; +-} +- + /** + * wait_for_owner_exiting - Block until the owner has exited + * @ret: owner's current futex lock status +--- a/kernel/futex/futex.h ++++ b/kernel/futex/futex.h +@@ -6,6 +6,7 @@ + #include + #include + #include ++#include + + #ifdef CONFIG_PREEMPT_RT + #include +@@ -225,10 +226,64 @@ extern bool __futex_wake_mark(struct fut + extern void futex_wake_mark(struct wake_q_head *wake_q, struct futex_q *q); + + extern int fault_in_user_writeable(u32 __user *uaddr); +-extern int futex_cmpxchg_value_locked(u32 *curval, u32 __user *uaddr, u32 uval, u32 newval); +-extern int futex_get_value_locked(u32 *dest, u32 __user *from); + extern struct futex_q *futex_top_waiter(struct futex_hash_bucket *hb, union futex_key *key); + ++static inline int futex_cmpxchg_value_locked(u32 *curval, u32 __user *uaddr, u32 uval, u32 newval) ++{ ++ int ret; ++ ++ pagefault_disable(); ++ ret = futex_atomic_cmpxchg_inatomic(curval, uaddr, uval, newval); ++ pagefault_enable(); ++ ++ return ret; ++} ++ ++/* ++ * This does a plain atomic user space read, and the user pointer has ++ * already been verified earlier by get_futex_key() to be both aligned ++ * and actually in user space, just like futex_atomic_cmpxchg_inatomic(). ++ * ++ * We still want to avoid any speculation, and while __get_user() is ++ * the traditional model for this, it's actually slower then doing ++ * this manually these days. ++ * ++ * We could just have a per-architecture special function for it, ++ * the same way we do futex_atomic_cmpxchg_inatomic(), but rather ++ * than force everybody to do that, write it out long-hand using ++ * the low-level user-access infrastructure. ++ * ++ * This looks a bit overkill, but generally just results in a couple ++ * of instructions. ++ */ ++static __always_inline int futex_read_inatomic(u32 *dest, u32 __user *from) ++{ ++ u32 val; ++ ++ if (can_do_masked_user_access()) ++ from = masked_user_access_begin(from); ++ else if (!user_read_access_begin(from, sizeof(*from))) ++ return -EFAULT; ++ unsafe_get_user(val, from, Efault); ++ user_access_end(); ++ *dest = val; ++ return 0; ++Efault: ++ user_access_end(); ++ return -EFAULT; ++} ++ ++static inline int futex_get_value_locked(u32 *dest, u32 __user *from) ++{ ++ int ret; ++ ++ pagefault_disable(); ++ ret = futex_read_inatomic(dest, from); ++ pagefault_enable(); ++ ++ return ret; ++} ++ + extern void __futex_unqueue(struct futex_q *q); + extern void __futex_queue(struct futex_q *q, struct futex_hash_bucket *hb); + extern int futex_unqueue(struct futex_q *q); diff --git a/debian/patches/patchset-zen/sauce/0001-ZEN-Add-VHBA-driver.patch b/debian/patches/patchset-zen/sauce/0001-ZEN-Add-VHBA-driver.patch index 9e4c756..34f02dc 100644 --- a/debian/patches/patchset-zen/sauce/0001-ZEN-Add-VHBA-driver.patch +++ b/debian/patches/patchset-zen/sauce/0001-ZEN-Add-VHBA-driver.patch @@ -1,10 +1,10 @@ -From cba900f94444c8c4cde6b5b4edfaeb6160b55ba3 Mon Sep 17 00:00:00 2001 +From 95490afcba944883e7f911214391a1a1e2fa3261 Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Mon, 26 Apr 2021 22:12:46 +0200 Subject: ZEN: Add VHBA driver remote https://github.com/cdemu/cdemu -tag vhba-module-20240202 +tag vhba-module-20240917 --- drivers/scsi/Kconfig | 2 + drivers/scsi/Makefile | 1 + @@ -50,7 +50,7 @@ tag vhba-module-20240202 --- /dev/null +++ b/drivers/scsi/vhba/Makefile @@ -0,0 +1,4 @@ -+VHBA_VERSION := 20240202 ++VHBA_VERSION := 20240917 + +obj-$(CONFIG_VHBA) += vhba.o +ccflags-y := -DVHBA_VERSION=\"$(VHBA_VERSION)\" -Werror diff --git a/debian/patches/patchset-zen/sauce/0002-vhba-Fix-compat-with-kernel-6.11.patch b/debian/patches/patchset-zen/sauce/0002-vhba-Fix-compat-with-kernel-6.11.patch index e4b2fd3..3c0e0ea 100644 --- a/debian/patches/patchset-zen/sauce/0002-vhba-Fix-compat-with-kernel-6.11.patch +++ b/debian/patches/patchset-zen/sauce/0002-vhba-Fix-compat-with-kernel-6.11.patch @@ -1,4 +1,4 @@ -From 6df7338351c342060088aa9abd561b81ccc113d2 Mon Sep 17 00:00:00 2001 +From 8a6a60b5a71d7f85351a9350eb651c4ce15b8f00 Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Sun, 15 Sep 2024 19:05:46 +0000 Subject: vhba: Fix compat with kernel 6.11 diff --git a/debian/patches/patchset-zen/sauce/0003-ZEN-PCI-Add-Intel-remapped-NVMe-device-support.patch b/debian/patches/patchset-zen/sauce/0003-ZEN-PCI-Add-Intel-remapped-NVMe-device-support.patch index 69c7a89..b6ad8a3 100644 --- a/debian/patches/patchset-zen/sauce/0003-ZEN-PCI-Add-Intel-remapped-NVMe-device-support.patch +++ b/debian/patches/patchset-zen/sauce/0003-ZEN-PCI-Add-Intel-remapped-NVMe-device-support.patch @@ -1,4 +1,4 @@ -From 567908cc05dc5e02b1b9c26620bce3791559f9d4 Mon Sep 17 00:00:00 2001 +From 1cdff301de6db901bc2bfd7ce78016d9b824d667 Mon Sep 17 00:00:00 2001 From: Daniel Drake Date: Tue, 4 Jun 2019 14:51:21 +0800 Subject: ZEN: PCI: Add Intel remapped NVMe device support diff --git a/debian/patches/patchset-zen/sauce/0004-ZEN-Disable-stack-conservation-for-GCC.patch b/debian/patches/patchset-zen/sauce/0004-ZEN-Disable-stack-conservation-for-GCC.patch index e2a70b0..3a6922a 100644 --- a/debian/patches/patchset-zen/sauce/0004-ZEN-Disable-stack-conservation-for-GCC.patch +++ b/debian/patches/patchset-zen/sauce/0004-ZEN-Disable-stack-conservation-for-GCC.patch @@ -1,4 +1,4 @@ -From 89a4975b413afa5f591c7a18109d35b5e848b582 Mon Sep 17 00:00:00 2001 +From 87b0cab8d8701db7754e5778b93ff83ffc64c7ae Mon Sep 17 00:00:00 2001 From: Sultan Alsawaf Date: Sun, 8 Mar 2020 00:31:35 -0800 Subject: ZEN: Disable stack conservation for GCC @@ -15,7 +15,7 @@ Signed-off-by: Sultan Alsawaf --- a/Makefile +++ b/Makefile -@@ -1003,11 +1003,6 @@ KBUILD_CFLAGS += -fno-strict-overflow +@@ -1018,11 +1018,6 @@ KBUILD_CFLAGS += -fno-strict-overflow # Make sure -fstack-check isn't enabled (like gentoo apparently did) KBUILD_CFLAGS += -fno-stack-check diff --git a/debian/patches/patchset-zen/sauce/0005-ZEN-Initialize-ata-before-graphics.patch b/debian/patches/patchset-zen/sauce/0005-ZEN-Initialize-ata-before-graphics.patch index 4ef331c..fc382cc 100644 --- a/debian/patches/patchset-zen/sauce/0005-ZEN-Initialize-ata-before-graphics.patch +++ b/debian/patches/patchset-zen/sauce/0005-ZEN-Initialize-ata-before-graphics.patch @@ -1,4 +1,4 @@ -From 5f2e6f795ce9908851acb20ab03af6550ae54f3b Mon Sep 17 00:00:00 2001 +From 48d2ea8801ccf8bd9cd48c12fce79040bbcae363 Mon Sep 17 00:00:00 2001 From: Arjan van de Ven Date: Thu, 2 Jun 2016 23:36:32 -0500 Subject: ZEN: Initialize ata before graphics @@ -12,7 +12,7 @@ in parallel --- a/drivers/Makefile +++ b/drivers/Makefile -@@ -61,14 +61,8 @@ obj-y += char/ +@@ -64,14 +64,8 @@ obj-y += char/ # iommu/ comes before gpu as gpu are using iommu controllers obj-y += iommu/ @@ -27,7 +27,7 @@ in parallel obj-$(CONFIG_PARPORT) += parport/ obj-y += base/ block/ misc/ mfd/ nfc/ obj-$(CONFIG_LIBNVDIMM) += nvdimm/ -@@ -80,6 +74,13 @@ obj-y += macintosh/ +@@ -83,6 +77,13 @@ obj-y += macintosh/ obj-y += scsi/ obj-y += nvme/ obj-$(CONFIG_ATA) += ata/ diff --git a/debian/patches/patchset-zen/sauce/0006-ZEN-Input-evdev-use-call_rcu-when-detaching-client.patch b/debian/patches/patchset-zen/sauce/0006-ZEN-Input-evdev-use-call_rcu-when-detaching-client.patch index b229161..e19c6a8 100644 --- a/debian/patches/patchset-zen/sauce/0006-ZEN-Input-evdev-use-call_rcu-when-detaching-client.patch +++ b/debian/patches/patchset-zen/sauce/0006-ZEN-Input-evdev-use-call_rcu-when-detaching-client.patch @@ -1,4 +1,4 @@ -From 3d92c251c04b1b4c6363018220af42ec3a294d1e Mon Sep 17 00:00:00 2001 +From 2f3e9fbc48151e4499f9cbd810d9467ac34b0a3b Mon Sep 17 00:00:00 2001 From: Kenny Levinsen Date: Sun, 27 Dec 2020 14:43:13 +0000 Subject: ZEN: Input: evdev - use call_rcu when detaching client diff --git a/debian/patches/patchset-zen/sauce/0007-ZEN-cpufreq-Remove-schedutil-dependency-on-Intel-AMD.patch b/debian/patches/patchset-zen/sauce/0007-ZEN-cpufreq-Remove-schedutil-dependency-on-Intel-AMD.patch index c94ccd2..a5a3c91 100644 --- a/debian/patches/patchset-zen/sauce/0007-ZEN-cpufreq-Remove-schedutil-dependency-on-Intel-AMD.patch +++ b/debian/patches/patchset-zen/sauce/0007-ZEN-cpufreq-Remove-schedutil-dependency-on-Intel-AMD.patch @@ -1,4 +1,4 @@ -From 67c446794b5fc16009bc1f31aee8846576796b11 Mon Sep 17 00:00:00 2001 +From 51026b78d015797e216aadc4e80158181c2c2bb4 Mon Sep 17 00:00:00 2001 From: Steven Barrett Date: Mon, 11 Jul 2022 19:10:30 -0500 Subject: ZEN: cpufreq: Remove schedutil dependency on Intel/AMD P-State diff --git a/debian/patches/patchset-zen/sauce/0008-ZEN-intel-pstate-Implement-enable-parameter.patch b/debian/patches/patchset-zen/sauce/0008-ZEN-intel-pstate-Implement-enable-parameter.patch index 007f9c6..6750826 100644 --- a/debian/patches/patchset-zen/sauce/0008-ZEN-intel-pstate-Implement-enable-parameter.patch +++ b/debian/patches/patchset-zen/sauce/0008-ZEN-intel-pstate-Implement-enable-parameter.patch @@ -1,4 +1,4 @@ -From 1d5cc90283f9de0c4cc996a2f3e6ba0306c1f14d Mon Sep 17 00:00:00 2001 +From 48c8812a4cea0190a037757589443f3103c610ba Mon Sep 17 00:00:00 2001 From: Steven Barrett Date: Wed, 15 Jan 2020 20:43:56 -0600 Subject: ZEN: intel-pstate: Implement "enable" parameter @@ -30,7 +30,7 @@ selection. --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt -@@ -2237,6 +2237,9 @@ +@@ -2254,6 +2254,9 @@ disable Do not enable intel_pstate as the default scaling driver for the supported processors @@ -42,7 +42,7 @@ selection. governors layer of cpufreq and provides it own --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c -@@ -3524,6 +3524,8 @@ static int __init intel_pstate_setup(cha +@@ -3817,6 +3817,8 @@ static int __init intel_pstate_setup(cha if (!strcmp(str, "disable")) no_load = 1; diff --git a/debian/patches/patchset-zen/sauce/0009-ZEN-drm-amdgpu-pm-Allow-override-of-min_power_limit-.patch b/debian/patches/patchset-zen/sauce/0009-ZEN-drm-amdgpu-pm-Allow-override-of-min_power_limit-.patch index 6e2803b..5e44279 100644 --- a/debian/patches/patchset-zen/sauce/0009-ZEN-drm-amdgpu-pm-Allow-override-of-min_power_limit-.patch +++ b/debian/patches/patchset-zen/sauce/0009-ZEN-drm-amdgpu-pm-Allow-override-of-min_power_limit-.patch @@ -1,4 +1,4 @@ -From 493aee188c1c7c5cee2791820bfc779932bc10dc Mon Sep 17 00:00:00 2001 +From bbc56fdeaa2017d0bbed05e1e832e6d7e4bdd6e0 Mon Sep 17 00:00:00 2001 From: Steven Barrett Date: Fri, 15 Mar 2024 12:36:51 -0500 Subject: ZEN: drm/amdgpu/pm: Allow override of min_power_limit with @@ -13,7 +13,7 @@ Subject: ZEN: drm/amdgpu/pm: Allow override of min_power_limit with --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h -@@ -162,6 +162,7 @@ struct amdgpu_watchdog_timer { +@@ -164,6 +164,7 @@ struct amdgpu_watchdog_timer { */ extern int amdgpu_modeset; extern unsigned int amdgpu_vram_limit; @@ -23,7 +23,7 @@ Subject: ZEN: drm/amdgpu/pm: Allow override of min_power_limit with extern int amdgpu_gtt_size; --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c -@@ -135,6 +135,7 @@ enum AMDGPU_DEBUG_MASK { +@@ -136,6 +136,7 @@ enum AMDGPU_DEBUG_MASK { }; unsigned int amdgpu_vram_limit = UINT_MAX; @@ -31,7 +31,7 @@ Subject: ZEN: drm/amdgpu/pm: Allow override of min_power_limit with int amdgpu_vis_vram_limit; int amdgpu_gart_size = -1; /* auto */ int amdgpu_gtt_size = -1; /* auto */ -@@ -249,6 +250,15 @@ struct amdgpu_watchdog_timer amdgpu_watc +@@ -260,6 +261,15 @@ struct amdgpu_watchdog_timer amdgpu_watc }; /** @@ -61,7 +61,7 @@ Subject: ZEN: drm/amdgpu/pm: Allow override of min_power_limit with --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c -@@ -2775,7 +2775,10 @@ int smu_get_power_limit(void *handle, +@@ -2779,7 +2779,10 @@ int smu_get_power_limit(void *handle, *limit = smu->max_power_limit; break; case SMU_PPT_LIMIT_MIN: @@ -73,7 +73,7 @@ Subject: ZEN: drm/amdgpu/pm: Allow override of min_power_limit with break; default: return -EINVAL; -@@ -2799,7 +2802,14 @@ static int smu_set_power_limit(void *han +@@ -2803,7 +2806,14 @@ static int smu_set_power_limit(void *han if (smu->ppt_funcs->set_power_limit) return smu->ppt_funcs->set_power_limit(smu, limit_type, limit); diff --git a/debian/patches/patchset-zen/sauce/0010-ZEN-Set-default-max-map-count-to-INT_MAX-5.patch b/debian/patches/patchset-zen/sauce/0010-ZEN-Set-default-max-map-count-to-INT_MAX-5.patch deleted file mode 100644 index b6d30fe..0000000 --- a/debian/patches/patchset-zen/sauce/0010-ZEN-Set-default-max-map-count-to-INT_MAX-5.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 531d884259632814e998d1662690daa1e57dd98c Mon Sep 17 00:00:00 2001 -From: Steven Barrett -Date: Thu, 27 Apr 2023 14:43:57 -0500 -Subject: ZEN: Set default max map count to (INT_MAX - 5) - -Per [Fedora][1], they intend to change the default max map count for -their distribution to improve OOTB compatibility with games played -through Steam/Proton. The value they picked comes from the Steam Deck, -which defaults to INT_MAX - MAPCOUNT_ELF_CORE_MARGIN. - -Since most ZEN and Liquorix users probably play games, follow Valve's -lead and raise this value to their default. - -[1]: https://fedoraproject.org/wiki/Changes/IncreaseVmMaxMapCount ---- - include/linux/mm.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/include/linux/mm.h -+++ b/include/linux/mm.h -@@ -197,7 +197,7 @@ static inline void __mm_zero_struct_page - * that. - */ - #define MAPCOUNT_ELF_CORE_MARGIN (5) --#define DEFAULT_MAX_MAP_COUNT (USHRT_MAX - MAPCOUNT_ELF_CORE_MARGIN) -+#define DEFAULT_MAX_MAP_COUNT (INT_MAX - MAPCOUNT_ELF_CORE_MARGIN) - - extern int sysctl_max_map_count; - diff --git a/debian/patches/patchset-zen/sauce/0025-ZEN-mm-Stop-kswapd-early-when-nothing-s-waiting-for-.patch b/debian/patches/patchset-zen/sauce/0010-ZEN-mm-Stop-kswapd-early-when-nothing-s-waiting-for-.patch similarity index 90% rename from debian/patches/patchset-zen/sauce/0025-ZEN-mm-Stop-kswapd-early-when-nothing-s-waiting-for-.patch rename to debian/patches/patchset-zen/sauce/0010-ZEN-mm-Stop-kswapd-early-when-nothing-s-waiting-for-.patch index 419e48d..6b90d70 100644 --- a/debian/patches/patchset-zen/sauce/0025-ZEN-mm-Stop-kswapd-early-when-nothing-s-waiting-for-.patch +++ b/debian/patches/patchset-zen/sauce/0010-ZEN-mm-Stop-kswapd-early-when-nothing-s-waiting-for-.patch @@ -1,4 +1,4 @@ -From c47df2793088980a32d6706da886fe32f7f045e6 Mon Sep 17 00:00:00 2001 +From 2cceda3c699f19f9c2f287614db2fe5dd009f73a Mon Sep 17 00:00:00 2001 From: Sultan Alsawaf Date: Sun, 19 Apr 2020 19:59:18 -0700 Subject: ZEN: mm: Stop kswapd early when nothing's waiting for it to free @@ -43,7 +43,7 @@ Contains: --- a/mm/internal.h +++ b/mm/internal.h -@@ -686,6 +686,7 @@ extern void post_alloc_hook(struct page +@@ -739,6 +739,7 @@ extern void post_alloc_hook(struct page extern bool free_pages_prepare(struct page *page, unsigned int order); extern int user_min_free_kbytes; @@ -62,15 +62,15 @@ Contains: /* prevent >1 _updater_ of zone percpu pageset ->high and ->batch fields */ static DEFINE_MUTEX(pcp_batch_high_lock); #define MIN_PERCPU_PAGELIST_HIGH_FRACTION (8) -@@ -4204,6 +4206,7 @@ __alloc_pages_slowpath(gfp_t gfp_mask, u +@@ -4218,6 +4220,7 @@ __alloc_pages_slowpath(gfp_t gfp_mask, u unsigned int cpuset_mems_cookie; unsigned int zonelist_iter_cookie; int reserve_flags; + bool woke_kswapd = false; - restart: - compaction_retries = 0; -@@ -4243,8 +4246,13 @@ restart: + if (unlikely(nofail)) { + /* +@@ -4276,8 +4279,13 @@ restart: goto nopage; } @@ -85,7 +85,7 @@ Contains: /* * The adjusted alloc_flags might result in immediate success, so try -@@ -4460,9 +4468,12 @@ nopage: +@@ -4479,9 +4487,12 @@ nopage: goto retry; } fail: @@ -102,7 +102,7 @@ Contains: --- a/mm/vmscan.c +++ b/mm/vmscan.c -@@ -6332,7 +6332,7 @@ retry: +@@ -6346,7 +6346,7 @@ retry: return 0; } @@ -111,7 +111,7 @@ Contains: { struct zone *zone; unsigned long pfmemalloc_reserve = 0; -@@ -6361,6 +6361,10 @@ static bool allow_direct_reclaim(pg_data +@@ -6375,6 +6375,10 @@ static bool allow_direct_reclaim(pg_data wmark_ok = free_pages > pfmemalloc_reserve / 2; @@ -122,7 +122,7 @@ Contains: /* kswapd must be awake if processes are being throttled */ if (!wmark_ok && waitqueue_active(&pgdat->kswapd_wait)) { if (READ_ONCE(pgdat->kswapd_highest_zoneidx) > ZONE_NORMAL) -@@ -6426,7 +6430,7 @@ static bool throttle_direct_reclaim(gfp_ +@@ -6440,7 +6444,7 @@ static bool throttle_direct_reclaim(gfp_ /* Throttle based on the first usable node */ pgdat = zone->zone_pgdat; @@ -131,7 +131,7 @@ Contains: goto out; break; } -@@ -6448,11 +6452,14 @@ static bool throttle_direct_reclaim(gfp_ +@@ -6462,11 +6466,14 @@ static bool throttle_direct_reclaim(gfp_ */ if (!(gfp_mask & __GFP_FS)) wait_event_interruptible_timeout(pgdat->pfmemalloc_wait, @@ -148,7 +148,7 @@ Contains: if (fatal_signal_pending(current)) return true; -@@ -6955,14 +6962,14 @@ restart: +@@ -6969,14 +6976,14 @@ restart: * able to safely make forward progress. Wake them */ if (waitqueue_active(&pgdat->pfmemalloc_wait) && diff --git a/debian/patches/patchset-zen/sauce/0011-ZEN-INTERACTIVE-Base-config-item.patch b/debian/patches/patchset-zen/sauce/0011-ZEN-INTERACTIVE-Base-config-item.patch index 58bc8d4..fd3c270 100644 --- a/debian/patches/patchset-zen/sauce/0011-ZEN-INTERACTIVE-Base-config-item.patch +++ b/debian/patches/patchset-zen/sauce/0011-ZEN-INTERACTIVE-Base-config-item.patch @@ -1,4 +1,4 @@ -From 032775267df11a87616d2ec7f09c0b1b12da5da7 Mon Sep 17 00:00:00 2001 +From 530ee9b20cf436bcbb3a632cb19fb5e13a29dde7 Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Mon, 27 Jan 2020 18:10:06 +0100 Subject: ZEN: INTERACTIVE: Base config item @@ -9,7 +9,7 @@ Subject: ZEN: INTERACTIVE: Base config item --- a/init/Kconfig +++ b/init/Kconfig -@@ -143,6 +143,12 @@ config THREAD_INFO_IN_TASK +@@ -154,6 +154,12 @@ config THREAD_INFO_IN_TASK menu "General setup" diff --git a/debian/patches/patchset-zen/sauce/0012-ZEN-INTERACTIVE-Use-BFQ-as-the-elevator-for-SQ-devic.patch b/debian/patches/patchset-zen/sauce/0012-ZEN-INTERACTIVE-Use-BFQ-as-the-elevator-for-SQ-devic.patch index 8eb24ad..f058d3e 100644 --- a/debian/patches/patchset-zen/sauce/0012-ZEN-INTERACTIVE-Use-BFQ-as-the-elevator-for-SQ-devic.patch +++ b/debian/patches/patchset-zen/sauce/0012-ZEN-INTERACTIVE-Use-BFQ-as-the-elevator-for-SQ-devic.patch @@ -1,4 +1,4 @@ -From c614dbbfd3480cf18c90fd51bb52abd53339b790 Mon Sep 17 00:00:00 2001 +From d2f0a5801471b5f67344b2c92a2aa29f1aed626a Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Mon, 27 Jan 2020 18:11:05 +0100 Subject: ZEN: INTERACTIVE: Use BFQ as the elevator for SQ devices @@ -24,7 +24,7 @@ Subject: ZEN: INTERACTIVE: Use BFQ as the elevator for SQ devices /* --- a/init/Kconfig +++ b/init/Kconfig -@@ -149,6 +149,10 @@ config ZEN_INTERACTIVE +@@ -160,6 +160,10 @@ config ZEN_INTERACTIVE help Tunes the kernel for responsiveness at the cost of throughput and power usage. diff --git a/debian/patches/patchset-zen/sauce/0013-ZEN-INTERACTIVE-Use-Kyber-as-the-elevator-for-MQ-dev.patch b/debian/patches/patchset-zen/sauce/0013-ZEN-INTERACTIVE-Use-Kyber-as-the-elevator-for-MQ-dev.patch index 4fca761..1c14af5 100644 --- a/debian/patches/patchset-zen/sauce/0013-ZEN-INTERACTIVE-Use-Kyber-as-the-elevator-for-MQ-dev.patch +++ b/debian/patches/patchset-zen/sauce/0013-ZEN-INTERACTIVE-Use-Kyber-as-the-elevator-for-MQ-dev.patch @@ -1,4 +1,4 @@ -From b87281991e8f34e557cf2fb1614b3f4808100233 Mon Sep 17 00:00:00 2001 +From 346251fa257245b3a06e37de863a1dbafbf2bbc2 Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Mon, 12 Dec 2022 00:03:03 +0100 Subject: ZEN: INTERACTIVE: Use Kyber as the elevator for MQ devices @@ -26,7 +26,7 @@ Subject: ZEN: INTERACTIVE: Use Kyber as the elevator for MQ devices return elevator_find_get("bfq"); --- a/init/Kconfig +++ b/init/Kconfig -@@ -152,6 +152,7 @@ config ZEN_INTERACTIVE +@@ -163,6 +163,7 @@ config ZEN_INTERACTIVE --- Block Layer ---------------------------------------- Default scheduler for SQ..: mq-deadline -> bfq diff --git a/debian/patches/patchset-zen/sauce/0014-ZEN-INTERACTIVE-Enable-background-reclaim-of-hugepag.patch b/debian/patches/patchset-zen/sauce/0014-ZEN-INTERACTIVE-Enable-background-reclaim-of-hugepag.patch index 10e54b7..6cbef40 100644 --- a/debian/patches/patchset-zen/sauce/0014-ZEN-INTERACTIVE-Enable-background-reclaim-of-hugepag.patch +++ b/debian/patches/patchset-zen/sauce/0014-ZEN-INTERACTIVE-Enable-background-reclaim-of-hugepag.patch @@ -1,4 +1,4 @@ -From e2db8ce3c52c7bd37e93728d6c12a483f17634bc Mon Sep 17 00:00:00 2001 +From 26fcaf58616b8cb3ce042e31c640594ea2fb5987 Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Mon, 27 Jan 2020 18:21:09 +0100 Subject: ZEN: INTERACTIVE: Enable background reclaim of hugepages @@ -32,7 +32,7 @@ Reasoning and details in the original patch: https://lwn.net/Articles/711248/ --- a/init/Kconfig +++ b/init/Kconfig -@@ -154,6 +154,10 @@ config ZEN_INTERACTIVE +@@ -165,6 +165,10 @@ config ZEN_INTERACTIVE Default scheduler for SQ..: mq-deadline -> bfq Default scheduler for MQ..: none -> kyber @@ -45,7 +45,7 @@ Reasoning and details in the original patch: https://lwn.net/Articles/711248/ --- a/mm/huge_memory.c +++ b/mm/huge_memory.c -@@ -64,7 +64,11 @@ unsigned long transparent_hugepage_flags +@@ -65,7 +65,11 @@ unsigned long transparent_hugepage_flags #ifdef CONFIG_TRANSPARENT_HUGEPAGE_MADVISE (1< Date: Tue, 31 Oct 2023 19:03:10 +0100 Subject: ZEN: INTERACTIVE: Tune EEVDF for interactivity @@ -42,9 +42,9 @@ caused by rebalancing too many tasks at once. --- a/init/Kconfig +++ b/init/Kconfig -@@ -159,6 +159,13 @@ config ZEN_INTERACTIVE +@@ -169,6 +169,13 @@ config ZEN_INTERACTIVE + Background-reclaim hugepages...: no -> yes - MG-LRU minimum cache TTL.......: 0 -> 1000 ms + --- EEVDF CPU Scheduler -------------------------------- + @@ -93,7 +93,7 @@ caused by rebalancing too many tasks at once. /* Restrict the NUMA promotion throughput (MB/s) for each target node. */ --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h -@@ -2591,7 +2591,7 @@ extern void deactivate_task(struct rq *r +@@ -2816,7 +2816,7 @@ extern void deactivate_task(struct rq *r extern void wakeup_preempt(struct rq *rq, struct task_struct *p, int flags); diff --git a/debian/patches/patchset-zen/sauce/0015-ZEN-INTERACTIVE-Tune-mgLRU-to-protect-cache-used-in-.patch b/debian/patches/patchset-zen/sauce/0015-ZEN-INTERACTIVE-Tune-mgLRU-to-protect-cache-used-in-.patch deleted file mode 100644 index a42c635..0000000 --- a/debian/patches/patchset-zen/sauce/0015-ZEN-INTERACTIVE-Tune-mgLRU-to-protect-cache-used-in-.patch +++ /dev/null @@ -1,41 +0,0 @@ -From f5b82cc382eaf3ddf5c26f60965037bde8733445 Mon Sep 17 00:00:00 2001 -From: Steven Barrett -Date: Wed, 11 Aug 2021 18:47:46 -0500 -Subject: ZEN: INTERACTIVE: Tune mgLRU to protect cache used in the last second - -Although not identical to the le9 patches that protect a byte-amount of -cache through tunables, multigenerational LRU now supports protecting -cache accessed in the last X milliseconds. - -In #218, Yu recommends starting with 1000ms and tuning as needed. This -looks like a safe default and turning on this feature should help users -that don't know they need it. ---- - init/Kconfig | 1 + - mm/vmscan.c | 4 ++++ - 2 files changed, 5 insertions(+) - ---- a/init/Kconfig -+++ b/init/Kconfig -@@ -157,6 +157,7 @@ config ZEN_INTERACTIVE - --- Virtual Memory Subsystem --------------------------- - - Background-reclaim hugepages...: no -> yes -+ MG-LRU minimum cache TTL.......: 0 -> 1000 ms - - config BROKEN - bool ---- a/mm/vmscan.c -+++ b/mm/vmscan.c -@@ -3974,7 +3974,11 @@ static bool lruvec_is_reclaimable(struct - } - - /* to protect the working set of the last N jiffies */ -+#ifdef CONFIG_ZEN_INTERACTIVE -+static unsigned long lru_gen_min_ttl __read_mostly = HZ; -+#else - static unsigned long lru_gen_min_ttl __read_mostly; -+#endif - - static void lru_gen_age_node(struct pglist_data *pgdat, struct scan_control *sc) - { diff --git a/debian/patches/patchset-zen/sauce/0017-ZEN-INTERACTIVE-Tune-ondemand-governor-for-interacti.patch b/debian/patches/patchset-zen/sauce/0016-ZEN-INTERACTIVE-Tune-ondemand-governor-for-interacti.patch similarity index 92% rename from debian/patches/patchset-zen/sauce/0017-ZEN-INTERACTIVE-Tune-ondemand-governor-for-interacti.patch rename to debian/patches/patchset-zen/sauce/0016-ZEN-INTERACTIVE-Tune-ondemand-governor-for-interacti.patch index 438f562..f623dc9 100644 --- a/debian/patches/patchset-zen/sauce/0017-ZEN-INTERACTIVE-Tune-ondemand-governor-for-interacti.patch +++ b/debian/patches/patchset-zen/sauce/0016-ZEN-INTERACTIVE-Tune-ondemand-governor-for-interacti.patch @@ -1,4 +1,4 @@ -From e9c6f500f4429c32f583d6da11352b2f0bcce4c8 Mon Sep 17 00:00:00 2001 +From f654ea11471f81ac7dd68467f552db25722df25e Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Mon, 27 Jan 2020 18:27:16 +0100 Subject: ZEN: INTERACTIVE: Tune ondemand governor for interactivity @@ -75,15 +75,15 @@ Remove MuQSS cpufreq configuration. --- a/init/Kconfig +++ b/init/Kconfig -@@ -166,6 +166,12 @@ config ZEN_INTERACTIVE +@@ -176,6 +176,12 @@ config ZEN_INTERACTIVE Bandwidth slice size...........: 5 -> 3 ms Task rebalancing threshold.....: 32 -> 8 + --- CPUFreq Settings ----------------------------------- + -+ Ondemand sampling down factor..: 100 -> 5 -+ Ondemand default up threshold..: 63 -> 55 -+ Ondemand micro up threshold....: 70 -> 60 ++ Ondemand sampling down factor..: 1 -> 5 ++ Ondemand default up threshold..: 80 -> 55 ++ Ondemand micro up threshold....: 95 -> 60 + config BROKEN bool diff --git a/debian/patches/patchset-zen/sauce/0018-ZEN-INTERACTIVE-mm-Disable-unevictable-compaction.patch b/debian/patches/patchset-zen/sauce/0017-ZEN-INTERACTIVE-mm-Disable-unevictable-compaction.patch similarity index 79% rename from debian/patches/patchset-zen/sauce/0018-ZEN-INTERACTIVE-mm-Disable-unevictable-compaction.patch rename to debian/patches/patchset-zen/sauce/0017-ZEN-INTERACTIVE-mm-Disable-unevictable-compaction.patch index 841acf9..fa5f14a 100644 --- a/debian/patches/patchset-zen/sauce/0018-ZEN-INTERACTIVE-mm-Disable-unevictable-compaction.patch +++ b/debian/patches/patchset-zen/sauce/0017-ZEN-INTERACTIVE-mm-Disable-unevictable-compaction.patch @@ -1,4 +1,4 @@ -From 4706a3fb5823c97dc6acc1e86958b71e2c048ec5 Mon Sep 17 00:00:00 2001 +From f138e9762fd03612db5593f4c267c8f8b5799159 Mon Sep 17 00:00:00 2001 From: Steven Barrett Date: Sat, 5 Mar 2022 11:37:14 -0600 Subject: ZEN: INTERACTIVE: mm: Disable unevictable compaction @@ -12,17 +12,17 @@ turn it off when CONFIG_ZEN_INTERACTIVE is set as well. --- a/init/Kconfig +++ b/init/Kconfig -@@ -158,6 +158,7 @@ config ZEN_INTERACTIVE +@@ -168,6 +168,7 @@ config ZEN_INTERACTIVE + --- Virtual Memory Subsystem --------------------------- Background-reclaim hugepages...: no -> yes - MG-LRU minimum cache TTL.......: 0 -> 1000 ms + Compact unevictable............: yes -> no --- EEVDF CPU Scheduler -------------------------------- --- a/mm/Kconfig +++ b/mm/Kconfig -@@ -649,7 +649,7 @@ config COMPACTION +@@ -648,7 +648,7 @@ config COMPACTION config COMPACT_UNEVICTABLE_DEFAULT int depends on COMPACTION diff --git a/debian/patches/patchset-zen/sauce/0020-ZEN-INTERACTIVE-mm-Disable-watermark-boosting-by-def.patch b/debian/patches/patchset-zen/sauce/0018-ZEN-INTERACTIVE-mm-Disable-watermark-boosting-by-def.patch similarity index 88% rename from debian/patches/patchset-zen/sauce/0020-ZEN-INTERACTIVE-mm-Disable-watermark-boosting-by-def.patch rename to debian/patches/patchset-zen/sauce/0018-ZEN-INTERACTIVE-mm-Disable-watermark-boosting-by-def.patch index f5caa56..35669b3 100644 --- a/debian/patches/patchset-zen/sauce/0020-ZEN-INTERACTIVE-mm-Disable-watermark-boosting-by-def.patch +++ b/debian/patches/patchset-zen/sauce/0018-ZEN-INTERACTIVE-mm-Disable-watermark-boosting-by-def.patch @@ -1,4 +1,4 @@ -From 5f16843397798d2c709e3b8af4b1a73539d13aa8 Mon Sep 17 00:00:00 2001 +From 76960c3806e7dfb618f49677cc84dafbfe48e4c4 Mon Sep 17 00:00:00 2001 From: Sultan Alsawaf Date: Sat, 28 Mar 2020 13:06:28 -0700 Subject: ZEN: INTERACTIVE: mm: Disable watermark boosting by default @@ -33,17 +33,17 @@ Signed-off-by: Sultan Alsawaf --- a/init/Kconfig +++ b/init/Kconfig -@@ -160,6 +160,7 @@ config ZEN_INTERACTIVE - MG-LRU minimum cache TTL.......: 0 -> 1000 ms +@@ -169,6 +169,7 @@ config ZEN_INTERACTIVE + + Background-reclaim hugepages...: no -> yes Compact unevictable............: yes -> no - Compaction proactiveness.......: 20 -> 0 + Watermark boost factor.........: 1.5 -> 0 --- EEVDF CPU Scheduler -------------------------------- --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -271,7 +271,11 @@ const char * const migratetype_names[MIG +@@ -273,7 +273,11 @@ const char * const migratetype_names[MIG int min_free_kbytes = 1024; int user_min_free_kbytes = -1; diff --git a/debian/patches/patchset-zen/sauce/0019-ZEN-INTERACTIVE-mm-Disable-proactive-compaction-by-d.patch b/debian/patches/patchset-zen/sauce/0019-ZEN-INTERACTIVE-mm-Disable-proactive-compaction-by-d.patch deleted file mode 100644 index fafd8bd..0000000 --- a/debian/patches/patchset-zen/sauce/0019-ZEN-INTERACTIVE-mm-Disable-proactive-compaction-by-d.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 8146f220f871c4db77c8363c831784041a5bcf7b Mon Sep 17 00:00:00 2001 -From: Sultan Alsawaf -Date: Sat, 24 Oct 2020 22:17:49 -0700 -Subject: ZEN: INTERACTIVE: mm: Disable proactive compaction by default - -On-demand compaction works fine assuming that you don't have a need to -spam the page allocator nonstop for large order page allocations. - -Signed-off-by: Sultan Alsawaf ---- - init/Kconfig | 1 + - mm/compaction.c | 4 ++++ - 2 files changed, 5 insertions(+) - ---- a/init/Kconfig -+++ b/init/Kconfig -@@ -159,6 +159,7 @@ config ZEN_INTERACTIVE - Background-reclaim hugepages...: no -> yes - MG-LRU minimum cache TTL.......: 0 -> 1000 ms - Compact unevictable............: yes -> no -+ Compaction proactiveness.......: 20 -> 0 - - --- EEVDF CPU Scheduler -------------------------------- - ---- a/mm/compaction.c -+++ b/mm/compaction.c -@@ -1950,7 +1950,11 @@ static int sysctl_compact_unevictable_al - * aggressively the kernel should compact memory in the - * background. It takes values in the range [0, 100]. - */ -+#ifdef CONFIG_ZEN_INTERACTIVE -+static unsigned int __read_mostly sysctl_compaction_proactiveness; -+#else - static unsigned int __read_mostly sysctl_compaction_proactiveness = 20; -+#endif - static int sysctl_extfrag_threshold = 500; - static int __read_mostly sysctl_compact_memory; - diff --git a/debian/patches/patchset-zen/sauce/0021-ZEN-INTERACTIVE-mm-Lower-the-non-hugetlbpage-pageblo.patch b/debian/patches/patchset-zen/sauce/0019-ZEN-INTERACTIVE-mm-Lower-the-non-hugetlbpage-pageblo.patch similarity index 93% rename from debian/patches/patchset-zen/sauce/0021-ZEN-INTERACTIVE-mm-Lower-the-non-hugetlbpage-pageblo.patch rename to debian/patches/patchset-zen/sauce/0019-ZEN-INTERACTIVE-mm-Lower-the-non-hugetlbpage-pageblo.patch index bba7ba1..1751479 100644 --- a/debian/patches/patchset-zen/sauce/0021-ZEN-INTERACTIVE-mm-Lower-the-non-hugetlbpage-pageblo.patch +++ b/debian/patches/patchset-zen/sauce/0019-ZEN-INTERACTIVE-mm-Lower-the-non-hugetlbpage-pageblo.patch @@ -1,4 +1,4 @@ -From eb51c53e5ded1743830368815c550b871f950738 Mon Sep 17 00:00:00 2001 +From fc3e794cecb686d4e05c6ed86fdf9b2dbd725ea9 Mon Sep 17 00:00:00 2001 From: Sultan Alsawaf Date: Wed, 20 Oct 2021 20:50:11 -0700 Subject: ZEN: INTERACTIVE: mm: Lower the non-hugetlbpage pageblock size to @@ -47,9 +47,9 @@ Signed-off-by: Sultan Alsawaf --- a/init/Kconfig +++ b/init/Kconfig -@@ -161,6 +161,7 @@ config ZEN_INTERACTIVE +@@ -170,6 +170,7 @@ config ZEN_INTERACTIVE + Background-reclaim hugepages...: no -> yes Compact unevictable............: yes -> no - Compaction proactiveness.......: 20 -> 0 Watermark boost factor.........: 1.5 -> 0 + Pageblock order................: 10 -> 3 diff --git a/debian/patches/patchset-zen/sauce/0022-ZEN-INTERACTIVE-dm-crypt-Disable-workqueues-for-cryp.patch b/debian/patches/patchset-zen/sauce/0020-ZEN-INTERACTIVE-dm-crypt-Disable-workqueues-for-cryp.patch similarity index 88% rename from debian/patches/patchset-zen/sauce/0022-ZEN-INTERACTIVE-dm-crypt-Disable-workqueues-for-cryp.patch rename to debian/patches/patchset-zen/sauce/0020-ZEN-INTERACTIVE-dm-crypt-Disable-workqueues-for-cryp.patch index 3cd88e6..bea82a3 100644 --- a/debian/patches/patchset-zen/sauce/0022-ZEN-INTERACTIVE-dm-crypt-Disable-workqueues-for-cryp.patch +++ b/debian/patches/patchset-zen/sauce/0020-ZEN-INTERACTIVE-dm-crypt-Disable-workqueues-for-cryp.patch @@ -1,4 +1,4 @@ -From a8a0d4b9f356610babe5b884500799310fe6dcdd Mon Sep 17 00:00:00 2001 +From be57a2710aef65116767d26930dd1251ff6e060f Mon Sep 17 00:00:00 2001 From: Steven Barrett Date: Sat, 21 May 2022 15:15:09 -0500 Subject: ZEN: INTERACTIVE: dm-crypt: Disable workqueues for crypto ops @@ -20,7 +20,7 @@ Fixes: https://github.com/zen-kernel/zen-kernel/issues/282 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c -@@ -3310,6 +3310,11 @@ static int crypt_ctr(struct dm_target *t +@@ -3315,6 +3315,11 @@ static int crypt_ctr(struct dm_target *t goto bad; } @@ -34,7 +34,7 @@ Fixes: https://github.com/zen-kernel/zen-kernel/issues/282 goto bad; --- a/init/Kconfig +++ b/init/Kconfig -@@ -153,6 +153,7 @@ config ZEN_INTERACTIVE +@@ -164,6 +164,7 @@ config ZEN_INTERACTIVE Default scheduler for SQ..: mq-deadline -> bfq Default scheduler for MQ..: none -> kyber diff --git a/debian/patches/patchset-zen/sauce/0023-ZEN-INTERACTIVE-mm-swap-Disable-swap-in-readahead.patch b/debian/patches/patchset-zen/sauce/0021-ZEN-INTERACTIVE-mm-swap-Disable-swap-in-readahead.patch similarity index 83% rename from debian/patches/patchset-zen/sauce/0023-ZEN-INTERACTIVE-mm-swap-Disable-swap-in-readahead.patch rename to debian/patches/patchset-zen/sauce/0021-ZEN-INTERACTIVE-mm-swap-Disable-swap-in-readahead.patch index a6392c6..0a5bab6 100644 --- a/debian/patches/patchset-zen/sauce/0023-ZEN-INTERACTIVE-mm-swap-Disable-swap-in-readahead.patch +++ b/debian/patches/patchset-zen/sauce/0021-ZEN-INTERACTIVE-mm-swap-Disable-swap-in-readahead.patch @@ -1,4 +1,4 @@ -From 5a8fabcd4e7396500f2c0070f8b7ce9106eb9bfa Mon Sep 17 00:00:00 2001 +From 41fe25c2e4e89c6afd35e3feb720e5a6797857d3 Mon Sep 17 00:00:00 2001 From: Steven Barrett Date: Mon, 5 Sep 2022 11:35:20 -0500 Subject: ZEN: INTERACTIVE: mm/swap: Disable swap-in readahead @@ -20,8 +20,8 @@ same change so Zen Kernel users benefit. --- a/init/Kconfig +++ b/init/Kconfig -@@ -163,6 +163,7 @@ config ZEN_INTERACTIVE - Compaction proactiveness.......: 20 -> 0 +@@ -172,6 +172,7 @@ config ZEN_INTERACTIVE + Compact unevictable............: yes -> no Watermark boost factor.........: 1.5 -> 0 Pageblock order................: 10 -> 3 + Swap-in readahead..............: 3 -> 0 @@ -30,7 +30,7 @@ same change so Zen Kernel users benefit. --- a/mm/swap.c +++ b/mm/swap.c -@@ -1112,6 +1112,10 @@ void folio_batch_remove_exceptionals(str +@@ -1080,6 +1080,10 @@ void folio_batch_remove_exceptionals(str */ void __init swap_setup(void) { @@ -41,7 +41,7 @@ same change so Zen Kernel users benefit. unsigned long megs = totalram_pages() >> (20 - PAGE_SHIFT); /* Use a smaller cluster for small-memory machines */ -@@ -1123,4 +1127,5 @@ void __init swap_setup(void) +@@ -1091,4 +1095,5 @@ void __init swap_setup(void) * Right now other parts of the system means that we * _really_ don't want to cluster much more */ diff --git a/debian/patches/patchset-zen/sauce/0022-ZEN-INTERACTIVE-Document-PDS-BMQ-configuration.patch b/debian/patches/patchset-zen/sauce/0022-ZEN-INTERACTIVE-Document-PDS-BMQ-configuration.patch new file mode 100644 index 0000000..5ac963c --- /dev/null +++ b/debian/patches/patchset-zen/sauce/0022-ZEN-INTERACTIVE-Document-PDS-BMQ-configuration.patch @@ -0,0 +1,23 @@ +From 40de9c08129e2d8e182a166df2f1e823f70fa31d Mon Sep 17 00:00:00 2001 +From: Steven Barrett +Date: Sun, 19 Sep 2021 16:03:36 -0500 +Subject: ZEN: INTERACTIVE: Document PDS/BMQ configuration + +--- + init/Kconfig | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/init/Kconfig ++++ b/init/Kconfig +@@ -181,6 +181,11 @@ config ZEN_INTERACTIVE + Bandwidth slice size...........: 5 -> 3 ms + Task rebalancing threshold.....: 32 -> 8 + ++ --- PDS/BMQ CPU Scheduler ------------------------------ ++ ++ Scheduling timeslice...........: 4 -> 2 ms ++ Yield type.....................: 1 -> 0 ++ + --- CPUFreq Settings ----------------------------------- + + Ondemand sampling down factor..: 1 -> 5 diff --git a/debian/patches/patchset-zen/sauce/0023-ZEN-ahci-Disable-staggered-spinup-by-default.patch b/debian/patches/patchset-zen/sauce/0023-ZEN-ahci-Disable-staggered-spinup-by-default.patch new file mode 100644 index 0000000..b66b8ca --- /dev/null +++ b/debian/patches/patchset-zen/sauce/0023-ZEN-ahci-Disable-staggered-spinup-by-default.patch @@ -0,0 +1,32 @@ +From 1ec451a4bbac7cc00b59f8ca504d6a8898615880 Mon Sep 17 00:00:00 2001 +From: EXtremeExploit +Date: Fri, 29 Nov 2024 13:05:27 -0300 +Subject: ZEN: ahci: Disable staggered spinup by default + +This patch disabled the staggered spinup used for HDDs. + +The goal is to make boot times faster on systems +with the small downside of a small spike in power consumption. + +Systems with a bunch of HDDs would see considerable faster boots + +This does make sense in the zen kernel as its supposed to be a kernel +specialized for desktop performance, and faster boot times does fit +into that description + +Signed-off-by: Pedro Montes Alcalde +--- + drivers/ata/libahci.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/ata/libahci.c ++++ b/drivers/ata/libahci.c +@@ -34,7 +34,7 @@ + #include "libata.h" + + static int ahci_skip_host_reset; +-int ahci_ignore_sss; ++int ahci_ignore_sss = 1; + EXPORT_SYMBOL_GPL(ahci_ignore_sss); + + module_param_named(skip_host_reset, ahci_skip_host_reset, int, 0444); diff --git a/debian/patches/patchset-zen/sauce/0024-ZEN-Update-VHBA-driver.patch b/debian/patches/patchset-zen/sauce/0024-ZEN-Update-VHBA-driver.patch deleted file mode 100644 index d89a19c..0000000 --- a/debian/patches/patchset-zen/sauce/0024-ZEN-Update-VHBA-driver.patch +++ /dev/null @@ -1,19 +0,0 @@ -From 238d23d6cb3f8610aa1cd3bdaeb398c63a4c9cb2 Mon Sep 17 00:00:00 2001 -From: "Jan Alexander Steffens (heftig)" -Date: Tue, 1 Oct 2024 02:22:46 +0200 -Subject: ZEN: Update VHBA driver - -remote https://github.com/cdemu/cdemu -tag vhba-module-20240917 ---- - drivers/scsi/vhba/Makefile | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/drivers/scsi/vhba/Makefile -+++ b/drivers/scsi/vhba/Makefile -@@ -1,4 +1,4 @@ --VHBA_VERSION := 20240202 -+VHBA_VERSION := 20240917 - - obj-$(CONFIG_VHBA) += vhba.o - ccflags-y := -DVHBA_VERSION=\"$(VHBA_VERSION)\" -Werror diff --git a/debian/patches/series b/debian/patches/series index a6fed10..3afe662 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -113,17 +113,15 @@ krd/0001-Revert-objtool-dont-fail-the-kernel-build-on-fatal-errors.patch krd/0002-established-timeout.patch krd/0003-local-ports.patch krd/0004-bridge-group_fwd_mask.patch -## adjustment for patchset-pf/amd-rapl/ -krd/1001-Revert-perf-x86-rapl-Fix-the-energy-pkg-event-for-AMD-CPUs.patch ## 3rd party patches mixed-arch/0001-ZEN-Add-graysky-s-more-ISA-levels-and-uarches.patch -mixed-arch/0002-ZEN-Fixup-graysky-s-more-ISA-levels-and-uarches.patch -mixed-arch/0003-ZEN-Restore-CONFIG_OPTIMIZE_FOR_PERFORMANCE_O3.patch -mixed-arch/0004-krd-adjust-CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3.patch -mixed-arch/0005-XANMOD-x86-build-Prevent-generating-avx2-and-avx512-.patch -mixed-arch/0006-krd-adjust-KBUILD_CFLAGS-fno-tree-vectorize.patch +mixed-arch/0002-ZEN-Restore-CONFIG_OPTIMIZE_FOR_PERFORMANCE_O3.patch +mixed-arch/0003-krd-adjust-CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3.patch +mixed-arch/0004-XANMOD-x86-build-Prevent-generating-avx2-and-avx512-.patch +mixed-arch/0005-krd-adjust-KBUILD_CFLAGS-fno-tree-vectorize.patch +mixed-arch/0006-XANMOD-kbuild-Add-GCC-SMS-based-modulo-scheduling-fl.patch misc-bbr3/0001-net-tcp_bbr-broaden-app-limited-rate-sample-detectio.patch misc-bbr3/0002-net-tcp_bbr-v2-shrink-delivered_mstamp-first_tx_msta.patch @@ -163,80 +161,83 @@ misc-ntsync5/0015-docs-ntsync-Add-documentation-for-the-ntsync-uAPI.patch misc-ntsync5/0016-Revert-misc-ntsync-mark-driver-as-broken-to-prevent-.patch misc-openwrt/0001-mac80211-ignore-AP-power-level-when-tx-power-type-is.patch -misc-openwrt/0002-net-enable-fraglist-GRO-by-default.patch -misc-openwrt/0003-net-remove-NETIF_F_GSO_FRAGLIST-from-NETIF_F_GSO_SOF.patch patchset-pf/amd-pstate/0001-cpufreq-amd-pstate-add-quirk-for-Ryzen-3000-series-p.patch -patchset-pf/amd-pstate/0002-cpufreq-amd-pstate-Export-symbols-for-changing-modes.patch -patchset-pf/amd-pstate/0003-cpufreq-amd-pstate-ut-Add-test-case-for-mode-switche.patch -patchset-pf/amd-pstate/0004-cpufreq-amd-pstate-Catch-failures-for-amd_pstate_epp.patch -patchset-pf/amd-pstate/0005-x86-amd-Move-amd_get_highest_perf-from-amd.c-to-cppc.patch -patchset-pf/amd-pstate/0006-ACPI-CPPC-Adjust-return-code-for-inline-functions-in.patch -patchset-pf/amd-pstate/0007-x86-amd-Rename-amd_get_highest_perf-to-amd_get_boost.patch -patchset-pf/amd-pstate/0008-ACPI-CPPC-Drop-check-for-non-zero-perf-ratio.patch -patchset-pf/amd-pstate/0009-ACPI-CPPC-Adjust-debug-messages-in-amd_set_max_freq_.patch -patchset-pf/amd-pstate/0010-x86-amd-Move-amd_get_highest_perf-out-of-amd-pstate.patch -patchset-pf/amd-pstate/0011-x86-amd-Detect-preferred-cores-in-amd_get_boost_rati.patch -patchset-pf/amd-pstate/0012-cpufreq-amd-pstate-Merge-amd_pstate_highest_perf_set.patch -patchset-pf/amd-pstate/0013-cpufreq-amd-pstate-Optimize-amd_pstate_update_limits.patch -patchset-pf/amd-pstate/0014-cpufreq-amd-pstate-Add-documentation-for-amd_pstate_.patch -patchset-pf/amd-pstate/0015-amd-pstate-Add-missing-documentation-for-amd_pstate_.patch -patchset-pf/amd-pstate/0016-cpufreq-amd-pstate-Fix-non-kerneldoc-comment.patch -patchset-pf/amd-pstate/0017-cpufreq-amd-pstate-ut-Fix-an-Uninitialized-variables.patch -patchset-pf/amd-pstate/0018-cpufreq-amd-pstate-Rename-MSR-and-shared-memory-spec.patch -patchset-pf/amd-pstate/0019-cpufreq-Add-a-callback-to-update-the-min_freq_req-fr.patch -patchset-pf/amd-pstate/0020-cpufreq-amd-pstate-Set-the-initial-min_freq-to-lowes.patch -patchset-pf/amd-pstate/0021-cpufreq-amd-pstate-Cleanup-the-old-min_freq-qos-requ.patch -patchset-pf/amd-pstate/0022-cpufreq-amd-pstate-Use-nominal-perf-for-limits-when-.patch -patchset-pf/amd-pstate/0024-cpufreq-amd-pstate-Use-amd_pstate_update_min_max_lim.patch -patchset-pf/amd-pstate/0025-cpufreq-amd-pstate-Drop-needless-EPP-initialization.patch -patchset-pf/amd-pstate/0026-amd-pstate-6.11-update-setting-the-minimum-frequency.patch -patchset-pf/amd-pstate/0027-cpufreq-amd-pstate-Call-amd_pstate_register-in-amd_p.patch -patchset-pf/amd-pstate/0028-cpufreq-amd-pstate-Call-amd_pstate_set_driver-in-amd.patch -patchset-pf/amd-pstate/0029-cpufreq-amd-pstate-Remove-the-switch-case-in-amd_pst.patch -patchset-pf/amd-pstate/0030-cpufreq-amd-pstate-Remove-the-redundant-amd_pstate_s.patch -patchset-pf/amd-pstate/0031-cpufreq-amd-pstate-ut-Add-fix-for-min-freq-unit-test.patch -patchset-pf/amd-pstate/0033-amd-pstate-Switch-to-amd-pstate-by-default-on-some-S.patch -patchset-pf/amd-pstate/0034-cpufreq-amd-pstate-Push-adjust_perf-vfunc-init-into-.patch -patchset-pf/amd-pstate/0035-ACPI-processor-Move-arch_init_invariance_cppc-call-l.patch +patchset-pf/amd-pstate/0002-cpufreq-amd-pstate-Fix-non-kerneldoc-comment.patch +patchset-pf/amd-pstate/0003-cpufreq-amd-pstate-Rename-MSR-and-shared-memory-spec.patch +patchset-pf/amd-pstate/0004-cpufreq-amd-pstate-Use-amd_pstate_update_min_max_lim.patch +patchset-pf/amd-pstate/0005-cpufreq-amd-pstate-Drop-needless-EPP-initialization.patch +patchset-pf/amd-pstate/0006-cpufreq-amd-pstate-Remove-the-redundant-verify-funct.patch +patchset-pf/amd-pstate/0007-cpufreq-amd-pstate-Set-the-initial-min_freq-to-lowes.patch +patchset-pf/amd-pstate/0008-cpufreq-amd-pstate-Call-amd_pstate_register-in-amd_p.patch +patchset-pf/amd-pstate/0009-cpufreq-amd-pstate-Call-amd_pstate_set_driver-in-amd.patch +patchset-pf/amd-pstate/0010-cpufreq-amd-pstate-Remove-the-switch-case-in-amd_pst.patch +patchset-pf/amd-pstate/0011-cpufreq-amd-pstate-Remove-the-redundant-amd_pstate_s.patch +patchset-pf/amd-pstate/0012-cpufreq-amd-pstate-ut-Add-fix-for-min-freq-unit-test.patch +patchset-pf/amd-pstate/0013-amd-pstate-Switch-to-amd-pstate-by-default-on-some-S.patch +patchset-pf/amd-pstate/0014-cpufreq-amd-pstate-Rename-functions-that-enable-CPPC.patch +patchset-pf/amd-pstate/0015-cpufreq-amd-pstate-Do-not-attempt-to-clear-MSR_AMD_C.patch +patchset-pf/amd-pstate/0016-cpufreq-amd-pstate-Call-cppc_set_epp_perf-in-the-ree.patch +patchset-pf/amd-pstate/0017-cpufreq-amd-pstate-Align-offline-flow-of-shared-memo.patch +patchset-pf/amd-pstate/0018-x86-cpufeatures-Rename-X86_FEATURE_FAST_CPPC-to-have.patch +patchset-pf/amd-pstate/0019-x86-cpufeatures-Add-feature-bits-for-AMD-heterogeneo.patch +patchset-pf/amd-pstate/0020-x86-cpu-Enable-SD_ASYM_PACKING-for-PKG-Domain-on-AMD.patch +patchset-pf/amd-pstate/0021-x86-cpu-Add-CPU-type-to-struct-cpuinfo_topology.patch +patchset-pf/amd-pstate/0022-x86-amd-Use-heterogeneous-core-topology-for-identify.patch +patchset-pf/amd-pstate/0023-cpufreq-amd-pstate-Push-adjust_perf-vfunc-init-into-.patch +patchset-pf/amd-pstate/0024-cpufreq-amd-pstate-Move-registration-after-static-fu.patch +patchset-pf/amd-pstate/0025-cpufreq-amd-pstate-Convert-the-amd_pstate_get-set_ep.patch +patchset-pf/amd-pstate/0026-cpufreq-amd-pstate-Move-the-invocation-of-amd_pstate.patch +patchset-pf/amd-pstate/0027-cpufreq-amd-pstate-Refactor-amd_pstate_epp_reenable-.patch +patchset-pf/amd-pstate/0028-cpufreq-amd-pstate-Remove-the-cppc_state-check-in-of.patch +patchset-pf/amd-pstate/0029-cpufreq-amd-pstate-Merge-amd_pstate_epp_cpu_offline-.patch +patchset-pf/amd-pstate/0030-cpufreq-amd-pstate-Add-trace-event-for-EPP-perf-upda.patch +patchset-pf/amd-pstate/0031-cpufreq-amd-pstate-convert-mutex-use-to-guard.patch +patchset-pf/amd-pstate/0032-cpufreq-amd-pstate-Drop-cached-epp_policy-variable.patch +patchset-pf/amd-pstate/0033-cpufreq-amd-pstate-Use-FIELD_PREP-and-FIELD_GET-macr.patch +patchset-pf/amd-pstate/0034-cpufreq-amd-pstate-Store-the-boost-numerator-as-high.patch +patchset-pf/amd-pstate/0035-cpufreq-amd-pstate-Use-boost-numerator-for-upper-bou.patch +patchset-pf/amd-pstate/0036-cpufreq-amd-pstate-Only-update-the-cached-value-in-m.patch +patchset-pf/amd-pstate/0037-cpufreq-amd-pstate-store-all-values-in-cpudata-struc.patch +patchset-pf/amd-pstate/0038-cpufreq-amd-pstate-Change-amd_pstate_update_perf-to-.patch +patchset-pf/amd-pstate/0039-cpufreq-amd-pstate-Move-limit-updating-code.patch +patchset-pf/amd-pstate/0040-cpufreq-amd-pstate-Cache-EPP-value-and-use-that-ever.patch +patchset-pf/amd-pstate/0041-cpufreq-amd-pstate-Always-write-EPP-value-when-updat.patch +patchset-pf/amd-pstate/0042-cpufreq-amd-pstate-Check-if-CPPC-request-has-changed.patch +patchset-pf/amd-pstate/0043-cpufreq-amd-pstate-Drop-ret-variable-from-amd_pstate.patch +patchset-pf/amd-pstate/0044-cpufreq-amd-pstate-Set-different-default-EPP-policy-.patch -patchset-pf/amd-rapl/0001-perf-Generic-hotplug-support-for-a-PMU-with-a-scope.patch -patchset-pf/amd-rapl/0002-perf-Add-PERF_EV_CAP_READ_SCOPE.patch -patchset-pf/amd-rapl/0003-perf-x86-intel-cstate-Clean-up-cpumask-and-hotplug.patch -patchset-pf/amd-rapl/0004-iommu-vt-d-Clean-up-cpumask-and-hotplug-for-perfmon.patch -patchset-pf/amd-rapl/0005-dmaengine-idxd-Clean-up-cpumask-and-hotplug-for-perf.patch -patchset-pf/amd-rapl/0006-perf-x86-rapl-Move-the-pmu-allocation-out-of-CPU-hot.patch -patchset-pf/amd-rapl/0007-perf-x86-rapl-Clean-up-cpumask-and-hotplug.patch -patchset-pf/amd-rapl/0008-perf-x86-rapl-Fix-the-energy-pkg-event-for-AMD-CPUs.patch -patchset-pf/amd-rapl/0009-x86-topology-Introduce-topology_logical_core_id.patch -patchset-pf/amd-rapl/0010-perf-x86-rapl-Remove-the-cpu_to_rapl_pmu-function.patch -patchset-pf/amd-rapl/0011-perf-x86-rapl-Rename-rapl_pmu-variables.patch -patchset-pf/amd-rapl/0012-perf-x86-rapl-Make-rapl_model-struct-global.patch -patchset-pf/amd-rapl/0013-perf-x86-rapl-Add-arguments-to-the-cleanup-and-init-.patch -patchset-pf/amd-rapl/0014-perf-x86-rapl-Modify-the-generic-variable-names-to-_.patch -patchset-pf/amd-rapl/0015-perf-x86-rapl-Remove-the-global-variable-rapl_msrs.patch -patchset-pf/amd-rapl/0016-perf-x86-rapl-Move-the-cntr_mask-to-rapl_pmus-struct.patch -patchset-pf/amd-rapl/0017-perf-x86-rapl-Add-per-core-energy-counter-support-fo.patch +patchset-pf/amd-rapl/0001-perf-x86-rapl-Move-the-pmu-allocation-out-of-CPU-hot.patch +patchset-pf/amd-rapl/0002-perf-x86-rapl-Clean-up-cpumask-and-hotplug.patch +patchset-pf/amd-rapl/0003-perf-x86-rapl-Remove-the-unused-get_rapl_pmu_cpumask.patch +patchset-pf/amd-rapl/0004-x86-topology-Introduce-topology_logical_core_id.patch +patchset-pf/amd-rapl/0005-perf-x86-rapl-Remove-the-cpu_to_rapl_pmu-function.patch +patchset-pf/amd-rapl/0006-perf-x86-rapl-Rename-rapl_pmu-variables.patch +patchset-pf/amd-rapl/0007-perf-x86-rapl-Make-rapl_model-struct-global.patch +patchset-pf/amd-rapl/0008-perf-x86-rapl-Add-arguments-to-the-init-and-cleanup-.patch +patchset-pf/amd-rapl/0009-perf-x86-rapl-Modify-the-generic-variable-names-to-_.patch +patchset-pf/amd-rapl/0010-perf-x86-rapl-Remove-the-global-variable-rapl_msrs.patch +patchset-pf/amd-rapl/0011-perf-x86-rapl-Move-the-cntr_mask-to-rapl_pmus-struct.patch +patchset-pf/amd-rapl/0012-perf-x86-rapl-Add-core-energy-counter-support-for-AM.patch +patchset-pf/amd-rapl/0013-amd-rapl-6.12-fix-clang-built-kernel-not-booting.patch patchset-pf/cpuidle/0001-cpuidle-menu-Remove-iowait-influence.patch patchset-pf/cpuidle/0002-cpuidle-Prefer-teo-over-menu-governor.patch -patchset-pf/cpuidle/0003-TEST-cpufreq-schedutil-Linear-iowait-boost-step.patch -patchset-pf/cpuidle/0004-TEST-cpufreq-schedutil-iowait-boost-cap-sysfs.patch -patchset-pf/cpuidle/0005-cpufreq-schedutil-Remove-iowait-boost.patch -patchset-pf/cpuidle/0006-cpufreq-intel_pstate-Remove-iowait-boost.patch -patchset-pf/cpuidle/0007-cpufreq-Remove-SCHED_CPUFREQ_IOWAIT-update.patch -patchset-pf/cpuidle/0008-io_uring-Do-not-set-iowait-before-sleeping.patch patchset-pf/crypto/0001-crypto-x86-crc32c-simplify-code-for-handling-fewer-t.patch patchset-pf/crypto/0002-crypto-x86-crc32c-access-32-bit-arguments-as-32-bit.patch patchset-pf/crypto/0003-crypto-x86-crc32c-eliminate-jump-table-and-excessive.patch -patchset-pf/ksm/0001-mm-expose-per-process-KSM-control-via-syscalls.patch -patchset-pf/ksm/0002-mm-process_ksm-use-pidfd_get_task-instead-of-pidfd_g.patch +patchset-pf/pksm/0001-mm-expose-per-process-KSM-control-via-syscalls.patch + +patchset-pf/xfs/0001-xfs-fix-chown-with-rt-quota.patch patchset-pf/zstd/0001-zstd-import-upstream-v1.5.6.patch patchset-pf/zstd/0002-lib-zstd-Refactor-intentional-wrap-around-test.patch +patchset-xanmod/amd/0001-platform-x86-amd-amd_3d_vcache-Add-AMD-3D-V-Cache-op.patch +patchset-xanmod/amd/0002-platform-x86-amd-amd_3d_vcache-Add-sysfs-ABI-documen.patch + patchset-xanmod/binder/0001-binder-turn-into-module.patch patchset-xanmod/clearlinux/0001-sched-wait-Do-accept-in-LIFO-order-for-cache-efficie.patch @@ -257,16 +258,16 @@ patchset-xanmod/valve/0004-leds-steamdeck-Add-support-for-Steam-Deck-LED.patch patchset-xanmod/valve/0005-mfd-Add-MFD-core-driver-for-Steam-Deck.patch patchset-xanmod/valve/0006-mfd-steamdeck-Expose-controller-board-power-in-sysfs.patch -patchset-xanmod/xanmod/0001-XANMOD-kbuild-Add-GCC-SMS-based-modulo-scheduling-fl.patch -patchset-xanmod/xanmod/0002-kbuild-Remove-GCC-minimal-function-alignment.patch -patchset-xanmod/xanmod/0003-XANMOD-fair-Set-scheduler-tunable-latencies-to-unsca.patch -patchset-xanmod/xanmod/0004-XANMOD-sched-Add-yield_type-sysctl-to-reduce-or-disa.patch -patchset-xanmod/xanmod/0005-XANMOD-block-mq-deadline-Increase-write-priority-to-.patch -patchset-xanmod/xanmod/0006-XANMOD-block-mq-deadline-Disable-front_merges-by-def.patch -patchset-xanmod/xanmod/0007-XANMOD-block-Set-rq_affinity-to-force-complete-I-O-r.patch -patchset-xanmod/xanmod/0008-XANMOD-blk-wbt-Set-wbt_default_latency_nsec-to-2msec.patch -patchset-xanmod/xanmod/0009-XANMOD-kconfig-add-500Hz-timer-interrupt-kernel-conf.patch -patchset-xanmod/xanmod/0010-XANMOD-dcache-cache_pressure-50-decreases-the-rate-a.patch +patchset-xanmod/xanmod/0001-kbuild-Remove-GCC-minimal-function-alignment.patch +patchset-xanmod/xanmod/0002-XANMOD-fair-Set-scheduler-tunable-latencies-to-unsca.patch +patchset-xanmod/xanmod/0003-XANMOD-sched-Add-yield_type-sysctl-to-reduce-or-disa.patch +patchset-xanmod/xanmod/0004-XANMOD-block-mq-deadline-Increase-write-priority-to-.patch +patchset-xanmod/xanmod/0005-XANMOD-block-mq-deadline-Disable-front_merges-by-def.patch +patchset-xanmod/xanmod/0006-XANMOD-block-Set-rq_affinity-to-force-complete-I-O-r.patch +patchset-xanmod/xanmod/0007-XANMOD-blk-wbt-Set-wbt_default_latency_nsec-to-2msec.patch +patchset-xanmod/xanmod/0008-XANMOD-kconfig-add-500Hz-timer-interrupt-kernel-conf.patch +patchset-xanmod/xanmod/0009-XANMOD-dcache-cache_pressure-50-decreases-the-rate-a.patch +patchset-xanmod/xanmod/0010-XANMOD-mm-Raise-max_map_count-default-value.patch patchset-xanmod/xanmod/0011-XANMOD-mm-vmscan-Set-minimum-amount-of-swapping.patch patchset-xanmod/xanmod/0012-XANMOD-sched-autogroup-Add-kernel-parameter-and-conf.patch patchset-xanmod/xanmod/0013-XANMOD-cpufreq-tunes-ondemand-and-conservative-gover.patch @@ -283,27 +284,22 @@ patchset-zen/sauce/0006-ZEN-Input-evdev-use-call_rcu-when-detaching-client.patch patchset-zen/sauce/0007-ZEN-cpufreq-Remove-schedutil-dependency-on-Intel-AMD.patch patchset-zen/sauce/0008-ZEN-intel-pstate-Implement-enable-parameter.patch patchset-zen/sauce/0009-ZEN-drm-amdgpu-pm-Allow-override-of-min_power_limit-.patch -patchset-zen/sauce/0010-ZEN-Set-default-max-map-count-to-INT_MAX-5.patch +patchset-zen/sauce/0010-ZEN-mm-Stop-kswapd-early-when-nothing-s-waiting-for-.patch patchset-zen/sauce/0011-ZEN-INTERACTIVE-Base-config-item.patch patchset-zen/sauce/0012-ZEN-INTERACTIVE-Use-BFQ-as-the-elevator-for-SQ-devic.patch patchset-zen/sauce/0013-ZEN-INTERACTIVE-Use-Kyber-as-the-elevator-for-MQ-dev.patch patchset-zen/sauce/0014-ZEN-INTERACTIVE-Enable-background-reclaim-of-hugepag.patch -patchset-zen/sauce/0015-ZEN-INTERACTIVE-Tune-mgLRU-to-protect-cache-used-in-.patch -patchset-zen/sauce/0016-ZEN-INTERACTIVE-Tune-EEVDF-for-interactivity.patch -patchset-zen/sauce/0017-ZEN-INTERACTIVE-Tune-ondemand-governor-for-interacti.patch -patchset-zen/sauce/0018-ZEN-INTERACTIVE-mm-Disable-unevictable-compaction.patch -patchset-zen/sauce/0019-ZEN-INTERACTIVE-mm-Disable-proactive-compaction-by-d.patch -patchset-zen/sauce/0020-ZEN-INTERACTIVE-mm-Disable-watermark-boosting-by-def.patch -patchset-zen/sauce/0021-ZEN-INTERACTIVE-mm-Lower-the-non-hugetlbpage-pageblo.patch -patchset-zen/sauce/0022-ZEN-INTERACTIVE-dm-crypt-Disable-workqueues-for-cryp.patch -patchset-zen/sauce/0023-ZEN-INTERACTIVE-mm-swap-Disable-swap-in-readahead.patch -patchset-zen/sauce/0024-ZEN-Update-VHBA-driver.patch -patchset-zen/sauce/0025-ZEN-mm-Stop-kswapd-early-when-nothing-s-waiting-for-.patch +patchset-zen/sauce/0015-ZEN-INTERACTIVE-Tune-EEVDF-for-interactivity.patch +patchset-zen/sauce/0016-ZEN-INTERACTIVE-Tune-ondemand-governor-for-interacti.patch +patchset-zen/sauce/0017-ZEN-INTERACTIVE-mm-Disable-unevictable-compaction.patch +patchset-zen/sauce/0018-ZEN-INTERACTIVE-mm-Disable-watermark-boosting-by-def.patch +patchset-zen/sauce/0019-ZEN-INTERACTIVE-mm-Lower-the-non-hugetlbpage-pageblo.patch +patchset-zen/sauce/0020-ZEN-INTERACTIVE-dm-crypt-Disable-workqueues-for-cryp.patch +patchset-zen/sauce/0021-ZEN-INTERACTIVE-mm-swap-Disable-swap-in-readahead.patch +patchset-zen/sauce/0022-ZEN-INTERACTIVE-Document-PDS-BMQ-configuration.patch +patchset-zen/sauce/0023-ZEN-ahci-Disable-staggered-spinup-by-default.patch patchset-pf/fixes/0001-arch-Kconfig-Default-to-maximum-amount-of-ASLR-bits.patch -patchset-pf/fixes/0002-cpufreq-Remove-LATENCY_MULTIPLIER.patch -patchset-pf/fixes/0003-drivers-firmware-skip-simpledrm-if-nvidia-drm.modese.patch -patchset-pf/fixes/0004-nfsd-add-more-info-to-WARN_ON_ONCE-on-failed-callbac.patch -patchset-pf/fixes/0005-btrfs-also-add-stripe-entries-for-NOCOW-writes.patch +patchset-pf/fixes/0002-drivers-firmware-skip-simpledrm-if-nvidia-drm.modese.patch -patchset-zen/fixes/0001-Partially-revert-drm-amd-amdgpu-add-pipe1-hardware-s.patch +patchset-zen/fixes/0001-futex-improve-user-space-accesses.patch diff --git a/debian/rules.d/certs/Makefile b/debian/rules.d/certs/Makefile index 7ff7bae..12f01ef 100644 --- a/debian/rules.d/certs/Makefile +++ b/debian/rules.d/certs/Makefile @@ -3,5 +3,5 @@ PROGS = \ include $(top_rulesdir)/Makefile.inc -CPPFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 +CPPFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -I$(top_srcdir)/scripts extract-cert: LDLIBS += -lcrypto diff --git a/debian/rules.d/scripts/Makefile b/debian/rules.d/scripts/Makefile index c913e25..a858eeb 100644 --- a/debian/rules.d/scripts/Makefile +++ b/debian/rules.d/scripts/Makefile @@ -8,6 +8,7 @@ DATA = \ Kbuild.include \ Makefile.* \ mkversion \ + module-common.c \ module-common.lds \ subarch.include diff --git a/debian/templates/image.postrm.in b/debian/templates/image.postrm.in index 5584b56..ab5a4e1 100644 --- a/debian/templates/image.postrm.in +++ b/debian/templates/image.postrm.in @@ -22,6 +22,7 @@ if [ "$1" = purge ]; then for extra_file in \ 'modules.*.bin' \ modules.alias \ + modules.builtin.ranges \ modules.ccwmap \ modules.dep \ modules.devname \