From 2a16120c2c599e5bccc29d46f5aa61394dd4ec8d Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 14 Jan 2022 10:50:20 +0100 Subject: [PATCH] drop queue-5.15/x86-mce-remove-noinstr-annotation-from-mce_setup.patch --- queue-5.15/series | 1 - ...ve-noinstr-annotation-from-mce_setup.patch | 81 ------------------- 2 files changed, 82 deletions(-) delete mode 100644 queue-5.15/x86-mce-remove-noinstr-annotation-from-mce_setup.patch diff --git a/queue-5.15/series b/queue-5.15/series index a53bcbcb213..d00f119e26b 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -27,7 +27,6 @@ bluetooth-btbcm-disable-read-tx-power-for-some-macs-with-the-t2-security-chip.pa bluetooth-btbcm-disable-read-tx-power-for-macbook-air-8-1-and-8-2.patch veth-do-not-record-rx-queue-hint-in-veth_xmit.patch mfd-intel-lpss-fix-too-early-pm-enablement-in-the-acpi-probe.patch -x86-mce-remove-noinstr-annotation-from-mce_setup.patch can-gs_usb-fix-use-of-uninitialized-variable-detach-device-on-reception-of-invalid-usb-data.patch can-isotp-convert-struct-tpcon-idx-len-to-unsigned-int.patch can-gs_usb-gs_can_start_xmit-zero-initialize-hf-flags-reserved.patch diff --git a/queue-5.15/x86-mce-remove-noinstr-annotation-from-mce_setup.patch b/queue-5.15/x86-mce-remove-noinstr-annotation-from-mce_setup.patch deleted file mode 100644 index d9b9fc432cb..00000000000 --- a/queue-5.15/x86-mce-remove-noinstr-annotation-from-mce_setup.patch +++ /dev/null @@ -1,81 +0,0 @@ -From 487d654db3edacc31dee86b10258cc740640fad8 Mon Sep 17 00:00:00 2001 -From: Borislav Petkov -Date: Tue, 5 Oct 2021 19:54:47 +0200 -Subject: x86/mce: Remove noinstr annotation from mce_setup() - -From: Borislav Petkov - -commit 487d654db3edacc31dee86b10258cc740640fad8 upstream. - -Instead, sandwitch around the call which is done in noinstr context and -mark the caller - mce_gather_info() - as noinstr. - -Also, document what the whole instrumentation strategy with #MC is going -to be in the future and where it all is supposed to be going to. - -Signed-off-by: Borislav Petkov -Link: https://lore.kernel.org/r/20211208111343.8130-5-bp@alien8.de -Signed-off-by: Greg Kroah-Hartman ---- - arch/x86/kernel/cpu/mce/core.c | 26 ++++++++++++++++++++------ - 1 file changed, 20 insertions(+), 6 deletions(-) - ---- a/arch/x86/kernel/cpu/mce/core.c -+++ b/arch/x86/kernel/cpu/mce/core.c -@@ -130,7 +130,7 @@ static void (*quirk_no_way_out)(int bank - BLOCKING_NOTIFIER_HEAD(x86_mce_decoder_chain); - - /* Do initial initialization of a struct mce */ --noinstr void mce_setup(struct mce *m) -+void mce_setup(struct mce *m) - { - memset(m, 0, sizeof(struct mce)); - m->cpu = m->extcpu = smp_processor_id(); -@@ -479,9 +479,15 @@ static noinstr void mce_wrmsrl(u32 msr, - * check into our "mce" struct so that we can use it later to assess - * the severity of the problem as we read per-bank specific details. - */ --static inline void mce_gather_info(struct mce *m, struct pt_regs *regs) -+static noinstr void mce_gather_info(struct mce *m, struct pt_regs *regs) - { -+ /* -+ * Enable instrumentation around mce_setup() which calls external -+ * facilities. -+ */ -+ instrumentation_begin(); - mce_setup(m); -+ instrumentation_end(); - - m->mcgstatus = mce_rdmsrl(MSR_IA32_MCG_STATUS); - if (regs) { -@@ -1327,11 +1333,11 @@ static void queue_task_work(struct mce * - } - - /* -- * The actual machine check handler. This only handles real -- * exceptions when something got corrupted coming in through int 18. -+ * The actual machine check handler. This only handles real exceptions when -+ * something got corrupted coming in through int 18. - * -- * This is executed in NMI context not subject to normal locking rules. This -- * implies that most kernel services cannot be safely used. Don't even -+ * This is executed in #MC context not subject to normal locking rules. -+ * This implies that most kernel services cannot be safely used. Don't even - * think about putting a printk in there! - * - * On Intel systems this is entered on all CPUs in parallel through -@@ -1343,6 +1349,14 @@ static void queue_task_work(struct mce * - * issues: if the machine check was due to a failure of the memory - * backing the user stack, tracing that reads the user stack will cause - * potentially infinite recursion. -+ * -+ * Currently, the #MC handler calls out to a number of external facilities -+ * and, therefore, allows instrumentation around them. The optimal thing to -+ * have would be to do the absolutely minimal work required in #MC context -+ * and have instrumentation disabled only around that. Further processing can -+ * then happen in process context where instrumentation is allowed. Achieving -+ * that requires careful auditing and modifications. Until then, the code -+ * allows instrumentation temporarily, where required. * - */ - noinstr void do_machine_check(struct pt_regs *regs) - { -- 2.47.3