Merge pull request #1 from import/kernel-5.15:rosa2021.1

Backports and update
This commit is contained in:
djam 2024-06-10 14:54:44 +00:00
commit 383f6c613e
5 changed files with 36 additions and 98 deletions

View file

@ -12,4 +12,4 @@ sources:
public_key_RSA_10.pem: ea4752f0a0671a998ba83050acad926a1cbd8c37
public_key_RSA_11.pem: b71d76f7f322fcd107b3607dfcacb99a0ca20892
public_key_RSA_12.pem: ce9600ed7fb5c505dc7208a4a2fab4c8ba20df72
patch-5.15.79.xz: 2444de3d1e19537f117b0c9e2f257261e3887678
patch-5.15.150.xz: 969a07bfddeb7fae2475603b33884995546af2d5

View file

@ -1950,7 +1950,7 @@ index edc32575828b..d80625ae4c12 100644
M: Miguel Ojeda <ojeda@kernel.org>
S: Maintained
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 79e485949b60..44fe18055d44 100644
index c96bdb3e7ac5..8a686e88b13c 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -673,6 +673,15 @@ static inline void loop_update_dio(struct loop_device *lo)
@ -1977,7 +1977,7 @@ index 79e485949b60..44fe18055d44 100644
int error;
bool partscan;
bool is_loop;
@@ -749,11 +759,19 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
@@ -753,11 +763,19 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
if (!(lo->lo_flags & LO_FLAGS_READ_ONLY))
goto out_err;
@ -1997,7 +1997,7 @@ index 79e485949b60..44fe18055d44 100644
error = -EINVAL;
@@ -766,6 +784,7 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
@@ -770,6 +788,7 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
blk_mq_freeze_queue(lo->lo_queue);
mapping_set_gfp_mask(old_file->f_mapping, lo->old_gfp_mask);
lo->lo_backing_file = file;
@ -2005,7 +2005,7 @@ index 79e485949b60..44fe18055d44 100644
lo->old_gfp_mask = mapping_gfp_mask(file->f_mapping);
mapping_set_gfp_mask(file->f_mapping,
lo->old_gfp_mask & ~(__GFP_IO|__GFP_FS));
@@ -788,6 +807,8 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
@@ -792,6 +811,8 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
* dependency.
*/
fput(old_file);
@ -2013,14 +2013,14 @@ index 79e485949b60..44fe18055d44 100644
+ fput(old_virt_file);
if (partscan)
loop_reread_partitions(lo);
return 0;
@@ -796,9 +817,29 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
@@ -805,9 +826,29 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
loop_global_unlock(lo, is_loop);
out_putf:
fput(file);
+ if (virt_file)
+ fput(virt_file);
return error;
goto done;
}
+/*
@ -2044,7 +2044,7 @@ index 79e485949b60..44fe18055d44 100644
/* loop sysfs attributes */
static ssize_t loop_attr_show(struct device *dev, char *page,
@@ -1188,6 +1229,7 @@ static int loop_configure(struct loop_device *lo, fmode_t mode,
@@ -1197,6 +1238,7 @@ static int loop_configure(struct loop_device *lo, fmode_t mode,
const struct loop_config *config)
{
struct file *file = fget(config->fd);
@ -2052,7 +2052,7 @@ index 79e485949b60..44fe18055d44 100644
struct inode *inode;
struct address_space *mapping;
int error;
@@ -1203,6 +1245,13 @@ static int loop_configure(struct loop_device *lo, fmode_t mode,
@@ -1212,6 +1254,13 @@ static int loop_configure(struct loop_device *lo, fmode_t mode,
/* This is safe, since we have a reference from open(). */
__module_get(THIS_MODULE);
@ -2066,7 +2066,7 @@ index 79e485949b60..44fe18055d44 100644
/*
* If we don't hold exclusive handle for the device, upgrade to it
* here to avoid changing device under exclusive owner.
@@ -1268,6 +1317,7 @@ static int loop_configure(struct loop_device *lo, fmode_t mode,
@@ -1280,6 +1329,7 @@ static int loop_configure(struct loop_device *lo, fmode_t mode,
lo->use_dio = lo->lo_flags & LO_FLAGS_DIRECT_IO;
lo->lo_device = bdev;
lo->lo_backing_file = file;
@ -2074,7 +2074,7 @@ index 79e485949b60..44fe18055d44 100644
lo->old_gfp_mask = mapping_gfp_mask(mapping);
mapping_set_gfp_mask(mapping, lo->old_gfp_mask & ~(__GFP_IO|__GFP_FS));
@@ -1318,6 +1368,8 @@ static int loop_configure(struct loop_device *lo, fmode_t mode,
@@ -1335,6 +1385,8 @@ static int loop_configure(struct loop_device *lo, fmode_t mode,
bd_abort_claiming(bdev, loop_configure);
out_putf:
fput(file);
@ -2083,7 +2083,7 @@ index 79e485949b60..44fe18055d44 100644
/* This is safe: open() is still holding a reference. */
module_put(THIS_MODULE);
return error;
@@ -1326,6 +1378,7 @@ static int loop_configure(struct loop_device *lo, fmode_t mode,
@@ -1343,6 +1395,7 @@ static int loop_configure(struct loop_device *lo, fmode_t mode,
static int __loop_clr_fd(struct loop_device *lo, bool release)
{
struct file *filp = NULL;
@ -2091,7 +2091,7 @@ index 79e485949b60..44fe18055d44 100644
gfp_t gfp = lo->old_gfp_mask;
struct block_device *bdev = lo->lo_device;
int err = 0;
@@ -1377,6 +1430,7 @@ static int __loop_clr_fd(struct loop_device *lo, bool release)
@@ -1394,6 +1447,7 @@ static int __loop_clr_fd(struct loop_device *lo, bool release)
spin_lock_irq(&lo->lo_lock);
lo->lo_backing_file = NULL;
@ -2099,7 +2099,7 @@ index 79e485949b60..44fe18055d44 100644
spin_unlock_irq(&lo->lo_lock);
loop_release_xfer(lo);
@@ -1457,6 +1511,8 @@ static int __loop_clr_fd(struct loop_device *lo, bool release)
@@ -1474,6 +1528,8 @@ static int __loop_clr_fd(struct loop_device *lo, bool release)
*/
if (filp)
fput(filp);

View file

@ -32,7 +32,7 @@ index 315ca5c4b..af98ec6fe 100644
- /* Error Handling: TX */
+ /* Error Handling: RX */
if (isr[i] & ISR_RXFO) {
- dev_err(dev->dev, "RX overrun (ch_id=%d)\n", i);
- dev_err_ratelimited(dev->dev, "RX overrun (ch_id=%d)\n", i);
+ rxor_count = READ_ONCE(dev->rx_overrun_count);
+ if (!(rxor_count & 0x3ff))
+ dev_dbg(dev->dev, "RX overrun (ch_id=%d)\n", i);

View file

@ -1,74 +0,0 @@
From e400ad8b7e6a1b9102123c6240289a811501f7d9 Mon Sep 17 00:00:00 2001
From: Dave Hansen <dave.hansen@intel.com>
Date: Thu, 22 Sep 2022 11:47:45 -0700
Subject: [PATCH] ACPI: processor idle: Practically limit "Dummy wait"
workaround to old Intel systems
Old, circa 2002 chipsets have a bug: they don't go idle when they are
supposed to. So, a workaround was added to slow the CPU down and
ensure that the CPU waits a bit for the chipset to actually go idle.
This workaround is ancient and has been in place in some form since
the original kernel ACPI implementation.
But, this workaround is very painful on modern systems. The "inl()"
can take thousands of cycles (see Link: for some more detailed
numbers and some fun kernel archaeology).
First and foremost, modern systems should not be using this code.
Typical Intel systems have not used it in over a decade because it is
horribly inferior to MWAIT-based idle.
Despite this, people do seem to be tripping over this workaround on
AMD system today.
Limit the "dummy wait" workaround to Intel systems. Keep Modern AMD
systems from tripping over the workaround. Remotely modern Intel
systems use intel_idle instead of this code and will, in practice,
remain unaffected by the dummy wait.
Reported-by: K Prateek Nayak <kprateek.nayak@amd.com>
Suggested-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Tested-by: K Prateek Nayak <kprateek.nayak@amd.com>
Link: https://lore.kernel.org/all/20220921063638.2489-1-kprateek.nayak@amd.com/
Link: https://lkml.kernel.org/r/20220922184745.3252932-1-dave.hansen@intel.com
---
drivers/acpi/processor_idle.c | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index 16a1663d02d460..9f40917c49efbf 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -531,10 +531,27 @@ static void wait_for_freeze(void)
/* No delay is needed if we are in guest */
if (boot_cpu_has(X86_FEATURE_HYPERVISOR))
return;
+ /*
+ * Modern (>=Nehalem) Intel systems use ACPI via intel_idle,
+ * not this code. Assume that any Intel systems using this
+ * are ancient and may need the dummy wait. This also assumes
+ * that the motivating chipset issue was Intel-only.
+ */
+ if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL)
+ return;
#endif
- /* Dummy wait op - must do something useless after P_LVL2 read
- because chipsets cannot guarantee that STPCLK# signal
- gets asserted in time to freeze execution properly. */
+ /*
+ * Dummy wait op - must do something useless after P_LVL2 read
+ * because chipsets cannot guarantee that STPCLK# signal gets
+ * asserted in time to freeze execution properly
+ *
+ * This workaround has been in place since the original ACPI
+ * implementation was merged, circa 2002.
+ *
+ * If a profile is pointing to this instruction, please first
+ * consider moving your system to a more modern idle
+ * mechanism.
+ */
inl(acpi_gbl_FADT.xpm_timer_block.address);
}

View file

@ -23,13 +23,16 @@
%global _debuginfo_template %{nil}
%undefine _debugsource_packages
# Avoid rediffing patches like AUFS when possible
%define _default_patch_fuzz 10
# Hack: flavour and major version are variable, make %%_build_pkgcheck_* always detect and use this config
%global _build_pkgcheck_set %(echo "%{_build_pkgcheck_set}" | sed -e 's,/%{name}.rpmlintrc,/kernel.rpmlintrc,')
%global _build_pkgcheck_srpm %(echo "%{_build_pkgcheck_srpm}" | sed -e 's,/%{name}.rpmlintrc,/kernel.rpmlintrc,')
%define kernelversion 5
%define patchlevel 15
%define sublevel 79
%define sublevel 150
# Release number. Increase this before a rebuild.
%define rpmrel 1
@ -178,6 +181,8 @@ cat %{_builddir}/debugfiles.list >> %{debuginfo_files}
%global nvidia_515_n %{kroko_n -p kernel-source-nvidia515 -r 515}
%global nvidia_520_j %{kroko_j -p kernel-source-nvidia520 -r 520}
%global nvidia_520_n %{kroko_n -p kernel-source-nvidia520 -r 520}
%global nvidia_525_j %{kroko_j -p kernel-source-nvidia525 -r 525}
%global nvidia_525_n %{kroko_n -p kernel-source-nvidia525 -r 525}
# For SRPM stage when auto-krokodil-rpm-macros is not installed
%{?!kroko_mk_release:%global kroko_mk_release(n:) %{nil}}
@ -210,11 +215,15 @@ cat %{_builddir}/debugfiles.list >> %{debuginfo_files}
%define build_debug 1
# Build kernel-headers package
%if %{mdvver} >= 202115
%define build_headers 0
%else
%define build_headers 1
%endif
# Build perf and cpupower tools
%define build_perf 1
%define build_cpupower 1
%define build_perf 0
%define build_cpupower 0
%if %{with compress_modules}
%if %{with modxz}
@ -311,8 +320,6 @@ Patch1: https://cdn.kernel.org/pub/linux/kernel/v%{kernelversion}.x/patch-%{kve
# Patches from mainline
# none
Patch2: kernel-5.10.93-fix-perf-build.patch
# https://www.opennet.ru/opennews/art.shtml?num=57838
Patch3: https://github.com/torvalds/linux/commit/e400ad8b7e6a1b9102123c6240289a811501f7d9.patch
# ROSA-specific patches
@ -463,6 +470,7 @@ BuildRequires: bzip2
BuildRequires: ccache
%endif
BuildRequires: flex
BuildRequires: elfutils-devel
BuildRequires: gcc
# ./scripts/mkcompile_h
BuildRequires: hostname
@ -501,7 +509,6 @@ BuildRequires: python3
BuildRequires: xmlto
BuildRequires: audit-devel
BuildRequires: binutils-devel
BuildRequires: elfutils-devel
BuildRequires: java-1.8.0-openjdk-devel
BuildRequires: libunwind-devel
BuildRequires: newt-devel
@ -553,6 +560,7 @@ BuildRequires: kernel-source-nvidia470
BuildRequires: kernel-source-nvidia510
BuildRequires: kernel-source-nvidia515
BuildRequires: kernel-source-nvidia520
BuildRequires: kernel-source-nvidia525
%endif
BuildRequires: kernel-source-tripso
BuildRequires: kernel-source-ipt-so
@ -582,7 +590,7 @@ Requires(posttrans): dracut >= 053-0.git5eb736.5
Requires(posttrans): kmod >= 28-3
# Need for rebuild dkms drivers
Requires: (%{name}-devel%{_isa} = %{EVRD} if dkms)
Recommends: (%{name}-devel%{_isa} = %{EVRD} if dkms)
# Usually necessary, but sometimes user may want to not install them
Recommends: crda
@ -616,6 +624,7 @@ Recommends: kernel-headers = %{EVRD}
%kroko_req_modules_in_kernel -j %{nvidia_510_j} -n %{nvidia_510_n} -p %{kver_full}
%kroko_req_modules_in_kernel -j %{nvidia_515_j} -n %{nvidia_515_n} -p %{kver_full}
%kroko_req_modules_in_kernel -j %{nvidia_520_j} -n %{nvidia_520_n} -p %{kver_full}
%kroko_req_modules_in_kernel -j %{nvidia_525_j} -n %{nvidia_525_n} -p %{kver_full}
%endif
%endif
@ -811,6 +820,7 @@ done
%{devel_root}/include/xen
%{devel_root}/init
%{devel_root}/ipc
%{devel_root}/io_uring
%{devel_root}/kernel
%{devel_root}/lib
%{devel_root}/mm
@ -1041,7 +1051,7 @@ User Mode Linux (UML) kernel modules:
%ksob_mk_module_pkg -n 8723du -s net/wireless
%ksob_mk_module_pkg -n 8852au -s net/wireless
%ksob_mk_module_pkg -n 8192du -s net/wireless
%ksob_mk_modules_pkg -n rtw89 -s net/wireless/realtek/rtw89p -r rtw89-firmware
%ksob_mk_modules_pkg -n rtw89 -s net/wireless/realtek/rtw89p
%ksob_mk_modules_pkg -n rtw88 -s net/wireless/realtek/rtw88p -r rtw88-firmware
%ifarch %{ix86} %{x86_64}
@ -1054,6 +1064,7 @@ User Mode Linux (UML) kernel modules:
%kroko_kmod_pkg -r %{kroko_release} -j %{nvidia_510_j} -n %{nvidia_510_n} -f %{flavour} -k %{kernelversion}.%{patchlevel} -m %{sublevel} -p %{kver_full} -s %{NAME} -c %{kmod_suffix}
%kroko_kmod_pkg -r %{kroko_release} -j %{nvidia_515_j} -n %{nvidia_515_n} -f %{flavour} -k %{kernelversion}.%{patchlevel} -m %{sublevel} -p %{kver_full} -s %{NAME} -c %{kmod_suffix}
%kroko_kmod_pkg -r %{kroko_release} -j %{nvidia_520_j} -n %{nvidia_520_n} -f %{flavour} -k %{kernelversion}.%{patchlevel} -m %{sublevel} -p %{kver_full} -s %{NAME} -c %{kmod_suffix}
%kroko_kmod_pkg -r %{kroko_release} -j %{nvidia_525_j} -n %{nvidia_525_n} -f %{flavour} -k %{kernelversion}.%{patchlevel} -m %{sublevel} -p %{kver_full} -s %{NAME} -c %{kmod_suffix}
%endif
%ksob_mk_module_pkg -n xt_TRIPSO -s net -r tripso
%ksob_mk_module_pkg -n xt_so -s net -r ipt-so
@ -1571,6 +1582,7 @@ _build_nvidia 470
_build_nvidia 510
_build_nvidia 515
_build_nvidia 520
_build_nvidia 525
%endif
cp -r "$(rpm -q --qf '/usr/src/tripso-%%{VERSION}-%%{RELEASE}' kernel-source-tripso)" kernel-source-tripso