From a9d9e16390f7af662ddcbfccf5c46df82c84d346 Mon Sep 17 00:00:00 2001 From: ferreo Date: Wed, 2 Oct 2024 18:20:45 +0200 Subject: [PATCH] Update patches/0001-cachyos-base-all.patch --- patches/0001-cachyos-base-all.patch | 2930 +++++++-------------------- 1 file changed, 782 insertions(+), 2148 deletions(-) diff --git a/patches/0001-cachyos-base-all.patch b/patches/0001-cachyos-base-all.patch index 96824b5..99482ae 100644 --- a/patches/0001-cachyos-base-all.patch +++ b/patches/0001-cachyos-base-all.patch @@ -1,726 +1,121 @@ -From b33a0dc63069a712b021e087147a5325228b44f6 Mon Sep 17 00:00:00 2001 -From: Eric Naim -Date: Thu, 19 Sep 2024 23:20:03 +0800 -Subject: [PATCH 01/11] amd-pstate +From 355418e0425514c300ff087ddf9e44c1621b9634 Mon Sep 17 00:00:00 2001 +From: Peter Jung +Date: Mon, 30 Sep 2024 16:51:21 +0200 +Subject: [PATCH 01/10] address-masking -Signed-off-by: Eric Naim +Signed-off-by: Peter Jung --- - Documentation/admin-guide/pm/amd-pstate.rst | 15 +- - arch/x86/include/asm/processor.h | 3 - - arch/x86/kernel/acpi/cppc.c | 172 ++++++++++++++++++-- - arch/x86/kernel/cpu/amd.c | 16 -- - drivers/acpi/cppc_acpi.c | 10 +- - drivers/cpufreq/acpi-cpufreq.c | 12 +- - drivers/cpufreq/amd-pstate.c | 133 ++++----------- - include/acpi/cppc_acpi.h | 41 +++-- - 8 files changed, 254 insertions(+), 148 deletions(-) + arch/x86/include/asm/uaccess_64.h | 11 +++++++++++ + fs/select.c | 4 +++- + include/linux/uaccess.h | 7 +++++++ + lib/strncpy_from_user.c | 9 +++++++++ + lib/strnlen_user.c | 9 +++++++++ + 5 files changed, 39 insertions(+), 1 deletion(-) -diff --git a/Documentation/admin-guide/pm/amd-pstate.rst b/Documentation/admin-guide/pm/amd-pstate.rst -index d0324d44f548..210a808b74ec 100644 ---- a/Documentation/admin-guide/pm/amd-pstate.rst -+++ b/Documentation/admin-guide/pm/amd-pstate.rst -@@ -251,7 +251,9 @@ performance supported in `AMD CPPC Performance Capability `_). - 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 and this will reflect the values -+advertised by the platform at bootup. - This attribute is read-only. +diff --git a/arch/x86/include/asm/uaccess_64.h b/arch/x86/include/asm/uaccess_64.h +index 04789f45ab2b2..afce8ee5d7b79 100644 +--- a/arch/x86/include/asm/uaccess_64.h ++++ b/arch/x86/include/asm/uaccess_64.h +@@ -53,6 +53,17 @@ static inline unsigned long __untagged_addr_remote(struct mm_struct *mm, + */ + #define valid_user_address(x) ((__force long)(x) >= 0) - ``amd_pstate_lowest_nonlinear_freq`` -@@ -262,6 +264,17 @@ lowest non-linear performance in `AMD CPPC Performance Capability - `_.) - 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. -+ -+``amd_pstate_prefcore_ranking`` -+ -+The performance ranking of the core. This number doesn't have any unit, but -+larger numbers are preferred at the time of reading. This can change at -+runtime based on platform conditions. This attribute is read-only. -+ - ``energy_performance_available_preferences`` - - A list of all the supported EPP preferences that could be used for -diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h -index a75a07f4931f..775acbdea1a9 100644 ---- 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(unsigned int cpu) - } - - #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_divider(void) - - 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 -diff --git a/arch/x86/kernel/acpi/cppc.c b/arch/x86/kernel/acpi/cppc.c -index ff8f25faca3d..956984054bf3 100644 ---- a/arch/x86/kernel/acpi/cppc.c -+++ b/arch/x86/kernel/acpi/cppc.c -@@ -9,6 +9,17 @@ - #include - #include - -+#define CPPC_HIGHEST_PERF_PERFORMANCE 196 -+#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) -@@ -69,31 +80,30 @@ int cpc_write_ffh(int cpunum, struct cpc_reg *reg, u64 val) - 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; - - 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; - } - -- highest_perf = amd_get_highest_perf(); -+ rc = amd_get_boost_ratio_numerator(0, &numerator); -+ if (rc) { -+ pr_warn("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_warn("Could not retrieve nominal performance\n"); - return; - } - -- perf_ratio = div_u64(highest_perf * 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); - } -@@ -116,3 +126,143 @@ void init_freq_invariance_cppc(void) - init_done = true; - 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. ++ * Masking the user address is an alternative to a conditional ++ * user_access_begin that can avoid the fencing. This only works ++ * for dense accesses starting at the address. + */ -+int amd_get_highest_perf(unsigned int cpu, u32 *highest_perf) -+{ -+ u64 val; -+ int ret; ++#define mask_user_address(x) ((typeof(x))((long)(x)|((long)(x)>>63))) ++#define masked_user_access_begin(x) ({ \ ++ __auto_type __masked_ptr = (x); \ ++ __masked_ptr = mask_user_address(__masked_ptr); \ ++ __uaccess_begin(); __masked_ptr; }) + -+ 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_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. -+ * -+ * 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. -+ * -+ * 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) -+{ -+ bool prefcore; -+ int ret; -+ -+ 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; -+ } -+ -+ /* -+ * 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; -+} -+EXPORT_SYMBOL_GPL(amd_get_boost_ratio_numerator); -diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c -index 1e0fe5f8ab84..015971adadfc 100644 ---- a/arch/x86/kernel/cpu/amd.c -+++ b/arch/x86/kernel/cpu/amd.c -@@ -1190,22 +1190,6 @@ unsigned long amd_get_dr_addr_mask(unsigned int dr) - } - 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) + /* + * User pointers can have tag bits on x86-64. This scheme tolerates + * arbitrary values in those bits rather then masking them off. +diff --git a/fs/select.c b/fs/select.c +index 9515c3fa1a03e..bc185d111436c 100644 +--- a/fs/select.c ++++ b/fs/select.c +@@ -780,7 +780,9 @@ static inline int get_sigset_argpack(struct sigset_argpack *to, { - struct cpuinfo_x86 *c = &cpu_data(smp_processor_id()); -diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c -index dd3d3082c8c7..3b5b695bb80b 100644 ---- a/drivers/acpi/cppc_acpi.c -+++ b/drivers/acpi/cppc_acpi.c -@@ -103,6 +103,11 @@ static DEFINE_PER_CPU(struct cpc_desc *, cpc_desc_ptr); - (cpc)->cpc_entry.reg.space_id == \ - ACPI_ADR_SPACE_PLATFORM_COMM) + // the path is hot enough for overhead of copy_from_user() to matter + if (from) { +- if (!user_read_access_begin(from, sizeof(*from))) ++ if (can_do_masked_user_access()) ++ from = masked_user_access_begin(from); ++ else if (!user_read_access_begin(from, sizeof(*from))) + return -EFAULT; + unsafe_get_user(to->p, &from->p, Efault); + unsafe_get_user(to->size, &from->size, Efault); +diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h +index d8e4105a2f21b..39c7cf82b0c22 100644 +--- a/include/linux/uaccess.h ++++ b/include/linux/uaccess.h +@@ -33,6 +33,13 @@ + }) + #endif -+/* Check if a CPC register is in FFH */ -+#define CPC_IN_FFH(cpc) ((cpc)->type == ACPI_TYPE_BUFFER && \ -+ (cpc)->cpc_entry.reg.space_id == \ -+ ACPI_ADR_SPACE_FIXED_HARDWARE) ++#ifdef masked_user_access_begin ++ #define can_do_masked_user_access() 1 ++#else ++ #define can_do_masked_user_access() 0 ++ #define masked_user_access_begin(src) NULL ++#endif + - /* Check if a CPC register is in SystemMemory */ - #define CPC_IN_SYSTEM_MEMORY(cpc) ((cpc)->type == ACPI_TYPE_BUFFER && \ - (cpc)->cpc_entry.reg.space_id == \ -@@ -1486,9 +1491,12 @@ int cppc_set_epp_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls, bool enable) - /* after writing CPC, transfer the ownership of PCC to platform */ - ret = send_pcc_cmd(pcc_ss_id, CMD_WRITE); - up_write(&pcc_ss_data->pcc_lock); -+ } else if (osc_cpc_flexible_adr_space_confirmed && -+ CPC_SUPPORTED(epp_set_reg) && CPC_IN_FFH(epp_set_reg)) { -+ ret = cpc_write(cpu, epp_set_reg, perf_ctrls->energy_perf); - } else { - ret = -ENOTSUPP; -- pr_debug("_CPC in PCC is not supported\n"); -+ pr_debug("_CPC in PCC and _CPC in FFH are not supported\n"); - } - - return ret; -diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c -index a8ca625a98b8..0f04feb6cafa 100644 ---- a/drivers/cpufreq/acpi-cpufreq.c -+++ b/drivers/cpufreq/acpi-cpufreq.c -@@ -642,10 +642,16 @@ static u64 get_max_boost_ratio(unsigned int cpu) + /* + * Architectures should provide two primitives (raw_copy_{to,from}_user()) + * and get rid of their private instances of copy_{to,from}_user() and +diff --git a/lib/strncpy_from_user.c b/lib/strncpy_from_user.c +index 6432b8c3e431e..989a12a678721 100644 +--- a/lib/strncpy_from_user.c ++++ b/lib/strncpy_from_user.c +@@ -120,6 +120,15 @@ long strncpy_from_user(char *dst, const char __user *src, long count) + if (unlikely(count <= 0)) 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; - -diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c -index 259a917da75f..113f82130a30 100644 ---- 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 -@@ -372,43 +370,17 @@ static inline int amd_pstate_enable(bool enable) - 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)); -@@ -420,19 +392,13 @@ static int pstate_init_perf(struct amd_cpudata *cpudata) - 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); -@@ -554,12 +520,15 @@ static void amd_pstate_update(struct amd_cpudata *cpudata, u32 min_perf, - } - - if (value == prev) -- return; -+ goto cpufreq_policy_put; - - WRITE_ONCE(cpudata->cppc_req_cached, value); - - amd_pstate_update_perf(cpudata, min_perf, des_perf, - max_perf, fast_switch); ++ if (can_do_masked_user_access()) { ++ long retval; + -+cpufreq_policy_put: -+ cpufreq_cpu_put(policy); - } - - static int amd_pstate_verify(struct cpufreq_policy_data *policy) -@@ -803,66 +772,22 @@ static void amd_pstste_sched_prefcore_workfn(struct work_struct *work) - } - 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) - { -- int ret, prio; -- u32 highest_perf; -- -- ret = amd_pstate_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); - } -@@ -875,17 +800,17 @@ static void amd_pstate_update_limits(unsigned int cpu) - int ret; - bool highest_perf_changed = false; - -- mutex_lock(&amd_pstate_driver_lock); -- if ((!amd_pstate_prefcore) || (!cpudata->hw_prefcore)) -- goto free_cpufreq_put; -+ if (!amd_pstate_prefcore) -+ return; - -- ret = amd_pstate_get_highest_perf(cpu, &cur_high); -+ 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) -@@ -949,8 +874,8 @@ static u32 amd_pstate_get_transition_latency(unsigned int cpu) - 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; -@@ -972,8 +897,10 @@ static int amd_pstate_init_freq(struct amd_cpudata *cpudata) - - 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); -@@ -1028,12 +955,12 @@ static int amd_pstate_cpu_init(struct cpufreq_policy *policy) - - 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; -@@ -1483,12 +1410,12 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy) - 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; -@@ -1947,6 +1874,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; ++ src = masked_user_access_begin(src); ++ retval = do_strncpy_from_user(dst, src, count, count); ++ user_read_access_end(); ++ return retval; + } + - /* enable amd pstate feature */ - ret = amd_pstate_enable(true); - if (ret) { -diff --git a/include/acpi/cppc_acpi.h b/include/acpi/cppc_acpi.h -index 930b6afba6f4..482e0587a041 100644 ---- a/include/acpi/cppc_acpi.h -+++ b/include/acpi/cppc_acpi.h -@@ -159,34 +159,37 @@ extern int cppc_get_epp_perf(int cpunum, u64 *epp_perf); - 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); -+extern int amd_detect_prefcore(bool *detected); - #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) - { -@@ -210,27 +213,39 @@ static inline bool cpc_ffh_supported(void) - } - 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; -+} -+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; -+} -+static inline int amd_detect_prefcore(bool *detected) -+{ -+ return -ENODEV; - } - #endif /* !CONFIG_ACPI_CPPC_LIB */ + max_addr = TASK_SIZE_MAX; + src_addr = (unsigned long)untagged_addr(src); + if (likely(src_addr < max_addr)) { +diff --git a/lib/strnlen_user.c b/lib/strnlen_user.c +index feeb935a22991..6e489f9e90f15 100644 +--- a/lib/strnlen_user.c ++++ b/lib/strnlen_user.c +@@ -96,6 +96,15 @@ long strnlen_user(const char __user *str, long count) + if (unlikely(count <= 0)) + return 0; ++ if (can_do_masked_user_access()) { ++ long retval; ++ ++ str = masked_user_access_begin(str); ++ retval = do_strnlen_user(str, count, count); ++ user_read_access_end(); ++ return retval; ++ } ++ + max_addr = TASK_SIZE_MAX; + src_addr = (unsigned long)untagged_addr(str); + if (likely(src_addr < max_addr)) { -- -2.46.1 +2.47.0.rc0 -From 5953215fa7b5cd9e6133a64341f9d11009c0b7ba Mon Sep 17 00:00:00 2001 -From: Eric Naim -Date: Thu, 19 Sep 2024 23:20:21 +0800 -Subject: [PATCH 02/11] bbr3 +From 02665aa9910f2066947a094a69b3cebf0f93bbdc Mon Sep 17 00:00:00 2001 +From: Peter Jung +Date: Mon, 30 Sep 2024 16:52:12 +0200 +Subject: [PATCH 02/10] bbr3 -Signed-off-by: Eric Naim +Signed-off-by: Peter Jung --- include/linux/tcp.h | 4 +- include/net/inet_connection_sock.h | 4 +- @@ -741,7 +136,7 @@ Signed-off-by: Eric Naim 16 files changed, 1940 insertions(+), 553 deletions(-) diff --git a/include/linux/tcp.h b/include/linux/tcp.h -index 6a5e08b937b3..27aab715490e 100644 +index 6a5e08b937b31..27aab715490ea 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h @@ -369,7 +369,9 @@ struct tcp_sock { @@ -756,7 +151,7 @@ index 6a5e08b937b3..27aab715490e 100644 fastopen_connect:1, /* FASTOPEN_CONNECT sockopt */ fastopen_no_cookie:1, /* Allow send/recv SYN+data without a cookie */ diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h -index c0deaafebfdc..d53f042d936e 100644 +index c0deaafebfdc0..d53f042d936e8 100644 --- a/include/net/inet_connection_sock.h +++ b/include/net/inet_connection_sock.h @@ -137,8 +137,8 @@ struct inet_connection_sock { @@ -771,7 +166,7 @@ index c0deaafebfdc..d53f042d936e 100644 #define ICSK_TIME_RETRANS 1 /* Retransmit timer */ diff --git a/include/net/tcp.h b/include/net/tcp.h -index 2aac11e7e1cc..482dcea8f507 100644 +index 2aac11e7e1cc5..482dcea8f5074 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -375,6 +375,8 @@ static inline void tcp_dec_quickack_mode(struct sock *sk) @@ -943,7 +338,7 @@ index 2aac11e7e1cc..482dcea8f507 100644 static inline void tcp_plb_init(const struct sock *sk, struct tcp_plb_state *plb) diff --git a/include/uapi/linux/inet_diag.h b/include/uapi/linux/inet_diag.h -index 50655de04c9b..82f8bd8f0d16 100644 +index 50655de04c9b6..82f8bd8f0d161 100644 --- a/include/uapi/linux/inet_diag.h +++ b/include/uapi/linux/inet_diag.h @@ -229,6 +229,29 @@ struct tcp_bbr_info { @@ -977,7 +372,7 @@ index 50655de04c9b..82f8bd8f0d16 100644 union tcp_cc_info { diff --git a/include/uapi/linux/rtnetlink.h b/include/uapi/linux/rtnetlink.h -index 3b687d20c9ed..a7c30c243b54 100644 +index 3b687d20c9ed3..a7c30c243b546 100644 --- a/include/uapi/linux/rtnetlink.h +++ b/include/uapi/linux/rtnetlink.h @@ -507,12 +507,14 @@ enum { @@ -997,7 +392,7 @@ index 3b687d20c9ed..a7c30c243b54 100644 struct rta_session { __u8 proto; diff --git a/include/uapi/linux/tcp.h b/include/uapi/linux/tcp.h -index dbf896f3146c..4702cd2f1ffc 100644 +index dbf896f3146c5..4702cd2f1ffcd 100644 --- a/include/uapi/linux/tcp.h +++ b/include/uapi/linux/tcp.h @@ -178,6 +178,7 @@ enum tcp_fastopen_client_fail { @@ -1009,7 +404,7 @@ index dbf896f3146c..4702cd2f1ffc 100644 /* * Sender's congestion state indicating normal or abnormal situations diff --git a/net/ipv4/Kconfig b/net/ipv4/Kconfig -index 8e94ed7c56a0..50dc9970cad2 100644 +index 8e94ed7c56a0e..50dc9970cad28 100644 --- a/net/ipv4/Kconfig +++ b/net/ipv4/Kconfig @@ -668,15 +668,18 @@ config TCP_CONG_BBR @@ -1041,7 +436,7 @@ index 8e94ed7c56a0..50dc9970cad2 100644 choice prompt "Default TCP congestion control" diff --git a/net/ipv4/bpf_tcp_ca.c b/net/ipv4/bpf_tcp_ca.c -index 3f88d0961e5b..4273cac333f6 100644 +index 3f88d0961e5b2..4273cac333f66 100644 --- 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 sock *sk, const struct ack_sample *samp @@ -1072,7 +467,7 @@ index 3f88d0961e5b..4273cac333f6 100644 .undo_cwnd = bpf_tcp_ca_undo_cwnd, .sndbuf_expand = bpf_tcp_ca_sndbuf_expand, diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c -index 831a18dc7aa6..d9faa8fef55e 100644 +index 831a18dc7aa6d..d9faa8fef55e9 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -3123,6 +3123,7 @@ int tcp_disconnect(struct sock *sk, int flags) @@ -1093,7 +488,7 @@ index 831a18dc7aa6..d9faa8fef55e 100644 info->tcpi_options |= TCPI_OPT_SYN_DATA; if (tp->tcp_usec_ts) diff --git a/net/ipv4/tcp_bbr.c b/net/ipv4/tcp_bbr.c -index 760941e55153..a180fa648d5e 100644 +index 760941e55153e..a180fa648d5e6 100644 --- a/net/ipv4/tcp_bbr.c +++ b/net/ipv4/tcp_bbr.c @@ -1,18 +1,19 @@ @@ -3737,7 +3132,7 @@ index 760941e55153..a180fa648d5e 100644 MODULE_DESCRIPTION("TCP BBR (Bottleneck Bandwidth and RTT)"); +MODULE_VERSION(__stringify(BBR_VERSION)); diff --git a/net/ipv4/tcp_cong.c b/net/ipv4/tcp_cong.c -index 0306d257fa64..28f581c0dab7 100644 +index 0306d257fa646..28f581c0dab76 100644 --- a/net/ipv4/tcp_cong.c +++ b/net/ipv4/tcp_cong.c @@ -237,6 +237,7 @@ void tcp_init_congestion_control(struct sock *sk) @@ -3749,7 +3144,7 @@ index 0306d257fa64..28f581c0dab7 100644 icsk->icsk_ca_ops->init(sk); if (tcp_ca_needs_ecn(sk)) diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c -index e37488d3453f..62eef7d067c2 100644 +index e37488d3453f0..62eef7d067c21 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -370,7 +370,7 @@ static void __tcp_ecn_check_ce(struct sock *sk, const struct sk_buff *skb) @@ -3883,7 +3278,7 @@ index e37488d3453f..62eef7d067c2 100644 tcp_in_quickack_mode(sk) || /* Protocol state mandates a one-time immediate ACK */ diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c -index a19a9dbd3409..e0ef8406a326 100644 +index a19a9dbd3409f..e0ef8406a3264 100644 --- a/net/ipv4/tcp_minisocks.c +++ b/net/ipv4/tcp_minisocks.c @@ -459,6 +459,8 @@ void tcp_ca_openreq_child(struct sock *sk, const struct dst_entry *dst) @@ -3896,7 +3291,7 @@ index a19a9dbd3409..e0ef8406a326 100644 const struct tcp_congestion_ops *ca; diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c -index 16c48df8df4c..6c3a1895238e 100644 +index 16c48df8df4cc..6c3a1895238eb 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -336,10 +336,9 @@ static void tcp_ecn_send_syn(struct sock *sk, struct sk_buff *skb) @@ -4007,7 +3402,7 @@ index 16c48df8df4c..6c3a1895238e 100644 goto rearm_timer; diff --git a/net/ipv4/tcp_rate.c b/net/ipv4/tcp_rate.c -index a8f6d9d06f2e..8737f2134648 100644 +index a8f6d9d06f2eb..8737f21346481 100644 --- a/net/ipv4/tcp_rate.c +++ b/net/ipv4/tcp_rate.c @@ -34,6 +34,24 @@ @@ -4087,7 +3482,7 @@ index a8f6d9d06f2e..8737f2134648 100644 rs->interval_us = max(snd_us, ack_us); diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c -index 4d40615dc8fc..f27941201ef2 100644 +index 4d40615dc8fc2..f27941201ef20 100644 --- a/net/ipv4/tcp_timer.c +++ b/net/ipv4/tcp_timer.c @@ -689,6 +689,7 @@ void tcp_write_timer_handler(struct sock *sk) @@ -4099,507 +3494,21 @@ index 4d40615dc8fc..f27941201ef2 100644 event = icsk->icsk_pending; -- -2.46.1 +2.47.0.rc0 -From aed1b10d860d25b7b18337ce0043ca2636678e69 Mon Sep 17 00:00:00 2001 -From: Eric Naim -Date: Thu, 19 Sep 2024 23:20:48 +0800 -Subject: [PATCH 03/11] block +From 34db38a99be8d8c28fc1aad79a5b1b0d8a9cd77d Mon Sep 17 00:00:00 2001 +From: Peter Jung +Date: Mon, 30 Sep 2024 16:52:23 +0200 +Subject: [PATCH 03/10] cachy -Signed-off-by: Eric Naim ---- - block/bfq-iosched.c | 120 ++++++++++++++++++++++++++++++++++++-------- - block/bfq-iosched.h | 16 +++++- - block/mq-deadline.c | 110 +++++++++++++++++++++++++++++++++------- - 3 files changed, 203 insertions(+), 43 deletions(-) - -diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c -index 36a4998c4b37..f9bc95f4488d 100644 ---- a/block/bfq-iosched.c -+++ b/block/bfq-iosched.c -@@ -467,6 +467,21 @@ static struct bfq_io_cq *bfq_bic_lookup(struct request_queue *q) - return icq; - } - -+static struct bfq_io_cq *bfq_bic_try_lookup(struct request_queue *q) -+{ -+ if (!current->io_context) -+ return NULL; -+ if (spin_trylock_irq(&q->queue_lock)) { -+ struct bfq_io_cq *icq; -+ -+ icq = icq_to_bic(ioc_lookup_icq(q)); -+ spin_unlock_irq(&q->queue_lock); -+ return icq; -+ } -+ -+ return NULL; -+} -+ - /* - * Scheduler run of queue, if there are requests pending and no one in the - * driver that will restart queueing. -@@ -2454,10 +2469,21 @@ static bool bfq_bio_merge(struct request_queue *q, struct bio *bio, - * returned by bfq_bic_lookup does not go away before - * bfqd->lock is taken. - */ -- struct bfq_io_cq *bic = bfq_bic_lookup(q); -+ struct bfq_io_cq *bic = bfq_bic_try_lookup(q); - bool ret; - -- spin_lock_irq(&bfqd->lock); -+ /* -+ * bio merging is called for every bio queued, and it's very easy -+ * to run into contention because of that. If we fail getting -+ * the dd lock, just skip this merge attempt. For related IO, the -+ * plug will be the successful merging point. If we get here, we -+ * already failed doing the obvious merge. Chances of actually -+ * getting a merge off this path is a lot slimmer, so skipping an -+ * occassional lookup that will most likely not succeed anyway should -+ * not be a problem. -+ */ -+ if (!spin_trylock_irq(&bfqd->lock)) -+ return false; - - if (bic) { - /* -@@ -5148,6 +5174,10 @@ static bool bfq_has_work(struct blk_mq_hw_ctx *hctx) - { - struct bfq_data *bfqd = hctx->queue->elevator->elevator_data; - -+ if (!list_empty_careful(&bfqd->at_head) || -+ !list_empty_careful(&bfqd->at_tail)) -+ return true; -+ - /* - * Avoiding lock: a race on bfqd->queued should cause at - * most a call to dispatch for nothing -@@ -5297,15 +5327,61 @@ static inline void bfq_update_dispatch_stats(struct request_queue *q, - bool idle_timer_disabled) {} - #endif /* CONFIG_BFQ_CGROUP_DEBUG */ - -+static void bfq_insert_request(struct request_queue *q, struct request *rq, -+ blk_insert_t flags, struct list_head *free); -+ -+static void __bfq_do_insert(struct request_queue *q, blk_insert_t flags, -+ struct list_head *list, struct list_head *free) -+{ -+ while (!list_empty(list)) { -+ struct request *rq; -+ -+ rq = list_first_entry(list, struct request, queuelist); -+ list_del_init(&rq->queuelist); -+ bfq_insert_request(q, rq, flags, free); -+ } -+} -+ -+static void bfq_do_insert(struct request_queue *q, struct list_head *free) -+{ -+ struct bfq_data *bfqd = q->elevator->elevator_data; -+ LIST_HEAD(at_head); -+ LIST_HEAD(at_tail); -+ -+ spin_lock(&bfqd->insert_lock); -+ list_splice_init(&bfqd->at_head, &at_head); -+ list_splice_init(&bfqd->at_tail, &at_tail); -+ spin_unlock(&bfqd->insert_lock); -+ -+ __bfq_do_insert(q, BLK_MQ_INSERT_AT_HEAD, &at_head, free); -+ __bfq_do_insert(q, 0, &at_tail, free); -+} -+ - static struct request *bfq_dispatch_request(struct blk_mq_hw_ctx *hctx) - { -- struct bfq_data *bfqd = hctx->queue->elevator->elevator_data; -+ struct request_queue *q = hctx->queue; -+ struct bfq_data *bfqd = q->elevator->elevator_data; - struct request *rq; - struct bfq_queue *in_serv_queue; - bool waiting_rq, idle_timer_disabled = false; -+ LIST_HEAD(free); -+ -+ /* -+ * If someone else is already dispatching, skip this one. This will -+ * defer the next dispatch event to when something completes, and could -+ * potentially lower the queue depth for contended cases. -+ * -+ * See the logic in blk_mq_do_dispatch_sched(), which loops and -+ * retries if nothing is dispatched. -+ */ -+ if (test_bit(BFQ_DISPATCHING, &bfqd->run_state) || -+ test_and_set_bit_lock(BFQ_DISPATCHING, &bfqd->run_state)) -+ return NULL; - - spin_lock_irq(&bfqd->lock); - -+ bfq_do_insert(hctx->queue, &free); -+ - in_serv_queue = bfqd->in_service_queue; - waiting_rq = in_serv_queue && bfq_bfqq_wait_request(in_serv_queue); - -@@ -5315,7 +5391,9 @@ static struct request *bfq_dispatch_request(struct blk_mq_hw_ctx *hctx) - waiting_rq && !bfq_bfqq_wait_request(in_serv_queue); - } - -+ clear_bit_unlock(BFQ_DISPATCHING, &bfqd->run_state); - spin_unlock_irq(&bfqd->lock); -+ blk_mq_free_requests(&free); - bfq_update_dispatch_stats(hctx->queue, rq, - idle_timer_disabled ? in_serv_queue : NULL, - idle_timer_disabled); -@@ -6238,27 +6316,21 @@ static inline void bfq_update_insert_stats(struct request_queue *q, - - static struct bfq_queue *bfq_init_rq(struct request *rq); - --static void bfq_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq, -- blk_insert_t flags) -+static void bfq_insert_request(struct request_queue *q, struct request *rq, -+ blk_insert_t flags, struct list_head *free) - { -- struct request_queue *q = hctx->queue; - struct bfq_data *bfqd = q->elevator->elevator_data; - struct bfq_queue *bfqq; - bool idle_timer_disabled = false; - blk_opf_t cmd_flags; -- LIST_HEAD(free); - - #ifdef CONFIG_BFQ_GROUP_IOSCHED - if (!cgroup_subsys_on_dfl(io_cgrp_subsys) && rq->bio) - bfqg_stats_update_legacy_io(q, rq); - #endif -- spin_lock_irq(&bfqd->lock); - bfqq = bfq_init_rq(rq); -- if (blk_mq_sched_try_insert_merge(q, rq, &free)) { -- spin_unlock_irq(&bfqd->lock); -- blk_mq_free_requests(&free); -+ if (blk_mq_sched_try_insert_merge(q, rq, free)) - return; -- } - - trace_block_rq_insert(rq); - -@@ -6288,8 +6360,6 @@ static void bfq_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq, - * merge). - */ - cmd_flags = rq->cmd_flags; -- spin_unlock_irq(&bfqd->lock); -- - bfq_update_insert_stats(q, bfqq, idle_timer_disabled, - cmd_flags); - } -@@ -6298,13 +6368,15 @@ static void bfq_insert_requests(struct blk_mq_hw_ctx *hctx, - struct list_head *list, - blk_insert_t flags) - { -- while (!list_empty(list)) { -- struct request *rq; -+ struct request_queue *q = hctx->queue; -+ struct bfq_data *bfqd = q->elevator->elevator_data; - -- rq = list_first_entry(list, struct request, queuelist); -- list_del_init(&rq->queuelist); -- bfq_insert_request(hctx, rq, flags); -- } -+ spin_lock_irq(&bfqd->insert_lock); -+ if (flags & BLK_MQ_INSERT_AT_HEAD) -+ list_splice_init(list, &bfqd->at_head); -+ else -+ list_splice_init(list, &bfqd->at_tail); -+ spin_unlock_irq(&bfqd->insert_lock); - } - - static void bfq_update_hw_tag(struct bfq_data *bfqd) -@@ -7213,6 +7285,12 @@ static int bfq_init_queue(struct request_queue *q, struct elevator_type *e) - q->elevator = eq; - spin_unlock_irq(&q->queue_lock); - -+ spin_lock_init(&bfqd->lock); -+ spin_lock_init(&bfqd->insert_lock); -+ -+ INIT_LIST_HEAD(&bfqd->at_head); -+ INIT_LIST_HEAD(&bfqd->at_tail); -+ - /* - * Our fallback bfqq if bfq_find_alloc_queue() runs into OOM issues. - * Grab a permanent reference to it, so that the normal code flow -@@ -7331,8 +7409,6 @@ static int bfq_init_queue(struct request_queue *q, struct elevator_type *e) - /* see comments on the definition of next field inside bfq_data */ - bfqd->actuator_load_threshold = 4; - -- spin_lock_init(&bfqd->lock); -- - /* - * The invocation of the next bfq_create_group_hierarchy - * function is the head of a chain of function calls -diff --git a/block/bfq-iosched.h b/block/bfq-iosched.h -index 08ddf2cfae5b..a5cb9b643699 100644 ---- a/block/bfq-iosched.h -+++ b/block/bfq-iosched.h -@@ -504,12 +504,26 @@ struct bfq_io_cq { - unsigned int requests; /* Number of requests this process has in flight */ - }; - -+enum { -+ BFQ_DISPATCHING = 0, -+}; -+ - /** - * struct bfq_data - per-device data structure. - * - * All the fields are protected by @lock. - */ - struct bfq_data { -+ struct { -+ spinlock_t lock; -+ spinlock_t insert_lock; -+ } ____cacheline_aligned_in_smp; -+ -+ unsigned long run_state; -+ -+ struct list_head at_head; -+ struct list_head at_tail; -+ - /* device request queue */ - struct request_queue *queue; - /* dispatch queue */ -@@ -795,8 +809,6 @@ struct bfq_data { - /* fallback dummy bfqq for extreme OOM conditions */ - struct bfq_queue oom_bfqq; - -- spinlock_t lock; -- - /* - * bic associated with the task issuing current bio for - * merging. This and the next field are used as a support to -diff --git a/block/mq-deadline.c b/block/mq-deadline.c -index acdc28756d9d..8b214233a061 100644 ---- a/block/mq-deadline.c -+++ b/block/mq-deadline.c -@@ -79,10 +79,23 @@ struct dd_per_prio { - struct io_stats_per_prio stats; - }; - -+enum { -+ DD_DISPATCHING = 0, -+}; -+ - struct deadline_data { - /* - * run time data - */ -+ struct { -+ spinlock_t lock; -+ spinlock_t insert_lock; -+ } ____cacheline_aligned_in_smp; -+ -+ unsigned long run_state; -+ -+ struct list_head at_head; -+ struct list_head at_tail; - - struct dd_per_prio per_prio[DD_PRIO_COUNT]; - -@@ -100,8 +113,6 @@ struct deadline_data { - int front_merges; - u32 async_depth; - int prio_aging_expire; -- -- spinlock_t lock; - }; - - /* Maps an I/O priority class to a deadline scheduler priority. */ -@@ -112,6 +123,9 @@ static const enum dd_prio ioprio_class_to_prio[] = { - [IOPRIO_CLASS_IDLE] = DD_IDLE_PRIO, - }; - -+static void dd_insert_request(struct request_queue *q, struct request *rq, -+ blk_insert_t flags, struct list_head *free); -+ - static inline struct rb_root * - deadline_rb_root(struct dd_per_prio *per_prio, struct request *rq) - { -@@ -451,6 +465,33 @@ static struct request *dd_dispatch_prio_aged_requests(struct deadline_data *dd, - return NULL; - } - -+static void __dd_do_insert(struct request_queue *q, blk_insert_t flags, -+ struct list_head *list, struct list_head *free) -+{ -+ while (!list_empty(list)) { -+ struct request *rq; -+ -+ rq = list_first_entry(list, struct request, queuelist); -+ list_del_init(&rq->queuelist); -+ dd_insert_request(q, rq, flags, free); -+ } -+} -+ -+static void dd_do_insert(struct request_queue *q, struct list_head *free) -+{ -+ struct deadline_data *dd = q->elevator->elevator_data; -+ LIST_HEAD(at_head); -+ LIST_HEAD(at_tail); -+ -+ spin_lock(&dd->insert_lock); -+ list_splice_init(&dd->at_head, &at_head); -+ list_splice_init(&dd->at_tail, &at_tail); -+ spin_unlock(&dd->insert_lock); -+ -+ __dd_do_insert(q, BLK_MQ_INSERT_AT_HEAD, &at_head, free); -+ __dd_do_insert(q, 0, &at_tail, free); -+} -+ - /* - * Called from blk_mq_run_hw_queue() -> __blk_mq_sched_dispatch_requests(). - * -@@ -461,12 +502,27 @@ static struct request *dd_dispatch_prio_aged_requests(struct deadline_data *dd, - */ - static struct request *dd_dispatch_request(struct blk_mq_hw_ctx *hctx) - { -- struct deadline_data *dd = hctx->queue->elevator->elevator_data; -+ struct request_queue *q = hctx->queue; -+ struct deadline_data *dd = q->elevator->elevator_data; - const unsigned long now = jiffies; - struct request *rq; - enum dd_prio prio; -+ LIST_HEAD(free); -+ -+ /* -+ * If someone else is already dispatching, skip this one. This will -+ * defer the next dispatch event to when something completes, and could -+ * potentially lower the queue depth for contended cases. -+ * -+ * See the logic in blk_mq_do_dispatch_sched(), which loops and -+ * retries if nothing is dispatched. -+ */ -+ if (test_bit(DD_DISPATCHING, &dd->run_state) || -+ test_and_set_bit_lock(DD_DISPATCHING, &dd->run_state)) -+ return NULL; - - spin_lock(&dd->lock); -+ dd_do_insert(q, &free); - rq = dd_dispatch_prio_aged_requests(dd, now); - if (rq) - goto unlock; -@@ -482,8 +538,10 @@ static struct request *dd_dispatch_request(struct blk_mq_hw_ctx *hctx) - } - - unlock: -+ clear_bit_unlock(DD_DISPATCHING, &dd->run_state); - spin_unlock(&dd->lock); - -+ blk_mq_free_requests(&free); - return rq; - } - -@@ -585,6 +643,12 @@ static int dd_init_sched(struct request_queue *q, struct elevator_type *e) - - eq->elevator_data = dd; - -+ spin_lock_init(&dd->lock); -+ spin_lock_init(&dd->insert_lock); -+ -+ INIT_LIST_HEAD(&dd->at_head); -+ INIT_LIST_HEAD(&dd->at_tail); -+ - for (prio = 0; prio <= DD_PRIO_MAX; prio++) { - struct dd_per_prio *per_prio = &dd->per_prio[prio]; - -@@ -601,7 +665,6 @@ static int dd_init_sched(struct request_queue *q, struct elevator_type *e) - dd->last_dir = DD_WRITE; - dd->fifo_batch = fifo_batch; - dd->prio_aging_expire = prio_aging_expire; -- spin_lock_init(&dd->lock); - - /* We dispatch from request queue wide instead of hw queue */ - blk_queue_flag_set(QUEUE_FLAG_SQ_SCHED, q); -@@ -657,7 +720,19 @@ static bool dd_bio_merge(struct request_queue *q, struct bio *bio, - struct request *free = NULL; - bool ret; - -- spin_lock(&dd->lock); -+ /* -+ * bio merging is called for every bio queued, and it's very easy -+ * to run into contention because of that. If we fail getting -+ * the dd lock, just skip this merge attempt. For related IO, the -+ * plug will be the successful merging point. If we get here, we -+ * already failed doing the obvious merge. Chances of actually -+ * getting a merge off this path is a lot slimmer, so skipping an -+ * occassional lookup that will most likely not succeed anyway should -+ * not be a problem. -+ */ -+ if (!spin_trylock(&dd->lock)) -+ return false; -+ - ret = blk_mq_sched_try_merge(q, bio, nr_segs, &free); - spin_unlock(&dd->lock); - -@@ -670,10 +745,9 @@ static bool dd_bio_merge(struct request_queue *q, struct bio *bio, - /* - * add rq to rbtree and fifo - */ --static void dd_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq, -+static void dd_insert_request(struct request_queue *q, struct request *rq, - blk_insert_t flags, struct list_head *free) - { -- struct request_queue *q = hctx->queue; - struct deadline_data *dd = q->elevator->elevator_data; - const enum dd_data_dir data_dir = rq_data_dir(rq); - u16 ioprio = req_get_ioprio(rq); -@@ -727,19 +801,13 @@ static void dd_insert_requests(struct blk_mq_hw_ctx *hctx, - { - struct request_queue *q = hctx->queue; - struct deadline_data *dd = q->elevator->elevator_data; -- LIST_HEAD(free); -- -- spin_lock(&dd->lock); -- while (!list_empty(list)) { -- struct request *rq; -- -- rq = list_first_entry(list, struct request, queuelist); -- list_del_init(&rq->queuelist); -- dd_insert_request(hctx, rq, flags, &free); -- } -- spin_unlock(&dd->lock); - -- blk_mq_free_requests(&free); -+ spin_lock(&dd->insert_lock); -+ if (flags & BLK_MQ_INSERT_AT_HEAD) -+ list_splice_init(list, &dd->at_head); -+ else -+ list_splice_init(list, &dd->at_tail); -+ spin_unlock(&dd->insert_lock); - } - - /* Callback from inside blk_mq_rq_ctx_init(). */ -@@ -780,6 +848,10 @@ static bool dd_has_work(struct blk_mq_hw_ctx *hctx) - struct deadline_data *dd = hctx->queue->elevator->elevator_data; - enum dd_prio prio; - -+ if (!list_empty_careful(&dd->at_head) || -+ !list_empty_careful(&dd->at_tail)) -+ return true; -+ - for (prio = 0; prio <= DD_PRIO_MAX; prio++) - if (dd_has_work_for_prio(&dd->per_prio[prio])) - return true; --- -2.46.1 - -From 42072fb3b6bd37efebe6085c790a114b394732a1 Mon Sep 17 00:00:00 2001 -From: Eric Naim -Date: Thu, 19 Sep 2024 23:21:02 +0800 -Subject: [PATCH 04/11] cachy - -Signed-off-by: Eric Naim +Signed-off-by: Peter Jung --- .../admin-guide/kernel-parameters.txt | 12 + - Documentation/admin-guide/sysctl/vm.rst | 72 + - Makefile | 7 +- - arch/x86/Kconfig.cpu | 432 ++- - arch/x86/Makefile | 45 +- + Makefile | 8 + + arch/x86/Kconfig.cpu | 363 +- + arch/x86/Makefile | 93 +- arch/x86/include/asm/pci.h | 6 + - arch/x86/include/asm/vermagic.h | 76 + + arch/x86/include/asm/vermagic.h | 70 + arch/x86/pci/common.c | 7 +- block/bfq-iosched.c | 6 + block/elevator.c | 10 + @@ -4632,28 +3541,30 @@ Signed-off-by: Eric Naim drivers/pci/controller/intel-nvme-remap.c | 462 +++ drivers/pci/quirks.c | 101 + include/linux/cpufreq.h | 6 - - include/linux/mm.h | 8 + include/linux/pagemap.h | 2 +- include/linux/user_namespace.h | 4 + + include/linux/wait.h | 2 + init/Kconfig | 26 + kernel/Kconfig.hz | 24 + kernel/fork.c | 14 + + kernel/locking/rwsem.c | 4 +- kernel/sched/fair.c | 13 + kernel/sched/sched.h | 2 +- - kernel/sysctl.c | 46 + + kernel/sched/wait.c | 24 + + kernel/sysctl.c | 12 + kernel/user_namespace.c | 7 + - mm/Kconfig | 65 +- + mm/Kconfig | 2 +- mm/compaction.c | 4 + mm/huge_memory.c | 4 + - mm/mm_init.c | 1 + mm/page-writeback.c | 8 + mm/page_alloc.c | 4 + mm/swap.c | 5 + mm/vmpressure.c | 4 + - mm/vmscan.c | 142 + + mm/vmscan.c | 8 + + net/ipv4/inet_connection_sock.c | 2 +- scripts/Makefile.package | 3 +- scripts/package/PKGBUILD | 52 +- - 60 files changed, 6113 insertions(+), 110 deletions(-) + 61 files changed, 5805 insertions(+), 112 deletions(-) create mode 100644 drivers/i2c/busses/i2c-nct6775.c create mode 100644 drivers/media/v4l2-core/v4l2loopback.c create mode 100644 drivers/media/v4l2-core/v4l2loopback.h @@ -4661,7 +3572,7 @@ Signed-off-by: Eric Naim create mode 100644 drivers/pci/controller/intel-nvme-remap.c diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt -index 09126bb8cc9f..43305af6b364 100644 +index 09126bb8cc9ff..43305af6b3643 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -2231,6 +2231,9 @@ @@ -4690,108 +3601,11 @@ index 09126bb8cc9f..43305af6b364 100644 noioapicquirk [APIC] Disable all boot interrupt quirks. Safety option to keep boot IRQs enabled. This should never be necessary. -diff --git a/Documentation/admin-guide/sysctl/vm.rst b/Documentation/admin-guide/sysctl/vm.rst -index f48eaa98d22d..fc777c14cff6 100644 ---- a/Documentation/admin-guide/sysctl/vm.rst -+++ b/Documentation/admin-guide/sysctl/vm.rst -@@ -25,6 +25,9 @@ files can be found in mm/swap.c. - Currently, these files are in /proc/sys/vm: - - - admin_reserve_kbytes -+- anon_min_ratio -+- clean_low_ratio -+- clean_min_ratio - - compact_memory - - compaction_proactiveness - - compact_unevictable_allowed -@@ -108,6 +111,67 @@ On x86_64 this is about 128MB. - Changing this takes effect whenever an application requests memory. - - -+anon_min_ratio -+============== -+ -+This knob provides *hard* protection of anonymous pages. The anonymous pages -+on the current node won't be reclaimed under any conditions when their amount -+is below vm.anon_min_ratio. -+ -+This knob may be used to prevent excessive swap thrashing when anonymous -+memory is low (for example, when memory is going to be overfilled by -+compressed data of zram module). -+ -+Setting this value too high (close to 100) can result in inability to -+swap and can lead to early OOM under memory pressure. -+ -+The unit of measurement is the percentage of the total memory of the node. -+ -+The default value is 15. -+ -+ -+clean_low_ratio -+================ -+ -+This knob provides *best-effort* protection of clean file pages. The file pages -+on the current node won't be reclaimed under memory pressure when the amount of -+clean file pages is below vm.clean_low_ratio *unless* we threaten to OOM. -+ -+Protection of clean file pages using this knob may be used when swapping is -+still possible to -+ - prevent disk I/O thrashing under memory pressure; -+ - improve performance in disk cache-bound tasks under memory pressure. -+ -+Setting it to a high value may result in a early eviction of anonymous pages -+into the swap space by attempting to hold the protected amount of clean file -+pages in memory. -+ -+The unit of measurement is the percentage of the total memory of the node. -+ -+The default value is 0. -+ -+ -+clean_min_ratio -+================ -+ -+This knob provides *hard* protection of clean file pages. The file pages on the -+current node won't be reclaimed under memory pressure when the amount of clean -+file pages is below vm.clean_min_ratio. -+ -+Hard protection of clean file pages using this knob may be used to -+ - prevent disk I/O thrashing under memory pressure even with no free swap space; -+ - improve performance in disk cache-bound tasks under memory pressure; -+ - avoid high latency and prevent livelock in near-OOM conditions. -+ -+Setting it to a high value may result in a early out-of-memory condition due to -+the inability to reclaim the protected amount of clean file pages when other -+types of pages cannot be reclaimed. -+ -+The unit of measurement is the percentage of the total memory of the node. -+ -+The default value is 15. -+ -+ - compact_memory - ============== - -@@ -964,6 +1028,14 @@ be 133 (x + 2x = 200, 2x = 133.33). - At 0, the kernel will not initiate swap until the amount of free and - file-backed pages is less than the high watermark in a zone. - -+This knob has no effect if the amount of clean file pages on the current -+node is below vm.clean_low_ratio or vm.clean_min_ratio. In this case, -+only anonymous pages can be reclaimed. -+ -+If the number of anonymous pages on the current node is below -+vm.anon_min_ratio, then only file pages can be reclaimed with -+any vm.swappiness value. -+ - - unprivileged_userfaultfd - ======================== diff --git a/Makefile b/Makefile -index 34bd1d5f9672..7b497ab43754 100644 +index df9c90cdd1c57..058667a0c3f49 100644 --- a/Makefile +++ b/Makefile -@@ -803,6 +803,9 @@ KBUILD_CFLAGS += -fno-delete-null-pointer-checks +@@ -803,11 +803,19 @@ KBUILD_CFLAGS += -fno-delete-null-pointer-checks ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE KBUILD_CFLAGS += -O2 KBUILD_RUSTFLAGS += -Copt-level=2 @@ -4801,32 +3615,32 @@ index 34bd1d5f9672..7b497ab43754 100644 else ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE KBUILD_CFLAGS += -Os KBUILD_RUSTFLAGS += -Copt-level=s -@@ -991,9 +994,9 @@ KBUILD_CFLAGS += -fno-strict-overflow - # Make sure -fstack-check isn't enabled (like gentoo apparently did) - KBUILD_CFLAGS += -fno-stack-check - --# conserve stack if available -+# conserve stack, ivopts and modulo-sched if available - ifdef CONFIG_CC_IS_GCC --KBUILD_CFLAGS += -fconserve-stack -+KBUILD_CFLAGS += -fconserve-stack -fivopts -fmodulo-sched -fno-tree-vectorize endif - # change __FILE__ to the relative path from the srctree ++# 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 -fivopts -fmodulo-sched) ++ + # Always set `debug-assertions` and `overflow-checks` because their default + # depends on `opt-level` and `debug-assertions`, respectively. + KBUILD_RUSTFLAGS += -Cdebug-assertions=$(if $(CONFIG_RUST_DEBUG_ASSERTIONS),y,n) diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu -index 2a7279d80460..3b077b9f9291 100644 +index 2a7279d80460a..eee3c57d02a67 100644 --- a/arch/x86/Kconfig.cpu +++ b/arch/x86/Kconfig.cpu -@@ -157,7 +157,7 @@ config MPENTIUM4 - +@@ -155,9 +155,8 @@ config MPENTIUM4 + -Paxville + -Dempsey +- config MK6 - bool "K6/K6-II/K6-III" + bool "AMD K6/K6-II/K6-III" depends on X86_32 help Select this for an AMD K6-family processor. Enables use of -@@ -165,7 +165,7 @@ config MK6 +@@ -165,7 +164,7 @@ config MK6 flags to GCC. config MK7 @@ -4835,7 +3649,7 @@ index 2a7279d80460..3b077b9f9291 100644 depends on X86_32 help Select this for an AMD Athlon K7-family processor. Enables use of -@@ -173,12 +173,114 @@ config MK7 +@@ -173,12 +172,114 @@ config MK7 flags to GCC. config MK8 @@ -4942,49 +3756,56 @@ index 2a7279d80460..3b077b9f9291 100644 + +config MZEN5 + bool "AMD Zen 5" -+ depends on (CC_IS_GCC && GCC_VERSION >= 140000) || (CC_IS_CLANG && CLANG_VERSION >= 180000) ++ depends on (CC_IS_GCC && GCC_VERSION > 140000) || (CC_IS_CLANG && CLANG_VERSION >= 191000) + help -+ Select this for AMD Family 1Ah Zen 5 processors. ++ Select this for AMD Family 19h Zen 5 processors. + + Enables -march=znver5 + config MCRUSOE bool "Crusoe" depends on X86_32 -@@ -270,7 +372,7 @@ config MPSC +@@ -269,8 +370,17 @@ config MPSC + using the cpu family field in /proc/cpuinfo. Family 15 is an older Xeon, Family 6 a newer one. ++config MATOM ++ bool "Intel Atom" ++ help ++ ++ Select this for the Intel Atom platform. Intel Atom CPUs have an ++ in-order pipelining architecture and thus can benefit from ++ accordingly optimized code. Use a recent GCC with specific Atom ++ support in order to fully benefit from selecting this option. ++ config MCORE2 - bool "Core 2/newer Xeon" + bool "Intel Core 2" help Select this for Intel Core 2 and newer Core 2 Xeons (Xeon 51xx and -@@ -278,6 +380,8 @@ config MCORE2 +@@ -278,14 +388,191 @@ config MCORE2 family in /proc/cpuinfo. Newer ones have 6 and older ones 15 (not a typo) +-config MATOM +- bool "Intel Atom" + Enables -march=core2 + - config MATOM - bool "Intel Atom" - help -@@ -287,6 +391,212 @@ config MATOM - accordingly optimized code. Use a recent GCC with specific Atom - support in order to fully benefit from selecting this option. - +config MNEHALEM + bool "Intel Nehalem" -+ select X86_P6_NOP -+ help -+ + help + +- Select this for the Intel Atom platform. Intel Atom CPUs have an +- in-order pipelining architecture and thus can benefit from +- accordingly optimized code. Use a recent GCC with specific Atom +- support in order to fully benefit from selecting this option. + Select this for 1st Gen Core processors in the Nehalem family. + + Enables -march=nehalem + +config MWESTMERE + bool "Intel Westmere" -+ select X86_P6_NOP + help + + Select this for the Intel Westmere formerly Nehalem-C family. @@ -4993,7 +3814,6 @@ index 2a7279d80460..3b077b9f9291 100644 + +config MSILVERMONT + bool "Intel Silvermont" -+ select X86_P6_NOP + help + + Select this for the Intel Silvermont platform. @@ -5002,7 +3822,6 @@ index 2a7279d80460..3b077b9f9291 100644 + +config MGOLDMONT + bool "Intel Goldmont" -+ select X86_P6_NOP + help + + Select this for the Intel Goldmont platform including Apollo Lake and Denverton. @@ -5011,7 +3830,6 @@ index 2a7279d80460..3b077b9f9291 100644 + +config MGOLDMONTPLUS + bool "Intel Goldmont Plus" -+ select X86_P6_NOP + help + + Select this for the Intel Goldmont Plus platform including Gemini Lake. @@ -5020,7 +3838,6 @@ index 2a7279d80460..3b077b9f9291 100644 + +config MSANDYBRIDGE + bool "Intel Sandy Bridge" -+ select X86_P6_NOP + help + + Select this for 2nd Gen Core processors in the Sandy Bridge family. @@ -5029,7 +3846,6 @@ index 2a7279d80460..3b077b9f9291 100644 + +config MIVYBRIDGE + bool "Intel Ivy Bridge" -+ select X86_P6_NOP + help + + Select this for 3rd Gen Core processors in the Ivy Bridge family. @@ -5038,7 +3854,6 @@ index 2a7279d80460..3b077b9f9291 100644 + +config MHASWELL + bool "Intel Haswell" -+ select X86_P6_NOP + help + + Select this for 4th Gen Core processors in the Haswell family. @@ -5047,7 +3862,6 @@ index 2a7279d80460..3b077b9f9291 100644 + +config MBROADWELL + bool "Intel Broadwell" -+ select X86_P6_NOP + help + + Select this for 5th Gen Core processors in the Broadwell family. @@ -5056,7 +3870,6 @@ index 2a7279d80460..3b077b9f9291 100644 + +config MSKYLAKE + bool "Intel Skylake" -+ select X86_P6_NOP + help + + Select this for 6th Gen Core processors in the Skylake family. @@ -5065,7 +3878,6 @@ index 2a7279d80460..3b077b9f9291 100644 + +config MSKYLAKEX + bool "Intel Skylake X" -+ select X86_P6_NOP + help + + Select this for 6th Gen Core processors in the Skylake X family. @@ -5074,7 +3886,6 @@ index 2a7279d80460..3b077b9f9291 100644 + +config MCANNONLAKE + bool "Intel Cannon Lake" -+ select X86_P6_NOP + help + + Select this for 8th Gen Core processors @@ -5083,7 +3894,6 @@ index 2a7279d80460..3b077b9f9291 100644 + +config MICELAKE + bool "Intel Ice Lake" -+ select X86_P6_NOP + help + + Select this for 10th Gen Core processors in the Ice Lake family. @@ -5092,7 +3902,6 @@ index 2a7279d80460..3b077b9f9291 100644 + +config MCASCADELAKE + bool "Intel Cascade Lake" -+ select X86_P6_NOP + help + + Select this for Xeon processors in the Cascade Lake family. @@ -5102,7 +3911,6 @@ index 2a7279d80460..3b077b9f9291 100644 +config MCOOPERLAKE + bool "Intel Cooper Lake" + depends on (CC_IS_GCC && GCC_VERSION > 100100) || (CC_IS_CLANG && CLANG_VERSION >= 100000) -+ select X86_P6_NOP + help + + Select this for Xeon processors in the Cooper Lake family. @@ -5112,7 +3920,6 @@ index 2a7279d80460..3b077b9f9291 100644 +config MTIGERLAKE + bool "Intel Tiger Lake" + depends on (CC_IS_GCC && GCC_VERSION > 100100) || (CC_IS_CLANG && CLANG_VERSION >= 100000) -+ select X86_P6_NOP + help + + Select this for third-generation 10 nm process processors in the Tiger Lake family. @@ -5122,7 +3929,6 @@ index 2a7279d80460..3b077b9f9291 100644 +config MSAPPHIRERAPIDS + bool "Intel Sapphire Rapids" + depends on (CC_IS_GCC && GCC_VERSION > 110000) || (CC_IS_CLANG && CLANG_VERSION >= 120000) -+ select X86_P6_NOP + help + + Select this for fourth-generation 10 nm process processors in the Sapphire Rapids family. @@ -5132,7 +3938,6 @@ index 2a7279d80460..3b077b9f9291 100644 +config MROCKETLAKE + bool "Intel Rocket Lake" + depends on (CC_IS_GCC && GCC_VERSION > 110000) || (CC_IS_CLANG && CLANG_VERSION >= 120000) -+ select X86_P6_NOP + help + + Select this for eleventh-generation processors in the Rocket Lake family. @@ -5142,7 +3947,6 @@ index 2a7279d80460..3b077b9f9291 100644 +config MALDERLAKE + bool "Intel Alder Lake" + depends on (CC_IS_GCC && GCC_VERSION > 110000) || (CC_IS_CLANG && CLANG_VERSION >= 120000) -+ select X86_P6_NOP + help + + Select this for twelfth-generation processors in the Alder Lake family. @@ -5152,7 +3956,6 @@ index 2a7279d80460..3b077b9f9291 100644 +config MRAPTORLAKE + bool "Intel Raptor Lake" + depends on (CC_IS_GCC && GCC_VERSION >= 130000) || (CC_IS_CLANG && CLANG_VERSION >= 150500) -+ select X86_P6_NOP + help + + Select this for thirteenth-generation processors in the Raptor Lake family. @@ -5162,7 +3965,6 @@ index 2a7279d80460..3b077b9f9291 100644 +config MMETEORLAKE + bool "Intel Meteor Lake" + depends on (CC_IS_GCC && GCC_VERSION >= 130000) || (CC_IS_CLANG && CLANG_VERSION >= 150500) -+ select X86_P6_NOP + help + + Select this for fourteenth-generation processors in the Meteor Lake family. @@ -5172,44 +3974,18 @@ index 2a7279d80460..3b077b9f9291 100644 +config MEMERALDRAPIDS + bool "Intel Emerald Rapids" + depends on (CC_IS_GCC && GCC_VERSION > 130000) || (CC_IS_CLANG && CLANG_VERSION >= 150500) -+ select X86_P6_NOP + help + + Select this for fifth-generation 10 nm process processors in the Emerald Rapids family. + + Enables -march=emeraldrapids -+ + config GENERIC_CPU bool "Generic-x86-64" - depends on X86_64 -@@ -294,6 +604,50 @@ config GENERIC_CPU +@@ -294,8 +581,32 @@ config GENERIC_CPU Generic x86-64 CPU. Run equally well on all x86-64 CPUs. -+config GENERIC_CPU2 -+ bool "Generic-x86-64-v2" -+ depends on (CC_IS_GCC && GCC_VERSION > 110000) || (CC_IS_CLANG && CLANG_VERSION >= 120000) -+ depends on X86_64 -+ help -+ Generic x86-64 CPU. -+ Run equally well on all x86-64 CPUs with min support of x86-64-v2. -+ -+config GENERIC_CPU3 -+ bool "Generic-x86-64-v3" -+ depends on (CC_IS_GCC && GCC_VERSION > 110000) || (CC_IS_CLANG && CLANG_VERSION >= 120000) -+ depends on X86_64 -+ help -+ Generic x86-64-v3 CPU with v3 instructions. -+ Run equally well on all x86-64 CPUs with min support of x86-64-v3. -+ -+config GENERIC_CPU4 -+ bool "Generic-x86-64-v4" -+ depends on (CC_IS_GCC && GCC_VERSION > 110000) || (CC_IS_CLANG && CLANG_VERSION >= 120000) -+ depends on X86_64 -+ help -+ Generic x86-64 CPU with v4 instructions. -+ Run equally well on all x86-64 CPUs with min support of x86-64-v4. -+ +config MNATIVE_INTEL + bool "Intel-Native optimizations autodetected by the compiler" + help @@ -5232,134 +4008,95 @@ index 2a7279d80460..3b077b9f9291 100644 + endchoice ++config SUPPORT_MARCH_CODEVERS ++ bool ++ default y if (CC_IS_GCC && GCC_VERSION > 110000) || (CC_IS_CLANG && CLANG_VERSION >= 120000) ++ config X86_GENERIC -@@ -318,9 +672,17 @@ config X86_INTERNODE_CACHE_SHIFT + bool "Generic x86 support" + depends on X86_32 +@@ -308,6 +619,30 @@ config X86_GENERIC + This is really intended for distributors who need more + generic optimizations. + ++config X86_64_VERSION ++ int "x86-64 compiler ISA level" ++ range 1 4 ++ depends on (CC_IS_GCC && GCC_VERSION > 110000) || (CC_IS_CLANG && CLANG_VERSION >= 120000) ++ depends on X86_64 && GENERIC_CPU ++ help ++ Specify a specific x86-64 compiler ISA level. ++ ++ There are three x86-64 ISA levels that work on top of ++ the x86-64 baseline, namely: x86-64-v2, x86-64-v3, and x86-64-v4. ++ ++ x86-64-v2 brings support for vector instructions up to Streaming SIMD ++ Extensions 4.2 (SSE4.2) and Supplemental Streaming SIMD Extensions 3 ++ (SSSE3), the POPCNT instruction, and CMPXCHG16B. ++ ++ x86-64-v3 adds vector instructions up to AVX2, MOVBE, and additional ++ bit-manipulation instructions. ++ ++ x86-64-v4 is not included since the kernel does not use AVX512 instructions ++ ++ You can find the best version for your CPU by running one of the following: ++ /lib/ld-linux-x86-64.so.2 --help | grep supported ++ /lib64/ld-linux-x86-64.so.2 --help | grep supported ++ + # + # Define implied options from the CPU selection here + config X86_INTERNODE_CACHE_SHIFT +@@ -318,7 +653,7 @@ config X86_INTERNODE_CACHE_SHIFT config X86_L1_CACHE_SHIFT int default "7" if MPENTIUM4 || MPSC - default "6" if MK7 || MK8 || MPENTIUMM || MCORE2 || MATOM || MVIAC7 || X86_GENERIC || GENERIC_CPU -+ default "6" if MK7 || MK8 || MPENTIUMM || MCORE2 || MATOM || MVIAC7 || MK8SSE3 || MK10 \ -+ || MBARCELONA || MBOBCAT || MJAGUAR || MBULLDOZER || MPILEDRIVER || MSTEAMROLLER \ -+ || MEXCAVATOR || MZEN || MZEN2 || MZEN3 || MZEN4 || MZEN5 || MNEHALEM || MWESTMERE || MSILVERMONT \ -+ || MGOLDMONT || MGOLDMONTPLUS || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL \ -+ || MSKYLAKE || MSKYLAKEX || MCANNONLAKE || MICELAKE || MCASCADELAKE || MCOOPERLAKE \ -+ || MTIGERLAKE || MSAPPHIRERAPIDS || MROCKETLAKE || MALDERLAKE || MRAPTORLAKE || MMETEORLAKE \ -+ || MEMERALDRAPIDS || MNATIVE_INTEL || MNATIVE_AMD || X86_GENERIC || GENERIC_CPU || GENERIC_CPU2 \ -+ || GENERIC_CPU3 || GENERIC_CPU4 ++ default "6" if MK7 || MK8 || MPENTIUMM || MCORE2 || MATOM || MVIAC7 || X86_GENERIC || GENERIC_CPU || MK8SSE3 || MK10 || MBARCELONA || MBOBCAT || MJAGUAR || MBULLDOZER || MPILEDRIVER || MSTEAMROLLER || MEXCAVATOR || MZEN || MZEN2 || MZEN3 || MZEN4 || MZEN5 || MNEHALEM || MWESTMERE || MSILVERMONT || MGOLDMONT || MGOLDMONTPLUS || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE || MSKYLAKEX || MCANNONLAKE || MICELAKE || MCASCADELAKE || MCOOPERLAKE || MTIGERLAKE || MSAPPHIRERAPIDS || MROCKETLAKE || MALDERLAKE || MRAPTORLAKE || MMETEORLAKE || MEMERALDRAPIDS || MNATIVE_INTEL || MNATIVE_AMD 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 -+ default "5" if MWINCHIP3D || MWINCHIPC6 || MCRUSOE || MEFFICEON || MCYRIXIII || MK6 || MPENTIUMIII \ -+ || MPENTIUMII || M686 || M586MMX || M586TSC || M586 || MVIAC3_2 || MGEODE_LX + default "5" if MWINCHIP3D || MWINCHIPC6 || MCRUSOE || MEFFICEON || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586 || MVIAC3_2 || MGEODE_LX - config X86_F00F_BUG - def_bool y -@@ -332,15 +694,27 @@ config X86_INVD_BUG - - config X86_ALIGNMENT_16 - def_bool y -- depends on MWINCHIP3D || MWINCHIPC6 || MCYRIXIII || MELAN || MK6 || M586MMX || M586TSC || M586 || M486SX || M486 || MVIAC3_2 || MGEODEGX1 -+ depends on MWINCHIP3D || MWINCHIPC6 || MCYRIXIII || MELAN || MK6 || M586MMX || M586TSC \ -+ || M586 || M486SX || M486 || MVIAC3_2 || MGEODEGX1 +@@ -336,11 +671,11 @@ config X86_ALIGNMENT_16 config X86_INTEL_USERCOPY def_bool y - depends on MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M586MMX || X86_GENERIC || MK8 || MK7 || MEFFICEON || MCORE2 -+ depends on MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M586MMX || X86_GENERIC \ -+ || MK8 || MK7 || MEFFICEON || MCORE2 || MNEHALEM || MWESTMERE || MSILVERMONT || MGOLDMONT \ -+ || MGOLDMONTPLUS || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE || MSKYLAKEX \ -+ || MCANNONLAKE || MICELAKE || MCASCADELAKE || MCOOPERLAKE || MTIGERLAKE || MSAPPHIRERAPIDS \ -+ || MROCKETLAKE || MALDERLAKE || MRAPTORLAKE || MMETEORLAKE || MEMERALDRAPIDS || MNATIVE_INTEL ++ depends on MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M586MMX || X86_GENERIC || MK8 || MK7 || MEFFICEON || MCORE2 || MNEHALEM || MWESTMERE || MSILVERMONT || MGOLDMONT || MGOLDMONTPLUS || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE || MSKYLAKEX || MCANNONLAKE || MICELAKE || MCASCADELAKE || MCOOPERLAKE || MTIGERLAKE || MSAPPHIRERAPIDS || MROCKETLAKE || MALDERLAKE || MRAPTORLAKE || MMETEORLAKE || MEMERALDRAPIDS || MNATIVE_INTEL config X86_USE_PPRO_CHECKSUM def_bool y - depends on MWINCHIP3D || MWINCHIPC6 || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MK8 || MVIAC3_2 || MVIAC7 || MEFFICEON || MGEODE_LX || MCORE2 || MATOM -+ depends on MWINCHIP3D || MWINCHIPC6 || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM \ -+ || MPENTIUMIII || MPENTIUMII || M686 || MK8 || MVIAC3_2 || MVIAC7 || MEFFICEON || MGEODE_LX \ -+ || MCORE2 || MATOM || MK8SSE3 || MK10 || MBARCELONA || MBOBCAT || MJAGUAR || MBULLDOZER \ -+ || MPILEDRIVER || MSTEAMROLLER || MEXCAVATOR || MZEN || MZEN2 || MZEN3 || MZEN4 || MZEN5 || MNEHALEM \ -+ || MWESTMERE || MSILVERMONT || MGOLDMONT || MGOLDMONTPLUS || MSANDYBRIDGE || MIVYBRIDGE \ -+ || MHASWELL || MBROADWELL || MSKYLAKE || MSKYLAKEX || MCANNONLAKE || MICELAKE \ -+ || MCASCADELAKE || MCOOPERLAKE || MTIGERLAKE || MSAPPHIRERAPIDS || MROCKETLAKE \ -+ || MALDERLAKE || MRAPTORLAKE || MMETEORLAKE || MEMERALDRAPIDS || MNATIVE_INTEL || MNATIVE_AMD ++ depends on MWINCHIP3D || MWINCHIPC6 || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MK8 || MVIAC3_2 || MVIAC7 || MEFFICEON || MGEODE_LX || MCORE2 || MATOM || MK8SSE3 || MK10 || MBARCELONA || MBOBCAT || MJAGUAR || MBULLDOZER || MPILEDRIVER || MSTEAMROLLER || MEXCAVATOR || MZEN || MZEN2 || MZEN3 || MZEN4 || MZEN5 || MNEHALEM || MWESTMERE || MSILVERMONT || MGOLDMONT || MGOLDMONTPLUS || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE || MSKYLAKEX || MCANNONLAKE || MICELAKE || MCASCADELAKE || MCOOPERLAKE || MTIGERLAKE || MSAPPHIRERAPIDS || MROCKETLAKE || MALDERLAKE || MRAPTORLAKE || MMETEORLAKE || MEMERALDRAPIDS || MNATIVE_INTEL || MNATIVE_AMD # # P6_NOPs are a relatively minor optimization that require a family >= -@@ -356,11 +730,22 @@ config X86_USE_PPRO_CHECKSUM - config X86_P6_NOP - def_bool y - depends on X86_64 -- depends on (MCORE2 || MPENTIUM4 || MPSC) -+ depends on (MCORE2 || MPENTIUM4 || MPSC || MNEHALEM || MWESTMERE || MSILVERMONT || MGOLDMONT \ -+ || MGOLDMONTPLUS || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE \ -+ || MSKYLAKEX || MCANNONLAKE || MICELAKE || MCASCADELAKE || MCOOPERLAKE || MTIGERLAKE \ -+ || MSAPPHIRERAPIDS || MROCKETLAKE || MALDERLAKE || MRAPTORLAKE || MMETEORLAKE || MEMERALDRAPIDS \ -+ || MNATIVE_INTEL) - - config X86_TSC - def_bool y -- depends on (MWINCHIP3D || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2 || MVIAC7 || MGEODEGX1 || MGEODE_LX || MCORE2 || MATOM) || X86_64 -+ depends on (MWINCHIP3D || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM \ -+ || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2 || MVIAC7 || MGEODEGX1 \ -+ || MGEODE_LX || MCORE2 || MATOM || MK8SSE3 || MK10 || MBARCELONA || MBOBCAT || MJAGUAR || MBULLDOZER \ -+ || MPILEDRIVER || MSTEAMROLLER || MEXCAVATOR || MZEN || MZEN2 || MZEN3 || MZEN4 || MZEN5 || MNEHALEM \ -+ || MWESTMERE || MSILVERMONT || MGOLDMONT || MGOLDMONTPLUS || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL \ -+ || MBROADWELL || MSKYLAKE || MSKYLAKEX || MCANNONLAKE || MICELAKE || MCASCADELAKE || MCOOPERLAKE \ -+ || MTIGERLAKE || MSAPPHIRERAPIDS || MROCKETLAKE || MALDERLAKE || MRAPTORLAKE || MMETEORLAKE || MEMERALDRAPIDS \ -+ || MNATIVE_INTEL || MNATIVE_AMD) || X86_64 - - config X86_HAVE_PAE - def_bool y -@@ -368,18 +753,37 @@ config X86_HAVE_PAE - - config X86_CMPXCHG64 - def_bool y -- depends on X86_HAVE_PAE || M586TSC || M586MMX || MK6 || MK7 -+ depends on X86_PAE || X86_64 || MCORE2 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 \ -+ || M586TSC || M586MMX || MATOM || MGEODE_LX || MGEODEGX1 || MK6 || MK7 || MK8 || MK8SSE3 || MK10 \ -+ || MBARCELONA || MBOBCAT || MJAGUAR || MBULLDOZER || MPILEDRIVER || MSTEAMROLLER || MEXCAVATOR || MZEN \ -+ || MZEN2 || MZEN3 || MZEN4 || MZEN5 || MNEHALEM || MWESTMERE || MSILVERMONT || MGOLDMONT || MGOLDMONTPLUS \ -+ || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE || MSKYLAKEX || MCANNONLAKE \ -+ || MICELAKE || MCASCADELAKE || MCOOPERLAKE || MTIGERLAKE || MSAPPHIRERAPIDS || MROCKETLAKE \ -+ || MALDERLAKE || MRAPTORLAKE || MMETEORLAKE || MEMERALDRAPIDS || MNATIVE_INTEL || MNATIVE_AMD - - # this should be set for all -march=.. options where the compiler - # generates cmov. - config X86_CMOV - def_bool y -- depends on (MK8 || MK7 || MCORE2 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MCRUSOE || MEFFICEON || X86_64 || MATOM || MGEODE_LX) -+ depends on (MK8 || MK7 || MCORE2 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 \ -+ || MVIAC3_2 || MVIAC7 || MCRUSOE || MEFFICEON || X86_64 || MATOM || MGEODE_LX || MK8SSE3 || MK10 \ -+ || MBARCELONA || MBOBCAT || MJAGUAR || MBULLDOZER || MPILEDRIVER || MSTEAMROLLER || MEXCAVATOR \ -+ || MZEN || MZEN2 || MZEN3 || MZEN4 || MZEN5 || MNEHALEM || MWESTMERE || MSILVERMONT || MGOLDMONT \ -+ || MGOLDMONTPLUS || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE || MSKYLAKEX \ -+ || MCANNONLAKE || MICELAKE || MCASCADELAKE || MCOOPERLAKE || MTIGERLAKE || MSAPPHIRERAPIDS \ -+ || MROCKETLAKE || MALDERLAKE || MRAPTORLAKE || MMETEORLAKE || MEMERALDRAPIDS || MNATIVE_INTEL || MNATIVE_AMD) - - config X86_MINIMUM_CPU_FAMILY - int - default "64" if X86_64 -- default "6" if X86_32 && (MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MEFFICEON || MATOM || MCORE2 || MK7 || MK8) -+ default "6" if X86_32 && (MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 \ -+ || MVIAC3_2 || MVIAC7 || MEFFICEON || MATOM || MCORE2 || MK7 || MK8 || MK8SSE3 \ -+ || MK10 || MBARCELONA || MBOBCAT || MJAGUAR || MBULLDOZER || MPILEDRIVER || MSTEAMROLLER \ -+ || MEXCAVATOR || MZEN || MZEN2 || MZEN3 || MZEN4 || MZEN5 || MNEHALEM || MWESTMERE || MSILVERMONT \ -+ || MGOLDMONT || MGOLDMONTPLUS || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL \ -+ || MSKYLAKE || MSKYLAKEX || MCANNONLAKE || MICELAKE || MCASCADELAKE || MCOOPERLAKE \ -+ || MTIGERLAKE || MSAPPHIRERAPIDS || MROCKETLAKE || MALDERLAKE || MRAPTORLAKE || MRAPTORLAKE \ -+ || MNATIVE_INTEL || MNATIVE_AMD) - default "5" if X86_32 && X86_CMPXCHG64 - default "4" - diff --git a/arch/x86/Makefile b/arch/x86/Makefile -index 801fd85c3ef6..93cc88b59cbb 100644 +index 801fd85c3ef69..26249f0f62c47 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile -@@ -176,8 +176,49 @@ else - # FIXME - should be integrated in Makefile.cpu (Makefile_32.cpu) - cflags-$(CONFIG_MK8) += -march=k8 +@@ -70,9 +70,9 @@ export BITS + # + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53383 + # +-KBUILD_CFLAGS += -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx ++KBUILD_CFLAGS += -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -mno-avx2 -mno-avx512f -fno-tree-vectorize + KBUILD_RUSTFLAGS += --target=$(objtree)/scripts/target.json +-KBUILD_RUSTFLAGS += -Ctarget-feature=-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-avx,-avx2 ++KBUILD_RUSTFLAGS += -Ctarget-feature=-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-avx,-avx2,-avx512f + + # + # CFLAGS for compiling floating point code inside the kernel. +@@ -178,14 +178,99 @@ else cflags-$(CONFIG_MPSC) += -march=nocona -- cflags-$(CONFIG_MCORE2) += -march=core2 -- cflags-$(CONFIG_MATOM) += -march=atom + cflags-$(CONFIG_MCORE2) += -march=core2 + cflags-$(CONFIG_MATOM) += -march=atom +- cflags-$(CONFIG_GENERIC_CPU) += -mtune=generic ++ ifeq ($(CONFIG_X86_64_VERSION),1) ++ cflags-$(CONFIG_GENERIC_CPU) += -mtune=generic ++ rustflags-$(CONFIG_GENERIC_CPU) += -Ztune-cpu=generic ++ else ++ cflags-$(CONFIG_GENERIC_CPU) += -march=x86-64-v$(CONFIG_X86_64_VERSION) ++ rustflags-$(CONFIG_GENERIC_CPU) += -Ctarget-cpu=x86-64-v$(CONFIG_X86_64_VERSION) ++ endif + cflags-$(CONFIG_MK8SSE3) += -march=k8-sse3 + cflags-$(CONFIG_MK10) += -march=amdfam10 + cflags-$(CONFIG_MBARCELONA) += -march=barcelona @@ -5375,7 +4112,7 @@ index 801fd85c3ef6..93cc88b59cbb 100644 + cflags-$(CONFIG_MZEN4) += -march=znver4 + cflags-$(CONFIG_MZEN5) += -march=znver5 + cflags-$(CONFIG_MNATIVE_INTEL) += -march=native -+ cflags-$(CONFIG_MNATIVE_AMD) += -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 @@ -5400,14 +4137,58 @@ index 801fd85c3ef6..93cc88b59cbb 100644 + cflags-$(CONFIG_MRAPTORLAKE) += -march=raptorlake + cflags-$(CONFIG_MMETEORLAKE) += -march=meteorlake + cflags-$(CONFIG_MEMERALDRAPIDS) += -march=emeraldrapids -+ cflags-$(CONFIG_GENERIC_CPU2) += -march=x86-64-v2 -+ cflags-$(CONFIG_GENERIC_CPU3) += -march=x86-64-v3 -+ cflags-$(CONFIG_GENERIC_CPU4) += -march=x86-64-v4 - cflags-$(CONFIG_GENERIC_CPU) += -mtune=generic KBUILD_CFLAGS += $(cflags-y) + 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_GENERIC_CPU) += -Ztune-cpu=generic ++ rustflags-$(CONFIG_MK8SSE3) += -Ctarget-cpu=k8-sse3 ++ rustflags-$(CONFIG_MK10) += -Ctarget-cpu=amdfam10 ++ rustflags-$(CONFIG_MBARCELONA) += -Ctarget-cpu=barcelona ++ rustflags-$(CONFIG_MBOBCAT) += -Ctarget-cpu=btver1 ++ rustflags-$(CONFIG_MJAGUAR) += -Ctarget-cpu=btver2 ++ rustflags-$(CONFIG_MBULLDOZER) += -Ctarget-cpu=bdver1 ++ rustflags-$(CONFIG_MPILEDRIVER) += -Ctarget-cpu=bdver2 ++ rustflags-$(CONFIG_MSTEAMROLLER) += -Ctarget-cpu=bdver3 ++ rustflags-$(CONFIG_MEXCAVATOR) += -Ctarget-cpu=bdver4 ++ rustflags-$(CONFIG_MZEN) += -Ctarget-cpu=znver1 ++ rustflags-$(CONFIG_MZEN2) += -Ctarget-cpu=znver2 ++ rustflags-$(CONFIG_MZEN3) += -Ctarget-cpu=znver3 ++ rustflags-$(CONFIG_MZEN4) += -Ctarget-cpu=znver4 ++ 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 ++ rustflags-$(CONFIG_MGOLDMONT) += -Ctarget-cpu=goldmont ++ rustflags-$(CONFIG_MGOLDMONTPLUS) += -Ctarget-cpu=goldmont-plus ++ rustflags-$(CONFIG_MSANDYBRIDGE) += -Ctarget-cpu=sandybridge ++ rustflags-$(CONFIG_MIVYBRIDGE) += -Ctarget-cpu=ivybridge ++ rustflags-$(CONFIG_MHASWELL) += -Ctarget-cpu=haswell ++ rustflags-$(CONFIG_MBROADWELL) += -Ctarget-cpu=broadwell ++ rustflags-$(CONFIG_MSKYLAKE) += -Ctarget-cpu=skylake ++ rustflags-$(CONFIG_MSKYLAKEX) += -Ctarget-cpu=skylake-avx512 ++ rustflags-$(CONFIG_MCANNONLAKE) += -Ctarget-cpu=cannonlake ++ rustflags-$(CONFIG_MICELAKE) += -Ctarget-cpu=icelake-client ++ rustflags-$(CONFIG_MCASCADELAKE) += -Ctarget-cpu=cascadelake ++ rustflags-$(CONFIG_MCOOPERLAKE) += -Ctarget-cpu=cooperlake ++ rustflags-$(CONFIG_MTIGERLAKE) += -Ctarget-cpu=tigerlake ++ rustflags-$(CONFIG_MSAPPHIRERAPIDS) += -Ctarget-cpu=sapphirerapids ++ rustflags-$(CONFIG_MROCKETLAKE) += -Ctarget-cpu=rocketlake ++ rustflags-$(CONFIG_MALDERLAKE) += -Ctarget-cpu=alderlake ++ rustflags-$(CONFIG_MRAPTORLAKE) += -Ctarget-cpu=raptorlake ++ rustflags-$(CONFIG_MMETEORLAKE) += -Ctarget-cpu=meteorlake ++ rustflags-$(CONFIG_MEMERALDRAPIDS) += -Ctarget-cpu=emeraldrapids + KBUILD_RUSTFLAGS += $(rustflags-y) + + KBUILD_CFLAGS += -mno-red-zone diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h -index b3ab80a03365..5e883b397ff3 100644 +index b3ab80a03365c..5e883b397ff3f 100644 --- a/arch/x86/include/asm/pci.h +++ b/arch/x86/include/asm/pci.h @@ -26,6 +26,7 @@ struct pci_sysdata { @@ -5431,7 +4212,7 @@ index b3ab80a03365..5e883b397ff3 100644 already-configured bus numbers - to be used for buggy BIOSes or architectures with incomplete PCI setup by the loader */ diff --git a/arch/x86/include/asm/vermagic.h b/arch/x86/include/asm/vermagic.h -index 75884d2cdec3..7acca9b5a9d5 100644 +index 75884d2cdec37..f4e29563473df 100644 --- a/arch/x86/include/asm/vermagic.h +++ b/arch/x86/include/asm/vermagic.h @@ -17,6 +17,54 @@ @@ -5489,7 +4270,7 @@ index 75884d2cdec3..7acca9b5a9d5 100644 #elif defined CONFIG_MATOM #define MODULE_PROC_FAMILY "ATOM " #elif defined CONFIG_M686 -@@ -35,6 +83,34 @@ +@@ -35,6 +83,28 @@ #define MODULE_PROC_FAMILY "K7 " #elif defined CONFIG_MK8 #define MODULE_PROC_FAMILY "K8 " @@ -5515,17 +4296,11 @@ index 75884d2cdec3..7acca9b5a9d5 100644 +#define MODULE_PROC_FAMILY "ZEN " +#elif defined CONFIG_MZEN2 +#define MODULE_PROC_FAMILY "ZEN2 " -+#elif defined CONFIG_MZEN3 -+#define MODULE_PROC_FAMILY "ZEN3 " -+#elif defined CONFIG_MZEN4 -+#define MODULE_PROC_FAMILY "ZEN4 " -+#elif defined CONFIG_MZEN5 -+#define MODULE_PROC_FAMILY "ZEN5 " #elif defined CONFIG_MELAN #define MODULE_PROC_FAMILY "ELAN " #elif defined CONFIG_MCRUSOE diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c -index ddb798603201..7c20387d8202 100644 +index ddb798603201e..7c20387d82029 100644 --- a/arch/x86/pci/common.c +++ b/arch/x86/pci/common.c @@ -723,12 +723,15 @@ int pci_ext_cfg_avail(void) @@ -5547,10 +4322,10 @@ index ddb798603201..7c20387d8202 100644 } -#endif diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c -index f9bc95f4488d..e85dd2bf39ed 100644 +index 36a4998c4b378..dc6afd534494d 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c -@@ -7705,6 +7705,7 @@ MODULE_ALIAS("bfq-iosched"); +@@ -7629,6 +7629,7 @@ MODULE_ALIAS("bfq-iosched"); static int __init bfq_init(void) { int ret; @@ -5558,7 +4333,7 @@ index f9bc95f4488d..e85dd2bf39ed 100644 #ifdef CONFIG_BFQ_GROUP_IOSCHED ret = blkcg_policy_register(&blkcg_policy_bfq); -@@ -7736,6 +7737,11 @@ static int __init bfq_init(void) +@@ -7660,6 +7661,11 @@ static int __init bfq_init(void) if (ret) goto slab_kill; @@ -5571,7 +4346,7 @@ index f9bc95f4488d..e85dd2bf39ed 100644 slab_kill: diff --git a/block/elevator.c b/block/elevator.c -index c355b55d0107..41cf94c3671e 100644 +index c355b55d01078..41cf94c3671ec 100644 --- a/block/elevator.c +++ b/block/elevator.c @@ -567,9 +567,19 @@ static struct elevator_type *elevator_get_default(struct request_queue *q) @@ -5595,7 +4370,7 @@ index c355b55d0107..41cf94c3671e 100644 /* diff --git a/drivers/Makefile b/drivers/Makefile -index fe9ceb0d2288..b58955caf19b 100644 +index fe9ceb0d2288a..b58955caf19bf 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -61,14 +61,8 @@ obj-y += char/ @@ -5628,7 +4403,7 @@ index fe9ceb0d2288..b58955caf19b 100644 obj-$(CONFIG_MTD) += mtd/ obj-$(CONFIG_SPI) += spi/ diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c -index a05c17249448..be4b54ff7e89 100644 +index a05c172494481..be4b54ff7e893 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -1618,7 +1618,7 @@ static irqreturn_t ahci_thunderx_irq_handler(int irq, void *dev_instance) @@ -5684,7 +4459,7 @@ index a05c17249448..be4b54ff7e89 100644 sysfs_add_file_to_group(&pdev->dev.kobj, &dev_attr_remapped_nvme.attr, diff --git a/drivers/cpufreq/Kconfig.x86 b/drivers/cpufreq/Kconfig.x86 -index 97c2d4f15d76..5a3af44d785a 100644 +index 97c2d4f15d76e..5a3af44d785a1 100644 --- a/drivers/cpufreq/Kconfig.x86 +++ b/drivers/cpufreq/Kconfig.x86 @@ -9,7 +9,6 @@ config X86_INTEL_PSTATE @@ -5704,7 +4479,7 @@ index 97c2d4f15d76..5a3af44d785a 100644 This driver adds a CPUFreq driver which utilizes a fine grain processor performance frequency control range instead of legacy diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c -index 04fc786dd2c0..f98c9438760c 100644 +index 04fc786dd2c09..f98c9438760c9 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -575,30 +575,11 @@ unsigned int cpufreq_policy_transition_delay_us(struct cpufreq_policy *policy) @@ -5743,7 +4518,7 @@ index 04fc786dd2c0..f98c9438760c 100644 EXPORT_SYMBOL_GPL(cpufreq_policy_transition_delay_us); diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c -index c0278d023cfc..7d92f16a430a 100644 +index c0278d023cfce..7d92f16a430a8 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -3568,6 +3568,8 @@ static int __init intel_pstate_setup(char *str) @@ -5756,7 +4531,7 @@ index c0278d023cfc..7d92f16a430a 100644 default_driver = &intel_pstate; else if (!strcmp(str, "passive")) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h -index 137a88b8de45..233c17537492 100644 +index 137a88b8de453..233c175374928 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h @@ -162,6 +162,7 @@ struct amdgpu_watchdog_timer { @@ -5768,7 +4543,7 @@ index 137a88b8de45..233c17537492 100644 extern int amdgpu_gart_size; extern int amdgpu_gtt_size; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c -index 094498a0964b..cddc33970d75 100644 +index 094498a0964b5..cddc33970d750 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -134,6 +134,7 @@ enum AMDGPU_DEBUG_MASK { @@ -5796,7 +4571,7 @@ index 094498a0964b..cddc33970d75 100644 * DOC: vramlimit (int) * Restrict the total amount of VRAM in MiB for testing. The default is 0 (Use full VRAM). diff --git a/drivers/gpu/drm/amd/display/Kconfig b/drivers/gpu/drm/amd/display/Kconfig -index df17e79c45c7..e454488c1a31 100644 +index df17e79c45c76..e454488c1a312 100644 --- a/drivers/gpu/drm/amd/display/Kconfig +++ b/drivers/gpu/drm/amd/display/Kconfig @@ -53,4 +53,10 @@ config DRM_AMD_SECURE_DISPLAY @@ -5811,7 +4586,7 @@ index df17e79c45c7..e454488c1a31 100644 + endmenu diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c -index 1e069fa5211e..f16a43106eb0 100644 +index 1e069fa5211ee..f16a43106eb0e 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -4408,7 +4408,7 @@ static int amdgpu_dm_mode_config_init(struct amdgpu_device *adev) @@ -5824,7 +4599,7 @@ index 1e069fa5211e..f16a43106eb0 100644 dc_state_release(state->context); kfree(state); diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c -index ebabfe3a512f..4d3ebcaacca1 100644 +index ebabfe3a512f4..4d3ebcaacca1b 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c @@ -97,7 +97,7 @@ static inline struct fixed31_32 amdgpu_dm_fixpt_from_s3132(__u64 x) @@ -5837,7 +4612,7 @@ index ebabfe3a512f..4d3ebcaacca1 100644 * * AMD driver supports pre-defined mathematical functions for transferring diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c -index 99014339aaa3..222f72b4c44f 100644 +index 99014339aaa39..222f72b4c44fc 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c @@ -426,7 +426,7 @@ static int amdgpu_dm_crtc_late_register(struct drm_crtc *crtc) @@ -5868,7 +4643,7 @@ index 99014339aaa3..222f72b4c44f 100644 #endif return 0; diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c -index 5cb11cc2d063..7e2020b0c0e8 100644 +index 5cb11cc2d0636..7e2020b0c0e8a 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c @@ -1568,7 +1568,7 @@ static void amdgpu_dm_plane_drm_plane_destroy_state(struct drm_plane *plane, @@ -5899,7 +4674,7 @@ index 5cb11cc2d063..7e2020b0c0e8 100644 #endif /* Create (reset) the plane state */ diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c b/drivers/gpu/drm/amd/pm/amdgpu_pm.c -index d5d6ab484e5a..dccba7bcdf97 100644 +index d5d6ab484e5ad..dccba7bcdf97c 100644 --- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c +++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c @@ -3272,6 +3272,9 @@ static ssize_t amdgpu_hwmon_show_power_cap_min(struct device *dev, @@ -5913,7 +4688,7 @@ index d5d6ab484e5a..dccba7bcdf97 100644 } diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c -index 2cf951184561..1a53bf05f8fc 100644 +index 2cf9511845618..1a53bf05f8fc4 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c @@ -2762,7 +2762,10 @@ int smu_get_power_limit(void *handle, @@ -5945,7 +4720,7 @@ index 2cf951184561..1a53bf05f8fc 100644 "New power limit (%d) is out of range [%d,%d]\n", limit, smu->min_power_limit, smu->max_power_limit); diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig -index a22f9125322a..44d863e0175e 100644 +index a22f9125322a7..44d863e0175e9 100644 --- a/drivers/i2c/busses/Kconfig +++ b/drivers/i2c/busses/Kconfig @@ -240,6 +240,15 @@ config I2C_CHT_WC @@ -5965,7 +4740,7 @@ index a22f9125322a..44d863e0175e 100644 tristate "Nvidia nForce2, nForce3 and nForce4" depends on PCI && HAS_IOPORT diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile -index 78d0561339e5..9ea3a294f9f0 100644 +index 78d0561339e5b..9ea3a294f9f02 100644 --- a/drivers/i2c/busses/Makefile +++ b/drivers/i2c/busses/Makefile @@ -20,6 +20,7 @@ obj-$(CONFIG_I2C_CHT_WC) += i2c-cht-wc.o @@ -5978,7 +4753,7 @@ index 78d0561339e5..9ea3a294f9f0 100644 obj-$(CONFIG_I2C_NVIDIA_GPU) += i2c-nvidia-gpu.o diff --git a/drivers/i2c/busses/i2c-nct6775.c b/drivers/i2c/busses/i2c-nct6775.c new file mode 100644 -index 000000000000..fdbd9a1c8d7a +index 0000000000000..fdbd9a1c8d7ae --- /dev/null +++ b/drivers/i2c/busses/i2c-nct6775.c @@ -0,0 +1,648 @@ @@ -6631,7 +5406,7 @@ index 000000000000..fdbd9a1c8d7a +module_init(i2c_nct6775_init); +module_exit(i2c_nct6775_exit); diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c -index 4e32d57ae0bf..a2deb7379904 100644 +index 4e32d57ae0bf3..a2deb73799047 100644 --- a/drivers/i2c/busses/i2c-piix4.c +++ b/drivers/i2c/busses/i2c-piix4.c @@ -569,11 +569,11 @@ static int piix4_transaction(struct i2c_adapter *piix4_adapter) @@ -6649,7 +5424,7 @@ index 4e32d57ae0bf..a2deb7379904 100644 /* If the SMBus is still busy, we give up */ if (timeout == MAX_TIMEOUT) { diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c -index a8ce3d140722..49729cf8c12f 100644 +index a8ce3d1407223..49729cf8c12f8 100644 --- a/drivers/input/evdev.c +++ b/drivers/input/evdev.c @@ -46,6 +46,7 @@ struct evdev_client { @@ -6713,7 +5488,7 @@ index a8ce3d140722..49729cf8c12f 100644 } diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c -index 348b4b26c272..708405b16687 100644 +index 348b4b26c2723..708405b166873 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c @@ -3310,6 +3310,11 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv) @@ -6729,7 +5504,7 @@ index 348b4b26c272..708405b16687 100644 if (ret < 0) goto bad; diff --git a/drivers/media/v4l2-core/Kconfig b/drivers/media/v4l2-core/Kconfig -index 331b8e535e5b..80dabeebf580 100644 +index 331b8e535e5bb..80dabeebf5804 100644 --- a/drivers/media/v4l2-core/Kconfig +++ b/drivers/media/v4l2-core/Kconfig @@ -40,6 +40,11 @@ config VIDEO_TUNER @@ -6745,7 +5520,7 @@ index 331b8e535e5b..80dabeebf580 100644 config V4L2_H264 tristate diff --git a/drivers/media/v4l2-core/Makefile b/drivers/media/v4l2-core/Makefile -index 2177b9d63a8f..c179507cedc4 100644 +index 2177b9d63a8ff..c179507cedc49 100644 --- a/drivers/media/v4l2-core/Makefile +++ b/drivers/media/v4l2-core/Makefile @@ -33,5 +33,7 @@ obj-$(CONFIG_V4L2_JPEG_HELPER) += v4l2-jpeg.o @@ -6758,7 +5533,7 @@ index 2177b9d63a8f..c179507cedc4 100644 obj-$(CONFIG_VIDEO_DEV) += v4l2-dv-timings.o videodev.o diff --git a/drivers/media/v4l2-core/v4l2loopback.c b/drivers/media/v4l2-core/v4l2loopback.c new file mode 100644 -index 000000000000..25cb1beb26e5 +index 0000000000000..25cb1beb26e50 --- /dev/null +++ b/drivers/media/v4l2-core/v4l2loopback.c @@ -0,0 +1,3184 @@ @@ -9948,7 +8723,7 @@ index 000000000000..25cb1beb26e5 +module_exit(v4l2loopback_cleanup_module); diff --git a/drivers/media/v4l2-core/v4l2loopback.h b/drivers/media/v4l2-core/v4l2loopback.h new file mode 100644 -index 000000000000..1bc7e6b747a4 +index 0000000000000..1bc7e6b747a40 --- /dev/null +++ b/drivers/media/v4l2-core/v4l2loopback.h @@ -0,0 +1,98 @@ @@ -10052,7 +8827,7 @@ index 000000000000..1bc7e6b747a4 +#endif /* _V4L2LOOPBACK_H */ diff --git a/drivers/media/v4l2-core/v4l2loopback_formats.h b/drivers/media/v4l2-core/v4l2loopback_formats.h new file mode 100644 -index 000000000000..d855a3796554 +index 0000000000000..d855a37965541 --- /dev/null +++ b/drivers/media/v4l2-core/v4l2loopback_formats.h @@ -0,0 +1,445 @@ @@ -10502,7 +9277,7 @@ index 000000000000..d855a3796554 +#endif /* V4L2_PIX_FMT_HEVC */ +}; diff --git a/drivers/pci/controller/Makefile b/drivers/pci/controller/Makefile -index 038ccbd9e3ba..de5e4f5145af 100644 +index 038ccbd9e3ba2..de5e4f5145af8 100644 --- a/drivers/pci/controller/Makefile +++ b/drivers/pci/controller/Makefile @@ -1,4 +1,10 @@ @@ -10518,7 +9293,7 @@ index 038ccbd9e3ba..de5e4f5145af 100644 obj-$(CONFIG_PCI_IXP4XX) += pci-ixp4xx.o diff --git a/drivers/pci/controller/intel-nvme-remap.c b/drivers/pci/controller/intel-nvme-remap.c new file mode 100644 -index 000000000000..e105e6f5cc91 +index 0000000000000..e105e6f5cc91d --- /dev/null +++ b/drivers/pci/controller/intel-nvme-remap.c @@ -0,0 +1,462 @@ @@ -10985,7 +9760,7 @@ index 000000000000..e105e6f5cc91 +MODULE_AUTHOR("Daniel Drake "); +MODULE_LICENSE("GPL v2"); diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c -index a2ce4e08edf5..7db97a14b34a 100644 +index a2ce4e08edf5a..7db97a14b34a3 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -3732,6 +3732,106 @@ static void quirk_no_bus_reset(struct pci_dev *dev) @@ -11104,7 +9879,7 @@ index a2ce4e08edf5..7db97a14b34a 100644 }; diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h -index d4d2f4d1d7cb..e0e19d9c1323 100644 +index d4d2f4d1d7cbd..e0e19d9c13231 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -577,12 +577,6 @@ static inline unsigned long cpufreq_scale(unsigned long old, u_int div, @@ -11120,27 +9895,8 @@ index d4d2f4d1d7cb..e0e19d9c1323 100644 struct cpufreq_governor { char name[CPUFREQ_NAME_LEN]; int (*init)(struct cpufreq_policy *policy); -diff --git a/include/linux/mm.h b/include/linux/mm.h -index 147073601716..9fafa99d56d1 100644 ---- a/include/linux/mm.h -+++ b/include/linux/mm.h -@@ -201,6 +201,14 @@ static inline void __mm_zero_struct_page(struct page *page) - - extern int sysctl_max_map_count; - -+extern bool sysctl_workingset_protection; -+extern u8 sysctl_anon_min_ratio; -+extern u8 sysctl_clean_low_ratio; -+extern u8 sysctl_clean_min_ratio; -+int vm_workingset_protection_update_handler( -+ const struct ctl_table *table, int write, -+ void __user *buffer, size_t *lenp, loff_t *ppos); -+ - extern unsigned long sysctl_user_reserve_kbytes; - extern unsigned long sysctl_admin_reserve_kbytes; - diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h -index d9c7edb6422b..b57c72793580 100644 +index d9c7edb6422bd..b57c72793580b 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -1264,7 +1264,7 @@ struct readahead_control { @@ -11153,7 +9909,7 @@ index d9c7edb6422b..b57c72793580 100644 void page_cache_ra_unbounded(struct readahead_control *, unsigned long nr_to_read, unsigned long lookahead_count); diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h -index 6030a8235617..60b7fe5fa74a 100644 +index 6030a82356173..60b7fe5fa74ad 100644 --- a/include/linux/user_namespace.h +++ b/include/linux/user_namespace.h @@ -156,6 +156,8 @@ static inline void set_userns_rlimit_max(struct user_namespace *ns, @@ -11174,8 +9930,28 @@ index 6030a8235617..60b7fe5fa74a 100644 static inline struct user_namespace *get_user_ns(struct user_namespace *ns) { return &init_user_ns; +diff --git a/include/linux/wait.h b/include/linux/wait.h +index 8aa3372f21a08..924778a426ce0 100644 +--- a/include/linux/wait.h ++++ b/include/linux/wait.h +@@ -163,6 +163,7 @@ static inline bool wq_has_sleeper(struct wait_queue_head *wq_head) + + extern void add_wait_queue(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry); + extern void add_wait_queue_exclusive(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry); ++extern void add_wait_queue_exclusive_lifo(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry); + extern void add_wait_queue_priority(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry); + extern void remove_wait_queue(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry); + +@@ -1191,6 +1192,7 @@ do { \ + */ + void prepare_to_wait(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry, int state); + bool prepare_to_wait_exclusive(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry, int state); ++void prepare_to_wait_exclusive_lifo(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry, int state); + long prepare_to_wait_event(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry, int state); + void finish_wait(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry); + long wait_woken(struct wait_queue_entry *wq_entry, unsigned mode, long timeout); diff --git a/init/Kconfig b/init/Kconfig -index 5783a0b87517..08a0d51afaae 100644 +index 5783a0b875172..08a0d51afaae4 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -134,6 +134,10 @@ config THREAD_INFO_IN_TASK @@ -11226,7 +10002,7 @@ index 5783a0b87517..08a0d51afaae 100644 bool "Optimize for size (-Os)" help diff --git a/kernel/Kconfig.hz b/kernel/Kconfig.hz -index 38ef6d06888e..0f78364efd4f 100644 +index 38ef6d06888ef..0f78364efd4f2 100644 --- a/kernel/Kconfig.hz +++ b/kernel/Kconfig.hz @@ -40,6 +40,27 @@ choice @@ -11268,7 +10044,7 @@ index 38ef6d06888e..0f78364efd4f 100644 config SCHED_HRTICK diff --git a/kernel/fork.c b/kernel/fork.c -index cc760491f201..238695afc630 100644 +index cc760491f2012..238695afc6304 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -105,6 +105,10 @@ @@ -11306,8 +10082,30 @@ index cc760491f201..238695afc630 100644 err = check_unshare_flags(unshare_flags); if (err) goto bad_unshare_out; +diff --git a/kernel/locking/rwsem.c b/kernel/locking/rwsem.c +index 33cac79e39946..3277df47ab3ca 100644 +--- a/kernel/locking/rwsem.c ++++ b/kernel/locking/rwsem.c +@@ -749,6 +749,7 @@ rwsem_spin_on_owner(struct rw_semaphore *sem) + struct task_struct *new, *owner; + unsigned long flags, new_flags; + enum owner_state state; ++ int i = 0; + + lockdep_assert_preemption_disabled(); + +@@ -785,7 +786,8 @@ rwsem_spin_on_owner(struct rw_semaphore *sem) + break; + } + +- cpu_relax(); ++ if (i++ > 1000) ++ cpu_relax(); + } + + return state; diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c -index 9057584ec06d..5dc714fd8a22 100644 +index 9057584ec06de..5dc714fd8a226 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -73,10 +73,19 @@ unsigned int sysctl_sched_tunable_scaling = SCHED_TUNABLESCALING_LOG; @@ -11344,7 +10142,7 @@ index 9057584ec06d..5dc714fd8a22 100644 #ifdef CONFIG_NUMA_BALANCING /* Restrict the NUMA promotion throughput (MB/s) for each target node. */ diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h -index 4c36cc680361..432b43aa091c 100644 +index 4c36cc6803617..432b43aa091cd 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -2591,7 +2591,7 @@ extern void deactivate_task(struct rq *rq, struct task_struct *p, int flags); @@ -11356,8 +10154,50 @@ index 4c36cc680361..432b43aa091c 100644 # define SCHED_NR_MIGRATE_BREAK 8 #else # define SCHED_NR_MIGRATE_BREAK 32 +diff --git a/kernel/sched/wait.c b/kernel/sched/wait.c +index 51e38f5f47018..c5cc616484bad 100644 +--- a/kernel/sched/wait.c ++++ b/kernel/sched/wait.c +@@ -47,6 +47,17 @@ void add_wait_queue_priority(struct wait_queue_head *wq_head, struct wait_queue_ + } + EXPORT_SYMBOL_GPL(add_wait_queue_priority); + ++void add_wait_queue_exclusive_lifo(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry) ++{ ++ unsigned long flags; ++ ++ wq_entry->flags |= WQ_FLAG_EXCLUSIVE; ++ spin_lock_irqsave(&wq_head->lock, flags); ++ __add_wait_queue(wq_head, wq_entry); ++ spin_unlock_irqrestore(&wq_head->lock, flags); ++} ++EXPORT_SYMBOL(add_wait_queue_exclusive_lifo); ++ + void remove_wait_queue(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry) + { + unsigned long flags; +@@ -258,6 +269,19 @@ prepare_to_wait_exclusive(struct wait_queue_head *wq_head, struct wait_queue_ent + } + EXPORT_SYMBOL(prepare_to_wait_exclusive); + ++void prepare_to_wait_exclusive_lifo(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry, int state) ++{ ++ unsigned long flags; ++ ++ wq_entry->flags |= WQ_FLAG_EXCLUSIVE; ++ spin_lock_irqsave(&wq_head->lock, flags); ++ if (list_empty(&wq_entry->entry)) ++ __add_wait_queue(wq_head, wq_entry); ++ set_current_state(state); ++ spin_unlock_irqrestore(&wq_head->lock, flags); ++} ++EXPORT_SYMBOL(prepare_to_wait_exclusive_lifo); ++ + void init_wait_entry(struct wait_queue_entry *wq_entry, int flags) + { + wq_entry->flags = flags; diff --git a/kernel/sysctl.c b/kernel/sysctl.c -index 79e6cb1d5c48..4a62ae02a2c0 100644 +index 79e6cb1d5c48f..676e89dc38c33 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -80,6 +80,9 @@ @@ -11386,49 +10226,8 @@ index 79e6cb1d5c48..4a62ae02a2c0 100644 #ifdef CONFIG_PROC_SYSCTL { .procname = "tainted", -@@ -2198,6 +2210,40 @@ static struct ctl_table vm_table[] = { - .extra1 = SYSCTL_ZERO, - }, - #endif -+ { -+ .procname = "workingset_protection", -+ .data = &sysctl_workingset_protection, -+ .maxlen = sizeof(bool), -+ .mode = 0644, -+ .proc_handler = &proc_dobool, -+ }, -+ { -+ .procname = "anon_min_ratio", -+ .data = &sysctl_anon_min_ratio, -+ .maxlen = sizeof(u8), -+ .mode = 0644, -+ .proc_handler = &vm_workingset_protection_update_handler, -+ .extra1 = SYSCTL_ZERO, -+ .extra2 = SYSCTL_ONE_HUNDRED, -+ }, -+ { -+ .procname = "clean_low_ratio", -+ .data = &sysctl_clean_low_ratio, -+ .maxlen = sizeof(u8), -+ .mode = 0644, -+ .proc_handler = &vm_workingset_protection_update_handler, -+ .extra1 = SYSCTL_ZERO, -+ .extra2 = SYSCTL_ONE_HUNDRED, -+ }, -+ { -+ .procname = "clean_min_ratio", -+ .data = &sysctl_clean_min_ratio, -+ .maxlen = sizeof(u8), -+ .mode = 0644, -+ .proc_handler = &vm_workingset_protection_update_handler, -+ .extra1 = SYSCTL_ZERO, -+ .extra2 = SYSCTL_ONE_HUNDRED, -+ }, - { - .procname = "user_reserve_kbytes", - .data = &sysctl_user_reserve_kbytes, diff --git a/kernel/user_namespace.c b/kernel/user_namespace.c -index 0b0b95418b16..c4b835b91fc0 100644 +index 0b0b95418b16a..c4b835b91fc00 100644 --- a/kernel/user_namespace.c +++ b/kernel/user_namespace.c @@ -22,6 +22,13 @@ @@ -11446,80 +10245,10 @@ index 0b0b95418b16..c4b835b91fc0 100644 static DEFINE_MUTEX(userns_state_mutex); diff --git a/mm/Kconfig b/mm/Kconfig -index b72e7d040f78..432f517fef8c 100644 +index b72e7d040f789..8feaa692ec87c 100644 --- a/mm/Kconfig +++ b/mm/Kconfig -@@ -492,6 +492,69 @@ config ARCH_WANT_OPTIMIZE_DAX_VMEMMAP - config ARCH_WANT_OPTIMIZE_HUGETLB_VMEMMAP - bool - -+config ANON_MIN_RATIO -+ int "Default value for vm.anon_min_ratio" -+ depends on SYSCTL -+ range 0 100 -+ default 15 -+ help -+ This option sets the default value for vm.anon_min_ratio sysctl knob. -+ -+ The vm.anon_min_ratio sysctl knob provides *hard* protection of -+ anonymous pages. The anonymous pages on the current node won't be -+ reclaimed under any conditions when their amount is below -+ vm.anon_min_ratio. This knob may be used to prevent excessive swap -+ thrashing when anonymous memory is low (for example, when memory is -+ going to be overfilled by compressed data of zram module). -+ -+ Setting this value too high (close to MemTotal) can result in -+ inability to swap and can lead to early OOM under memory pressure. -+ -+config CLEAN_LOW_RATIO -+ int "Default value for vm.clean_low_ratio" -+ depends on SYSCTL -+ range 0 100 -+ default 0 -+ help -+ This option sets the default value for vm.clean_low_ratio sysctl knob. -+ -+ The vm.clean_low_ratio sysctl knob provides *best-effort* -+ protection of clean file pages. The file pages on the current node -+ won't be reclaimed under memory pressure when the amount of clean file -+ pages is below vm.clean_low_ratio *unless* we threaten to OOM. -+ Protection of clean file pages using this knob may be used when -+ swapping is still possible to -+ - prevent disk I/O thrashing under memory pressure; -+ - improve performance in disk cache-bound tasks under memory -+ pressure. -+ -+ Setting it to a high value may result in a early eviction of anonymous -+ pages into the swap space by attempting to hold the protected amount -+ of clean file pages in memory. -+ -+config CLEAN_MIN_RATIO -+ int "Default value for vm.clean_min_ratio" -+ depends on SYSCTL -+ range 0 100 -+ default 15 -+ help -+ This option sets the default value for vm.clean_min_ratio sysctl knob. -+ -+ The vm.clean_min_ratio sysctl knob provides *hard* protection of -+ clean file pages. The file pages on the current node won't be -+ reclaimed under memory pressure when the amount of clean file pages is -+ below vm.clean_min_ratio. Hard protection of clean file pages using -+ this knob may be used to -+ - prevent disk I/O thrashing under memory pressure even with no free -+ swap space; -+ - improve performance in disk cache-bound tasks under memory -+ pressure; -+ - avoid high latency and prevent livelock in near-OOM conditions. -+ -+ Setting it to a high value may result in a early out-of-memory condition -+ due to the inability to reclaim the protected amount of clean file pages -+ when other types of pages cannot be reclaimed. -+ - config HAVE_MEMBLOCK_PHYS_MAP - bool - -@@ -636,7 +699,7 @@ config COMPACTION +@@ -636,7 +636,7 @@ config COMPACTION config COMPACT_UNEVICTABLE_DEFAULT int depends on COMPACTION @@ -11529,7 +10258,7 @@ index b72e7d040f78..432f517fef8c 100644 # diff --git a/mm/compaction.c b/mm/compaction.c -index eb95e9b435d0..ae03cdc3e76e 100644 +index eb95e9b435d0f..ae03cdc3e76e4 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -1950,7 +1950,11 @@ static int sysctl_compact_unevictable_allowed __read_mostly = CONFIG_COMPACT_UNE @@ -11545,7 +10274,7 @@ index eb95e9b435d0..ae03cdc3e76e 100644 static int __read_mostly sysctl_compact_memory; diff --git a/mm/huge_memory.c b/mm/huge_memory.c -index 67c86a5d64a6..90bc49d1ca92 100644 +index 67c86a5d64a6a..90bc49d1ca922 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -64,7 +64,11 @@ unsigned long transparent_hugepage_flags __read_mostly = @@ -11560,20 +10289,8 @@ index 67c86a5d64a6..90bc49d1ca92 100644 (1<clean_below_min : sc->anon_below_min) -+ goto keep_locked; -+ - /* - * The number of dirty pages determines if a node is marked - * reclaim_congested. kswapd will stall and start writing -@@ -2391,6 +2416,15 @@ static void get_scan_count(struct lruvec *lruvec, struct scan_control *sc, - goto out; - } - -+ /* -+ * Force-scan anon if clean file pages is under vm.clean_low_ratio -+ * or vm.clean_min_ratio. -+ */ -+ if (sc->clean_below_low || sc->clean_below_min) { -+ scan_balance = SCAN_ANON; -+ goto out; -+ } -+ - /* - * If there is enough inactive page cache, we do not reclaim - * anything from the anonymous working right now. -@@ -2535,6 +2569,14 @@ static void get_scan_count(struct lruvec *lruvec, struct scan_control *sc, - BUG(); - } - -+ /* -+ * Hard protection of the working set. -+ * Don't reclaim anon/file pages when the amount is -+ * below the watermark of the same type. -+ */ -+ if (file ? sc->clean_below_min : sc->anon_below_min) -+ scan = 0; -+ - nr[lru] = scan; - } - } -@@ -3968,7 +4010,11 @@ static bool lruvec_is_reclaimable(struct lruvec *lruvec, struct scan_control *sc +@@ -3968,7 +3972,11 @@ static bool lruvec_is_reclaimable(struct lruvec *lruvec, struct scan_control *sc } /* to protect the working set of the last N jiffies */ @@ -11750,132 +10398,21 @@ index bd489c1af228..fb8fc07523b9 100644 static void lru_gen_age_node(struct pglist_data *pgdat, struct scan_control *sc) { -@@ -4006,6 +4052,96 @@ static void lru_gen_age_node(struct pglist_data *pgdat, struct scan_control *sc) - } - } - -+int vm_workingset_protection_update_handler(const struct ctl_table *table, int write, -+ void __user *buffer, size_t *lenp, loff_t *ppos) -+{ -+ int ret = proc_dou8vec_minmax(table, write, buffer, lenp, ppos); -+ if (ret || !write) -+ return ret; -+ -+ workingset_protection_prev_totalram = 0; -+ -+ return 0; -+} -+ -+static void prepare_workingset_protection(pg_data_t *pgdat, struct scan_control *sc) -+{ -+ unsigned long node_mem_total; -+ struct sysinfo i; -+ -+ if (!(sysctl_workingset_protection)) { -+ sc->anon_below_min = 0; -+ sc->clean_below_low = 0; -+ sc->clean_below_min = 0; -+ return; -+ } -+ -+ if (likely(sysctl_anon_min_ratio || -+ sysctl_clean_low_ratio || -+ sysctl_clean_min_ratio)) { -+#ifdef CONFIG_NUMA -+ si_meminfo_node(&i, pgdat->node_id); -+#else //CONFIG_NUMA -+ si_meminfo(&i); -+#endif //CONFIG_NUMA -+ node_mem_total = i.totalram; -+ -+ if (unlikely(workingset_protection_prev_totalram != node_mem_total)) { -+ sysctl_anon_min_ratio_kb = -+ node_mem_total * sysctl_anon_min_ratio / 100; -+ sysctl_clean_low_ratio_kb = -+ node_mem_total * sysctl_clean_low_ratio / 100; -+ sysctl_clean_min_ratio_kb = -+ node_mem_total * sysctl_clean_min_ratio / 100; -+ workingset_protection_prev_totalram = node_mem_total; -+ } -+ } -+ -+ /* -+ * Check the number of anonymous pages to protect them from -+ * reclaiming if their amount is below the specified. -+ */ -+ if (sysctl_anon_min_ratio) { -+ unsigned long reclaimable_anon; -+ -+ reclaimable_anon = -+ node_page_state(pgdat, NR_ACTIVE_ANON) + -+ node_page_state(pgdat, NR_INACTIVE_ANON) + -+ node_page_state(pgdat, NR_ISOLATED_ANON); -+ -+ sc->anon_below_min = reclaimable_anon < sysctl_anon_min_ratio_kb; -+ } else -+ sc->anon_below_min = 0; -+ -+ /* -+ * Check the number of clean file pages to protect them from -+ * reclaiming if their amount is below the specified. -+ */ -+ if (sysctl_clean_low_ratio || sysctl_clean_min_ratio) { -+ unsigned long reclaimable_file, dirty, clean; -+ -+ reclaimable_file = -+ node_page_state(pgdat, NR_ACTIVE_FILE) + -+ node_page_state(pgdat, NR_INACTIVE_FILE) + -+ node_page_state(pgdat, NR_ISOLATED_FILE); -+ dirty = node_page_state(pgdat, NR_FILE_DIRTY); -+ /* -+ * node_page_state() sum can go out of sync since -+ * all the values are not read at once. -+ */ -+ if (likely(reclaimable_file > dirty)) -+ clean = reclaimable_file - dirty; -+ else -+ clean = 0; -+ -+ sc->clean_below_low = clean < sysctl_clean_low_ratio_kb; -+ sc->clean_below_min = clean < sysctl_clean_min_ratio_kb; -+ } else { -+ sc->clean_below_low = 0; -+ sc->clean_below_min = 0; -+ } -+} -+ - /****************************************************************************** - * rmap/PT walk feedback - ******************************************************************************/ -@@ -4499,6 +4635,8 @@ static int isolate_folios(struct lruvec *lruvec, struct scan_control *sc, int sw +diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c +index 64d07b842e736..a0ac138e7bf88 100644 +--- a/net/ipv4/inet_connection_sock.c ++++ b/net/ipv4/inet_connection_sock.c +@@ -634,7 +634,7 @@ static int inet_csk_wait_for_connect(struct sock *sk, long timeo) + * having to remove and re-insert us on the wait queue. */ - if (!swappiness) - type = LRU_GEN_FILE; -+ else if (sc->clean_below_low || sc->clean_below_min) -+ type = LRU_GEN_ANON; - else if (min_seq[LRU_GEN_ANON] < min_seq[LRU_GEN_FILE]) - type = LRU_GEN_ANON; - else if (swappiness == 1) -@@ -4778,6 +4916,8 @@ static int shrink_one(struct lruvec *lruvec, struct scan_control *sc) - struct mem_cgroup *memcg = lruvec_memcg(lruvec); - struct pglist_data *pgdat = lruvec_pgdat(lruvec); - -+ prepare_workingset_protection(pgdat, sc); -+ - /* lru_gen_age_node() called mem_cgroup_calculate_protection() */ - if (mem_cgroup_below_min(NULL, memcg)) - return MEMCG_LRU_YOUNG; -@@ -5925,6 +6065,8 @@ static void shrink_node(pg_data_t *pgdat, struct scan_control *sc) - - prepare_scan_control(pgdat, sc); - -+ prepare_workingset_protection(pgdat, sc); -+ - shrink_node_memcgs(pgdat, sc); - - flush_reclaim_state(sc); + for (;;) { +- prepare_to_wait_exclusive(sk_sleep(sk), &wait, ++ prepare_to_wait_exclusive_lifo(sk_sleep(sk), &wait, + TASK_INTERRUPTIBLE); + release_sock(sk); + if (reqsk_queue_empty(&icsk->icsk_accept_queue)) diff --git a/scripts/Makefile.package b/scripts/Makefile.package -index 4a80584ec771..11d53f240a2b 100644 +index 4a80584ec7712..11d53f240a2bc 100644 --- a/scripts/Makefile.package +++ b/scripts/Makefile.package @@ -147,8 +147,7 @@ snap-pkg: @@ -11889,7 +10426,7 @@ index 4a80584ec771..11d53f240a2b 100644 KBUILD_MAKEFLAGS="$(MAKEFLAGS)" \ KBUILD_REVISION="$(shell $(srctree)/scripts/build-version)" \ diff --git a/scripts/package/PKGBUILD b/scripts/package/PKGBUILD -index 663ce300dd06..f83493838cf9 100644 +index 663ce300dd06d..f83493838cf96 100644 --- a/scripts/package/PKGBUILD +++ b/scripts/package/PKGBUILD @@ -3,10 +3,13 @@ @@ -11993,25 +10530,27 @@ index 663ce300dd06..f83493838cf9 100644 eval "package_$_p() { $(declare -f "_package${_p#$pkgbase}") -- -2.46.1 +2.47.0.rc0 -From 72728b1ad0206a7eb9048237818eeed6c4a37119 Mon Sep 17 00:00:00 2001 -From: Eric Naim -Date: Thu, 19 Sep 2024 23:21:22 +0800 -Subject: [PATCH 05/11] fixes +From e11c05750027d05a3d091f065afb695876963546 Mon Sep 17 00:00:00 2001 +From: Peter Jung +Date: Mon, 30 Sep 2024 16:55:12 +0200 +Subject: [PATCH 04/10] fixes -Signed-off-by: Eric Naim +Signed-off-by: Peter Jung --- - arch/Kconfig | 4 +- - arch/x86/include/asm/apic.h | 8 -- - arch/x86/kernel/amd_nb.c | 4 + - arch/x86/kernel/apic/apic_flat_64.c | 119 ++------------------------- - block/elevator.c | 4 +- - drivers/powercap/intel_rapl_common.c | 1 + - 6 files changed, 17 insertions(+), 123 deletions(-) + arch/Kconfig | 4 +- + arch/x86/include/asm/apic.h | 8 -- + arch/x86/kernel/amd_nb.c | 4 + + arch/x86/kernel/apic/apic_flat_64.c | 119 ++---------------------- + arch/x86/kernel/cpu/amd.c | 3 +- + block/elevator.c | 4 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 5 + + fs/btrfs/send.c | 8 +- + 8 files changed, 28 insertions(+), 127 deletions(-) diff --git a/arch/Kconfig b/arch/Kconfig -index 975dd22a2dbd..de69b8f5b5be 100644 +index 975dd22a2dbd2..de69b8f5b5be8 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -1050,7 +1050,7 @@ config ARCH_MMAP_RND_BITS @@ -12033,7 +10572,7 @@ index 975dd22a2dbd..de69b8f5b5be 100644 help This value can be used to select the number of bits to use to diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h -index 9327eb00e96d..be2045a18e69 100644 +index 9327eb00e96d0..be2045a18e69b 100644 --- a/arch/x86/include/asm/apic.h +++ b/arch/x86/include/asm/apic.h @@ -345,20 +345,12 @@ extern struct apic *apic; @@ -12058,7 +10597,7 @@ index 9327eb00e96d..be2045a18e69 100644 /* diff --git a/arch/x86/kernel/amd_nb.c b/arch/x86/kernel/amd_nb.c -index 059e5c16af05..e8c3d65aee60 100644 +index 059e5c16af054..e8c3d65aee60b 100644 --- a/arch/x86/kernel/amd_nb.c +++ b/arch/x86/kernel/amd_nb.c @@ -43,6 +43,8 @@ @@ -12080,7 +10619,7 @@ index 059e5c16af05..e8c3d65aee60 100644 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_MI300_DF_F4) }, {} diff --git a/arch/x86/kernel/apic/apic_flat_64.c b/arch/x86/kernel/apic/apic_flat_64.c -index f37ad3392fec..e0308d8c4e6c 100644 +index f37ad3392fec9..e0308d8c4e6c2 100644 --- a/arch/x86/kernel/apic/apic_flat_64.c +++ b/arch/x86/kernel/apic/apic_flat_64.c @@ -8,129 +8,25 @@ @@ -12237,8 +10776,20 @@ index f37ad3392fec..e0308d8c4e6c 100644 -apic_drivers(apic_physflat, apic_flat); +struct apic *apic __ro_after_init = &apic_physflat; +EXPORT_SYMBOL_GPL(apic); +diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c +index 1e0fe5f8ab84e..65b2f0c5ec2d5 100644 +--- a/arch/x86/kernel/cpu/amd.c ++++ b/arch/x86/kernel/cpu/amd.c +@@ -1218,5 +1218,6 @@ void amd_check_microcode(void) + if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD) + return; + +- on_each_cpu(zenbleed_check_cpu, NULL, 1); ++ if (boot_cpu_has(X86_FEATURE_ZEN2)) ++ on_each_cpu(zenbleed_check_cpu, NULL, 1); + } diff --git a/block/elevator.c b/block/elevator.c -index 41cf94c3671e..cd630e991eae 100644 +index 41cf94c3671ec..cd630e991eaea 100644 --- a/block/elevator.c +++ b/block/elevator.c @@ -725,7 +725,9 @@ int elv_iosched_load_module(struct gendisk *disk, const char *buf, @@ -12252,27 +10803,119 @@ index 41cf94c3671e..cd630e991eae 100644 } ssize_t elv_iosched_store(struct gendisk *disk, const char *buf, -diff --git a/drivers/powercap/intel_rapl_common.c b/drivers/powercap/intel_rapl_common.c -index 3cffa6c79538..8b7a5a31e8c1 100644 ---- a/drivers/powercap/intel_rapl_common.c -+++ b/drivers/powercap/intel_rapl_common.c -@@ -1285,6 +1285,7 @@ static const struct x86_cpu_id rapl_ids[] __initconst = { +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +index cddc33970d750..8bf31cbde0cdb 100644 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +@@ -3055,6 +3055,11 @@ static int __init amdgpu_init(void) + /* Ignore KFD init failures. Normal when CONFIG_HSA_AMD is not set. */ + amdgpu_amdkfd_init(); - X86_MATCH_VENDOR_FAM(AMD, 0x17, &rapl_defaults_amd), - X86_MATCH_VENDOR_FAM(AMD, 0x19, &rapl_defaults_amd), -+ X86_MATCH_VENDOR_FAM(AMD, 0x1A, &rapl_defaults_amd), - X86_MATCH_VENDOR_FAM(HYGON, 0x18, &rapl_defaults_amd), - {} ++ if (amdgpu_pp_feature_mask & PP_OVERDRIVE_MASK) { ++ add_taint(TAINT_CPU_OUT_OF_SPEC, LOCKDEP_STILL_OK); ++ pr_crit("Overdrive is enabled, please disable it before reporting any bugs.\n"); ++ } ++ + /* let modprobe override vga console setting */ + return pci_register_driver(&amdgpu_kms_pci_driver); + +diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c +index 619fa0b8b3f6f..f3de12a31c380 100644 +--- a/fs/btrfs/send.c ++++ b/fs/btrfs/send.c +@@ -346,8 +346,10 @@ struct name_cache_entry { + u64 parent_gen; + int ret; + int need_later_update; ++ /* Name length without NUL terminator. */ + int name_len; +- char name[] __counted_by(name_len); ++ /* Not NUL terminated. */ ++ char name[] __counted_by(name_len) __nonstring; }; + + /* See the comment at lru_cache.h about struct btrfs_lru_cache_entry. */ +@@ -2388,7 +2390,7 @@ static int __get_cur_name_and_parent(struct send_ctx *sctx, + /* + * Store the result of the lookup in the name cache. + */ +- nce = kmalloc(sizeof(*nce) + fs_path_len(dest) + 1, GFP_KERNEL); ++ nce = kmalloc(sizeof(*nce) + fs_path_len(dest), GFP_KERNEL); + if (!nce) { + ret = -ENOMEM; + goto out; +@@ -2400,7 +2402,7 @@ static int __get_cur_name_and_parent(struct send_ctx *sctx, + nce->parent_gen = *parent_gen; + nce->name_len = fs_path_len(dest); + nce->ret = ret; +- strcpy(nce->name, dest->start); ++ memcpy(nce->name, dest->start, nce->name_len); + + if (ino < sctx->send_progress) + nce->need_later_update = 0; -- -2.46.1 +2.47.0.rc0 -From bcd25ccd10f46e269dd7d9a2217af6a33bf7deaa Mon Sep 17 00:00:00 2001 -From: Eric Naim -Date: Thu, 19 Sep 2024 23:21:44 +0800 -Subject: [PATCH 06/11] intel-pstate +From ad604f0a4c040dcb8faf44dc72db25e457c28076 Mon Sep 17 00:00:00 2001 +From: Thomas Zimmermann +Date: Tue, 24 Sep 2024 10:41:03 +0200 +Subject: [PATCH] firmware/sysfb: Disable sysfb for firmware buffers with + unknown parent -Signed-off-by: Eric Naim +The sysfb framebuffer handling only operates on graphics devices +that provide the system's firmware framebuffer. If that device is +not known, assume that any graphics device has been initialized by +firmware. + +Fixes a problem on i915 where sysfb does not release the firmware +framebuffer after the native graphics driver loaded. + +Reported-by: Borah, Chaitanya Kumar +Closes: https://lore.kernel.org/dri-devel/SJ1PR11MB6129EFB8CE63D1EF6D932F94B96F2@SJ1PR11MB6129.namprd11.prod.outlook.com/ +Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/12160 +Signed-off-by: Thomas Zimmermann +Fixes: b49420d6a1ae ("video/aperture: optionally match the device in sysfb_disable()") +Cc: Javier Martinez Canillas +Cc: Thomas Zimmermann +Cc: Helge Deller +Cc: Sam Ravnborg +Cc: Daniel Vetter +Cc: Alex Deucher +Cc: dri-devel@lists.freedesktop.org +Cc: Linux regression tracking (Thorsten Leemhuis) +Cc: # v6.11+ +Acked-by: Alex Deucher +Reviewed-by: Javier Martinez Canillas +Link: https://patchwork.freedesktop.org/patch/msgid/20240924084227.262271-1-tzimmermann@suse.de +--- + drivers/firmware/sysfb.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/firmware/sysfb.c b/drivers/firmware/sysfb.c +index 02a07d3d0d40a..a3df782fa687b 100644 +--- a/drivers/firmware/sysfb.c ++++ b/drivers/firmware/sysfb.c +@@ -67,9 +67,11 @@ static bool sysfb_unregister(void) + void sysfb_disable(struct device *dev) + { + struct screen_info *si = &screen_info; ++ struct device *parent; + + mutex_lock(&disable_lock); +- if (!dev || dev == sysfb_parent_dev(si)) { ++ parent = sysfb_parent_dev(si); ++ if (!dev || !parent || dev == parent) { + sysfb_unregister(); + disabled = true; + } +-- +GitLab +From fdfdeaa0dbceb2960e0233037887a1464eb91262 Mon Sep 17 00:00:00 2001 +From: Peter Jung +Date: Mon, 30 Sep 2024 16:55:24 +0200 +Subject: [PATCH 05/10] intel-pstate + +Signed-off-by: Peter Jung --- arch/x86/include/asm/topology.h | 13 ++ arch/x86/kernel/cpu/aperfmperf.c | 89 +++++++++++- @@ -12280,7 +10923,7 @@ Signed-off-by: Eric Naim 3 files changed, 328 insertions(+), 6 deletions(-) diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h -index abe3a8f22cbd..aef70336d624 100644 +index abe3a8f22cbd9..aef70336d6247 100644 --- a/arch/x86/include/asm/topology.h +++ b/arch/x86/include/asm/topology.h @@ -282,9 +282,22 @@ static inline long arch_scale_freq_capacity(int cpu) @@ -12307,7 +10950,7 @@ index abe3a8f22cbd..aef70336d624 100644 static inline void freq_invariance_set_perf_ratio(u64 ratio, bool turbo_disabled) { } #endif diff --git a/arch/x86/kernel/cpu/aperfmperf.c b/arch/x86/kernel/cpu/aperfmperf.c -index 0b69bfbf345d..ec07678c641b 100644 +index 0b69bfbf345d0..ec07678c641b7 100644 --- a/arch/x86/kernel/cpu/aperfmperf.c +++ b/arch/x86/kernel/cpu/aperfmperf.c @@ -349,9 +349,89 @@ static DECLARE_WORK(disable_freq_invariance_work, @@ -12416,7 +11059,7 @@ index 0b69bfbf345d..ec07678c641b 100644 freq_scale = div64_u64(acnt, mcnt); diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c -index 7d92f16a430a..86ad1fed71f1 100644 +index 7d92f16a430a8..86ad1fed71f1a 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -16,6 +16,7 @@ @@ -12749,14 +11392,14 @@ index 7d92f16a430a..86ad1fed71f1 100644 } -- -2.46.1 +2.47.0.rc0 -From eb003fb17cb5145d650125d3e52db93a6902524c Mon Sep 17 00:00:00 2001 -From: Eric Naim -Date: Thu, 19 Sep 2024 23:22:02 +0800 -Subject: [PATCH 07/11] ksm +From e47c2bad2a96e99ad1a3f85cbc283adf394c0524 Mon Sep 17 00:00:00 2001 +From: Peter Jung +Date: Mon, 30 Sep 2024 16:55:34 +0200 +Subject: [PATCH 06/10] ksm -Signed-off-by: Eric Naim +Signed-off-by: Peter Jung --- arch/alpha/kernel/syscalls/syscall.tbl | 3 + arch/arm/tools/syscall.tbl | 3 + @@ -12775,15 +11418,15 @@ Signed-off-by: Eric Naim arch/xtensa/kernel/syscalls/syscall.tbl | 3 + include/linux/syscalls.h | 3 + include/uapi/asm-generic/unistd.h | 9 +- - kernel/sys.c | 147 ++++++++++++++++++ + kernel/sys.c | 138 ++++++++++++++++++ kernel/sys_ni.c | 3 + scripts/syscall.tbl | 3 + .../arch/powerpc/entry/syscalls/syscall.tbl | 3 + .../perf/arch/s390/entry/syscalls/syscall.tbl | 3 + - 22 files changed, 215 insertions(+), 1 deletion(-) + 22 files changed, 206 insertions(+), 1 deletion(-) diff --git a/arch/alpha/kernel/syscalls/syscall.tbl b/arch/alpha/kernel/syscalls/syscall.tbl -index 74720667fe09..e6a11f3c0a2e 100644 +index 74720667fe091..e6a11f3c0a2e3 100644 --- a/arch/alpha/kernel/syscalls/syscall.tbl +++ b/arch/alpha/kernel/syscalls/syscall.tbl @@ -502,3 +502,6 @@ @@ -12794,7 +11437,7 @@ index 74720667fe09..e6a11f3c0a2e 100644 +574 common process_ksm_disable sys_process_ksm_disable +575 common process_ksm_status sys_process_ksm_status diff --git a/arch/arm/tools/syscall.tbl b/arch/arm/tools/syscall.tbl -index 23c98203c40f..10a3099decbe 100644 +index 23c98203c40fe..10a3099decbe3 100644 --- a/arch/arm/tools/syscall.tbl +++ b/arch/arm/tools/syscall.tbl @@ -477,3 +477,6 @@ @@ -12805,7 +11448,7 @@ index 23c98203c40f..10a3099decbe 100644 +464 common process_ksm_disable sys_process_ksm_disable +465 common process_ksm_status sys_process_ksm_status diff --git a/arch/m68k/kernel/syscalls/syscall.tbl b/arch/m68k/kernel/syscalls/syscall.tbl -index 22a3cbd4c602..12d2c7594bf0 100644 +index 22a3cbd4c6029..12d2c7594bf0b 100644 --- a/arch/m68k/kernel/syscalls/syscall.tbl +++ b/arch/m68k/kernel/syscalls/syscall.tbl @@ -462,3 +462,6 @@ @@ -12816,7 +11459,7 @@ index 22a3cbd4c602..12d2c7594bf0 100644 +464 common process_ksm_disable sys_process_ksm_disable +465 common process_ksm_status sys_process_ksm_status diff --git a/arch/microblaze/kernel/syscalls/syscall.tbl b/arch/microblaze/kernel/syscalls/syscall.tbl -index 2b81a6bd78b2..e2a93c856eed 100644 +index 2b81a6bd78b29..e2a93c856eede 100644 --- a/arch/microblaze/kernel/syscalls/syscall.tbl +++ b/arch/microblaze/kernel/syscalls/syscall.tbl @@ -468,3 +468,6 @@ @@ -12827,7 +11470,7 @@ index 2b81a6bd78b2..e2a93c856eed 100644 +464 common process_ksm_disable sys_process_ksm_disable +465 common process_ksm_status sys_process_ksm_status diff --git a/arch/mips/kernel/syscalls/syscall_n32.tbl b/arch/mips/kernel/syscalls/syscall_n32.tbl -index 953f5b7dc723..b921fbf56fa6 100644 +index 953f5b7dc723f..b921fbf56fa6d 100644 --- a/arch/mips/kernel/syscalls/syscall_n32.tbl +++ b/arch/mips/kernel/syscalls/syscall_n32.tbl @@ -401,3 +401,6 @@ @@ -12838,7 +11481,7 @@ index 953f5b7dc723..b921fbf56fa6 100644 +464 n32 process_ksm_disable sys_process_ksm_disable +465 n32 process_ksm_status sys_process_ksm_status diff --git a/arch/mips/kernel/syscalls/syscall_n64.tbl b/arch/mips/kernel/syscalls/syscall_n64.tbl -index 1464c6be6eb3..8d7f9ddd66f4 100644 +index 1464c6be6eb3c..8d7f9ddd66f4b 100644 --- a/arch/mips/kernel/syscalls/syscall_n64.tbl +++ b/arch/mips/kernel/syscalls/syscall_n64.tbl @@ -377,3 +377,6 @@ @@ -12849,7 +11492,7 @@ index 1464c6be6eb3..8d7f9ddd66f4 100644 +464 n64 process_ksm_disable sys_process_ksm_disable +465 n64 process_ksm_status sys_process_ksm_status diff --git a/arch/mips/kernel/syscalls/syscall_o32.tbl b/arch/mips/kernel/syscalls/syscall_o32.tbl -index 2439a2491cff..9d6142739954 100644 +index 2439a2491cffe..9d6142739954d 100644 --- a/arch/mips/kernel/syscalls/syscall_o32.tbl +++ b/arch/mips/kernel/syscalls/syscall_o32.tbl @@ -450,3 +450,6 @@ @@ -12860,7 +11503,7 @@ index 2439a2491cff..9d6142739954 100644 +464 o32 process_ksm_disable sys_process_ksm_disable +465 o32 process_ksm_status sys_process_ksm_status diff --git a/arch/parisc/kernel/syscalls/syscall.tbl b/arch/parisc/kernel/syscalls/syscall.tbl -index 66dc406b12e4..9d46476fd908 100644 +index 66dc406b12e44..9d46476fd9083 100644 --- a/arch/parisc/kernel/syscalls/syscall.tbl +++ b/arch/parisc/kernel/syscalls/syscall.tbl @@ -461,3 +461,6 @@ @@ -12871,7 +11514,7 @@ index 66dc406b12e4..9d46476fd908 100644 +464 common process_ksm_disable sys_process_ksm_disable +465 common process_ksm_status sys_process_ksm_status diff --git a/arch/powerpc/kernel/syscalls/syscall.tbl b/arch/powerpc/kernel/syscalls/syscall.tbl -index ebae8415dfbb..16f71bc2f6f0 100644 +index ebae8415dfbba..16f71bc2f6f01 100644 --- a/arch/powerpc/kernel/syscalls/syscall.tbl +++ b/arch/powerpc/kernel/syscalls/syscall.tbl @@ -553,3 +553,6 @@ @@ -12882,7 +11525,7 @@ index ebae8415dfbb..16f71bc2f6f0 100644 +464 common process_ksm_disable sys_process_ksm_disable +465 common process_ksm_status sys_process_ksm_status diff --git a/arch/s390/kernel/syscalls/syscall.tbl b/arch/s390/kernel/syscalls/syscall.tbl -index 01071182763e..7394bad8178e 100644 +index 01071182763e9..7394bad8178e6 100644 --- a/arch/s390/kernel/syscalls/syscall.tbl +++ b/arch/s390/kernel/syscalls/syscall.tbl @@ -465,3 +465,6 @@ @@ -12893,7 +11536,7 @@ index 01071182763e..7394bad8178e 100644 +464 common process_ksm_disable sys_process_ksm_disable sys_process_ksm_disable +465 common process_ksm_status sys_process_ksm_status sys_process_ksm_status diff --git a/arch/sh/kernel/syscalls/syscall.tbl b/arch/sh/kernel/syscalls/syscall.tbl -index c55fd7696d40..b9fc31221b87 100644 +index c55fd7696d40f..b9fc31221b874 100644 --- a/arch/sh/kernel/syscalls/syscall.tbl +++ b/arch/sh/kernel/syscalls/syscall.tbl @@ -466,3 +466,6 @@ @@ -12904,7 +11547,7 @@ index c55fd7696d40..b9fc31221b87 100644 +464 common process_ksm_disable sys_process_ksm_disable +465 common process_ksm_status sys_process_ksm_status diff --git a/arch/sparc/kernel/syscalls/syscall.tbl b/arch/sparc/kernel/syscalls/syscall.tbl -index cfdfb3707c16..0d79fd772854 100644 +index cfdfb3707c167..0d79fd7728540 100644 --- a/arch/sparc/kernel/syscalls/syscall.tbl +++ b/arch/sparc/kernel/syscalls/syscall.tbl @@ -508,3 +508,6 @@ @@ -12915,7 +11558,7 @@ index cfdfb3707c16..0d79fd772854 100644 +464 common process_ksm_disable sys_process_ksm_disable +465 common process_ksm_status sys_process_ksm_status diff --git a/arch/x86/entry/syscalls/syscall_32.tbl b/arch/x86/entry/syscalls/syscall_32.tbl -index 534c74b14fab..c546a30575f1 100644 +index 534c74b14fab5..c546a30575f1c 100644 --- a/arch/x86/entry/syscalls/syscall_32.tbl +++ b/arch/x86/entry/syscalls/syscall_32.tbl @@ -468,3 +468,6 @@ @@ -12926,7 +11569,7 @@ index 534c74b14fab..c546a30575f1 100644 +464 i386 process_ksm_disable sys_process_ksm_disable +465 i386 process_ksm_status sys_process_ksm_status diff --git a/arch/x86/entry/syscalls/syscall_64.tbl b/arch/x86/entry/syscalls/syscall_64.tbl -index 7093ee21c0d1..0fcd10ba8dfe 100644 +index 7093ee21c0d1c..0fcd10ba8dfeb 100644 --- a/arch/x86/entry/syscalls/syscall_64.tbl +++ b/arch/x86/entry/syscalls/syscall_64.tbl @@ -386,6 +386,9 @@ @@ -12940,7 +11583,7 @@ index 7093ee21c0d1..0fcd10ba8dfe 100644 # # Due to a historical design error, certain syscalls are numbered differently diff --git a/arch/xtensa/kernel/syscalls/syscall.tbl b/arch/xtensa/kernel/syscalls/syscall.tbl -index 67083fc1b2f5..c1aecee4ad9b 100644 +index 67083fc1b2f56..c1aecee4ad9b6 100644 --- a/arch/xtensa/kernel/syscalls/syscall.tbl +++ b/arch/xtensa/kernel/syscalls/syscall.tbl @@ -433,3 +433,6 @@ @@ -12951,7 +11594,7 @@ index 67083fc1b2f5..c1aecee4ad9b 100644 +464 common process_ksm_disable sys_process_ksm_disable +465 common process_ksm_status sys_process_ksm_status diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h -index 4bcf6754738d..b3ea08e920f7 100644 +index 4bcf6754738d4..b3ea08e920f70 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h @@ -818,6 +818,9 @@ asmlinkage long sys_madvise(unsigned long start, size_t len, int behavior); @@ -12965,7 +11608,7 @@ index 4bcf6754738d..b3ea08e920f7 100644 unsigned long prot, unsigned long pgoff, unsigned long flags); diff --git a/include/uapi/asm-generic/unistd.h b/include/uapi/asm-generic/unistd.h -index 5bf6148cac2b..613e559ad6e0 100644 +index 5bf6148cac2b9..613e559ad6e0a 100644 --- a/include/uapi/asm-generic/unistd.h +++ b/include/uapi/asm-generic/unistd.h @@ -841,8 +841,15 @@ __SYSCALL(__NR_lsm_list_modules, sys_lsm_list_modules) @@ -12986,10 +11629,10 @@ index 5bf6148cac2b..613e559ad6e0 100644 /* * 32 bit systems traditionally used different diff --git a/kernel/sys.c b/kernel/sys.c -index 3a2df1bd9f64..86c6dd9d8c84 100644 +index 3a2df1bd9f640..bc77dc7845270 100644 --- a/kernel/sys.c +++ b/kernel/sys.c -@@ -2789,6 +2789,153 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3, +@@ -2789,6 +2789,144 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3, return error; } @@ -13003,23 +11646,16 @@ index 3a2df1bd9f64..86c6dd9d8c84 100644 +static long do_process_ksm_control(int pidfd, enum pkc_action action) +{ + long ret; -+ struct pid *pid; + struct task_struct *task; + struct mm_struct *mm; + unsigned int f_flags; + -+ pid = pidfd_get_pid(pidfd, &f_flags); -+ if (IS_ERR(pid)) { -+ ret = PTR_ERR(pid); ++ task = pidfd_get_task(pidfd, &f_flags); ++ if (IS_ERR(task)) { ++ ret = PTR_ERR(task); + goto out; + } + -+ task = get_pid_task(pid, PIDTYPE_PID); -+ if (!task) { -+ ret = -ESRCH; -+ goto put_pid; -+ } -+ + /* Require PTRACE_MODE_READ to avoid leaking ASLR metadata. */ + mm = mm_access(task, PTRACE_MODE_READ_FSCREDS); + if (IS_ERR_OR_NULL(mm)) { @@ -13056,8 +11692,6 @@ index 3a2df1bd9f64..86c6dd9d8c84 100644 + mmput(mm); +release_task: + put_task_struct(task); -+put_pid: -+ put_pid(pid); +out: + return ret; +} @@ -13144,7 +11778,7 @@ index 3a2df1bd9f64..86c6dd9d8c84 100644 struct getcpu_cache __user *, unused) { diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c -index c00a86931f8c..d82213d68522 100644 +index c00a86931f8c6..d82213d68522c 100644 --- a/kernel/sys_ni.c +++ b/kernel/sys_ni.c @@ -186,6 +186,9 @@ COND_SYSCALL(mincore); @@ -13158,7 +11792,7 @@ index c00a86931f8c..d82213d68522 100644 COND_SYSCALL(mbind); COND_SYSCALL(get_mempolicy); diff --git a/scripts/syscall.tbl b/scripts/syscall.tbl -index 845e24eb372e..227d9cc12365 100644 +index 845e24eb372e7..227d9cc123651 100644 --- a/scripts/syscall.tbl +++ b/scripts/syscall.tbl @@ -403,3 +403,6 @@ @@ -13169,7 +11803,7 @@ index 845e24eb372e..227d9cc12365 100644 +464 common process_ksm_disable sys_process_ksm_disable +465 common process_ksm_status sys_process_ksm_status diff --git a/tools/perf/arch/powerpc/entry/syscalls/syscall.tbl b/tools/perf/arch/powerpc/entry/syscalls/syscall.tbl -index ebae8415dfbb..16f71bc2f6f0 100644 +index ebae8415dfbba..16f71bc2f6f01 100644 --- a/tools/perf/arch/powerpc/entry/syscalls/syscall.tbl +++ b/tools/perf/arch/powerpc/entry/syscalls/syscall.tbl @@ -553,3 +553,6 @@ @@ -13180,7 +11814,7 @@ index ebae8415dfbb..16f71bc2f6f0 100644 +464 common process_ksm_disable sys_process_ksm_disable +465 common process_ksm_status sys_process_ksm_status diff --git a/tools/perf/arch/s390/entry/syscalls/syscall.tbl b/tools/perf/arch/s390/entry/syscalls/syscall.tbl -index 01071182763e..7394bad8178e 100644 +index 01071182763e9..7394bad8178e6 100644 --- a/tools/perf/arch/s390/entry/syscalls/syscall.tbl +++ b/tools/perf/arch/s390/entry/syscalls/syscall.tbl @@ -465,3 +465,6 @@ @@ -13191,14 +11825,14 @@ index 01071182763e..7394bad8178e 100644 +464 common process_ksm_disable sys_process_ksm_disable sys_process_ksm_disable +465 common process_ksm_status sys_process_ksm_status sys_process_ksm_status -- -2.46.1 +2.47.0.rc0 -From 10e07b6ee168c6d23fbde9e0de127b025f7b1f5c Mon Sep 17 00:00:00 2001 -From: Eric Naim -Date: Thu, 19 Sep 2024 23:22:14 +0800 -Subject: [PATCH 08/11] ntsync +From 572791832138e7cdc58cdaabb1e62cf773d42a44 Mon Sep 17 00:00:00 2001 +From: Peter Jung +Date: Mon, 30 Sep 2024 16:55:43 +0200 +Subject: [PATCH 07/10] ntsync -Signed-off-by: Eric Naim +Signed-off-by: Peter Jung --- Documentation/userspace-api/index.rst | 1 + Documentation/userspace-api/ntsync.rst | 398 +++++ @@ -13219,7 +11853,7 @@ Signed-off-by: Eric Naim create mode 100644 tools/testing/selftests/drivers/ntsync/ntsync.c diff --git a/Documentation/userspace-api/index.rst b/Documentation/userspace-api/index.rst -index 274cc7546efc..9c1b15cd89ab 100644 +index 274cc7546efc2..9c1b15cd89ab0 100644 --- a/Documentation/userspace-api/index.rst +++ b/Documentation/userspace-api/index.rst @@ -63,6 +63,7 @@ Everything else @@ -13232,7 +11866,7 @@ index 274cc7546efc..9c1b15cd89ab 100644 diff --git a/Documentation/userspace-api/ntsync.rst b/Documentation/userspace-api/ntsync.rst new file mode 100644 -index 000000000000..767844637a7d +index 0000000000000..767844637a7df --- /dev/null +++ b/Documentation/userspace-api/ntsync.rst @@ -0,0 +1,398 @@ @@ -13635,7 +12269,7 @@ index 000000000000..767844637a7d + ``objs`` and in ``alert``. If this is attempted, the function fails + with ``EINVAL``. diff --git a/MAINTAINERS b/MAINTAINERS -index cc40a9d9b8cd..2cd7168dc401 100644 +index cc40a9d9b8cd1..2cd7168dc401d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -16319,6 +16319,15 @@ T: git https://github.com/Paragon-Software-Group/linux-ntfs3.git @@ -13655,7 +12289,7 @@ index cc40a9d9b8cd..2cd7168dc401 100644 M: Finn Thain L: linux-m68k@lists.linux-m68k.org diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig -index 41c54051347a..bde398e12696 100644 +index 41c54051347ab..bde398e12696e 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig @@ -507,7 +507,6 @@ config OPEN_DICE @@ -13667,7 +12301,7 @@ index 41c54051347a..bde398e12696 100644 This module provides kernel support for emulation of Windows NT synchronization primitives. It is not a hardware driver. diff --git a/drivers/misc/ntsync.c b/drivers/misc/ntsync.c -index 3c2f743c58b0..87a24798a5c7 100644 +index 3c2f743c58b00..87a24798a5c7b 100644 --- a/drivers/misc/ntsync.c +++ b/drivers/misc/ntsync.c @@ -6,11 +6,17 @@ @@ -14776,7 +13410,7 @@ index 3c2f743c58b0..87a24798a5c7 100644 return -ENOIOCTLCMD; } diff --git a/include/uapi/linux/ntsync.h b/include/uapi/linux/ntsync.h -index dcfa38fdc93c..4a8095a3fc34 100644 +index dcfa38fdc93c6..4a8095a3fc34c 100644 --- a/include/uapi/linux/ntsync.h +++ b/include/uapi/linux/ntsync.h @@ -16,8 +16,47 @@ struct ntsync_sem_args { @@ -14828,7 +13462,7 @@ index dcfa38fdc93c..4a8095a3fc34 100644 #endif diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile -index bc8fe9e8f7f2..b1296bd8eb3f 100644 +index bc8fe9e8f7f20..b1296bd8eb3f7 100644 --- a/tools/testing/selftests/Makefile +++ b/tools/testing/selftests/Makefile @@ -17,6 +17,7 @@ TARGETS += devices/error_logs @@ -14841,14 +13475,14 @@ index bc8fe9e8f7f2..b1296bd8eb3f 100644 TARGETS += drivers/net/bonding diff --git a/tools/testing/selftests/drivers/ntsync/.gitignore b/tools/testing/selftests/drivers/ntsync/.gitignore new file mode 100644 -index 000000000000..848573a3d3ea +index 0000000000000..848573a3d3eaf --- /dev/null +++ b/tools/testing/selftests/drivers/ntsync/.gitignore @@ -0,0 +1 @@ +ntsync diff --git a/tools/testing/selftests/drivers/ntsync/Makefile b/tools/testing/selftests/drivers/ntsync/Makefile new file mode 100644 -index 000000000000..dbf2b055c0b2 +index 0000000000000..dbf2b055c0b28 --- /dev/null +++ b/tools/testing/selftests/drivers/ntsync/Makefile @@ -0,0 +1,7 @@ @@ -14861,14 +13495,14 @@ index 000000000000..dbf2b055c0b2 +include ../../lib.mk diff --git a/tools/testing/selftests/drivers/ntsync/config b/tools/testing/selftests/drivers/ntsync/config new file mode 100644 -index 000000000000..60539c826d06 +index 0000000000000..60539c826d062 --- /dev/null +++ b/tools/testing/selftests/drivers/ntsync/config @@ -0,0 +1 @@ +CONFIG_WINESYNC=y diff --git a/tools/testing/selftests/drivers/ntsync/ntsync.c b/tools/testing/selftests/drivers/ntsync/ntsync.c new file mode 100644 -index 000000000000..5fa2c9a0768c +index 0000000000000..5fa2c9a0768c0 --- /dev/null +++ b/tools/testing/selftests/drivers/ntsync/ntsync.c @@ -0,0 +1,1407 @@ @@ -16280,14 +14914,14 @@ index 000000000000..5fa2c9a0768c + +TEST_HARNESS_MAIN -- -2.46.1 +2.47.0.rc0 -From 1bf306ae3df8a0f8a4588cf278b01530d1979cd3 Mon Sep 17 00:00:00 2001 -From: Eric Naim -Date: Thu, 19 Sep 2024 23:22:29 +0800 -Subject: [PATCH 09/11] perf-per-core +From f1d1da8874c086f233e059f95c7143871f9c6fdb Mon Sep 17 00:00:00 2001 +From: Peter Jung +Date: Mon, 30 Sep 2024 16:55:53 +0200 +Subject: [PATCH 08/10] perf-per-core -Signed-off-by: Eric Naim +Signed-off-by: Peter Jung --- Documentation/arch/x86/topology.rst | 4 + arch/x86/events/rapl.c | 418 ++++++++++++++++++-------- @@ -16298,7 +14932,7 @@ Signed-off-by: Eric Naim 6 files changed, 305 insertions(+), 121 deletions(-) diff --git a/Documentation/arch/x86/topology.rst b/Documentation/arch/x86/topology.rst -index 7352ab89a55a..c12837e61bda 100644 +index 7352ab89a55ae..c12837e61bda5 100644 --- a/Documentation/arch/x86/topology.rst +++ b/Documentation/arch/x86/topology.rst @@ -135,6 +135,10 @@ Thread-related topology information in the kernel: @@ -16313,7 +14947,7 @@ index 7352ab89a55a..c12837e61bda 100644 System topology examples diff --git a/arch/x86/events/rapl.c b/arch/x86/events/rapl.c -index b985ca79cf97..8206038a01ac 100644 +index b985ca79cf97b..8206038a01ac2 100644 --- a/arch/x86/events/rapl.c +++ b/arch/x86/events/rapl.c @@ -39,6 +39,10 @@ @@ -17140,7 +15774,7 @@ index b985ca79cf97..8206038a01ac 100644 } module_exit(intel_rapl_exit); diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h -index 775acbdea1a9..86b22e7e5acb 100644 +index a75a07f4931fd..5a59713ec62b1 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h @@ -98,6 +98,7 @@ struct cpuinfo_topology { @@ -17152,7 +15786,7 @@ index 775acbdea1a9..86b22e7e5acb 100644 // AMD Node ID and Nodes per Package info u32 amd_node_id; diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h -index aef70336d624..672fccf9f845 100644 +index aef70336d6247..672fccf9f8459 100644 --- a/arch/x86/include/asm/topology.h +++ b/arch/x86/include/asm/topology.h @@ -137,6 +137,7 @@ extern const struct cpumask *cpu_clustergroup_mask(int cpu); @@ -17164,7 +15798,7 @@ index aef70336d624..672fccf9f845 100644 #define topology_core_id(cpu) (cpu_data(cpu).topo.core_id) #define topology_ppin(cpu) (cpu_data(cpu).ppin) diff --git a/arch/x86/kernel/cpu/debugfs.c b/arch/x86/kernel/cpu/debugfs.c -index 3baf3e435834..b1eb6d7828db 100644 +index 3baf3e4358347..b1eb6d7828dbd 100644 --- a/arch/x86/kernel/cpu/debugfs.c +++ b/arch/x86/kernel/cpu/debugfs.c @@ -24,6 +24,7 @@ static int cpu_debug_show(struct seq_file *m, void *p) @@ -17176,7 +15810,7 @@ index 3baf3e435834..b1eb6d7828db 100644 seq_printf(m, "l2c_id: %u\n", c->topo.l2c_id); seq_printf(m, "amd_node_id: %u\n", c->topo.amd_node_id); diff --git a/arch/x86/kernel/cpu/topology_common.c b/arch/x86/kernel/cpu/topology_common.c -index 9a6069e7133c..23722aa21e2f 100644 +index 9a6069e7133c9..23722aa21e2f6 100644 --- a/arch/x86/kernel/cpu/topology_common.c +++ b/arch/x86/kernel/cpu/topology_common.c @@ -151,6 +151,7 @@ static void topo_set_ids(struct topo_scan *tscan, bool early) @@ -17188,14 +15822,14 @@ index 9a6069e7133c..23722aa21e2f 100644 /* Package relative core ID */ -- -2.46.1 +2.47.0.rc0 -From 56faa02c031210ff953a42fe996da7c1ff25396a Mon Sep 17 00:00:00 2001 -From: Eric Naim -Date: Thu, 19 Sep 2024 23:23:04 +0800 -Subject: [PATCH 10/11] t2 +From 6b89faaddb4b30770af655bc54f219304adbe7e6 Mon Sep 17 00:00:00 2001 +From: Peter Jung +Date: Mon, 30 Sep 2024 16:56:20 +0200 +Subject: [PATCH 09/10] t2 -Signed-off-by: Eric Naim +Signed-off-by: Peter Jung --- .../ABI/testing/sysfs-driver-hid-appletb-kbd | 13 + Documentation/core-api/printk-formats.rst | 32 + @@ -17290,7 +15924,7 @@ Signed-off-by: Eric Naim diff --git a/Documentation/ABI/testing/sysfs-driver-hid-appletb-kbd b/Documentation/ABI/testing/sysfs-driver-hid-appletb-kbd new file mode 100644 -index 000000000000..2a19584d091e +index 0000000000000..2a19584d091e4 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-driver-hid-appletb-kbd @@ -0,0 +1,13 @@ @@ -17308,7 +15942,7 @@ index 000000000000..2a19584d091e + 3 None + == ================= diff --git a/Documentation/core-api/printk-formats.rst b/Documentation/core-api/printk-formats.rst -index 4451ef501936..c726a846f752 100644 +index 4451ef5019361..c726a846f752e 100644 --- a/Documentation/core-api/printk-formats.rst +++ b/Documentation/core-api/printk-formats.rst @@ -632,6 +632,38 @@ Examples:: @@ -17351,7 +15985,7 @@ index 4451ef501936..c726a846f752 100644 ---- diff --git a/MAINTAINERS b/MAINTAINERS -index 2cd7168dc401..16df466c205d 100644 +index 2cd7168dc401d..16df466c205dc 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -6895,6 +6895,12 @@ S: Supported @@ -17368,7 +16002,7 @@ index 2cd7168dc401..16df466c205d 100644 S: Orphan T: git https://gitlab.freedesktop.org/drm/misc/kernel.git diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c -index cddc33970d75..30a18ebd05ba 100644 +index 8bf31cbde0cdb..bc6592169e43f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -2236,6 +2236,9 @@ static int amdgpu_pci_probe(struct pci_dev *pdev, @@ -17382,7 +16016,7 @@ index cddc33970d75..30a18ebd05ba 100644 for (i = 0; i < ARRAY_SIZE(amdgpu_unsupported_pciidlist); i++) { if (amdgpu_unsupported_pciidlist[i] == pdev->device) diff --git a/drivers/gpu/drm/drm_format_helper.c b/drivers/gpu/drm/drm_format_helper.c -index b1be458ed4dd..28c0e76a1e88 100644 +index b1be458ed4dda..28c0e76a1e889 100644 --- a/drivers/gpu/drm/drm_format_helper.c +++ b/drivers/gpu/drm/drm_format_helper.c @@ -702,6 +702,57 @@ void drm_fb_xrgb8888_to_rgb888(struct iosys_map *dst, const unsigned int *dst_pi @@ -17454,7 +16088,7 @@ index b1be458ed4dd..28c0e76a1e88 100644 drm_fb_xrgb8888_to_argb8888(dst, dst_pitch, src, fb, clip, state); return 0; diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c -index a07aca96e551..210e20b03aab 100644 +index a07aca96e5517..210e20b03aabe 100644 --- a/drivers/gpu/drm/i915/display/intel_ddi.c +++ b/drivers/gpu/drm/i915/display/intel_ddi.c @@ -4640,6 +4640,7 @@ intel_ddi_init_hdmi_connector(struct intel_digital_port *dig_port) @@ -17476,7 +16110,7 @@ index a07aca96e551..210e20b03aab 100644 * supported configuration */ diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c -index 49a1ac4f5491..c8c10a6104c4 100644 +index 49a1ac4f54919..c8c10a6104c4e 100644 --- a/drivers/gpu/drm/i915/display/intel_fbdev.c +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c @@ -199,10 +199,10 @@ static int intelfb_create(struct drm_fb_helper *helper, @@ -17494,7 +16128,7 @@ index 49a1ac4f5491..c8c10a6104c4 100644 fb->base.width, fb->base.height, sizes->fb_width, sizes->fb_height); diff --git a/drivers/gpu/drm/i915/display/intel_quirks.c b/drivers/gpu/drm/i915/display/intel_quirks.c -index dfd8b4960e6d..7232f9acd0a0 100644 +index dfd8b4960e6d6..7232f9acd0a01 100644 --- a/drivers/gpu/drm/i915/display/intel_quirks.c +++ b/drivers/gpu/drm/i915/display/intel_quirks.c @@ -64,6 +64,18 @@ static void quirk_increase_ddi_disabled_time(struct intel_display *display) @@ -17527,7 +16161,7 @@ index dfd8b4960e6d..7232f9acd0a0 100644 static struct intel_dpcd_quirk intel_dpcd_quirks[] = { diff --git a/drivers/gpu/drm/i915/display/intel_quirks.h b/drivers/gpu/drm/i915/display/intel_quirks.h -index cafdebda7535..a5296f82776e 100644 +index cafdebda75354..a5296f82776e4 100644 --- a/drivers/gpu/drm/i915/display/intel_quirks.h +++ b/drivers/gpu/drm/i915/display/intel_quirks.h @@ -20,6 +20,7 @@ enum intel_quirk_id { @@ -17539,7 +16173,7 @@ index cafdebda7535..a5296f82776e 100644 void intel_init_quirks(struct intel_display *display); diff --git a/drivers/gpu/drm/tests/drm_format_helper_test.c b/drivers/gpu/drm/tests/drm_format_helper_test.c -index 08992636ec05..35cd3405d045 100644 +index 08992636ec05f..35cd3405d0450 100644 --- a/drivers/gpu/drm/tests/drm_format_helper_test.c +++ b/drivers/gpu/drm/tests/drm_format_helper_test.c @@ -60,6 +60,11 @@ struct convert_to_rgb888_result { @@ -17680,7 +16314,7 @@ index 08992636ec05..35cd3405d045 100644 KUNIT_CASE_PARAM(drm_test_fb_xrgb8888_to_xrgb2101010, convert_xrgb8888_gen_params), KUNIT_CASE_PARAM(drm_test_fb_xrgb8888_to_argb2101010, convert_xrgb8888_gen_params), diff --git a/drivers/gpu/drm/tiny/Kconfig b/drivers/gpu/drm/tiny/Kconfig -index f6889f649bc1..559a97bce12c 100644 +index f6889f649bc18..559a97bce12c6 100644 --- a/drivers/gpu/drm/tiny/Kconfig +++ b/drivers/gpu/drm/tiny/Kconfig @@ -1,5 +1,17 @@ @@ -17702,7 +16336,7 @@ index f6889f649bc1..559a97bce12c 100644 tristate "ARC PGU" depends on DRM && OF diff --git a/drivers/gpu/drm/tiny/Makefile b/drivers/gpu/drm/tiny/Makefile -index 76dde89a044b..9a1b412e764a 100644 +index 76dde89a044b7..9a1b412e764ae 100644 --- a/drivers/gpu/drm/tiny/Makefile +++ b/drivers/gpu/drm/tiny/Makefile @@ -1,5 +1,6 @@ @@ -17714,7 +16348,7 @@ index 76dde89a044b..9a1b412e764a 100644 obj-$(CONFIG_DRM_CIRRUS_QEMU) += cirrus.o diff --git a/drivers/gpu/drm/tiny/appletbdrm.c b/drivers/gpu/drm/tiny/appletbdrm.c new file mode 100644 -index 000000000000..b9440ce0064e +index 0000000000000..b9440ce0064e0 --- /dev/null +++ b/drivers/gpu/drm/tiny/appletbdrm.c @@ -0,0 +1,624 @@ @@ -18343,7 +16977,7 @@ index 000000000000..b9440ce0064e +MODULE_DESCRIPTION("Apple Touch Bar DRM Driver"); +MODULE_LICENSE("GPL"); diff --git a/drivers/gpu/vga/vga_switcheroo.c b/drivers/gpu/vga/vga_switcheroo.c -index 365e6ddbe90f..cf357cd3389d 100644 +index 365e6ddbe90fe..cf357cd3389db 100644 --- a/drivers/gpu/vga/vga_switcheroo.c +++ b/drivers/gpu/vga/vga_switcheroo.c @@ -438,12 +438,7 @@ find_active_client(struct list_head *head) @@ -18361,7 +16995,7 @@ index 365e6ddbe90f..cf357cd3389d 100644 } diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig -index 08446c89eff6..35ef5d4ef068 100644 +index 08446c89eff6e..35ef5d4ef068e 100644 --- a/drivers/hid/Kconfig +++ b/drivers/hid/Kconfig @@ -148,6 +148,27 @@ config HID_APPLEIR @@ -18401,7 +17035,7 @@ index 08446c89eff6..35ef5d4ef068 100644 - Cando dual touch panels - Chunghwa panels diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile -index e40f1ddebbb7..d903c9a2629d 100644 +index e40f1ddebbb71..d903c9a2629d9 100644 --- a/drivers/hid/Makefile +++ b/drivers/hid/Makefile @@ -29,6 +29,8 @@ obj-$(CONFIG_HID_ALPS) += hid-alps.o @@ -18415,7 +17049,7 @@ index e40f1ddebbb7..d903c9a2629d 100644 obj-$(CONFIG_HID_AUREAL) += hid-aureal.o diff --git a/drivers/hid/hid-appletb-bl.c b/drivers/hid/hid-appletb-bl.c new file mode 100644 -index 000000000000..819157686e59 +index 0000000000000..819157686e59d --- /dev/null +++ b/drivers/hid/hid-appletb-bl.c @@ -0,0 +1,207 @@ @@ -18628,7 +17262,7 @@ index 000000000000..819157686e59 +MODULE_LICENSE("GPL"); diff --git a/drivers/hid/hid-appletb-kbd.c b/drivers/hid/hid-appletb-kbd.c new file mode 100644 -index 000000000000..c26b7a19a5e4 +index 0000000000000..c26b7a19a5e4a --- /dev/null +++ b/drivers/hid/hid-appletb-kbd.c @@ -0,0 +1,501 @@ @@ -19134,7 +17768,7 @@ index 000000000000..c26b7a19a5e4 +MODULE_DESCRIPTION("MacBookPro Touch Bar Keyboard Mode Driver"); +MODULE_LICENSE("GPL"); diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c -index 988d0acbdf04..caeba5487b69 100644 +index 988d0acbdf04d..caeba5487b69b 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -1912,6 +1912,31 @@ int hid_set_field(struct hid_field *field, unsigned offset, __s32 value) @@ -19170,7 +17804,7 @@ index 988d0acbdf04..caeba5487b69 100644 const u8 *data) { diff --git a/drivers/hid/hid-google-hammer.c b/drivers/hid/hid-google-hammer.c -index 6e4ebc349e45..4e79fafeeafa 100644 +index 6e4ebc349e452..4e79fafeeafa8 100644 --- a/drivers/hid/hid-google-hammer.c +++ b/drivers/hid/hid-google-hammer.c @@ -418,38 +418,15 @@ static int hammer_event(struct hid_device *hid, struct hid_field *field, @@ -19215,7 +17849,7 @@ index 6e4ebc349e45..4e79fafeeafa 100644 } diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c -index 99812c0f830b..bb845947585f 100644 +index 99812c0f830b5..bb845947585f4 100644 --- a/drivers/hid/hid-multitouch.c +++ b/drivers/hid/hid-multitouch.c @@ -72,6 +72,7 @@ MODULE_LICENSE("GPL"); @@ -19389,7 +18023,7 @@ index 99812c0f830b..bb845947585f 100644 { .driver_data = MT_CLS_GOOGLE, HID_DEVICE(HID_BUS_ANY, HID_GROUP_ANY, USB_VENDOR_ID_GOOGLE, diff --git a/drivers/hid/hid-quirks.c b/drivers/hid/hid-quirks.c -index e0bbf0c6345d..7c576d6540fe 100644 +index e0bbf0c6345d6..7c576d6540fed 100644 --- a/drivers/hid/hid-quirks.c +++ b/drivers/hid/hid-quirks.c @@ -328,8 +328,6 @@ static const struct hid_device_id hid_have_special_driver[] = { @@ -19415,7 +18049,7 @@ index e0bbf0c6345d..7c576d6540fe 100644 { HID_I2C_DEVICE(USB_VENDOR_ID_ASUSTEK, USB_DEVICE_ID_ASUSTEK_I2C_KEYBOARD) }, { HID_I2C_DEVICE(USB_VENDOR_ID_ASUSTEK, USB_DEVICE_ID_ASUSTEK_I2C_TOUCHPAD) }, diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c -index fc6d6a9053ce..698f44794453 100644 +index fc6d6a9053cee..698f44794453f 100644 --- a/drivers/hwmon/applesmc.c +++ b/drivers/hwmon/applesmc.c @@ -6,6 +6,7 @@ @@ -21401,7 +20035,7 @@ index fc6d6a9053ce..698f44794453 100644 MODULE_LICENSE("GPL v2"); MODULE_DEVICE_TABLE(dmi, applesmc_whitelist); diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c -index 10a03a566905..8c3ccd98ba93 100644 +index 10a03a5669058..8c3ccd98ba937 100644 --- a/drivers/input/mouse/bcm5974.c +++ b/drivers/input/mouse/bcm5974.c @@ -83,6 +83,24 @@ @@ -21564,7 +20198,7 @@ index 10a03a566905..8c3ccd98ba93 100644 }; diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c -index 78748e8d2dba..2b2b558cebe6 100644 +index 78748e8d2dbae..2b2b558cebe68 100644 --- a/drivers/pci/vgaarb.c +++ b/drivers/pci/vgaarb.c @@ -143,6 +143,7 @@ void vga_set_default_device(struct pci_dev *pdev) @@ -21576,7 +20210,7 @@ index 78748e8d2dba..2b2b558cebe6 100644 /** * vga_remove_vgacon - deactivate VGA console diff --git a/drivers/platform/x86/apple-gmux.c b/drivers/platform/x86/apple-gmux.c -index 1417e230edbd..e69785af8e1d 100644 +index 1417e230edbd8..e69785af8e1d7 100644 --- a/drivers/platform/x86/apple-gmux.c +++ b/drivers/platform/x86/apple-gmux.c @@ -21,6 +21,7 @@ @@ -21619,7 +20253,7 @@ index 1417e230edbd..e69785af8e1d 100644 * Retina MacBook Pros cannot switch the panel's AUX separately * and need eDP pre-calibration. They are distinguishable from diff --git a/drivers/staging/Kconfig b/drivers/staging/Kconfig -index db4a392841b1..580df4ce4f9f 100644 +index db4a392841b16..580df4ce4f9fa 100644 --- a/drivers/staging/Kconfig +++ b/drivers/staging/Kconfig @@ -66,4 +66,6 @@ source "drivers/staging/fieldbus/Kconfig" @@ -21630,7 +20264,7 @@ index db4a392841b1..580df4ce4f9f 100644 + endif # STAGING diff --git a/drivers/staging/Makefile b/drivers/staging/Makefile -index 5390879b5d1b..528be2d3b546 100644 +index 5390879b5d1b7..528be2d3b5462 100644 --- a/drivers/staging/Makefile +++ b/drivers/staging/Makefile @@ -22,3 +22,4 @@ obj-$(CONFIG_GREYBUS) += greybus/ @@ -21640,7 +20274,7 @@ index 5390879b5d1b..528be2d3b546 100644 +obj-$(CONFIG_APPLE_BCE) += apple-bce/ diff --git a/drivers/staging/apple-bce/Kconfig b/drivers/staging/apple-bce/Kconfig new file mode 100644 -index 000000000000..fe92bc441e89 +index 0000000000000..fe92bc441e89a --- /dev/null +++ b/drivers/staging/apple-bce/Kconfig @@ -0,0 +1,18 @@ @@ -21664,7 +20298,7 @@ index 000000000000..fe92bc441e89 + If "M" is selected, the module will be called apple-bce.' diff --git a/drivers/staging/apple-bce/Makefile b/drivers/staging/apple-bce/Makefile new file mode 100644 -index 000000000000..8cfbd3f64af6 +index 0000000000000..8cfbd3f64af69 --- /dev/null +++ b/drivers/staging/apple-bce/Makefile @@ -0,0 +1,28 @@ @@ -21698,7 +20332,7 @@ index 000000000000..8cfbd3f64af6 + $(MAKE) -C $(KDIR) M=$(PWD) modules_install diff --git a/drivers/staging/apple-bce/apple_bce.c b/drivers/staging/apple-bce/apple_bce.c new file mode 100644 -index 000000000000..4fd2415d7028 +index 0000000000000..4fd2415d70288 --- /dev/null +++ b/drivers/staging/apple-bce/apple_bce.c @@ -0,0 +1,445 @@ @@ -22149,7 +20783,7 @@ index 000000000000..4fd2415d7028 +module_exit(apple_bce_module_exit); diff --git a/drivers/staging/apple-bce/apple_bce.h b/drivers/staging/apple-bce/apple_bce.h new file mode 100644 -index 000000000000..f13ab8d5742e +index 0000000000000..f13ab8d5742e3 --- /dev/null +++ b/drivers/staging/apple-bce/apple_bce.h @@ -0,0 +1,38 @@ @@ -22194,7 +20828,7 @@ index 000000000000..f13ab8d5742e \ No newline at end of file diff --git a/drivers/staging/apple-bce/audio/audio.c b/drivers/staging/apple-bce/audio/audio.c new file mode 100644 -index 000000000000..bd16ddd16c1d +index 0000000000000..bd16ddd16c1da --- /dev/null +++ b/drivers/staging/apple-bce/audio/audio.c @@ -0,0 +1,711 @@ @@ -22911,7 +21545,7 @@ index 000000000000..bd16ddd16c1d +MODULE_PARM_DESC(id, "ID string for Apple Internal Audio soundcard."); diff --git a/drivers/staging/apple-bce/audio/audio.h b/drivers/staging/apple-bce/audio/audio.h new file mode 100644 -index 000000000000..004bc1e22ea4 +index 0000000000000..004bc1e22ea4a --- /dev/null +++ b/drivers/staging/apple-bce/audio/audio.h @@ -0,0 +1,125 @@ @@ -23042,7 +21676,7 @@ index 000000000000..004bc1e22ea4 +#endif //AAUDIO_H diff --git a/drivers/staging/apple-bce/audio/description.h b/drivers/staging/apple-bce/audio/description.h new file mode 100644 -index 000000000000..dfef3ab68f27 +index 0000000000000..dfef3ab68f279 --- /dev/null +++ b/drivers/staging/apple-bce/audio/description.h @@ -0,0 +1,42 @@ @@ -23090,7 +21724,7 @@ index 000000000000..dfef3ab68f27 +#endif //AAUDIO_DESCRIPTION_H diff --git a/drivers/staging/apple-bce/audio/pcm.c b/drivers/staging/apple-bce/audio/pcm.c new file mode 100644 -index 000000000000..1026e10a9ac5 +index 0000000000000..1026e10a9ac58 --- /dev/null +++ b/drivers/staging/apple-bce/audio/pcm.c @@ -0,0 +1,308 @@ @@ -23404,7 +22038,7 @@ index 000000000000..1026e10a9ac5 +} diff --git a/drivers/staging/apple-bce/audio/pcm.h b/drivers/staging/apple-bce/audio/pcm.h new file mode 100644 -index 000000000000..ea5f35fbe408 +index 0000000000000..ea5f35fbe4085 --- /dev/null +++ b/drivers/staging/apple-bce/audio/pcm.h @@ -0,0 +1,16 @@ @@ -23426,7 +22060,7 @@ index 000000000000..ea5f35fbe408 +#endif //AAUDIO_PCM_H diff --git a/drivers/staging/apple-bce/audio/protocol.c b/drivers/staging/apple-bce/audio/protocol.c new file mode 100644 -index 000000000000..2314813aeead +index 0000000000000..2314813aeeadc --- /dev/null +++ b/drivers/staging/apple-bce/audio/protocol.c @@ -0,0 +1,347 @@ @@ -23780,7 +22414,7 @@ index 000000000000..2314813aeead \ No newline at end of file diff --git a/drivers/staging/apple-bce/audio/protocol.h b/drivers/staging/apple-bce/audio/protocol.h new file mode 100644 -index 000000000000..3427486f3f57 +index 0000000000000..3427486f3f570 --- /dev/null +++ b/drivers/staging/apple-bce/audio/protocol.h @@ -0,0 +1,147 @@ @@ -23933,7 +22567,7 @@ index 000000000000..3427486f3f57 +#endif //AAUDIO_PROTOCOL_H diff --git a/drivers/staging/apple-bce/audio/protocol_bce.c b/drivers/staging/apple-bce/audio/protocol_bce.c new file mode 100644 -index 000000000000..28f2dfd44d67 +index 0000000000000..28f2dfd44d676 --- /dev/null +++ b/drivers/staging/apple-bce/audio/protocol_bce.c @@ -0,0 +1,226 @@ @@ -24165,7 +22799,7 @@ index 000000000000..28f2dfd44d67 +} diff --git a/drivers/staging/apple-bce/audio/protocol_bce.h b/drivers/staging/apple-bce/audio/protocol_bce.h new file mode 100644 -index 000000000000..14d26c05ddf9 +index 0000000000000..14d26c05ddf9d --- /dev/null +++ b/drivers/staging/apple-bce/audio/protocol_bce.h @@ -0,0 +1,72 @@ @@ -24243,7 +22877,7 @@ index 000000000000..14d26c05ddf9 +#endif //AAUDIO_PROTOCOL_BCE_H diff --git a/drivers/staging/apple-bce/mailbox.c b/drivers/staging/apple-bce/mailbox.c new file mode 100644 -index 000000000000..e24bd35215c0 +index 0000000000000..e24bd35215c00 --- /dev/null +++ b/drivers/staging/apple-bce/mailbox.c @@ -0,0 +1,151 @@ @@ -24401,7 +23035,7 @@ index 000000000000..e24bd35215c0 \ No newline at end of file diff --git a/drivers/staging/apple-bce/mailbox.h b/drivers/staging/apple-bce/mailbox.h new file mode 100644 -index 000000000000..f3323f95ba51 +index 0000000000000..f3323f95ba51d --- /dev/null +++ b/drivers/staging/apple-bce/mailbox.h @@ -0,0 +1,53 @@ @@ -24460,7 +23094,7 @@ index 000000000000..f3323f95ba51 +#endif //BCEDRIVER_MAILBOX_H diff --git a/drivers/staging/apple-bce/queue.c b/drivers/staging/apple-bce/queue.c new file mode 100644 -index 000000000000..bc9cd3bc6f0c +index 0000000000000..bc9cd3bc6f0ca --- /dev/null +++ b/drivers/staging/apple-bce/queue.c @@ -0,0 +1,390 @@ @@ -24857,7 +23491,7 @@ index 000000000000..bc9cd3bc6f0c \ No newline at end of file diff --git a/drivers/staging/apple-bce/queue.h b/drivers/staging/apple-bce/queue.h new file mode 100644 -index 000000000000..8368ac5dfca8 +index 0000000000000..8368ac5dfca82 --- /dev/null +++ b/drivers/staging/apple-bce/queue.h @@ -0,0 +1,177 @@ @@ -25040,7 +23674,7 @@ index 000000000000..8368ac5dfca8 +#endif //BCEDRIVER_MAILBOX_H diff --git a/drivers/staging/apple-bce/queue_dma.c b/drivers/staging/apple-bce/queue_dma.c new file mode 100644 -index 000000000000..b236613285c0 +index 0000000000000..b236613285c0f --- /dev/null +++ b/drivers/staging/apple-bce/queue_dma.c @@ -0,0 +1,220 @@ @@ -25267,7 +23901,7 @@ index 000000000000..b236613285c0 \ No newline at end of file diff --git a/drivers/staging/apple-bce/queue_dma.h b/drivers/staging/apple-bce/queue_dma.h new file mode 100644 -index 000000000000..f8a57e50e7a3 +index 0000000000000..f8a57e50e7a30 --- /dev/null +++ b/drivers/staging/apple-bce/queue_dma.h @@ -0,0 +1,50 @@ @@ -25323,7 +23957,7 @@ index 000000000000..f8a57e50e7a3 +#endif //BCE_QUEUE_DMA_H diff --git a/drivers/staging/apple-bce/vhci/command.h b/drivers/staging/apple-bce/vhci/command.h new file mode 100644 -index 000000000000..26619e0bccfa +index 0000000000000..26619e0bccfa1 --- /dev/null +++ b/drivers/staging/apple-bce/vhci/command.h @@ -0,0 +1,204 @@ @@ -25533,7 +24167,7 @@ index 000000000000..26619e0bccfa +#endif //BCE_VHCI_COMMAND_H diff --git a/drivers/staging/apple-bce/vhci/queue.c b/drivers/staging/apple-bce/vhci/queue.c new file mode 100644 -index 000000000000..7b0b5027157b +index 0000000000000..7b0b5027157ba --- /dev/null +++ b/drivers/staging/apple-bce/vhci/queue.c @@ -0,0 +1,268 @@ @@ -25807,7 +24441,7 @@ index 000000000000..7b0b5027157b +} diff --git a/drivers/staging/apple-bce/vhci/queue.h b/drivers/staging/apple-bce/vhci/queue.h new file mode 100644 -index 000000000000..adb705b6ba1d +index 0000000000000..adb705b6ba1d2 --- /dev/null +++ b/drivers/staging/apple-bce/vhci/queue.h @@ -0,0 +1,76 @@ @@ -25889,7 +24523,7 @@ index 000000000000..adb705b6ba1d +#endif //BCE_VHCI_QUEUE_H diff --git a/drivers/staging/apple-bce/vhci/transfer.c b/drivers/staging/apple-bce/vhci/transfer.c new file mode 100644 -index 000000000000..8226363d69c8 +index 0000000000000..8226363d69c81 --- /dev/null +++ b/drivers/staging/apple-bce/vhci/transfer.c @@ -0,0 +1,661 @@ @@ -26556,7 +25190,7 @@ index 000000000000..8226363d69c8 +} diff --git a/drivers/staging/apple-bce/vhci/transfer.h b/drivers/staging/apple-bce/vhci/transfer.h new file mode 100644 -index 000000000000..89ecad6bcf8f +index 0000000000000..89ecad6bcf8f6 --- /dev/null +++ b/drivers/staging/apple-bce/vhci/transfer.h @@ -0,0 +1,73 @@ @@ -26635,7 +25269,7 @@ index 000000000000..89ecad6bcf8f +#endif //BCEDRIVER_TRANSFER_H diff --git a/drivers/staging/apple-bce/vhci/vhci.c b/drivers/staging/apple-bce/vhci/vhci.c new file mode 100644 -index 000000000000..eb26f55000d8 +index 0000000000000..eb26f55000d84 --- /dev/null +++ b/drivers/staging/apple-bce/vhci/vhci.c @@ -0,0 +1,759 @@ @@ -27400,7 +26034,7 @@ index 000000000000..eb26f55000d8 +MODULE_PARM_DESC(vhci_port_mask, "Specifies which VHCI ports are enabled"); diff --git a/drivers/staging/apple-bce/vhci/vhci.h b/drivers/staging/apple-bce/vhci/vhci.h new file mode 100644 -index 000000000000..6c2e22622f4c +index 0000000000000..6c2e22622f4c1 --- /dev/null +++ b/drivers/staging/apple-bce/vhci/vhci.h @@ -0,0 +1,52 @@ @@ -27457,7 +26091,7 @@ index 000000000000..6c2e22622f4c + +#endif //BCE_VHCI_H diff --git a/include/drm/drm_format_helper.h b/include/drm/drm_format_helper.h -index 428d81afe215..aa1604d92c1a 100644 +index 428d81afe2151..aa1604d92c1a7 100644 --- a/include/drm/drm_format_helper.h +++ b/include/drm/drm_format_helper.h @@ -96,6 +96,9 @@ void drm_fb_xrgb8888_to_rgba5551(struct iosys_map *dst, const unsigned int *dst_ @@ -27471,7 +26105,7 @@ index 428d81afe215..aa1604d92c1a 100644 const struct iosys_map *src, const struct drm_framebuffer *fb, const struct drm_rect *clip, struct drm_format_conv_state *state); diff --git a/include/linux/hid.h b/include/linux/hid.h -index 1533c9dcd3a6..2deff79f39a1 100644 +index 1533c9dcd3a67..2deff79f39a15 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -940,6 +940,8 @@ extern void hidinput_report_event(struct hid_device *hid, struct hid_report *rep @@ -27484,7 +26118,7 @@ index 1533c9dcd3a6..2deff79f39a1 100644 int hid_input_report(struct hid_device *hid, enum hid_report_type type, u8 *data, u32 size, int interrupt); diff --git a/lib/test_printf.c b/lib/test_printf.c -index 965cb6f28527..db99014b8c13 100644 +index 965cb6f285272..db99014b8c135 100644 --- a/lib/test_printf.c +++ b/lib/test_printf.c @@ -745,18 +745,26 @@ static void __init fwnode_pointer(void) @@ -27521,7 +26155,7 @@ index 965cb6f28527..db99014b8c13 100644 static void __init diff --git a/lib/vsprintf.c b/lib/vsprintf.c -index 2d71b1115916..5274e3c881de 100644 +index 2d71b11159161..5274e3c881de8 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -1760,27 +1760,50 @@ char *fourcc_string(char *buf, char *end, const u32 *fourcc, @@ -27590,7 +26224,7 @@ index 2d71b1115916..5274e3c881de 100644 * a certain separator (' ' by default): * C colon diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl -index 4427572b2477..b60c99d61882 100755 +index 4427572b24771..b60c99d618829 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -6917,7 +6917,7 @@ sub process { @@ -27603,14 +26237,14 @@ index 4427572b2477..b60c99d61882 100755 last; } -- -2.46.1 +2.47.0.rc0 -From eedeea376c1cc453dc1d63b13ee1c68e36b1dac1 Mon Sep 17 00:00:00 2001 -From: Eric Naim -Date: Thu, 19 Sep 2024 23:23:17 +0800 -Subject: [PATCH 11/11] zstd +From 0bf4affd05af4f7b24c07097720a340a1caa406d Mon Sep 17 00:00:00 2001 +From: Peter Jung +Date: Mon, 30 Sep 2024 16:56:28 +0200 +Subject: [PATCH 10/10] zstd -Signed-off-by: Eric Naim +Signed-off-by: Peter Jung --- include/linux/zstd.h | 2 +- include/linux/zstd_errors.h | 23 +- @@ -27675,7 +26309,7 @@ Signed-off-by: Eric Naim create mode 100644 lib/zstd/common/bits.h diff --git a/include/linux/zstd.h b/include/linux/zstd.h -index 113408eef6ec..f109d49f43f8 100644 +index 113408eef6ece..f109d49f43f80 100644 --- a/include/linux/zstd.h +++ b/include/linux/zstd.h @@ -1,6 +1,6 @@ @@ -27687,7 +26321,7 @@ index 113408eef6ec..f109d49f43f8 100644 * * This source code is licensed under both the BSD-style license (found in the diff --git a/include/linux/zstd_errors.h b/include/linux/zstd_errors.h -index 58b6dd45a969..6d5cf55f0bf3 100644 +index 58b6dd45a969f..6d5cf55f0bf3e 100644 --- a/include/linux/zstd_errors.h +++ b/include/linux/zstd_errors.h @@ -1,5 +1,6 @@ @@ -27753,7 +26387,7 @@ index 58b6dd45a969..6d5cf55f0bf3 100644 } ZSTD_ErrorCode; diff --git a/include/linux/zstd_lib.h b/include/linux/zstd_lib.h -index 79d55465d5c1..6320fedcf8a4 100644 +index 79d55465d5c1d..6320fedcf8a43 100644 --- a/include/linux/zstd_lib.h +++ b/include/linux/zstd_lib.h @@ -1,5 +1,6 @@ @@ -29234,7 +27868,7 @@ index 79d55465d5c1..6320fedcf8a4 100644 #endif /* ZSTD_H_ZSTD_STATIC_LINKING_ONLY */ diff --git a/lib/zstd/Makefile b/lib/zstd/Makefile -index 20f08c644b71..464c410b2768 100644 +index 20f08c644b71a..464c410b2768c 100644 --- a/lib/zstd/Makefile +++ b/lib/zstd/Makefile @@ -1,6 +1,6 @@ @@ -29247,7 +27881,7 @@ index 20f08c644b71..464c410b2768 100644 # This source code is licensed under both the BSD-style license (found in the diff --git a/lib/zstd/common/allocations.h b/lib/zstd/common/allocations.h new file mode 100644 -index 000000000000..16c3d08e8d1a +index 0000000000000..16c3d08e8d1a6 --- /dev/null +++ b/lib/zstd/common/allocations.h @@ -0,0 +1,56 @@ @@ -29309,7 +27943,7 @@ index 000000000000..16c3d08e8d1a +#endif /* ZSTD_ALLOCATIONS_H */ diff --git a/lib/zstd/common/bits.h b/lib/zstd/common/bits.h new file mode 100644 -index 000000000000..aa3487ec4b6a +index 0000000000000..aa3487ec4b6a7 --- /dev/null +++ b/lib/zstd/common/bits.h @@ -0,0 +1,149 @@ @@ -29463,7 +28097,7 @@ index 000000000000..aa3487ec4b6a + +#endif /* ZSTD_BITS_H */ diff --git a/lib/zstd/common/bitstream.h b/lib/zstd/common/bitstream.h -index feef3a1b1d60..6a13f1f0f1e8 100644 +index feef3a1b1d600..6a13f1f0f1e84 100644 --- a/lib/zstd/common/bitstream.h +++ b/lib/zstd/common/bitstream.h @@ -1,7 +1,8 @@ @@ -29752,7 +28386,7 @@ index feef3a1b1d60..6a13f1f0f1e8 100644 BIT_DStream_status result = BIT_DStream_unfinished; if (bitD->ptr - nbBytes < bitD->start) { diff --git a/lib/zstd/common/compiler.h b/lib/zstd/common/compiler.h -index c42d39faf9bd..508ee25537bb 100644 +index c42d39faf9bd8..508ee25537bb8 100644 --- a/lib/zstd/common/compiler.h +++ b/lib/zstd/common/compiler.h @@ -1,5 +1,6 @@ @@ -29950,7 +28584,7 @@ index c42d39faf9bd..508ee25537bb 100644 #endif /* ZSTD_COMPILER_H */ diff --git a/lib/zstd/common/cpu.h b/lib/zstd/common/cpu.h -index 0db7b42407ee..d8319a2bef4c 100644 +index 0db7b42407eea..d8319a2bef4ce 100644 --- a/lib/zstd/common/cpu.h +++ b/lib/zstd/common/cpu.h @@ -1,5 +1,6 @@ @@ -29962,7 +28596,7 @@ index 0db7b42407ee..d8319a2bef4c 100644 * * This source code is licensed under both the BSD-style license (found in the diff --git a/lib/zstd/common/debug.c b/lib/zstd/common/debug.c -index bb863c9ea616..8eb6aa9a3b20 100644 +index bb863c9ea6164..8eb6aa9a3b205 100644 --- a/lib/zstd/common/debug.c +++ b/lib/zstd/common/debug.c @@ -1,7 +1,8 @@ @@ -29987,7 +28621,7 @@ index bb863c9ea616..8eb6aa9a3b20 100644 int g_debuglevel = DEBUGLEVEL; +#endif diff --git a/lib/zstd/common/debug.h b/lib/zstd/common/debug.h -index 6dd88d1fbd02..226ba3c57ec3 100644 +index 6dd88d1fbd02c..226ba3c57ec34 100644 --- a/lib/zstd/common/debug.h +++ b/lib/zstd/common/debug.h @@ -1,7 +1,8 @@ @@ -30040,7 +28674,7 @@ index 6dd88d1fbd02..226ba3c57ec3 100644 diff --git a/lib/zstd/common/entropy_common.c b/lib/zstd/common/entropy_common.c -index fef67056f052..6cdd82233fb5 100644 +index fef67056f0524..6cdd82233fb59 100644 --- a/lib/zstd/common/entropy_common.c +++ b/lib/zstd/common/entropy_common.c @@ -1,6 +1,7 @@ @@ -30158,7 +28792,7 @@ index fef67056f052..6cdd82233fb5 100644 return HUF_readStats_body_default(huffWeight, hwSize, rankStats, nbSymbolsPtr, tableLogPtr, src, srcSize, workSpace, wkspSize); } diff --git a/lib/zstd/common/error_private.c b/lib/zstd/common/error_private.c -index 6d1135f8c373..a4062d30d170 100644 +index 6d1135f8c3733..a4062d30d1703 100644 --- a/lib/zstd/common/error_private.c +++ b/lib/zstd/common/error_private.c @@ -1,5 +1,6 @@ @@ -30206,7 +28840,7 @@ index 6d1135f8c373..a4062d30d170 100644 default: return notErrorCode; } diff --git a/lib/zstd/common/error_private.h b/lib/zstd/common/error_private.h -index ca5101e542fa..0410ca415b54 100644 +index ca5101e542faa..0410ca415b547 100644 --- a/lib/zstd/common/error_private.h +++ b/lib/zstd/common/error_private.h @@ -1,5 +1,6 @@ @@ -30332,7 +28966,7 @@ index ca5101e542fa..0410ca415b54 100644 #endif /* ERROR_H_MODULE */ diff --git a/lib/zstd/common/fse.h b/lib/zstd/common/fse.h -index 4507043b2287..2185a578617d 100644 +index 4507043b2287c..2185a578617de 100644 --- a/lib/zstd/common/fse.h +++ b/lib/zstd/common/fse.h @@ -1,7 +1,8 @@ @@ -30507,7 +29141,7 @@ index 4507043b2287..2185a578617d 100644 * note 2 : if freq[symbolValue]==0, @return a fake cost of tableLog+1 bits */ MEM_STATIC U32 FSE_getMaxNbBits(const void* symbolTTPtr, U32 symbolValue) diff --git a/lib/zstd/common/fse_decompress.c b/lib/zstd/common/fse_decompress.c -index 8dcb8ca39767..3a17e84f27bf 100644 +index 8dcb8ca39767c..3a17e84f27bfc 100644 --- a/lib/zstd/common/fse_decompress.c +++ b/lib/zstd/common/fse_decompress.c @@ -1,6 +1,7 @@ @@ -30741,7 +29375,7 @@ index 8dcb8ca39767..3a17e84f27bf 100644 - #endif /* FSE_COMMONDEFS_ONLY */ diff --git a/lib/zstd/common/huf.h b/lib/zstd/common/huf.h -index 5042ff870308..57462466e188 100644 +index 5042ff8703087..57462466e188c 100644 --- a/lib/zstd/common/huf.h +++ b/lib/zstd/common/huf.h @@ -1,7 +1,8 @@ @@ -31092,7 +29726,7 @@ index 5042ff870308..57462466e188 100644 +#endif /* HUF_H_298734234 */ diff --git a/lib/zstd/common/mem.h b/lib/zstd/common/mem.h -index 1d9cc03924ca..2e91e7780c1f 100644 +index 1d9cc03924ca9..2e91e7780c1fd 100644 --- a/lib/zstd/common/mem.h +++ b/lib/zstd/common/mem.h @@ -1,6 +1,6 @@ @@ -31112,7 +29746,7 @@ index 1d9cc03924ca..2e91e7780c1f 100644 /*-************************************************************** diff --git a/lib/zstd/common/portability_macros.h b/lib/zstd/common/portability_macros.h -index 0e3b2c0a527d..f08638cced6c 100644 +index 0e3b2c0a527db..f08638cced6c3 100644 --- a/lib/zstd/common/portability_macros.h +++ b/lib/zstd/common/portability_macros.h @@ -1,5 +1,6 @@ @@ -31175,7 +29809,7 @@ index 0e3b2c0a527d..f08638cced6c 100644 + #endif /* ZSTD_PORTABILITY_MACROS_H */ diff --git a/lib/zstd/common/zstd_common.c b/lib/zstd/common/zstd_common.c -index 3d7e35b309b5..44b95b25344a 100644 +index 3d7e35b309b5d..44b95b25344a1 100644 --- a/lib/zstd/common/zstd_common.c +++ b/lib/zstd/common/zstd_common.c @@ -1,5 +1,6 @@ @@ -31233,7 +29867,7 @@ index 3d7e35b309b5..44b95b25344a 100644 - } -} diff --git a/lib/zstd/common/zstd_deps.h b/lib/zstd/common/zstd_deps.h -index 2c34e8a33a1c..f931f7d0e294 100644 +index 2c34e8a33a1c1..f931f7d0e2947 100644 --- a/lib/zstd/common/zstd_deps.h +++ b/lib/zstd/common/zstd_deps.h @@ -1,6 +1,6 @@ @@ -31263,7 +29897,7 @@ index 2c34e8a33a1c..f931f7d0e294 100644 +#endif /* ZSTD_DEPS_STDINT */ +#endif /* ZSTD_DEPS_NEED_STDINT */ diff --git a/lib/zstd/common/zstd_internal.h b/lib/zstd/common/zstd_internal.h -index 93305d9b41bb..11da1233e890 100644 +index 93305d9b41bba..11da1233e8909 100644 --- a/lib/zstd/common/zstd_internal.h +++ b/lib/zstd/common/zstd_internal.h @@ -1,5 +1,6 @@ @@ -31492,7 +30126,7 @@ index 93305d9b41bb..11da1233e890 100644 const void* src, size_t srcSize); diff --git a/lib/zstd/compress/clevels.h b/lib/zstd/compress/clevels.h -index d9a76112ec3a..6ab8be6532ef 100644 +index d9a76112ec3af..6ab8be6532efc 100644 --- a/lib/zstd/compress/clevels.h +++ b/lib/zstd/compress/clevels.h @@ -1,5 +1,6 @@ @@ -31504,7 +30138,7 @@ index d9a76112ec3a..6ab8be6532ef 100644 * * This source code is licensed under both the BSD-style license (found in the diff --git a/lib/zstd/compress/fse_compress.c b/lib/zstd/compress/fse_compress.c -index ec5b1ca6d71a..44a3c10becf2 100644 +index ec5b1ca6d71af..44a3c10becf26 100644 --- a/lib/zstd/compress/fse_compress.c +++ b/lib/zstd/compress/fse_compress.c @@ -1,6 +1,7 @@ @@ -31673,7 +30307,7 @@ index ec5b1ca6d71a..44a3c10becf2 100644 - #endif /* FSE_COMMONDEFS_ONLY */ diff --git a/lib/zstd/compress/hist.c b/lib/zstd/compress/hist.c -index 3ddc6dfb6894..0b12587cc14b 100644 +index 3ddc6dfb68948..0b12587cc14b1 100644 --- a/lib/zstd/compress/hist.c +++ b/lib/zstd/compress/hist.c @@ -1,7 +1,8 @@ @@ -31687,7 +30321,7 @@ index 3ddc6dfb6894..0b12587cc14b 100644 * You can contact the author at : * - FSE source repository : https://github.com/Cyan4973/FiniteStateEntropy diff --git a/lib/zstd/compress/hist.h b/lib/zstd/compress/hist.h -index fc1830abc9c6..f7687b0fc20a 100644 +index fc1830abc9c63..f7687b0fc20a0 100644 --- a/lib/zstd/compress/hist.h +++ b/lib/zstd/compress/hist.h @@ -1,7 +1,8 @@ @@ -31701,7 +30335,7 @@ index fc1830abc9c6..f7687b0fc20a 100644 * You can contact the author at : * - FSE source repository : https://github.com/Cyan4973/FiniteStateEntropy diff --git a/lib/zstd/compress/huf_compress.c b/lib/zstd/compress/huf_compress.c -index 74ef0db47621..0b229f5d2ae2 100644 +index 74ef0db476210..0b229f5d2ae22 100644 --- a/lib/zstd/compress/huf_compress.c +++ b/lib/zstd/compress/huf_compress.c @@ -1,6 +1,7 @@ @@ -32572,7 +31206,7 @@ index 74ef0db47621..0b229f5d2ae2 100644 } - diff --git a/lib/zstd/compress/zstd_compress.c b/lib/zstd/compress/zstd_compress.c -index f620cafca633..0d139727cd39 100644 +index f620cafca633b..0d139727cd392 100644 --- a/lib/zstd/compress/zstd_compress.c +++ b/lib/zstd/compress/zstd_compress.c @@ -1,5 +1,6 @@ @@ -36480,7 +35114,7 @@ index f620cafca633..0d139727cd39 100644 + } +} diff --git a/lib/zstd/compress/zstd_compress_internal.h b/lib/zstd/compress/zstd_compress_internal.h -index 71697a11ae30..53cb582a8d2b 100644 +index 71697a11ae305..53cb582a8d2b5 100644 --- a/lib/zstd/compress/zstd_compress_internal.h +++ b/lib/zstd/compress/zstd_compress_internal.h @@ -1,5 +1,6 @@ @@ -37097,7 +35731,7 @@ index 71697a11ae30..53cb582a8d2b 100644 + #endif /* ZSTD_COMPRESS_H */ diff --git a/lib/zstd/compress/zstd_compress_literals.c b/lib/zstd/compress/zstd_compress_literals.c -index 52b0a8059aba..3e9ea46a670a 100644 +index 52b0a8059aba9..3e9ea46a670a6 100644 --- a/lib/zstd/compress/zstd_compress_literals.c +++ b/lib/zstd/compress/zstd_compress_literals.c @@ -1,5 +1,6 @@ @@ -37339,7 +35973,7 @@ index 52b0a8059aba..3e9ea46a670a 100644 MEM_writeLE32(ostart, lhc); ostart[4] = (BYTE)(cLitSize >> 10); diff --git a/lib/zstd/compress/zstd_compress_literals.h b/lib/zstd/compress/zstd_compress_literals.h -index 9775fb97cb70..a2a85d6b69e5 100644 +index 9775fb97cb702..a2a85d6b69e53 100644 --- a/lib/zstd/compress/zstd_compress_literals.h +++ b/lib/zstd/compress/zstd_compress_literals.h @@ -1,5 +1,6 @@ @@ -37383,7 +36017,7 @@ index 9775fb97cb70..a2a85d6b69e5 100644 #endif /* ZSTD_COMPRESS_LITERALS_H */ diff --git a/lib/zstd/compress/zstd_compress_sequences.c b/lib/zstd/compress/zstd_compress_sequences.c -index 21ddc1b37acf..5c028c78d889 100644 +index 21ddc1b37acf8..5c028c78d889b 100644 --- a/lib/zstd/compress/zstd_compress_sequences.c +++ b/lib/zstd/compress/zstd_compress_sequences.c @@ -1,5 +1,6 @@ @@ -37413,7 +36047,7 @@ index 21ddc1b37acf..5c028c78d889 100644 * If basic encoding isn't possible, always choose RLE. */ diff --git a/lib/zstd/compress/zstd_compress_sequences.h b/lib/zstd/compress/zstd_compress_sequences.h -index 7991364c2f71..7fe6f4ff5cf2 100644 +index 7991364c2f71f..7fe6f4ff5cf25 100644 --- a/lib/zstd/compress/zstd_compress_sequences.h +++ b/lib/zstd/compress/zstd_compress_sequences.h @@ -1,5 +1,6 @@ @@ -37425,7 +36059,7 @@ index 7991364c2f71..7fe6f4ff5cf2 100644 * * This source code is licensed under both the BSD-style license (found in the diff --git a/lib/zstd/compress/zstd_compress_superblock.c b/lib/zstd/compress/zstd_compress_superblock.c -index 17d836cc84e8..41f6521b27cd 100644 +index 17d836cc84e8f..41f6521b27cd3 100644 --- a/lib/zstd/compress/zstd_compress_superblock.c +++ b/lib/zstd/compress/zstd_compress_superblock.c @@ -1,5 +1,6 @@ @@ -37983,7 +36617,7 @@ index 17d836cc84e8..41f6521b27cd 100644 FORWARD_IF_ERROR(ZSTD_buildBlockEntropyStats(&zc->seqStore, diff --git a/lib/zstd/compress/zstd_compress_superblock.h b/lib/zstd/compress/zstd_compress_superblock.h -index 224ece79546e..826bbc9e029b 100644 +index 224ece79546eb..826bbc9e029b1 100644 --- a/lib/zstd/compress/zstd_compress_superblock.h +++ b/lib/zstd/compress/zstd_compress_superblock.h @@ -1,5 +1,6 @@ @@ -37995,7 +36629,7 @@ index 224ece79546e..826bbc9e029b 100644 * * This source code is licensed under both the BSD-style license (found in the diff --git a/lib/zstd/compress/zstd_cwksp.h b/lib/zstd/compress/zstd_cwksp.h -index 349fc923c355..86bc3c2c23c7 100644 +index 349fc923c355a..86bc3c2c23c77 100644 --- a/lib/zstd/compress/zstd_cwksp.h +++ b/lib/zstd/compress/zstd_cwksp.h @@ -1,5 +1,6 @@ @@ -38335,7 +36969,7 @@ index 349fc923c355..86bc3c2c23c7 100644 diff --git a/lib/zstd/compress/zstd_double_fast.c b/lib/zstd/compress/zstd_double_fast.c -index 76933dea2624..5ff54f17d92f 100644 +index 76933dea2624e..5ff54f17d92f0 100644 --- a/lib/zstd/compress/zstd_double_fast.c +++ b/lib/zstd/compress/zstd_double_fast.c @@ -1,5 +1,6 @@ @@ -38684,7 +37318,7 @@ index 76933dea2624..5ff54f17d92f 100644 + +#endif /* ZSTD_EXCLUDE_DFAST_BLOCK_COMPRESSOR */ diff --git a/lib/zstd/compress/zstd_double_fast.h b/lib/zstd/compress/zstd_double_fast.h -index 6822bde65a1d..b7ddc714f13e 100644 +index 6822bde65a1d8..b7ddc714f13ed 100644 --- a/lib/zstd/compress/zstd_double_fast.h +++ b/lib/zstd/compress/zstd_double_fast.h @@ -1,5 +1,6 @@ @@ -38725,7 +37359,7 @@ index 6822bde65a1d..b7ddc714f13e 100644 #endif /* ZSTD_DOUBLE_FAST_H */ diff --git a/lib/zstd/compress/zstd_fast.c b/lib/zstd/compress/zstd_fast.c -index a752e6beab52..b7a63ba4ce56 100644 +index a752e6beab52e..b7a63ba4ce568 100644 --- a/lib/zstd/compress/zstd_fast.c +++ b/lib/zstd/compress/zstd_fast.c @@ -1,5 +1,6 @@ @@ -39543,7 +38177,7 @@ index a752e6beab52..b7a63ba4ce56 100644 { default: /* includes case 3 */ diff --git a/lib/zstd/compress/zstd_fast.h b/lib/zstd/compress/zstd_fast.h -index fddc2f532d21..e64d9e1b2d39 100644 +index fddc2f532d21d..e64d9e1b2d393 100644 --- a/lib/zstd/compress/zstd_fast.h +++ b/lib/zstd/compress/zstd_fast.h @@ -1,5 +1,6 @@ @@ -39565,7 +38199,7 @@ index fddc2f532d21..e64d9e1b2d39 100644 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], void const* src, size_t srcSize); diff --git a/lib/zstd/compress/zstd_lazy.c b/lib/zstd/compress/zstd_lazy.c -index 0298a01a7504..3e88d8a1a136 100644 +index 0298a01a7504a..3e88d8a1a1365 100644 --- a/lib/zstd/compress/zstd_lazy.c +++ b/lib/zstd/compress/zstd_lazy.c @@ -1,5 +1,6 @@ @@ -41048,7 +39682,7 @@ index 0298a01a7504..3e88d8a1a136 100644 } +#endif diff --git a/lib/zstd/compress/zstd_lazy.h b/lib/zstd/compress/zstd_lazy.h -index e5bdf4df8dde..22c9201f4e63 100644 +index e5bdf4df8dde0..22c9201f4e632 100644 --- a/lib/zstd/compress/zstd_lazy.h +++ b/lib/zstd/compress/zstd_lazy.h @@ -1,5 +1,6 @@ @@ -41265,7 +39899,7 @@ index e5bdf4df8dde..22c9201f4e63 100644 #endif /* ZSTD_LAZY_H */ diff --git a/lib/zstd/compress/zstd_ldm.c b/lib/zstd/compress/zstd_ldm.c -index dd86fc83e7dd..07f3bc6437ce 100644 +index dd86fc83e7dde..07f3bc6437ce6 100644 --- a/lib/zstd/compress/zstd_ldm.c +++ b/lib/zstd/compress/zstd_ldm.c @@ -1,5 +1,6 @@ @@ -41340,7 +39974,7 @@ index dd86fc83e7dd..07f3bc6437ce 100644 ip += sequence.matchLength; } diff --git a/lib/zstd/compress/zstd_ldm.h b/lib/zstd/compress/zstd_ldm.h -index fbc6a5e88fd7..c540731abde7 100644 +index fbc6a5e88fd7a..c540731abde72 100644 --- a/lib/zstd/compress/zstd_ldm.h +++ b/lib/zstd/compress/zstd_ldm.h @@ -1,5 +1,6 @@ @@ -41352,7 +39986,7 @@ index fbc6a5e88fd7..c540731abde7 100644 * * This source code is licensed under both the BSD-style license (found in the diff --git a/lib/zstd/compress/zstd_ldm_geartab.h b/lib/zstd/compress/zstd_ldm_geartab.h -index 647f865be290..cfccfc46f6f7 100644 +index 647f865be2903..cfccfc46f6f7b 100644 --- a/lib/zstd/compress/zstd_ldm_geartab.h +++ b/lib/zstd/compress/zstd_ldm_geartab.h @@ -1,5 +1,6 @@ @@ -41364,7 +39998,7 @@ index 647f865be290..cfccfc46f6f7 100644 * * This source code is licensed under both the BSD-style license (found in the diff --git a/lib/zstd/compress/zstd_opt.c b/lib/zstd/compress/zstd_opt.c -index fd82acfda62f..a87b66ac8d24 100644 +index fd82acfda62f6..a87b66ac8d248 100644 --- a/lib/zstd/compress/zstd_opt.c +++ b/lib/zstd/compress/zstd_opt.c @@ -1,5 +1,6 @@ @@ -42363,7 +40997,7 @@ index fd82acfda62f..a87b66ac8d24 100644 /* note : no btultra2 variant for extDict nor dictMatchState, * because btultra2 is not meant to work with dictionaries diff --git a/lib/zstd/compress/zstd_opt.h b/lib/zstd/compress/zstd_opt.h -index 22b862858ba7..ac1b743d27cd 100644 +index 22b862858ba7a..ac1b743d27cd1 100644 --- a/lib/zstd/compress/zstd_opt.h +++ b/lib/zstd/compress/zstd_opt.h @@ -1,5 +1,6 @@ @@ -42444,7 +41078,7 @@ index 22b862858ba7..ac1b743d27cd 100644 #endif /* ZSTD_OPT_H */ diff --git a/lib/zstd/decompress/huf_decompress.c b/lib/zstd/decompress/huf_decompress.c -index 60958afebc41..ac8b87f48f84 100644 +index 60958afebc415..ac8b87f48f847 100644 --- a/lib/zstd/decompress/huf_decompress.c +++ b/lib/zstd/decompress/huf_decompress.c @@ -1,7 +1,8 @@ @@ -43835,7 +42469,7 @@ index 60958afebc41..ac8b87f48f84 100644 } - diff --git a/lib/zstd/decompress/zstd_ddict.c b/lib/zstd/decompress/zstd_ddict.c -index dbbc7919de53..30ef65e1ab5c 100644 +index dbbc7919de534..30ef65e1ab5ca 100644 --- a/lib/zstd/decompress/zstd_ddict.c +++ b/lib/zstd/decompress/zstd_ddict.c @@ -1,5 +1,6 @@ @@ -43877,7 +42511,7 @@ index dbbc7919de53..30ef65e1ab5c 100644 + return ddict->dictID; } diff --git a/lib/zstd/decompress/zstd_ddict.h b/lib/zstd/decompress/zstd_ddict.h -index 8c1a79d666f8..de459a0dacd1 100644 +index 8c1a79d666f89..de459a0dacd19 100644 --- a/lib/zstd/decompress/zstd_ddict.h +++ b/lib/zstd/decompress/zstd_ddict.h @@ -1,5 +1,6 @@ @@ -43889,7 +42523,7 @@ index 8c1a79d666f8..de459a0dacd1 100644 * * This source code is licensed under both the BSD-style license (found in the diff --git a/lib/zstd/decompress/zstd_decompress.c b/lib/zstd/decompress/zstd_decompress.c -index 6b3177c94711..c9cbc45f6ed9 100644 +index 6b3177c947114..c9cbc45f6ed94 100644 --- a/lib/zstd/decompress/zstd_decompress.c +++ b/lib/zstd/decompress/zstd_decompress.c @@ -1,5 +1,6 @@ @@ -44668,7 +43302,7 @@ index 6b3177c94711..c9cbc45f6ed9 100644 + } } diff --git a/lib/zstd/decompress/zstd_decompress_block.c b/lib/zstd/decompress/zstd_decompress_block.c -index c1913b8e7c89..9fe9a12c8a2c 100644 +index c1913b8e7c897..9fe9a12c8a2c0 100644 --- a/lib/zstd/decompress/zstd_decompress_block.c +++ b/lib/zstd/decompress/zstd_decompress_block.c @@ -1,5 +1,6 @@ @@ -46112,7 +44746,7 @@ index c1913b8e7c89..9fe9a12c8a2c 100644 + return ZSTD_decompressBlock_deprecated(dctx, dst, dstCapacity, src, srcSize); +} diff --git a/lib/zstd/decompress/zstd_decompress_block.h b/lib/zstd/decompress/zstd_decompress_block.h -index 3d2d57a5d25a..becffbd89364 100644 +index 3d2d57a5d25a7..becffbd893642 100644 --- a/lib/zstd/decompress/zstd_decompress_block.h +++ b/lib/zstd/decompress/zstd_decompress_block.h @@ -1,5 +1,6 @@ @@ -46144,7 +44778,7 @@ index 3d2d57a5d25a..becffbd89364 100644 #endif /* ZSTD_DEC_BLOCK_H */ diff --git a/lib/zstd/decompress/zstd_decompress_internal.h b/lib/zstd/decompress/zstd_decompress_internal.h -index 98102edb6a83..0f02526be774 100644 +index 98102edb6a832..0f02526be7744 100644 --- a/lib/zstd/decompress/zstd_decompress_internal.h +++ b/lib/zstd/decompress/zstd_decompress_internal.h @@ -1,5 +1,6 @@ @@ -46188,7 +44822,7 @@ index 98102edb6a83..0f02526be774 100644 /* streaming */ ZSTD_dStreamStage streamStage; diff --git a/lib/zstd/decompress_sources.h b/lib/zstd/decompress_sources.h -index a06ca187aab5..8a47eb2a4514 100644 +index a06ca187aab5f..8a47eb2a45145 100644 --- a/lib/zstd/decompress_sources.h +++ b/lib/zstd/decompress_sources.h @@ -1,6 +1,6 @@ @@ -46200,7 +44834,7 @@ index a06ca187aab5..8a47eb2a4514 100644 * * This source code is licensed under both the BSD-style license (found in the diff --git a/lib/zstd/zstd_common_module.c b/lib/zstd/zstd_common_module.c -index 22686e367e6f..466828e35752 100644 +index 22686e367e6f0..466828e357525 100644 --- a/lib/zstd/zstd_common_module.c +++ b/lib/zstd/zstd_common_module.c @@ -1,6 +1,6 @@ @@ -46222,7 +44856,7 @@ index 22686e367e6f..466828e35752 100644 MODULE_LICENSE("Dual BSD/GPL"); MODULE_DESCRIPTION("Zstd Common"); diff --git a/lib/zstd/zstd_compress_module.c b/lib/zstd/zstd_compress_module.c -index 04e1b5c01d9b..8ecf43226af2 100644 +index 04e1b5c01d9b6..8ecf43226af2f 100644 --- a/lib/zstd/zstd_compress_module.c +++ b/lib/zstd/zstd_compress_module.c @@ -1,6 +1,6 @@ @@ -46234,7 +44868,7 @@ index 04e1b5c01d9b..8ecf43226af2 100644 * * This source code is licensed under both the BSD-style license (found in the diff --git a/lib/zstd/zstd_decompress_module.c b/lib/zstd/zstd_decompress_module.c -index f4ed952ed485..7d31518e9d5a 100644 +index f4ed952ed4852..7d31518e9d5ab 100644 --- a/lib/zstd/zstd_decompress_module.c +++ b/lib/zstd/zstd_decompress_module.c @@ -1,6 +1,6 @@ @@ -46255,4 +44889,4 @@ index f4ed952ed485..7d31518e9d5a 100644 EXPORT_SYMBOL(zstd_reset_dstream); -- -2.46.1 +2.47.0.rc0