diff --git a/.github/release-nest-v3 b/.github/release-nest-v3 index d8263ee..e440e5c 100644 --- a/.github/release-nest-v3 +++ b/.github/release-nest-v3 @@ -1 +1 @@ -2 \ No newline at end of file +3 \ No newline at end of file diff --git a/config b/config index a66f036..9cbfb75 100644 --- a/config +++ b/config @@ -1,6 +1,6 @@ # # Automatically generated file; DO NOT EDIT. -# Linux/x86 6.10.5 Kernel Configuration +# Linux/x86 6.10.7 Kernel Configuration # CONFIG_CC_VERSION_TEXT="gcc (GCC) 14.2.1 20240805" CONFIG_CC_IS_GCC=y @@ -130,7 +130,6 @@ CONFIG_BPF_JIT_DEFAULT_ON=y CONFIG_BPF_UNPRIV_DEFAULT_OFF=y # CONFIG_BPF_PRELOAD is not set CONFIG_BPF_LSM=y -CONFIG_DEBUG_INFO_BTF=y # end of BPF subsystem CONFIG_PREEMPT_BUILD=y @@ -141,7 +140,7 @@ CONFIG_PREEMPT_COUNT=y CONFIG_PREEMPTION=y CONFIG_PREEMPT_DYNAMIC=y CONFIG_SCHED_CORE=y -CONFIG_SCHED_CLASS_EXT=y +# CONFIG_SCHED_CLASS_EXT is not set # # CPU/Task time and stats accounting @@ -309,7 +308,6 @@ CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_SELFTEST is not set CONFIG_KALLSYMS_ALL=y CONFIG_KALLSYMS_ABSOLUTE_PERCPU=y -CONFIG_KALLSYMS_BASE_RELATIVE=y CONFIG_ARCH_HAS_MEMBARRIER_SYNC_CORE=y CONFIG_HAVE_PERF_EVENTS=y CONFIG_GUEST_PERF_EVENTS=y diff --git a/patches/0001-cachyos-base-all.patch b/patches/0001-cachyos-base-all.patch index f8fb7aa..4d2d982 100644 --- a/patches/0001-cachyos-base-all.patch +++ b/patches/0001-cachyos-base-all.patch @@ -1,6 +1,6 @@ -From d6a6d104d46aedec0a853aaeac60ab4bcce7c9d4 Mon Sep 17 00:00:00 2001 +From 4eac490bd421e6a4a21b1c42cc11d226c4c06c4e Mon Sep 17 00:00:00 2001 From: Peter Jung -Date: Wed, 14 Aug 2024 16:18:27 +0200 +Date: Thu, 29 Aug 2024 18:11:02 +0200 Subject: [PATCH 01/12] amd-pstate Signed-off-by: Peter Jung @@ -11,10 +11,10 @@ Signed-off-by: Peter Jung arch/x86/kernel/cpu/scattered.c | 1 + drivers/cpufreq/Kconfig.x86 | 1 + drivers/cpufreq/acpi-cpufreq.c | 3 +- - drivers/cpufreq/amd-pstate.c | 307 +++++++++++++++----- + drivers/cpufreq/amd-pstate.c | 323 +++++++++++++++----- drivers/cpufreq/amd-pstate.h | 1 + drivers/cpufreq/cpufreq.c | 11 +- - 9 files changed, 260 insertions(+), 85 deletions(-) + 9 files changed, 276 insertions(+), 85 deletions(-) diff --git a/Documentation/admin-guide/pm/amd-pstate.rst b/Documentation/admin-guide/pm/amd-pstate.rst index 1e0d101b020a..d0324d44f548 100644 @@ -123,7 +123,7 @@ index 4ac3a35dcd98..f4f8587c4ea0 100644 return 0; } diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c -index 67c4a6a0ef12..d7c4a7d6d993 100644 +index 67c4a6a0ef12..82c2ffa93cf2 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -51,6 +51,7 @@ @@ -639,7 +639,7 @@ index 67c4a6a0ef12..d7c4a7d6d993 100644 .name = "amd-pstate-epp", .attr = amd_pstate_epp_attr, }; -@@ -1742,6 +1852,44 @@ static int __init amd_pstate_set_driver(int mode_idx) +@@ -1742,6 +1852,60 @@ static int __init amd_pstate_set_driver(int mode_idx) return -EINVAL; } @@ -658,18 +658,34 @@ index 67c4a6a0ef12..d7c4a7d6d993 100644 + } + + /* -+ * If the CPPC feature is disabled in the BIOS for processors that support MSR-based CPPC, -+ * the AMD Pstate driver may not function correctly. -+ * Check the CPPC flag and display a warning message if the platform supports CPPC. -+ * Note: below checking code will not abort the driver registeration process because of -+ * the code is added for debugging purposes. ++ * If the CPPC feature is disabled in the BIOS for processors ++ * that support MSR-based CPPC, the AMD Pstate driver may not ++ * function correctly. ++ * ++ * For such processors, check the CPPC flag and display a ++ * warning message if the platform supports CPPC. ++ * ++ * Note: The code check below will not abort the driver ++ * registration process because of the code is added for ++ * debugging purposes. Besides, it may still be possible for ++ * the driver to work using the shared-memory mechanism. + */ + if (!cpu_feature_enabled(X86_FEATURE_CPPC)) { -+ if (cpu_feature_enabled(X86_FEATURE_ZEN3) || -+ cpu_feature_enabled(X86_FEATURE_ZEN4)) { -+ if ((c->x86_model > 0x10 && c->x86_model < 0x1F) || -+ (c->x86_model > 0x40 && c->x86_model < 0xaf)) ++ if (cpu_feature_enabled(X86_FEATURE_ZEN2)) { ++ switch (c->x86_model) { ++ case 0x60 ... 0x6F: ++ case 0x80 ... 0xAF: + warn = true; ++ break; ++ } ++ } else if (cpu_feature_enabled(X86_FEATURE_ZEN3) || ++ cpu_feature_enabled(X86_FEATURE_ZEN4)) { ++ switch (c->x86_model) { ++ case 0x10 ... 0x1F: ++ case 0x40 ... 0xAF: ++ warn = true; ++ break; ++ } + } else if (cpu_feature_enabled(X86_FEATURE_ZEN5)) { + warn = true; + } @@ -684,7 +700,7 @@ index 67c4a6a0ef12..d7c4a7d6d993 100644 static int __init amd_pstate_init(void) { struct device *dev_root; -@@ -1750,6 +1898,11 @@ static int __init amd_pstate_init(void) +@@ -1750,6 +1914,11 @@ static int __init amd_pstate_init(void) if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD) return -ENODEV; @@ -696,7 +712,7 @@ index 67c4a6a0ef12..d7c4a7d6d993 100644 if (!acpi_cpc_valid()) { pr_warn_once("the _CPC object is not present in SBIOS or ACPI disabled\n"); return -ENODEV; -@@ -1774,11 +1927,9 @@ static int __init amd_pstate_init(void) +@@ -1774,11 +1943,9 @@ static int __init amd_pstate_init(void) /* Disable on the following configs by default: * 1. Undefined platforms * 2. Server platforms @@ -709,7 +725,7 @@ index 67c4a6a0ef12..d7c4a7d6d993 100644 pr_info("driver load is disabled, boot with specific mode to enable this\n"); return -ENODEV; } -@@ -1802,7 +1953,7 @@ static int __init amd_pstate_init(void) +@@ -1802,7 +1969,7 @@ static int __init amd_pstate_init(void) } /* capability check */ @@ -718,7 +734,7 @@ index 67c4a6a0ef12..d7c4a7d6d993 100644 pr_debug("AMD CPPC MSR based functionality is supported\n"); if (cppc_state != AMD_PSTATE_ACTIVE) current_pstate_driver->adjust_perf = amd_pstate_adjust_perf; -@@ -1821,8 +1972,10 @@ static int __init amd_pstate_init(void) +@@ -1821,8 +1988,10 @@ static int __init amd_pstate_init(void) } ret = cpufreq_register_driver(current_pstate_driver); @@ -730,7 +746,7 @@ index 67c4a6a0ef12..d7c4a7d6d993 100644 dev_root = bus_get_dev_root(&cpu_subsys); if (dev_root) { -@@ -1838,6 +1991,8 @@ static int __init amd_pstate_init(void) +@@ -1838,6 +2007,8 @@ static int __init amd_pstate_init(void) global_attr_free: cpufreq_unregister_driver(current_pstate_driver); @@ -785,9 +801,9 @@ index 9e5060b27864..270ea04fb616 100644 -- 2.46.0 -From 3f0f8331e3fd1ad093220484546330eef1ed36b9 Mon Sep 17 00:00:00 2001 +From 609fcda7ede707fffb29c91c69d0d7e1c198253f Mon Sep 17 00:00:00 2001 From: Peter Jung -Date: Wed, 14 Aug 2024 16:18:40 +0200 +Date: Thu, 29 Aug 2024 18:11:11 +0200 Subject: [PATCH 02/12] bbr3 Signed-off-by: Peter Jung @@ -3819,10 +3835,10 @@ index 28ffcfbeef14..7b13915ba288 100644 icsk->icsk_ca_ops->init(sk); if (tcp_ca_needs_ecn(sk)) diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c -index ecd521108559..83b4928bc014 100644 +index 2c52f6dcbd29..009917385bea 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c -@@ -365,7 +365,7 @@ static void __tcp_ecn_check_ce(struct sock *sk, const struct sk_buff *skb) +@@ -370,7 +370,7 @@ static void __tcp_ecn_check_ce(struct sock *sk, const struct sk_buff *skb) tcp_enter_quickack_mode(sk, 2); break; case INET_ECN_CE: @@ -3831,7 +3847,7 @@ index ecd521108559..83b4928bc014 100644 tcp_ca_event(sk, CA_EVENT_ECN_IS_CE); if (!(tp->ecn_flags & TCP_ECN_DEMAND_CWR)) { -@@ -376,7 +376,7 @@ static void __tcp_ecn_check_ce(struct sock *sk, const struct sk_buff *skb) +@@ -381,7 +381,7 @@ static void __tcp_ecn_check_ce(struct sock *sk, const struct sk_buff *skb) tp->ecn_flags |= TCP_ECN_SEEN; break; default: @@ -3840,7 +3856,7 @@ index ecd521108559..83b4928bc014 100644 tcp_ca_event(sk, CA_EVENT_ECN_NO_CE); tp->ecn_flags |= TCP_ECN_SEEN; break; -@@ -1124,7 +1124,12 @@ static void tcp_verify_retransmit_hint(struct tcp_sock *tp, struct sk_buff *skb) +@@ -1120,7 +1120,12 @@ static void tcp_verify_retransmit_hint(struct tcp_sock *tp, struct sk_buff *skb) */ static void tcp_notify_skb_loss_event(struct tcp_sock *tp, const struct sk_buff *skb) { @@ -3853,7 +3869,7 @@ index ecd521108559..83b4928bc014 100644 } void tcp_mark_skb_lost(struct sock *sk, struct sk_buff *skb) -@@ -1505,6 +1510,17 @@ static bool tcp_shifted_skb(struct sock *sk, struct sk_buff *prev, +@@ -1501,6 +1506,17 @@ static bool tcp_shifted_skb(struct sock *sk, struct sk_buff *prev, WARN_ON_ONCE(tcp_skb_pcount(skb) < pcount); tcp_skb_pcount_add(skb, -pcount); @@ -3871,7 +3887,7 @@ index ecd521108559..83b4928bc014 100644 /* When we're adding to gso_segs == 1, gso_size will be zero, * in theory this shouldn't be necessary but as long as DSACK * code can come after this skb later on it's better to keep -@@ -3799,7 +3815,8 @@ static void tcp_replace_ts_recent(struct tcp_sock *tp, u32 seq) +@@ -3795,7 +3811,8 @@ static void tcp_replace_ts_recent(struct tcp_sock *tp, u32 seq) /* This routine deals with acks during a TLP episode and ends an episode by * resetting tlp_high_seq. Ref: TLP algorithm in draft-ietf-tcpm-rack */ @@ -3881,7 +3897,7 @@ index ecd521108559..83b4928bc014 100644 { struct tcp_sock *tp = tcp_sk(sk); -@@ -3816,6 +3833,7 @@ static void tcp_process_tlp_ack(struct sock *sk, u32 ack, int flag) +@@ -3812,6 +3829,7 @@ static void tcp_process_tlp_ack(struct sock *sk, u32 ack, int flag) /* ACK advances: there was a loss, so reduce cwnd. Reset * tlp_high_seq in tcp_init_cwnd_reduction() */ @@ -3889,7 +3905,7 @@ index ecd521108559..83b4928bc014 100644 tcp_init_cwnd_reduction(sk); tcp_set_ca_state(sk, TCP_CA_CWR); tcp_end_cwnd_reduction(sk); -@@ -3826,6 +3844,11 @@ static void tcp_process_tlp_ack(struct sock *sk, u32 ack, int flag) +@@ -3822,6 +3840,11 @@ static void tcp_process_tlp_ack(struct sock *sk, u32 ack, int flag) FLAG_NOT_DUP | FLAG_DATA_SACKED))) { /* Pure dupack: original and TLP probe arrived; no loss */ tp->tlp_high_seq = 0; @@ -3901,7 +3917,7 @@ index ecd521108559..83b4928bc014 100644 } } -@@ -3934,6 +3957,7 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag) +@@ -3930,6 +3953,7 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag) prior_fack = tcp_is_sack(tp) ? tcp_highest_sack_seq(tp) : tp->snd_una; rs.prior_in_flight = tcp_packets_in_flight(tp); @@ -3909,7 +3925,7 @@ index ecd521108559..83b4928bc014 100644 /* ts_recent update must be made after we are sure that the packet * is in window. -@@ -4008,7 +4032,7 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag) +@@ -4004,7 +4028,7 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag) tcp_rack_update_reo_wnd(sk, &rs); if (tp->tlp_high_seq) @@ -3918,7 +3934,7 @@ index ecd521108559..83b4928bc014 100644 if (tcp_ack_is_dubious(sk, flag)) { if (!(flag & (FLAG_SND_UNA_ADVANCED | -@@ -4032,6 +4056,7 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag) +@@ -4028,6 +4052,7 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag) delivered = tcp_newly_delivered(sk, delivered, flag); lost = tp->lost - lost; /* freshly marked lost */ rs.is_ack_delayed = !!(flag & FLAG_ACK_MAYBE_DELAYED); @@ -3926,7 +3942,7 @@ index ecd521108559..83b4928bc014 100644 tcp_rate_gen(sk, delivered, lost, is_sack_reneg, sack_state.rate); tcp_cong_control(sk, ack, delivered, flag, sack_state.rate); tcp_xmit_recovery(sk, rexmit); -@@ -4051,7 +4076,7 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag) +@@ -4047,7 +4072,7 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag) tcp_ack_probe(sk); if (tp->tlp_high_seq) @@ -3935,7 +3951,7 @@ index ecd521108559..83b4928bc014 100644 return 1; old_ack: -@@ -5723,13 +5748,14 @@ static void __tcp_ack_snd_check(struct sock *sk, int ofo_possible) +@@ -5719,13 +5744,14 @@ static void __tcp_ack_snd_check(struct sock *sk, int ofo_possible) /* More than one full frame received... */ if (((tp->rcv_nxt - tp->rcv_wup) > inet_csk(sk)->icsk_ack.rcv_mss && @@ -4171,9 +4187,9 @@ index 4d40615dc8fc..f27941201ef2 100644 -- 2.46.0 -From 6f3d18e8b87fe3d732050b597e42200fc22e0d01 Mon Sep 17 00:00:00 2001 +From d0f09b45389d4c5772a0c210d92f54ca2b1ecad4 Mon Sep 17 00:00:00 2001 From: Peter Jung -Date: Wed, 14 Aug 2024 16:18:51 +0200 +Date: Thu, 29 Aug 2024 18:11:20 +0200 Subject: [PATCH 03/12] block Signed-off-by: Peter Jung @@ -4656,9 +4672,9 @@ index acdc28756d9d..8b214233a061 100644 -- 2.46.0 -From 693c2b3378b5d86ce5ed5236d114da0606e0ee76 Mon Sep 17 00:00:00 2001 +From 18ac14361294862f1ff9b60756b771c2cb0cb308 Mon Sep 17 00:00:00 2001 From: Peter Jung -Date: Wed, 14 Aug 2024 16:19:02 +0200 +Date: Thu, 29 Aug 2024 18:11:29 +0200 Subject: [PATCH 04/12] cachy Signed-off-by: Peter Jung @@ -4723,9 +4739,9 @@ Signed-off-by: Peter Jung mm/swap.c | 5 + mm/vmpressure.c | 4 + mm/vmscan.c | 8 + - scripts/Makefile.package | 14 + - scripts/package/PKGBUILD | 108 + - 62 files changed, 5910 insertions(+), 99 deletions(-) + scripts/Makefile.package | 13 + + scripts/package/PKGBUILD | 119 + + 62 files changed, 5920 insertions(+), 99 deletions(-) create mode 100644 drivers/i2c/busses/i2c-nct6775.c create mode 100644 drivers/media/v4l2-core/v4l2loopback.c create mode 100644 drivers/media/v4l2-core/v4l2loopback.h @@ -4799,7 +4815,7 @@ index 958e935449e5..b27470be2e6a 100644 M: Thorsten Leemhuis L: regressions@lists.linux.dev diff --git a/Makefile b/Makefile -index f9badb79ae8f..fbe293960f60 100644 +index ab77d171e268..76fd437cffff 100644 --- a/Makefile +++ b/Makefile @@ -817,6 +817,9 @@ KBUILD_CFLAGS += -fno-delete-null-pointer-checks @@ -5854,10 +5870,10 @@ index 47b8b49da8a7..943959d1f401 100644 + endmenu diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c -index 964bb6d0a383..a5f10700c16b 100644 +index 8d4ad15b8e17..ea95c8fe0e4e 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c -@@ -4119,7 +4119,7 @@ static int amdgpu_dm_mode_config_init(struct amdgpu_device *adev) +@@ -4128,7 +4128,7 @@ static int amdgpu_dm_mode_config_init(struct amdgpu_device *adev) return r; } @@ -5911,7 +5927,7 @@ index e23a0a276e33..dd83cf50a89b 100644 #endif return 0; diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c -index 8a4c40b4c27e..779880c64575 100644 +index 311c62d2d1eb..8c8d0d209d7a 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c @@ -1468,7 +1468,7 @@ static void amdgpu_dm_plane_drm_plane_destroy_state(struct drm_plane *plane, @@ -11235,7 +11251,7 @@ index 6030a8235617..60b7fe5fa74a 100644 { return &init_user_ns; diff --git a/init/Kconfig b/init/Kconfig -index d8a971b804d3..bfc033b53242 100644 +index 9684e5d2b81c..fdfe1928de17 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -132,6 +132,10 @@ config THREAD_INFO_IN_TASK @@ -11494,7 +11510,7 @@ index 739b1bf3d637..3a4269c02fb2 100644 static int __read_mostly sysctl_compact_memory; diff --git a/mm/huge_memory.c b/mm/huge_memory.c -index 5f32a196a612..99832eb64739 100644 +index 4d9c1277e5e4..8d551e3be086 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -63,7 +63,11 @@ unsigned long transparent_hugepage_flags __read_mostly = @@ -11538,7 +11554,7 @@ index 8a1c92090129..a415623cde8f 100644 EXPORT_SYMBOL_GPL(dirty_writeback_interval); diff --git a/mm/page_alloc.c b/mm/page_alloc.c -index df2c442f1c47..0d2e014af058 100644 +index b50060405d94..da9f688657f6 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -271,7 +271,11 @@ const char * const migratetype_names[MIGRATE_TYPES] = { @@ -11619,10 +11635,10 @@ index 68ac33bea3a3..9ede4f0c1c0e 100644 static void lru_gen_age_node(struct pglist_data *pgdat, struct scan_control *sc) { diff --git a/scripts/Makefile.package b/scripts/Makefile.package -index bf016af8bf8a..4a80584ec771 100644 +index bf016af8bf8a..11d53f240a2b 100644 --- a/scripts/Makefile.package +++ b/scripts/Makefile.package -@@ -141,6 +141,19 @@ snap-pkg: +@@ -141,6 +141,18 @@ snap-pkg: cd $(objtree)/snap && \ snapcraft --target-arch=$(UTS_MACHINE) @@ -11632,8 +11648,7 @@ index bf016af8bf8a..4a80584ec771 100644 +PHONY += pacman-pkg +pacman-pkg: + @ln -srf $(srctree)/scripts/package/PKGBUILD $(objtree)/PKGBUILD -+ +objtree="$(realpath $(objtree))" \ -+ BUILDDIR="$(realpath $(objtree))/pacman" \ ++ +BUILDDIR="$(realpath $(objtree))/pacman" \ + CARCH="$(UTS_MACHINE)" \ + KBUILD_MAKEFLAGS="$(MAKEFLAGS)" \ + KBUILD_REVISION="$(shell $(srctree)/scripts/build-version)" \ @@ -11642,7 +11657,7 @@ index bf016af8bf8a..4a80584ec771 100644 # dir-pkg tar*-pkg - tarball targets # --------------------------------------------------------------------------- -@@ -221,6 +234,7 @@ help: +@@ -221,6 +233,7 @@ help: @echo ' bindeb-pkg - Build only the binary kernel deb package' @echo ' snap-pkg - Build only the binary kernel snap package' @echo ' (will connect to external hosts)' @@ -11652,19 +11667,22 @@ index bf016af8bf8a..4a80584ec771 100644 @echo ' targz-pkg - Build the kernel as a gzip compressed tarball' diff --git a/scripts/package/PKGBUILD b/scripts/package/PKGBUILD new file mode 100644 -index 000000000000..663ce300dd06 +index 000000000000..839cd5e634d2 --- /dev/null +++ b/scripts/package/PKGBUILD -@@ -0,0 +1,108 @@ +@@ -0,0 +1,119 @@ +# SPDX-License-Identifier: GPL-2.0-only +# Maintainer: Thomas Weißschuh +# Contributor: Jan Alexander Steffens (heftig) + +pkgbase=${PACMAN_PKGBASE:-linux-upstream} -+pkgname=("${pkgbase}" "${pkgbase}-api-headers") -+if grep -q CONFIG_MODULES=y include/config/auto.conf; then -+ pkgname+=("${pkgbase}-headers") -+fi ++pkgname=("${pkgbase}") ++ ++_extrapackages=${PACMAN_EXTRAPACKAGES-headers api-headers} ++for pkg in $_extrapackages; do ++ pkgname+=("${pkgbase}-${pkg}") ++done ++ +pkgver="${KERNELRELEASE//-/_}" +# The PKGBUILD is evaluated multiple times. +# Running scripts/build-version from here would introduce inconsistencies. @@ -11691,11 +11709,17 @@ index 000000000000..663ce300dd06 +) +options=(!debug !strip !buildflags !makeflags) + -+build() { ++_prologue() { + # MAKEFLAGS from makepkg.conf override the ones inherited from kbuild. + # Bypass this override with a custom variable. + export MAKEFLAGS="${KBUILD_MAKEFLAGS}" -+ cd "${objtree}" ++ ++ # Kbuild works in the output directory, where this PKGBUILD is located. ++ cd "$(dirname "${BASH_SOURCE[0]}")" ++} ++ ++build() { ++ _prologue + + ${MAKE} KERNELRELEASE="${KERNELRELEASE}" KBUILD_BUILD_VERSION="${pkgrel}" +} @@ -11703,10 +11727,10 @@ index 000000000000..663ce300dd06 +_package() { + pkgdesc="The ${pkgdesc} kernel and modules" + -+ export MAKEFLAGS="${KBUILD_MAKEFLAGS}" -+ cd "${objtree}" + local modulesdir="${pkgdir}/usr/${MODLIB}" + ++ _prologue ++ + echo "Installing boot image..." + # systemd expects to find the kernel here to allow hibernation + # https://github.com/systemd/systemd/commit/edda44605f06a41fb86b7ab8128dcf99161d2344 @@ -11731,14 +11755,17 @@ index 000000000000..663ce300dd06 +_package-headers() { + pkgdesc="Headers and scripts for building modules for the ${pkgdesc} kernel" + -+ export MAKEFLAGS="${KBUILD_MAKEFLAGS}" -+ cd "${objtree}" + local builddir="${pkgdir}/usr/${MODLIB}/build" + -+ echo "Installing build files..." -+ "${srctree}/scripts/package/install-extmod-build" "${builddir}" ++ _prologue ++ ++ if grep -q CONFIG_MODULES=y include/config/auto.conf; then ++ echo "Installing build files..." ++ "${srctree}/scripts/package/install-extmod-build" "${builddir}" ++ fi + + echo "Installing System.map and config..." ++ mkdir -p "${builddir}" + cp System.map "${builddir}/System.map" + cp .config "${builddir}/.config" + @@ -11752,8 +11779,7 @@ index 000000000000..663ce300dd06 + provides=(linux-api-headers) + conflicts=(linux-api-headers) + -+ export MAKEFLAGS="${KBUILD_MAKEFLAGS}" -+ cd "${objtree}" ++ _prologue + + ${MAKE} headers_install INSTALL_HDR_PATH="${pkgdir}/usr" +} @@ -11767,9 +11793,9 @@ index 000000000000..663ce300dd06 -- 2.46.0 -From 7f81e97ab2c94fec90c410ca66e5e5382769cb9f Mon Sep 17 00:00:00 2001 +From 439f92c070a6ef817b632396df6d77cb71d09675 Mon Sep 17 00:00:00 2001 From: Peter Jung -Date: Wed, 14 Aug 2024 16:19:12 +0200 +Date: Thu, 29 Aug 2024 18:11:50 +0200 Subject: [PATCH 05/12] crypto Signed-off-by: Peter Jung @@ -19956,23 +19982,24 @@ index ef031655b2d3..cd37de5ec404 100644 -- 2.46.0 -From 1de4c03fd12b0064af9db641bac0080f222cca7e Mon Sep 17 00:00:00 2001 +From 14db30eda7df7c06812087bd43bed7c08b660f00 Mon Sep 17 00:00:00 2001 From: Peter Jung -Date: Wed, 14 Aug 2024 16:19:23 +0200 +Date: Thu, 29 Aug 2024 18:11:59 +0200 Subject: [PATCH 06/12] fixes Signed-off-by: Peter Jung --- arch/Kconfig | 4 ++-- + arch/x86/kernel/amd_nb.c | 4 ++++ + drivers/cpufreq/intel_pstate.c | 4 +++- drivers/gpu/drm/nouveau/nouveau_bo.c | 2 +- drivers/gpu/drm/nouveau/nouveau_chan.c | 2 +- drivers/gpu/drm/nouveau/nouveau_dmem.c | 2 +- drivers/gpu/drm/nouveau/nouveau_fence.c | 30 +------------------------ drivers/gpu/drm/nouveau/nouveau_fence.h | 2 +- drivers/gpu/drm/nouveau/nouveau_gem.c | 2 +- - fs/btrfs/extent_map.c | 22 +++++------------- - fs/btrfs/super.c | 10 +++++++++ - 9 files changed, 24 insertions(+), 52 deletions(-) + drivers/powercap/intel_rapl_common.c | 1 + + 10 files changed, 16 insertions(+), 37 deletions(-) diff --git a/arch/Kconfig b/arch/Kconfig index 975dd22a2dbd..de69b8f5b5be 100644 @@ -19996,6 +20023,43 @@ index 975dd22a2dbd..de69b8f5b5be 100644 depends on HAVE_ARCH_MMAP_RND_COMPAT_BITS help This value can be used to select the number of bits to use to +diff --git a/arch/x86/kernel/amd_nb.c b/arch/x86/kernel/amd_nb.c +index 027a8c7a2c9e..41043d9b885a 100644 +--- a/arch/x86/kernel/amd_nb.c ++++ b/arch/x86/kernel/amd_nb.c +@@ -43,6 +43,8 @@ + #define PCI_DEVICE_ID_AMD_19H_M70H_DF_F4 0x14f4 + #define PCI_DEVICE_ID_AMD_19H_M78H_DF_F4 0x12fc + #define PCI_DEVICE_ID_AMD_1AH_M00H_DF_F4 0x12c4 ++#define PCI_DEVICE_ID_AMD_1AH_M60H_DF_F4 0x124c ++#define PCI_DEVICE_ID_AMD_1AH_M70H_DF_F4 0x12bc + #define PCI_DEVICE_ID_AMD_MI200_DF_F4 0x14d4 + #define PCI_DEVICE_ID_AMD_MI300_DF_F4 0x152c + +@@ -122,6 +124,8 @@ static const struct pci_device_id amd_nb_link_ids[] = { + { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M78H_DF_F4) }, + { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CNB17H_F4) }, + { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_1AH_M00H_DF_F4) }, ++ { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_1AH_M60H_DF_F4) }, ++ { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_1AH_M70H_DF_F4) }, + { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_MI200_DF_F4) }, + { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_MI300_DF_F4) }, + {} +diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c +index 1035c074f36a..cc54238596ed 100644 +--- a/drivers/cpufreq/intel_pstate.c ++++ b/drivers/cpufreq/intel_pstate.c +@@ -3393,7 +3393,9 @@ static const struct x86_cpu_id intel_epp_default[] = { + X86_MATCH_INTEL_FAM6_MODEL(ALDERLAKE_L, HWP_SET_DEF_BALANCE_PERF_EPP(102)), + X86_MATCH_INTEL_FAM6_MODEL(SAPPHIRERAPIDS_X, HWP_SET_DEF_BALANCE_PERF_EPP(32)), + X86_MATCH_INTEL_FAM6_MODEL(METEORLAKE_L, HWP_SET_EPP_VALUES(HWP_EPP_POWERSAVE, +- HWP_EPP_BALANCE_POWERSAVE, 115, 16)), ++ 179, 64, 16)), ++ X86_MATCH_INTEL_FAM6_MODEL(ARROWLAKE, HWP_SET_EPP_VALUES(HWP_EPP_POWERSAVE, ++ 179, 64, 16)), + {} + }; + diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c index 70fb003a6666..0712d0b15170 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo.c @@ -20106,152 +20170,62 @@ index 5a887d67dc0e..2e535caa7d6e 100644 if ((ret = dma_fence_get_status(&fence->base)) == 1) ret = 0; } -diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c -index b4c9a6aa118c..6853f043c2c1 100644 ---- a/fs/btrfs/extent_map.c -+++ b/fs/btrfs/extent_map.c -@@ -1065,8 +1065,7 @@ static long btrfs_scan_inode(struct btrfs_inode *inode, struct btrfs_em_shrink_c - return 0; - - /* -- * We want to be fast because we can be called from any path trying to -- * allocate memory, so if the lock is busy we don't want to spend time -+ * We want to be fast so if the lock is busy we don't want to spend time - * waiting for it - either some task is about to do IO for the inode or - * we may have another task shrinking extent maps, here in this code, so - * skip this inode. -@@ -1109,9 +1108,7 @@ static long btrfs_scan_inode(struct btrfs_inode *inode, struct btrfs_em_shrink_c - /* - * Stop if we need to reschedule or there's contention on the - * lock. This is to avoid slowing other tasks trying to take the -- * lock and because the shrinker might be called during a memory -- * allocation path and we want to avoid taking a very long time -- * and slowing down all sorts of tasks. -+ * lock. - */ - if (need_resched() || rwlock_needbreak(&tree->lock)) - break; -@@ -1139,12 +1136,7 @@ static long btrfs_scan_root(struct btrfs_root *root, struct btrfs_em_shrink_ctx - if (ctx->scanned >= ctx->nr_to_scan) - break; - -- /* -- * We may be called from memory allocation paths, so we don't -- * want to take too much time and slowdown tasks. -- */ -- if (need_resched()) -- break; -+ cond_resched(); - - inode = btrfs_find_first_inode(root, min_ino); - } -@@ -1202,14 +1194,12 @@ long btrfs_free_extent_maps(struct btrfs_fs_info *fs_info, long nr_to_scan) - ctx.last_ino); - } - -- /* -- * We may be called from memory allocation paths, so we don't want to -- * take too much time and slowdown tasks, so stop if we need reschedule. -- */ -- while (ctx.scanned < ctx.nr_to_scan && !need_resched()) { -+ while (ctx.scanned < ctx.nr_to_scan) { - struct btrfs_root *root; - unsigned long count; - -+ cond_resched(); -+ - spin_lock(&fs_info->fs_roots_radix_lock); - count = radix_tree_gang_lookup(&fs_info->fs_roots_radix, - (void **)&root, -diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c -index f05cce7c8b8d..11faf5e983ea 100644 ---- a/fs/btrfs/super.c -+++ b/fs/btrfs/super.c -@@ -28,6 +28,7 @@ - #include - #include - #include -+#include - #include "messages.h" - #include "delayed-inode.h" - #include "ctree.h" -@@ -2394,6 +2395,15 @@ static long btrfs_free_cached_objects(struct super_block *sb, struct shrink_cont - const long nr_to_scan = min_t(unsigned long, LONG_MAX, sc->nr_to_scan); - struct btrfs_fs_info *fs_info = btrfs_sb(sb); - -+ /* -+ * We may be called from any task trying to allocate memory and we don't -+ * want to slow it down with scanning and dropping extent maps. It would -+ * also cause heavy lock contention if many tasks concurrently enter -+ * here. Therefore only allow kswapd tasks to scan and drop extent maps. -+ */ -+ if (!current_is_kswapd()) -+ return 0; -+ - return btrfs_free_extent_maps(fs_info, nr_to_scan); - } +diff --git a/drivers/powercap/intel_rapl_common.c b/drivers/powercap/intel_rapl_common.c +index aac0744011a3..d51d4ec8d707 100644 +--- a/drivers/powercap/intel_rapl_common.c ++++ b/drivers/powercap/intel_rapl_common.c +@@ -1285,6 +1285,7 @@ static const struct x86_cpu_id rapl_ids[] __initconst = { + X86_MATCH_VENDOR_FAM(AMD, 0x17, &rapl_defaults_amd), + X86_MATCH_VENDOR_FAM(AMD, 0x19, &rapl_defaults_amd), ++ X86_MATCH_VENDOR_FAM(AMD, 0x1A, &rapl_defaults_amd), + X86_MATCH_VENDOR_FAM(HYGON, 0x18, &rapl_defaults_amd), + {} + }; -- 2.46.0 -From 6b5c02d298d86e3d59dbc0b01df47ffcfa74f79f Mon Sep 17 00:00:00 2001 +From c02a018fbeeacd6d7199ab2d484a9af674c7de20 Mon Sep 17 00:00:00 2001 From: Peter Jung -Date: Wed, 14 Aug 2024 16:19:34 +0200 +Date: Thu, 29 Aug 2024 18:12:10 +0200 Subject: [PATCH 07/12] intel-pstate Signed-off-by: Peter Jung --- - arch/x86/include/asm/topology.h | 19 ++- - arch/x86/kernel/cpu/aperfmperf.c | 87 +++++++++++- - arch/x86/kernel/itmt.c | 12 +- - arch/x86/kernel/smpboot.c | 10 +- - drivers/cpufreq/intel_pstate.c | 220 ++++++++++++++++++++++++++++++- - 5 files changed, 332 insertions(+), 16 deletions(-) + arch/x86/include/asm/topology.h | 13 ++ + arch/x86/kernel/cpu/aperfmperf.c | 89 +++++++++++- + drivers/cpufreq/intel_pstate.c | 232 ++++++++++++++++++++++++++++++- + 3 files changed, 328 insertions(+), 6 deletions(-) diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h -index abe3a8f22cbd..e5b203fe7956 100644 +index abe3a8f22cbd..aef70336d624 100644 --- a/arch/x86/include/asm/topology.h +++ b/arch/x86/include/asm/topology.h -@@ -235,8 +235,6 @@ struct pci_bus; - int x86_pci_root_bus_node(int bus); - void x86_pci_root_bus_resources(int bus, struct list_head *resources); - --extern bool x86_topology_update; -- - #ifdef CONFIG_SCHED_MC_PRIO - #include - -@@ -282,11 +280,28 @@ static inline long arch_scale_freq_capacity(int cpu) +@@ -282,9 +282,22 @@ static inline long arch_scale_freq_capacity(int cpu) } #define arch_scale_freq_capacity arch_scale_freq_capacity +bool arch_enable_hybrid_capacity_scale(void); -+void arch_set_cpu_capacity(int cpu, unsigned long cap, unsigned long base_cap, -+ unsigned long max_freq, unsigned long base_freq); ++void arch_set_cpu_capacity(int cpu, unsigned long cap, unsigned long max_cap, ++ unsigned long cap_freq, unsigned long base_freq); + +unsigned long arch_scale_cpu_capacity(int cpu); +#define arch_scale_cpu_capacity arch_scale_cpu_capacity + extern void arch_set_max_freq_ratio(bool turbo_disabled); extern void freq_invariance_set_perf_ratio(u64 ratio, bool turbo_disabled); -+ -+void arch_rebuild_sched_domains(void); #else +static inline bool arch_enable_hybrid_capacity_scale(void) { return false; } +static inline void arch_set_cpu_capacity(int cpu, unsigned long cap, -+ unsigned long base_cap, -+ unsigned long max_freq, ++ unsigned long max_cap, ++ unsigned long cap_freq, + unsigned long base_freq) { } + static inline void arch_set_max_freq_ratio(bool turbo_disabled) { } static inline void freq_invariance_set_perf_ratio(u64 ratio, bool turbo_disabled) { } -+ -+static inline void arch_rebuild_sched_domains(void) { } #endif - - extern void arch_scale_freq_tick(void); diff --git a/arch/x86/kernel/cpu/aperfmperf.c b/arch/x86/kernel/cpu/aperfmperf.c -index b3fa61d45352..6ff86c02fe63 100644 +index b3fa61d45352..f85d3f4233d4 100644 --- a/arch/x86/kernel/cpu/aperfmperf.c +++ b/arch/x86/kernel/cpu/aperfmperf.c @@ -347,9 +347,89 @@ static DECLARE_WORK(disable_freq_invariance_work, @@ -20283,6 +20257,7 @@ index b3fa61d45352..6ff86c02fe63 100644 + WARN_ONCE(1, "Hybrid CPU capacity scaling already enabled"); + return true; + } ++ + arch_cpu_scale = alloc_percpu(struct arch_hybrid_cpu_scale); + if (!arch_cpu_scale) + return false; @@ -20302,27 +20277,27 @@ index b3fa61d45352..6ff86c02fe63 100644 +/** + * arch_set_cpu_capacity - Set scale-invariance parameters for a CPU + * @cpu: Target CPU. -+ * @cap: Capacity of @cpu, relative to @base_cap, at its maximum frequency. -+ * @base_cap: System-wide maximum CPU capacity. -+ * @max_freq: Frequency of @cpu corresponding to @cap. ++ * @cap: Capacity of @cpu at its maximum frequency, relative to @max_cap. ++ * @max_cap: System-wide maximum CPU capacity. ++ * @cap_freq: Frequency of @cpu corresponding to @cap. + * @base_freq: Frequency of @cpu at which MPERF counts. + * -+ * The units in which @cap and @base_cap are expressed do not matter, so long ++ * The units in which @cap and @max_cap are expressed do not matter, so long + * as they are consistent, because the former is effectively divided by the -+ * latter. Analogously for @max_freq and @base_freq. ++ * latter. Analogously for @cap_freq and @base_freq. + * + * After calling this function for all CPUs, call arch_rebuild_sched_domains() + * to let the scheduler know that capacity-aware scheduling can be used going + * forward. + */ -+void arch_set_cpu_capacity(int cpu, unsigned long cap, unsigned long base_cap, -+ unsigned long max_freq, unsigned long base_freq) ++void arch_set_cpu_capacity(int cpu, unsigned long cap, unsigned long max_cap, ++ unsigned long cap_freq, unsigned long base_freq) +{ + if (static_branch_likely(&arch_hybrid_cap_scale_key)) { + WRITE_ONCE(per_cpu_ptr(arch_cpu_scale, cpu)->capacity, -+ div_u64(cap << SCHED_CAPACITY_SHIFT, base_cap)); ++ div_u64(cap << SCHED_CAPACITY_SHIFT, max_cap)); + WRITE_ONCE(per_cpu_ptr(arch_cpu_scale, cpu)->freq_ratio, -+ div_u64(max_freq << SCHED_CAPACITY_SHIFT, base_freq)); ++ div_u64(cap_freq << SCHED_CAPACITY_SHIFT, base_freq)); + } else { + WARN_ONCE(1, "Hybrid CPU capacity scaling not enabled"); + } @@ -20339,8 +20314,8 @@ index b3fa61d45352..6ff86c02fe63 100644 + static void scale_freq_tick(u64 acnt, u64 mcnt) { - u64 freq_scale; -+ u64 freq_ratio; +- u64 freq_scale; ++ u64 freq_scale, freq_ratio; if (!arch_scale_freq_invariant()) return; @@ -20358,80 +20333,8 @@ index b3fa61d45352..6ff86c02fe63 100644 goto error; freq_scale = div64_u64(acnt, mcnt); -diff --git a/arch/x86/kernel/itmt.c b/arch/x86/kernel/itmt.c -index 9a7c03d47861..af2f60c094a8 100644 ---- a/arch/x86/kernel/itmt.c -+++ b/arch/x86/kernel/itmt.c -@@ -54,10 +54,8 @@ static int sched_itmt_update_handler(struct ctl_table *table, int write, - old_sysctl = sysctl_sched_itmt_enabled; - ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos); - -- if (!ret && write && old_sysctl != sysctl_sched_itmt_enabled) { -- x86_topology_update = true; -- rebuild_sched_domains(); -- } -+ if (!ret && write && old_sysctl != sysctl_sched_itmt_enabled) -+ arch_rebuild_sched_domains(); - - mutex_unlock(&itmt_update_mutex); - -@@ -114,8 +112,7 @@ int sched_set_itmt_support(void) - - sysctl_sched_itmt_enabled = 1; - -- x86_topology_update = true; -- rebuild_sched_domains(); -+ arch_rebuild_sched_domains(); - - mutex_unlock(&itmt_update_mutex); - -@@ -150,8 +147,7 @@ void sched_clear_itmt_support(void) - if (sysctl_sched_itmt_enabled) { - /* disable sched_itmt if we are no longer ITMT capable */ - sysctl_sched_itmt_enabled = 0; -- x86_topology_update = true; -- rebuild_sched_domains(); -+ arch_rebuild_sched_domains(); - } - - mutex_unlock(&itmt_update_mutex); -diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c -index 0c35207320cb..90a6fb54a128 100644 ---- a/arch/x86/kernel/smpboot.c -+++ b/arch/x86/kernel/smpboot.c -@@ -39,6 +39,7 @@ - - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -+#include - #include - #include - #include -@@ -125,7 +126,7 @@ static DEFINE_PER_CPU_ALIGNED(struct mwait_cpu_dead, mwait_cpu_dead); - int __read_mostly __max_smt_threads = 1; - - /* Flag to indicate if a complete sched domain rebuild is required */ --bool x86_topology_update; -+static bool x86_topology_update; - - int arch_update_cpu_topology(void) - { -@@ -135,6 +136,13 @@ int arch_update_cpu_topology(void) - return retval; - } - -+#ifdef CONFIG_X86_64 -+void arch_rebuild_sched_domains(void) { -+ x86_topology_update = true; -+ rebuild_sched_domains(); -+} -+#endif -+ - static unsigned int smpboot_warm_reset_vector_count; - - static inline void smpboot_setup_warm_reset_vector(unsigned long start_eip) diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c -index 1035c074f36a..2ab495e1ba36 100644 +index cc54238596ed..4e59a5446861 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -16,6 +16,7 @@ @@ -20466,7 +20369,7 @@ index 1035c074f36a..2ab495e1ba36 100644 static struct cpufreq_driver *intel_pstate_driver __read_mostly; -@@ -933,6 +937,111 @@ static struct freq_attr *hwp_cpufreq_attrs[] = { +@@ -933,6 +937,135 @@ static struct freq_attr *hwp_cpufreq_attrs[] = { NULL, }; @@ -20568,17 +20471,41 @@ index 1035c074f36a..2ab495e1ba36 100644 + +static void hybrid_init_cpu_scaling(void) +{ ++ bool disable_itmt = false; ++ + mutex_lock(&hybrid_capacity_lock); + -+ __hybrid_init_cpu_scaling(); ++ /* ++ * If hybrid_max_perf_cpu is set at this point, the hybrid CPU capacity ++ * scaling has been enabled already and the driver is just changing the ++ * operation mode. ++ */ ++ if (hybrid_max_perf_cpu) { ++ __hybrid_init_cpu_scaling(); ++ goto unlock; ++ } + ++ /* ++ * On hybrid systems, use asym capacity instead of ITMT, but because ++ * the capacity of SMT threads is not deterministic even approximately, ++ * do not do that when SMT is in use. ++ */ ++ if (hwp_is_hybrid && !sched_smt_active() && arch_enable_hybrid_capacity_scale()) { ++ __hybrid_init_cpu_scaling(); ++ disable_itmt = true; ++ } ++ ++unlock: + mutex_unlock(&hybrid_capacity_lock); ++ ++ if (disable_itmt) ++ sched_clear_itmt_support(); +} + static void __intel_pstate_get_hwp_cap(struct cpudata *cpu) { u64 cap; -@@ -961,6 +1070,43 @@ static void intel_pstate_get_hwp_cap(struct cpudata *cpu) +@@ -961,6 +1094,43 @@ static void intel_pstate_get_hwp_cap(struct cpudata *cpu) } } @@ -20622,7 +20549,7 @@ index 1035c074f36a..2ab495e1ba36 100644 static void intel_pstate_hwp_set(unsigned int cpu) { struct cpudata *cpu_data = all_cpu_data[cpu]; -@@ -1069,6 +1215,22 @@ static void intel_pstate_hwp_offline(struct cpudata *cpu) +@@ -1069,6 +1239,22 @@ static void intel_pstate_hwp_offline(struct cpudata *cpu) value |= HWP_ENERGY_PERF_PREFERENCE(HWP_EPP_POWERSAVE); wrmsrl_on_cpu(cpu->cpu, MSR_HWP_REQUEST, value); @@ -20645,7 +20572,7 @@ index 1035c074f36a..2ab495e1ba36 100644 } #define POWER_CTL_EE_ENABLE 1 -@@ -1164,21 +1326,46 @@ static void __intel_pstate_update_max_freq(struct cpudata *cpudata, +@@ -1164,21 +1350,46 @@ static void __intel_pstate_update_max_freq(struct cpudata *cpudata, static void intel_pstate_update_limits(unsigned int cpu) { struct cpufreq_policy *policy = cpufreq_cpu_acquire(cpu); @@ -20695,7 +20622,7 @@ index 1035c074f36a..2ab495e1ba36 100644 } /************************** sysfs begin ************************/ -@@ -1617,6 +1804,13 @@ static void intel_pstate_notify_work(struct work_struct *work) +@@ -1617,6 +1828,13 @@ static void intel_pstate_notify_work(struct work_struct *work) __intel_pstate_update_max_freq(cpudata, policy); cpufreq_cpu_release(policy); @@ -20709,7 +20636,7 @@ index 1035c074f36a..2ab495e1ba36 100644 } wrmsrl_on_cpu(cpudata->cpu, MSR_HWP_STATUS, 0); -@@ -2018,8 +2212,10 @@ static void intel_pstate_get_cpu_pstates(struct cpudata *cpu) +@@ -2018,8 +2236,10 @@ static void intel_pstate_get_cpu_pstates(struct cpudata *cpu) if (pstate_funcs.get_cpu_scaling) { cpu->pstate.scaling = pstate_funcs.get_cpu_scaling(cpu->cpu); @@ -20721,7 +20648,7 @@ index 1035c074f36a..2ab495e1ba36 100644 } else { cpu->pstate.scaling = perf_ctl_scaling; } -@@ -2687,6 +2883,8 @@ static int intel_pstate_cpu_online(struct cpufreq_policy *policy) +@@ -2687,6 +2907,8 @@ static int intel_pstate_cpu_online(struct cpufreq_policy *policy) */ intel_pstate_hwp_reenable(cpu); cpu->suspended = false; @@ -20730,23 +20657,11 @@ index 1035c074f36a..2ab495e1ba36 100644 } return 0; -@@ -3129,6 +3327,20 @@ static int intel_pstate_register_driver(struct cpufreq_driver *driver) +@@ -3129,6 +3351,8 @@ static int intel_pstate_register_driver(struct cpufreq_driver *driver) global.min_perf_pct = min_perf_pct_min(); -+ /* -+ * On hybrid systems, use asym capacity instead of ITMT, but because -+ * the capacity of SMT threads is not deterministic even approximately, -+ * do not do that when SMT is in use. -+ */ -+ if (hwp_is_hybrid && !sched_smt_active() && -+ arch_enable_hybrid_capacity_scale()) { -+ sched_clear_itmt_support(); -+ -+ hybrid_init_cpu_scaling(); -+ -+ arch_rebuild_sched_domains(); -+ } ++ hybrid_init_cpu_scaling(); + return 0; } @@ -20754,9 +20669,9 @@ index 1035c074f36a..2ab495e1ba36 100644 -- 2.46.0 -From b5c1d03092fedd1e5446aec3b8d16029834ef4b7 Mon Sep 17 00:00:00 2001 +From 82240c1cd09e0c3ebe16adb670cb42ca3989707d Mon Sep 17 00:00:00 2001 From: Peter Jung -Date: Wed, 14 Aug 2024 16:19:43 +0200 +Date: Thu, 29 Aug 2024 18:12:19 +0200 Subject: [PATCH 08/12] ksm Signed-off-by: Peter Jung @@ -21194,9 +21109,9 @@ index b696b85ac63e..cf7f3d841b1e 100644 -- 2.46.0 -From f32682f3e50005e5e88aabb18aefac39fd4497a0 Mon Sep 17 00:00:00 2001 +From b975a412d17b3a64c0ba792fd0bbfbba005e22ec Mon Sep 17 00:00:00 2001 From: Peter Jung -Date: Wed, 14 Aug 2024 16:19:55 +0200 +Date: Thu, 29 Aug 2024 18:12:29 +0200 Subject: [PATCH 09/12] ntsync Signed-off-by: Peter Jung @@ -24283,9 +24198,9 @@ index 000000000000..5fa2c9a0768c -- 2.46.0 -From 2aee49acbdd1e24099f9458a8eaed2ffe8afc683 Mon Sep 17 00:00:00 2001 +From d8988d80159dcf97dce7ba4653dda9096fe4368f Mon Sep 17 00:00:00 2001 From: Peter Jung -Date: Wed, 14 Aug 2024 16:20:05 +0200 +Date: Thu, 29 Aug 2024 18:12:40 +0200 Subject: [PATCH 10/12] perf-per-core Signed-off-by: Peter Jung @@ -25153,7 +25068,7 @@ index cb4f6c513c48..1ffe4260bef6 100644 // AMD Node ID and Nodes per Package info u32 amd_node_id; diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h -index e5b203fe7956..8c2fea7dd065 100644 +index aef70336d624..672fccf9f845 100644 --- a/arch/x86/include/asm/topology.h +++ b/arch/x86/include/asm/topology.h @@ -137,6 +137,7 @@ extern const struct cpumask *cpu_clustergroup_mask(int cpu); @@ -25191,9 +25106,9 @@ index 9a6069e7133c..23722aa21e2f 100644 -- 2.46.0 -From f5b9118439a16a5cd3ce3f611ae27dd41f73b146 Mon Sep 17 00:00:00 2001 +From d6cc714fac7770513508d906ab52439fc377aa7a Mon Sep 17 00:00:00 2001 From: Peter Jung -Date: Wed, 14 Aug 2024 16:20:14 +0200 +Date: Thu, 29 Aug 2024 18:12:54 +0200 Subject: [PATCH 11/12] t2 Signed-off-by: Peter Jung @@ -25393,10 +25308,10 @@ index 4112729fc23a..064156d69e75 100644 M: Jiri Kosina M: Benjamin Tissoires diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c -index 2cc3821b2b16..c11cbe5b6eaa 100644 +index ff6f260433a1..674b9db7a1ef 100644 --- a/drivers/acpi/video_detect.c +++ b/drivers/acpi/video_detect.c -@@ -539,6 +539,14 @@ static const struct dmi_system_id video_detect_dmi_table[] = { +@@ -541,6 +541,14 @@ static const struct dmi_system_id video_detect_dmi_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "iMac12,2"), }, }, @@ -25411,7 +25326,7 @@ index 2cc3821b2b16..c11cbe5b6eaa 100644 { /* https://bugzilla.redhat.com/show_bug.cgi?id=1217249 */ .callback = video_detect_force_native, -@@ -548,6 +556,14 @@ static const struct dmi_system_id video_detect_dmi_table[] = { +@@ -550,6 +558,14 @@ static const struct dmi_system_id video_detect_dmi_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro12,1"), }, }, @@ -36050,9 +35965,9 @@ index 2b812210b412..4c3a8cc6ef15 100755 -- 2.46.0 -From 22944ae0c983c003b10a918fef8a578e6d7689db Mon Sep 17 00:00:00 2001 +From 9afecb85f641ac23f4433d7be212e179699324aa Mon Sep 17 00:00:00 2001 From: Peter Jung -Date: Wed, 14 Aug 2024 16:20:35 +0200 +Date: Thu, 29 Aug 2024 18:13:03 +0200 Subject: [PATCH 12/12] zstd Signed-off-by: Peter Jung