Skip to content

Commit

Permalink
kernel: Update to v5.12.11
Browse files Browse the repository at this point in the history
  • Loading branch information
aunali1 committed Jun 16, 2021
1 parent 0c09067 commit 199a151
Show file tree
Hide file tree
Showing 9 changed files with 722 additions and 15 deletions.
29 changes: 20 additions & 9 deletions .SRCINFO
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
pkgbase = linux-mbp
pkgdesc = Linux for MBP
pkgver = 5.12.8
pkgver = 5.12.11
pkgrel = 1
url = https://git.archlinux.org/linux.git/log/?h=vv5.12-8
url = https://git.archlinux.org/linux.git/log/?h=vv5.12-11
arch = x86_64
license = GPL2
makedepends = bc
Expand All @@ -20,10 +20,16 @@ pkgbase = linux-mbp
makedepends = imagemagick
makedepends = git
options = !strip
source = https://www.kernel.org/pub/linux/kernel/v5.x/linux-5.12.8.tar.xz
source = https://www.kernel.org/pub/linux/kernel/v5.x/linux-5.12.8.tar.sign
source = https://www.kernel.org/pub/linux/kernel/v5.x/linux-5.12.11.tar.xz
source = https://www.kernel.org/pub/linux/kernel/v5.x/linux-5.12.11.tar.sign
source = config
source = 0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch
source = 0002-x86-setup-Consolidate-early-memory-reservations.patch
source = 0003-x86-setup-Merge-several-reservations-of-start-of-mem.patch
source = 0004-x86-setup-Move-trim_snb_memory-later-in-setup_arch-t.patch
source = 0005-x86-setup-always-reserve-the-first-1M-of-RAM.patch
source = 0006-x86-setup-remove-CONFIG_X86_RESERVE_LOW-and-reservel.patch
source = 0007-x86-crash-remove-crash_reserve_low_1M.patch
source = 2001-drm-amd-display-Force-link_rate-as-LINK_RATE_RBR2-fo.patch
source = 3001-applesmc-convert-static-structures-to-drvdata.patch
source = 3002-applesmc-make-io-port-base-addr-dynamic.patch
Expand All @@ -48,10 +54,16 @@ pkgbase = linux-mbp
source = 8002-brcmfmac-Add-initial-support-for-the-BRCM4377.patch
validpgpkeys = ABAF11C65A2970B130ABE3C479BE3E4300411886
validpgpkeys = 647F28654894E3BD457199BE38DBBDC86092693E
sha256sums = ad46b6ae540c13a6adcd05e8e37a24385686db1145997f7cc7edaffd4b438f8c
sha256sums = ae7c3310365f6afdc0b6bd01f434a52c484589bd9b0fea8067b81a46d6f67f7a
sha256sums = SKIP
sha256sums = 57acef504e43acf77ba6515ca01adfe74870ceb7cec6f0b5fbd5546793da52b1
sha256sums = fb8a471c91de22544a63aac13fe56e28a958b786b7cfd533fa57e03d22960366
sha256sums = 5cba62d057b0338caf5348c2c4ba9d2316d9b643baacfbd3b76a1f21109ca087
sha256sums = 2941e2966740841c5d21e642b3f85d4363db18efc86965ff0f7d197ebacc3a1b
sha256sums = caf0d5e9e56bc890ed630397f65eb7cba5fff3c9870e367764991668a8f92c86
sha256sums = dd66b57504483583bc19fbaee5f394dcb81a62507a86aeb7dd513eaff27c830c
sha256sums = 877bf8cf4fe38113c5ad010830a6bf181aca9de7a85d5dff27fe1c23585352fb
sha256sums = e81362adf65c7dd02ec4ca04304d51856cab72befb89af0a06f4d08685ce170c
sha256sums = e4306b524c70e420591b8e3630e6720a5de497e60f0c97334f2c75331042e576
sha256sums = 786dfc22e4c6ece883e7dedd0ba3f6c14018584df95450b2cb78f3da8b01f7cb
sha256sums = 0d3e591d7cb2532ee68c4621594a10b1d0240528a312159ee0731484bb180400
sha256sums = 63187212c33d844b6b9a26f76e789d9f4144d0d8fe9444dfd499f31430b45648
Expand Down Expand Up @@ -82,14 +94,13 @@ pkgname = linux-mbp
depends = initramfs
optdepends = crda: to set the correct wireless channels of your country
optdepends = linux-firmware: firmware images needed for some devices
provides = linux=5.12.8
provides = linux=5.12.11
replaces = virtualbox-guest-modules-arch
replaces = wireguard-arch

pkgname = linux-mbp-headers
pkgdesc = Headers and scripts for building modules for the Linux for MBP kernel
provides = linux-headers=5.12.8
provides = linux-headers=5.12.11

