From: Greg Kroah-Hartman Date: Mon, 30 Jan 2023 10:53:20 +0000 (+0100) Subject: 6.1-stable patches X-Git-Tag: v5.10.166~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=416ad3b1a508ca28cc1d36beb24749fa7a145454;p=thirdparty%2Fkernel%2Fstable-queue.git 6.1-stable patches added patches: acpi-fix-suspend-with-xen-pv.patch --- diff --git a/queue-6.1/acpi-fix-suspend-with-xen-pv.patch b/queue-6.1/acpi-fix-suspend-with-xen-pv.patch new file mode 100644 index 00000000000..3efab48fcbf --- /dev/null +++ b/queue-6.1/acpi-fix-suspend-with-xen-pv.patch @@ -0,0 +1,94 @@ +From fe0ba8c23f9a35b0307eb662f16dd3a75fcdae41 Mon Sep 17 00:00:00 2001 +From: Juergen Gross +Date: Tue, 17 Jan 2023 16:57:23 +0100 +Subject: acpi: Fix suspend with Xen PV +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Juergen Gross + +commit fe0ba8c23f9a35b0307eb662f16dd3a75fcdae41 upstream. + +Commit f1e525009493 ("x86/boot: Skip realmode init code when running as +Xen PV guest") missed one code path accessing real_mode_header, leading +to dereferencing NULL when suspending the system under Xen: + + [ 348.284004] PM: suspend entry (deep) + [ 348.289532] Filesystems sync: 0.005 seconds + [ 348.291545] Freezing user space processes ... (elapsed 0.000 seconds) done. + [ 348.292457] OOM killer disabled. + [ 348.292462] Freezing remaining freezable tasks ... (elapsed 0.104 seconds) done. + [ 348.396612] printk: Suspending console(s) (use no_console_suspend to debug) + [ 348.749228] PM: suspend devices took 0.352 seconds + [ 348.769713] ACPI: EC: interrupt blocked + [ 348.816077] BUG: kernel NULL pointer dereference, address: 000000000000001c + [ 348.816080] #PF: supervisor read access in kernel mode + [ 348.816081] #PF: error_code(0x0000) - not-present page + [ 348.816083] PGD 0 P4D 0 + [ 348.816086] Oops: 0000 [#1] PREEMPT SMP NOPTI + [ 348.816089] CPU: 0 PID: 6764 Comm: systemd-sleep Not tainted 6.1.3-1.fc32.qubes.x86_64 #1 + [ 348.816092] Hardware name: Star Labs StarBook/StarBook, BIOS 8.01 07/03/2022 + [ 348.816093] RIP: e030:acpi_get_wakeup_address+0xc/0x20 + +Fix that by adding an optional acpi callback allowing to skip setting +the wakeup address, as in the Xen PV case this will be handled by the +hypervisor anyway. + +Fixes: f1e525009493 ("x86/boot: Skip realmode init code when running as Xen PV guest") +Reported-by: Marek Marczykowski-Górecki +Signed-off-by: Juergen Gross +Signed-off-by: Dave Hansen +Acked-by: Rafael J. Wysocki +Link: https://lore.kernel.org/all/20230117155724.22940-1-jgross%40suse.com +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/include/asm/acpi.h | 8 ++++++++ + drivers/acpi/sleep.c | 6 +++++- + 2 files changed, 13 insertions(+), 1 deletion(-) + +--- a/arch/x86/include/asm/acpi.h ++++ b/arch/x86/include/asm/acpi.h +@@ -14,6 +14,7 @@ + #include + #include + #include ++#include + + #ifdef CONFIG_ACPI_APEI + # include +@@ -63,6 +64,13 @@ extern int (*acpi_suspend_lowlevel)(void + /* Physical address to resume after wakeup */ + unsigned long acpi_get_wakeup_address(void); + ++static inline bool acpi_skip_set_wakeup_address(void) ++{ ++ return cpu_feature_enabled(X86_FEATURE_XENPV); ++} ++ ++#define acpi_skip_set_wakeup_address acpi_skip_set_wakeup_address ++ + /* + * Check if the CPU can handle C2 and deeper + */ +--- a/drivers/acpi/sleep.c ++++ b/drivers/acpi/sleep.c +@@ -60,13 +60,17 @@ static struct notifier_block tts_notifie + .priority = 0, + }; + ++#ifndef acpi_skip_set_wakeup_address ++#define acpi_skip_set_wakeup_address() false ++#endif ++ + static int acpi_sleep_prepare(u32 acpi_state) + { + #ifdef CONFIG_ACPI_SLEEP + unsigned long acpi_wakeup_address; + + /* do we have a wakeup address for S2 and S3? */ +- if (acpi_state == ACPI_STATE_S3) { ++ if (acpi_state == ACPI_STATE_S3 && !acpi_skip_set_wakeup_address()) { + acpi_wakeup_address = acpi_get_wakeup_address(); + if (!acpi_wakeup_address) + return -EFAULT; diff --git a/queue-6.1/series b/queue-6.1/series index 9c75671ed6c..cc5ae1e324a 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -304,3 +304,4 @@ revert-mm-compaction-fix-set-skip-in-fast_find_migrateblock.patch revert-input-synaptics-switch-touchpad-on-hp-laptop-15-da3001tu-to-rmi-mode.patch input-i8042-add-clevo-pcx0dx-to-i8042-quirk-table.patch x86-sev-add-sev-snp-guest-feature-negotiation-support.patch +acpi-fix-suspend-with-xen-pv.patch