release 6.12.4 (preliminary)
This commit is contained in:
@@ -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 },
|
||||
|
@@ -39,7 +39,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
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 <ben@decadent.org.uk>
|
||||
|
||||
--- 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 <okir@monad.swb.de>");
|
||||
MODULE_DESCRIPTION("In-kernel NFS server");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
@@ -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
|
||||
|
||||
|
@@ -7,7 +7,7 @@ Signed-off-by: Ben Hutchings <benh@debian.org>
|
||||
---
|
||||
--- 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)
|
||||
|
@@ -16,7 +16,7 @@ Signed-off-by: Ben Hutchings <benh@debian.org>
|
||||
---
|
||||
--- 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= \
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -10,12 +10,12 @@ Signed-off-by: Ben Hutchings <benh@debian.org>
|
||||
---
|
||||
--- 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
|
||||
|
@@ -6,7 +6,7 @@ Signed-off-by: Ben Hutchings <benh@debian.org>
|
||||
---
|
||||
--- 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
|
||||
|
@@ -16,7 +16,7 @@ Acked-by: Ian Rogers <irogers@google.com>
|
||||
|
||||
--- 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)
|
||||
|
@@ -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
|
||||
|
@@ -21,7 +21,7 @@ Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
|
||||
|
||||
--- a/kernel/fork.c
|
||||
+++ b/kernel/fork.c
|
||||
@@ -119,6 +119,12 @@
|
||||
@@ -120,6 +120,12 @@
|
||||
|
||||
#include <kunit/visibility.h>
|
||||
|
||||
@@ -34,7 +34,7 @@ Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
|
||||
/*
|
||||
* 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 <serge.hallyn@ubuntu.com>
|
||||
/*
|
||||
* 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;
|
||||
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -25,5 +25,5 @@ actually used.
|
||||
+#endif
|
||||
+
|
||||
f = fdget(fanotify_fd);
|
||||
if (unlikely(!f.file))
|
||||
if (unlikely(!fd_file(f)))
|
||||
return -EBADF;
|
||||
|
@@ -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
|
||||
|
||||
|
6
debian/patches/debian/gitignore.patch
vendored
6
debian/patches/debian/gitignore.patch
vendored
@@ -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
|
||||
|
@@ -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))
|
||||
|
@@ -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))"
|
||||
|
@@ -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:
|
||||
|
@@ -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:
|
||||
|
@@ -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'
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -35,7 +35,7 @@ Signed-off-by: Salvatore Bonaccorso <carnil@debian.org>
|
||||
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 <carnil@debian.org>
|
||||
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
|
||||
|
@@ -22,7 +22,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
|
||||
--- 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 <ben@decadent.org.uk>
|
||||
|
||||
--- 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 <ben@decadent.org.uk>
|
||||
|
||||
/* 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;
|
||||
|
||||
|
@@ -15,7 +15,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
--- 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 <ben@decadent.org.uk>
|
||||
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 <ben@decadent.org.uk>
|
||||
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;
|
||||
|
@@ -22,7 +22,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
|
||||
--- 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 <ben@decadent.org.uk>
|
||||
#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 <ben@decadent.org.uk>
|
||||
|
||||
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 <ben@decadent.org.uk>
|
||||
} 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 <ben@decadent.org.uk>
|
||||
}
|
||||
|
||||
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 <ben@decadent.org.uk>
|
||||
+
|
||||
check_tylersburg_isoch();
|
||||
|
||||
ret = si_domain_init(hw_pass_through);
|
||||
/*
|
||||
|
@@ -29,7 +29,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
|
||||
--- 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 <ben@decadent.org.uk>
|
||||
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
|
||||
|
||||
|
@@ -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:
|
||||
|
@@ -1,144 +0,0 @@
|
||||
this reverts following commit:
|
||||
|
||||
From: Dhananjay Ugwekar <Dhananjay.Ugwekar@amd.com>
|
||||
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 <Dhananjay.Ugwekar@amd.com>
|
||||
Signed-off-by: Ingo Molnar <mingo@kernel.org>
|
||||
Reviewed-by: Kan Liang <kan.liang@linux.intel.com>
|
||||
Link: https://lore.kernel.org/r/20240904100934.3260-1-Dhananjay.Ugwekar@amd.com
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
--- 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)
|
@@ -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 <ncardwell@google.com>
|
||||
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 <kernel@xanmod.org>
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@@ -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 <ncardwell@google.com>
|
||||
Date: Sun, 24 Jun 2018 21:55:59 -0400
|
||||
Subject: [PATCH 02/19] net-tcp_bbr: v2: shrink delivered_mstamp,
|
||||
|
@@ -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 <ncardwell@google.com>
|
||||
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 <kernel@xanmod.org>
|
||||
} 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 <kernel@xanmod.org>
|
||||
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 */
|
||||
|
@@ -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 <ncardwell@google.com>
|
||||
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 <kernel@xanmod.org>
|
||||
} 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 */
|
||||
|
@@ -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 <ncardwell@google.com>
|
||||
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 <kernel@xanmod.org>
|
||||
|
||||
--- 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? */
|
||||
|
@@ -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 <ncardwell@google.com>
|
||||
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 <kernel@xanmod.org>
|
||||
|
||||
--- 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);
|
||||
|
||||
|
@@ -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 <ncardwell@google.com>
|
||||
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
|
||||
|
@@ -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 <ncardwell@google.com>
|
||||
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 <kernel@xanmod.org>
|
||||
|
||||
--- 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));
|
||||
}
|
||||
|
||||
|
@@ -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 <ysseung@google.com>
|
||||
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 <kernel@xanmod.org>
|
||||
|
||||
--- 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 <kernel@xanmod.org>
|
||||
|
||||
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
|
||||
|
||||
|
@@ -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 <ncardwell@google.com>
|
||||
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 <kernel@xanmod.org>
|
||||
|
||||
--- 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);
|
||||
|
||||
|
@@ -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 <ncardwell@google.com>
|
||||
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 <kernel@xanmod.org>
|
||||
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 <kernel@xanmod.org>
|
||||
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 &&
|
||||
|
@@ -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 <jfwang@google.com>
|
||||
Date: Fri, 19 Jun 2020 17:33:45 +0000
|
||||
Subject: [PATCH 12/19] net-tcp_bbr: v2: record app-limited status of
|
||||
|
@@ -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 <jfwang@google.com>
|
||||
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 <kernel@xanmod.org>
|
||||
|
||||
--- 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 */
|
||||
|
@@ -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 <ncardwell@google.com>
|
||||
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 <kernel@xanmod.org>
|
||||
|
||||
--- 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? */
|
||||
|
@@ -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 <morleyd@google.com>
|
||||
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 <kernel@xanmod.org>
|
||||
__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;
|
||||
|
||||
|
@@ -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 <ncardwell@google.com>
|
||||
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 <kernel@xanmod.org>
|
||||
#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 <kernel@xanmod.org>
|
||||
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
|
||||
|
||||
|
@@ -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 <abrahamphilip@google.com>
|
||||
Date: Fri, 11 Jun 2021 21:56:10 +0000
|
||||
Subject: [PATCH 17/19] net-tcp_bbr: v3: ensure ECN-enabled BBR flows set ECT
|
||||
|
@@ -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 <ncardwell@google.com>
|
||||
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 <kernel@xanmod.org>
|
||||
* 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;
|
||||
|
@@ -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 <kernel@xanmod.org>
|
||||
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 <kernel@xanmod.org>
|
||||
|
||||
--- 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 <kernel@xanmod.org>
|
||||
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,
|
||||
|
@@ -135,7 +135,7 @@ Signed-off-by: Elizabeth Figura <zfigura@codeweavers.com>
|
||||
|
||||
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 <zfigura@codeweavers.com>
|
||||
|
||||
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 <zfigura@codeweavers.com>
|
||||
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);
|
||||
|
@@ -322,7 +322,7 @@ Signed-off-by: Elizabeth Figura <zfigura@codeweavers.com>
|
||||
|
||||
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 <zfigura@codeweavers.com>
|
||||
|
||||
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 <zfigura@codeweavers.com>
|
||||
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 <zfigura@codeweavers.com>
|
||||
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 <zfigura@codeweavers.com>
|
||||
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 <zfigura@codeweavers.com>
|
||||
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 <zfigura@codeweavers.com>
|
||||
}
|
||||
|
||||
/* 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 <zfigura@codeweavers.com>
|
||||
}
|
||||
|
||||
/* 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 <zfigura@codeweavers.com>
|
||||
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 <zfigura@codeweavers.com>
|
||||
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);
|
||||
|
@@ -121,7 +121,7 @@ Signed-off-by: Elizabeth Figura <zfigura@codeweavers.com>
|
||||
/*
|
||||
* 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 <zfigura@codeweavers.com>
|
||||
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 <zfigura@codeweavers.com>
|
||||
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 <zfigura@codeweavers.com>
|
||||
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 <zfigura@codeweavers.com>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
@@ -119,7 +119,7 @@ Signed-off-by: Elizabeth Figura <zfigura@codeweavers.com>
|
||||
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 <zfigura@codeweavers.com>
|
||||
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 <zfigura@codeweavers.com>
|
||||
|
||||
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 */
|
||||
|
@@ -91,7 +91,7 @@ Signed-off-by: Elizabeth Figura <zfigura@codeweavers.com>
|
||||
/*
|
||||
* 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 <zfigura@codeweavers.com>
|
||||
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 <zfigura@codeweavers.com>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
@@ -21,7 +21,7 @@ Signed-off-by: Elizabeth Figura <zfigura@codeweavers.com>
|
||||
|
||||
--- 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 <zfigura@codeweavers.com>
|
||||
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 <zfigura@codeweavers.com>
|
||||
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 <zfigura@codeweavers.com>
|
||||
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 <zfigura@codeweavers.com>
|
||||
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 <zfigura@codeweavers.com>
|
||||
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 <zfigura@codeweavers.com>
|
||||
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 <zfigura@codeweavers.com>
|
||||
|
||||
/* 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 <zfigura@codeweavers.com>
|
||||
/* 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);
|
||||
|
||||
|
@@ -12,7 +12,7 @@ Signed-off-by: Elizabeth Figura <zfigura@codeweavers.com>
|
||||
|
||||
--- 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/
|
||||
|
||||
|
@@ -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"
|
||||
|
@@ -1,24 +0,0 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
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 <nbd@nbd.name>
|
||||
---
|
||||
|
||||
--- 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 | \
|
@@ -1,129 +0,0 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
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 <nbd@nbd.name>
|
||||
---
|
||||
|
||||
--- 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;
|
@@ -1,14 +1,14 @@
|
||||
From a657df31affbb91d8cb2718e70f42cf8ed6e9a7c Mon Sep 17 00:00:00 2001
|
||||
From 421120bda34d994c5e0e07a89e2f9c40c53e8e87 Mon Sep 17 00:00:00 2001
|
||||
From: graysky <therealgraysky AT proton DOT me>
|
||||
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
|
||||
|
@@ -1,60 +0,0 @@
|
||||
From 44295ad130b8735cecb288dd7463a14892803d9b Mon Sep 17 00:00:00 2001
|
||||
From: "Jan Alexander Steffens (heftig)" <heftig@archlinux.org>
|
||||
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
|
@@ -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)" <heftig@archlinux.org>
|
||||
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.
|
||||
|
13
debian/patches/mixed-arch/0003-krd-adjust-CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3.patch
vendored
Normal file
13
debian/patches/mixed-arch/0003-krd-adjust-CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3.patch
vendored
Normal file
@@ -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)
|
@@ -11,7 +11,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
|
||||
|
||||
--- 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
|
||||
#
|
@@ -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
|
@@ -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
|
||||
#
|
@@ -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 <kernel@xanmod.org>
|
||||
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 <kernel@xanmod.org>
|
||||
---
|
||||
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.
|
@@ -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 <perry.yuan@amd.com>
|
||||
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 <perry.yuan@amd.com>
|
||||
|
||||
--- 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 <perry.yuan@amd.com>
|
||||
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 <perry.yuan@amd.com>
|
||||
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,
|
||||
},
|
||||
|
@@ -1,88 +0,0 @@
|
||||
From 44f21855901b1fd618ac16b07dbd14e8fea4ee13 Mon Sep 17 00:00:00 2001
|
||||
From: Mario Limonciello <mario.limonciello@amd.com>
|
||||
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 <mario.limonciello@amd.com>
|
||||
---
|
||||
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 */
|
@@ -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 <mario.limonciello@amd.com>
|
||||
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 <mario.limonciello@amd.com>
|
||||
|
||||
--- 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;
|
||||
}
|
||||
|
@@ -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 <Dhananjay.Ugwekar@amd.com>
|
||||
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 <Dhananjay.Ugwekar@amd.com>
|
||||
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");
|
@@ -1,77 +0,0 @@
|
||||
From aabfc7370a7da9c52be97c79ba70a20201e6864a Mon Sep 17 00:00:00 2001
|
||||
From: Mario Limonciello <mario.limonciello@amd.com>
|
||||
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 <mario.limonciello@amd.com>
|
||||
---
|
||||
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);
|
@@ -1,60 +0,0 @@
|
||||
From 24e62fbc101d079d398ac6fc76f458676d3d9491 Mon Sep 17 00:00:00 2001
|
||||
From: Mario Limonciello <mario.limonciello@amd.com>
|
||||
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 <mario.limonciello@amd.com>
|
||||
---
|
||||
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
|
@@ -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 <mario.limonciello@amd.com>
|
||||
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 <mario.limonciello@amd.com>
|
||||
|
||||
--- 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;
|
@@ -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 <mario.limonciello@amd.com>
|
||||
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 <mario.limonciello@amd.com>
|
||||
|
||||
--- 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;
|
||||
|
@@ -1,67 +0,0 @@
|
||||
From 29c0347dd542e091e2f7e5980dd885f918f5f676 Mon Sep 17 00:00:00 2001
|
||||
From: Mario Limonciello <mario.limonciello@amd.com>
|
||||
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 <perry.yuan@amd.com>
|
||||
Reviewed-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
|
||||
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
|
||||
Reviewed-by: Gautham R. Shenoy <gautham.sheoy@amd.com>
|
||||
---
|
||||
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());
|
@@ -1,95 +0,0 @@
|
||||
From 072efeb45349edd8ba9def11b6a450eaf56690a8 Mon Sep 17 00:00:00 2001
|
||||
From: Mario Limonciello <mario.limonciello@amd.com>
|
||||
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 <gautham.shenoy@amd.com>
|
||||
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
|
||||
Reviewed-by: Gautham R. Shenoy <gautham.sheoy@amd.com>
|
||||
---
|
||||
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 */
|
||||
|
@@ -0,0 +1,54 @@
|
||||
From 2a012fdcef91db6e380000b8042f90544ea49fd7 Mon Sep 17 00:00:00 2001
|
||||
From: Dhananjay Ugwekar <Dhananjay.Ugwekar@amd.com>
|
||||
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 <Dhananjay.Ugwekar@amd.com>
|
||||
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
|
||||
Reviewed-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
|
||||
---
|
||||
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,
|
@@ -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 <Dhananjay.Ugwekar@amd.com>
|
||||
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 <Dhananjay.Ugwekar@amd.com>
|
||||
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
|
||||
---
|
||||
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;
|
@@ -1,162 +0,0 @@
|
||||
From 21492d91ffc7c3fdb6507f64a74abf8326c75141 Mon Sep 17 00:00:00 2001
|
||||
From: Mario Limonciello <mario.limonciello@amd.com>
|
||||
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 <gautham.shenoy@amd.com>
|
||||
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
|
||||
Reviewed-by: Gautham R. Shenoy <gautham.sheoy@amd.com>
|
||||
---
|
||||
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*/
|
@@ -1,35 +0,0 @@
|
||||
From 6f10d066dce0f1781b514a0352f0b427a32b1bb2 Mon Sep 17 00:00:00 2001
|
||||
From: Mario Limonciello <mario.limonciello@amd.com>
|
||||
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 <gautham.shenoy@amd.com>
|
||||
Reviewed-by: Gautham R. Shenoy <gautham.sheoy@amd.com>
|
||||
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
|
||||
Reviewed-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
|
||||
---
|
||||
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);
|
||||
}
|
@@ -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 <Dhananjay.Ugwekar@amd.com>
|
||||
Date: Thu, 17 Oct 2024 10:05:27 +0000
|
||||
Subject: cpufreq/amd-pstate: Call amd_pstate_register() in amd_pstate_init()
|
@@ -1,44 +0,0 @@
|
||||
From 8c142a91a58f24119e99d4e66b11890f4a4ef984 Mon Sep 17 00:00:00 2001
|
||||
From: Mario Limonciello <mario.limonciello@amd.com>
|
||||
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 <Perry.Yuan@amd.com>
|
||||
Reviewed-by: Perry Yuan <perry.yuan@amd.com>
|
||||
Reviewed-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
|
||||
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
|
||||
Reviewed-by: Gautham R. Shenoy <gautham.sheoy@amd.com>
|
||||
---
|
||||
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;
|
||||
}
|
||||
|
@@ -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 <Dhananjay.Ugwekar@amd.com>
|
||||
Date: Thu, 17 Oct 2024 10:05:29 +0000
|
||||
Subject: cpufreq/amd-pstate: Call amd_pstate_set_driver() in
|
@@ -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 <Dhananjay.Ugwekar@amd.com>
|
||||
Date: Thu, 17 Oct 2024 10:05:31 +0000
|
||||
Subject: cpufreq/amd-pstate: Remove the switch case in amd_pstate_init()
|
@@ -1,138 +0,0 @@
|
||||
From 952e7bdc4cf67603f230f8eb91818ad4676e5a83 Mon Sep 17 00:00:00 2001
|
||||
From: Mario Limonciello <mario.limonciello@amd.com>
|
||||
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 <perry.yuan@amd.com>
|
||||
Reviewed-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
|
||||
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
|
||||
Reviewed-by: Gautham R. Shenoy <gautham.sheoy@amd.com>
|
||||
---
|
||||
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;
|
@@ -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 <Dhananjay.Ugwekar@amd.com>
|
||||
Date: Thu, 17 Oct 2024 10:05:33 +0000
|
||||
Subject: cpufreq/amd-pstate: Remove the redundant amd_pstate_set_driver() call
|
@@ -1,251 +0,0 @@
|
||||
From 3ab7da5bbf2087982dbfe2b0f2937d0dddc3afb1 Mon Sep 17 00:00:00 2001
|
||||
From: Mario Limonciello <mario.limonciello@amd.com>
|
||||
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 <gautham.shenoy@amd.com>
|
||||
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
|
||||
---
|
||||
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 <asm/processor.h>
|
||||
#include <asm/topology.h>
|
||||
|
||||
+#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*/
|
@@ -1,169 +0,0 @@
|
||||
From 68d89574b86625f4bd7a784fe9bcc221dc290e4f Mon Sep 17 00:00:00 2001
|
||||
From: Mario Limonciello <mario.limonciello@amd.com>
|
||||
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 <gautham.shenoy@amd.com>
|
||||
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
|
||||
Reviewed-by: Gautham R. Shenoy <gautham.sheoy@amd.com>
|
||||
---
|
||||
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 <asm/processor.h>
|
||||
#include <asm/topology.h>
|
||||
|
||||
+#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);
|
@@ -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 <mario.limonciello@amd.com>
|
||||
Date: Thu, 17 Oct 2024 12:34:39 -0500
|
||||
Subject: cpufreq/amd-pstate-ut: Add fix for min freq unit test
|
@@ -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 <swapnil.sapkal@amd.com>
|
||||
Date: Mon, 21 Oct 2024 15:48:36 +0530
|
||||
Subject: amd-pstate: Switch to amd-pstate by default on some Server platforms
|
@@ -1,42 +0,0 @@
|
||||
From deed718125e73b6bf280dcebb80c39108226388c Mon Sep 17 00:00:00 2001
|
||||
From: Mario Limonciello <mario.limonciello@amd.com>
|
||||
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 <gautham.shenoy@amd.com>
|
||||
Reviewed-by: Perry Yuan <perry.yuan@amd.com>
|
||||
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
|
||||
Reviewed-by: Gautham R. Shenoy <gautham.sheoy@amd.com>
|
||||
---
|
||||
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)
|
@@ -1,29 +0,0 @@
|
||||
From 391075a34e392c7cacd338a6b034a21a10679855 Mon Sep 17 00:00:00 2001
|
||||
From: Mario Limonciello <mario.limonciello@amd.com>
|
||||
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 <gautham.shenoy@amd.com>
|
||||
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
|
||||
Reviewed-by: Gautham R. Shenoy <gautham.sheoy@amd.com>
|
||||
---
|
||||
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
|
||||
<perf_cap_>`_.)
|
||||
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
|
@@ -0,0 +1,121 @@
|
||||
From ca32f306d11e95ca133a2f90249bb4555c2742c3 Mon Sep 17 00:00:00 2001
|
||||
From: Dhananjay Ugwekar <Dhananjay.Ugwekar@amd.com>
|
||||
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 <Dhananjay.Ugwekar@amd.com>
|
||||
Reviewed-by: Perry Yuan <perry.yuan@amd.com>
|
||||
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
|
||||
---
|
||||
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);
|
@@ -1,42 +0,0 @@
|
||||
From 2ed9874f6dcafcc2bee7a922af9e1d1c62dbeb18 Mon Sep 17 00:00:00 2001
|
||||
From: Mario Limonciello <mario.limonciello@amd.com>
|
||||
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 <gautham.shenoy@amd.com>
|
||||
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
|
||||
Reviewed-by: Gautham R. Shenoy <gautham.sheoy@amd.com>
|
||||
---
|
||||
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
|
@@ -0,0 +1,30 @@
|
||||
From de31d4a11e894a73ed7ef2388fb27f0bb4036de3 Mon Sep 17 00:00:00 2001
|
||||
From: Dhananjay Ugwekar <Dhananjay.Ugwekar@amd.com>
|
||||
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 <Dhananjay.Ugwekar@amd.com>
|
||||
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
|
||||
---
|
||||
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;
|
||||
|
@@ -0,0 +1,39 @@
|
||||
From c5eadae39ccdf6bada95c834147e285e445b12ad Mon Sep 17 00:00:00 2001
|
||||
From: Dhananjay Ugwekar <Dhananjay.Ugwekar@amd.com>
|
||||
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 <Dhananjay.Ugwekar@amd.com>
|
||||
Reviewed-by: Perry Yuan <perry.yuan@amd.com>
|
||||
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
|
||||
---
|
||||
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);
|
||||
}
|
@@ -0,0 +1,25 @@
|
||||
From 275a7a8c95ac5d0c0ff586acd882d751478f6a00 Mon Sep 17 00:00:00 2001
|
||||
From: Dhananjay Ugwekar <Dhananjay.Ugwekar@amd.com>
|
||||
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 <Dhananjay.Ugwekar@amd.com>
|
||||
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
|
||||
---
|
||||
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);
|
@@ -1,24 +0,0 @@
|
||||
From 185e64a7e1a749593f3d6dadc666da9dda82d48c Mon Sep 17 00:00:00 2001
|
||||
From: Qianqiang Liu <qianqiang.liu@163.com>
|
||||
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 <qianqiang.liu@163.com>
|
||||
---
|
||||
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++) {
|
@@ -0,0 +1,60 @@
|
||||
From 173172a4604a050ccb5a6745acd9fa90d01257a7 Mon Sep 17 00:00:00 2001
|
||||
From: Mario Limonciello <mario.limonciello@amd.com>
|
||||
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 <mario.limonciello@amd.com>
|
||||
---
|
||||
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)
|
@@ -1,115 +0,0 @@
|
||||
From 787175146e26a199c06be4e6bf8cf8da0f757271 Mon Sep 17 00:00:00 2001
|
||||
From: Dhananjay Ugwekar <Dhananjay.Ugwekar@amd.com>
|
||||
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 <Dhananjay.Ugwekar@amd.com>
|
||||
Reviewed-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
|
||||
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
|
||||
---
|
||||
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 */
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user