pkgname = linux-mbp-docs
pkgdesc = Documentation for the Linux for MBP kernel

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From c07e44df5b54011594a65027f658473a11afe1e1 Mon Sep 17 00:00:00 2001
From fa17daad7209d62169553ce6336ef29ba4748049 Mon Sep 17 00:00:00 2001
From: "Jan Alexander Steffens (heftig)" <[email protected]>
Date: Mon, 16 Sep 2019 04:53:20 +0200
Subject: [PATCH] ZEN: Add sysctl and CONFIG to disallow unprivileged
Subject: [PATCH 1/7] ZEN: Add sysctl and CONFIG to disallow unprivileged
CLONE_NEWUSER

Our default behavior continues to match the vanilla kernel.
Expand Down Expand Up @@ -150,5 +150,5 @@ index 9a4b980d695b..4388ca13ea3f 100644
static DEFINE_MUTEX(userns_state_mutex);

--
2.31.1
2.32.0

188 changes: 188 additions & 0 deletions 0002-x86-setup-Consolidate-early-memory-reservations.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
From 56e6bb0fe2b790adda81851794409faa533e521c Mon Sep 17 00:00:00 2001
From: Mike Rapoport <[email protected]>
Date: Tue, 2 Mar 2021 12:04:05 +0200
Subject: [PATCH 2/7] x86/setup: Consolidate early memory reservations

The early reservations of memory areas used by the firmware, bootloader,
kernel text and data are spread over setup_arch(). Moreover, some of them
happen *after* memblock allocations, e.g trim_platform_memory_ranges() and
trim_low_memory_range() are called after reserve_real_mode() that allocates
memory.

There was no corruption of these memory regions because memblock always
allocates memory either from the end of memory (in top-down mode) or above
the kernel image (in bottom-up mode). However, the bottom up mode is going
to be updated to span the entire memory [1] to avoid limitations caused by
KASLR.

Consolidate early memory reservations in a dedicated function to improve
robustness against future changes. Having the early reservations in one
place also makes it clearer what memory must be reserved before memblock
allocations are allowed.

Signed-off-by: Mike Rapoport <[email protected]>
Signed-off-by: Borislav Petkov <[email protected]>
Reviewed-by: Baoquan He <[email protected]>
Acked-by: Borislav Petkov <[email protected]>
Acked-by: David Hildenbrand <[email protected]>
Link: [1] https://lore.kernel.org/lkml/[email protected]
Link: https://lkml.kernel.org/r/[email protected]
---
arch/x86/kernel/setup.c | 92 ++++++++++++++++++++---------------------
1 file changed, 44 insertions(+), 48 deletions(-)

diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index e79f21d13a0d..420d881da2bd 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -646,18 +646,6 @@ static void __init trim_snb_memory(void)
}
}

-/*
- * Here we put platform-specific memory range workarounds, i.e.
- * memory known to be corrupt or otherwise in need to be reserved on
- * specific platforms.
- *
- * If this gets used more widely it could use a real dispatch mechanism.
- */
-static void __init trim_platform_memory_ranges(void)
-{
- trim_snb_memory();
-}
-
static void __init trim_bios_range(void)
{
/*
@@ -730,7 +718,38 @@ static void __init trim_low_memory_range(void)
{
memblock_reserve(0, ALIGN(reserve_low, PAGE_SIZE));
}
-
+
+static void __init early_reserve_memory(void)
+{
+ /*
+ * Reserve the memory occupied by the kernel between _text and
+ * __end_of_kernel_reserve symbols. Any kernel sections after the
+ * __end_of_kernel_reserve symbol must be explicitly reserved with a
+ * separate memblock_reserve() or they will be discarded.
+ */
+ memblock_reserve(__pa_symbol(_text),
+ (unsigned long)__end_of_kernel_reserve - (unsigned long)_text);
+
+ /*
+ * Make sure page 0 is always reserved because on systems with
+ * L1TF its contents can be leaked to user processes.
+ */
+ memblock_reserve(0, PAGE_SIZE);
+
+ early_reserve_initrd();
+
+ if (efi_enabled(EFI_BOOT))
+ efi_memblock_x86_reserve_range();
+
+ memblock_x86_reserve_range_setup_data();
+
+ reserve_ibft_region();
+ reserve_bios_regions();
+
+ trim_snb_memory();
+ trim_low_memory_range();
+}
+
/*
* Dump out kernel offset information on panic.
*/
@@ -765,29 +784,6 @@ dump_kernel_offset(struct notifier_block *self, unsigned long v, void *p)

void __init setup_arch(char **cmdline_p)
{
- /*
- * Reserve the memory occupied by the kernel between _text and
- * __end_of_kernel_reserve symbols. Any kernel sections after the
- * __end_of_kernel_reserve symbol must be explicitly reserved with a
- * separate memblock_reserve() or they will be discarded.
- */
- memblock_reserve(__pa_symbol(_text),
- (unsigned long)__end_of_kernel_reserve - (unsigned long)_text);
-
- /*
- * Make sure page 0 is always reserved because on systems with
- * L1TF its contents can be leaked to user processes.
- */
- memblock_reserve(0, PAGE_SIZE);
-
- early_reserve_initrd();
-
- /*
- * At this point everything still needed from the boot loader
- * or BIOS or kernel text should be early reserved or marked not
- * RAM in e820. All other memory is free game.
- */
-
#ifdef CONFIG_X86_32
memcpy(&boot_cpu_data, &new_cpu_data, sizeof(new_cpu_data));

@@ -911,8 +907,18 @@ void __init setup_arch(char **cmdline_p)

parse_early_param();

- if (efi_enabled(EFI_BOOT))
- efi_memblock_x86_reserve_range();
+ /*
+ * Do some memory reservations *before* memory is added to
+ * memblock, so memblock allocations won't overwrite it.
+ * Do it after early param, so we could get (unlikely) panic from
+ * serial.
+ *
+ * After this point everything still needed from the boot loader or
+ * firmware or kernel text should be early reserved or marked not
+ * RAM in e820. All other memory is free game.
+ */
+ early_reserve_memory();
+
#ifdef CONFIG_MEMORY_HOTPLUG
/*
* Memory used by the kernel cannot be hot-removed because Linux
@@ -939,9 +945,6 @@ void __init setup_arch(char **cmdline_p)

x86_report_nx();

- /* after early param, so could get panic from serial */
- memblock_x86_reserve_range_setup_data();
-
if (acpi_mps_check()) {
#ifdef CONFIG_X86_LOCAL_APIC
disable_apic = 1;
@@ -1033,8 +1036,6 @@ void __init setup_arch(char **cmdline_p)
*/
find_smp_config();

- reserve_ibft_region();
-
early_alloc_pgt_buf();

/*
@@ -1055,8 +1056,6 @@ void __init setup_arch(char **cmdline_p)
*/
sev_setup_arch();

- reserve_bios_regions();
-
efi_fake_memmap();
efi_find_mirror();
efi_esrt_init();
@@ -1082,9 +1081,6 @@ void __init setup_arch(char **cmdline_p)

reserve_real_mode();

- trim_platform_memory_ranges();
- trim_low_memory_range();
-
init_mem_mapping();

idt_setup_early_pf();
--
2.32.0

67 changes: 67 additions & 0 deletions 0003-x86-setup-Merge-several-reservations-of-start-of-mem.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
From e63cb4a867fe803dc90376af8b268ba1549ec36e Mon Sep 17 00:00:00 2001
From: Mike Rapoport <[email protected]>
Date: Tue, 2 Mar 2021 12:04:06 +0200
Subject: [PATCH 3/7] x86/setup: Merge several reservations of start of memory

Currently, the first several pages are reserved both to avoid leaking
their contents on systems with L1TF and to avoid corrupting BIOS memory.

Merge the two memory reservations.

Signed-off-by: Mike Rapoport <[email protected]>
Signed-off-by: Borislav Petkov <[email protected]>
Reviewed-by: David Hildenbrand <[email protected]>
Acked-by: Borislav Petkov <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
---
arch/x86/kernel/setup.c | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 420d881da2bd..282d572e49af 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -714,11 +714,6 @@ static int __init parse_reservelow(char *p)

early_param("reservelow", parse_reservelow);

-static void __init trim_low_memory_range(void)
-{
- memblock_reserve(0, ALIGN(reserve_low, PAGE_SIZE));
-}
-
static void __init early_reserve_memory(void)
{
/*
@@ -731,10 +726,17 @@ static void __init early_reserve_memory(void)
(unsigned long)__end_of_kernel_reserve - (unsigned long)_text);

/*
- * Make sure page 0 is always reserved because on systems with
- * L1TF its contents can be leaked to user processes.
+ * The first 4Kb of memory is a BIOS owned area, but generally it is
+ * not listed as such in the E820 table.
+ *
+ * Reserve the first memory page and typically some additional
+ * memory (64KiB by default) since some BIOSes are known to corrupt
+ * low memory. See the Kconfig help text for X86_RESERVE_LOW.
+ *
+ * In addition, make sure page 0 is always reserved because on
+ * systems with L1TF its contents can be leaked to user processes.
*/
- memblock_reserve(0, PAGE_SIZE);
+ memblock_reserve(0, ALIGN(reserve_low, PAGE_SIZE));

early_reserve_initrd();

@@ -747,7 +749,6 @@ static void __init early_reserve_memory(void)
reserve_bios_regions();

trim_snb_memory();
- trim_low_memory_range();
}

/*
--
2.32.0

Loading

0 comments on commit 199a151

Please sign in to comment.