]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 24 Nov 2023 11:40:37 +0000 (11:40 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 24 Nov 2023 11:40:37 +0000 (11:40 +0000)
added patches:
parisc-pgtable-do-not-drop-upper-5-address-bits-of-physical-address.patch
parisc-power-fix-power-soft-off-when-running-on-qemu.patch
parisc-prevent-booting-64-bit-kernels-on-pa1.x-machines.patch

queue-5.4/parisc-pgtable-do-not-drop-upper-5-address-bits-of-physical-address.patch [new file with mode: 0644]
queue-5.4/parisc-power-fix-power-soft-off-when-running-on-qemu.patch [new file with mode: 0644]
queue-5.4/parisc-prevent-booting-64-bit-kernels-on-pa1.x-machines.patch [new file with mode: 0644]
queue-5.4/series

diff --git a/queue-5.4/parisc-pgtable-do-not-drop-upper-5-address-bits-of-physical-address.patch b/queue-5.4/parisc-pgtable-do-not-drop-upper-5-address-bits-of-physical-address.patch
new file mode 100644 (file)
index 0000000..f4248c5
--- /dev/null
@@ -0,0 +1,49 @@
+From 166b0110d1ee53290bd11618df6e3991c117495a Mon Sep 17 00:00:00 2001
+From: Helge Deller <deller@gmx.de>
+Date: Tue, 7 Nov 2023 14:33:32 +0100
+Subject: parisc/pgtable: Do not drop upper 5 address bits of physical address
+
+From: Helge Deller <deller@gmx.de>
+
+commit 166b0110d1ee53290bd11618df6e3991c117495a upstream.
+
+When calculating the pfn for the iitlbt/idtlbt instruction, do not
+drop the upper 5 address bits. This doesn't seem to have an effect
+on physical hardware which uses less physical address bits, but in
+qemu the missing bits are visible.
+
+Signed-off-by: Helge Deller <deller@gmx.de>
+Cc:  <stable@vger.kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/parisc/kernel/entry.S |    7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+--- a/arch/parisc/kernel/entry.S
++++ b/arch/parisc/kernel/entry.S
+@@ -511,13 +511,13 @@
+        * to a CPU TLB 4k PFN (4k => 12 bits to shift) */
+       #define PAGE_ADD_SHIFT          (PAGE_SHIFT-12)
+       #define PAGE_ADD_HUGE_SHIFT     (REAL_HPAGE_SHIFT-12)
++      #define PFN_START_BIT   (63-ASM_PFN_PTE_SHIFT+(63-58)-PAGE_ADD_SHIFT)
+       /* Drop prot bits and convert to page addr for iitlbt and idtlbt */
+       .macro          convert_for_tlb_insert20 pte,tmp
+ #ifdef CONFIG_HUGETLB_PAGE
+       copy            \pte,\tmp
+-      extrd,u         \tmp,(63-ASM_PFN_PTE_SHIFT)+(63-58)+PAGE_ADD_SHIFT,\
+-                              64-PAGE_SHIFT-PAGE_ADD_SHIFT,\pte
++      extrd,u         \tmp,PFN_START_BIT,PFN_START_BIT+1,\pte
+       depdi           _PAGE_SIZE_ENCODING_DEFAULT,63,\
+                               (63-58)+PAGE_ADD_SHIFT,\pte
+@@ -525,8 +525,7 @@
+       depdi           _HUGE_PAGE_SIZE_ENCODING_DEFAULT,63,\
+                               (63-58)+PAGE_ADD_HUGE_SHIFT,\pte
+ #else /* Huge pages disabled */
+-      extrd,u         \pte,(63-ASM_PFN_PTE_SHIFT)+(63-58)+PAGE_ADD_SHIFT,\
+-                              64-PAGE_SHIFT-PAGE_ADD_SHIFT,\pte
++      extrd,u         \pte,PFN_START_BIT,PFN_START_BIT+1,\pte
+       depdi           _PAGE_SIZE_ENCODING_DEFAULT,63,\
+                               (63-58)+PAGE_ADD_SHIFT,\pte
+ #endif
diff --git a/queue-5.4/parisc-power-fix-power-soft-off-when-running-on-qemu.patch b/queue-5.4/parisc-power-fix-power-soft-off-when-running-on-qemu.patch
new file mode 100644 (file)
index 0000000..1ed60ef
--- /dev/null
@@ -0,0 +1,31 @@
+From 6ad6e15a9c46b8f0932cd99724f26f3db4db1cdf Mon Sep 17 00:00:00 2001
+From: Helge Deller <deller@gmx.de>
+Date: Fri, 17 Nov 2023 16:43:52 +0100
+Subject: parisc/power: Fix power soft-off when running on qemu
+
+From: Helge Deller <deller@gmx.de>
+
+commit 6ad6e15a9c46b8f0932cd99724f26f3db4db1cdf upstream.
+
+Firmware returns the physical address of the power switch,
+so need to use gsc_writel() instead of direct memory access.
+
+Fixes: d0c219472980 ("parisc/power: Add power soft-off when running on qemu")
+Signed-off-by: Helge Deller <deller@gmx.de>
+Cc: stable@vger.kernel.org # v6.0+
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/parisc/power.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/parisc/power.c
++++ b/drivers/parisc/power.c
+@@ -196,7 +196,7 @@ static struct notifier_block parisc_pani
+ static int qemu_power_off(struct sys_off_data *data)
+ {
+       /* this turns the system off via SeaBIOS */
+-      *(int *)data->cb_data = 0;
++      gsc_writel(0, (unsigned long) data->cb_data);
+       pdc_soft_power_button(1);
+       return NOTIFY_DONE;
+ }
diff --git a/queue-5.4/parisc-prevent-booting-64-bit-kernels-on-pa1.x-machines.patch b/queue-5.4/parisc-prevent-booting-64-bit-kernels-on-pa1.x-machines.patch
new file mode 100644 (file)
index 0000000..d7901c2
--- /dev/null
@@ -0,0 +1,35 @@
+From a406b8b424fa01f244c1aab02ba186258448c36b Mon Sep 17 00:00:00 2001
+From: Helge Deller <deller@gmx.de>
+Date: Fri, 10 Nov 2023 16:13:15 +0100
+Subject: parisc: Prevent booting 64-bit kernels on PA1.x machines
+
+From: Helge Deller <deller@gmx.de>
+
+commit a406b8b424fa01f244c1aab02ba186258448c36b upstream.
+
+Bail out early with error message when trying to boot a 64-bit kernel on
+32-bit machines. This fixes the previous commit to include the check for
+true 64-bit kernels as well.
+
+Signed-off-by: Helge Deller <deller@gmx.de>
+Fixes: 591d2108f3abc ("parisc: Add runtime check to prevent PA2.0 kernels on PA1.x machines")
+Cc:  <stable@vger.kernel.org> # v6.0+
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/parisc/kernel/head.S |    5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+--- a/arch/parisc/kernel/head.S
++++ b/arch/parisc/kernel/head.S
+@@ -69,9 +69,8 @@ $bss_loop:
+       stw,ma          %arg2,4(%r1)
+       stw,ma          %arg3,4(%r1)
+-#if !defined(CONFIG_64BIT) && defined(CONFIG_PA20)
+-      /* This 32-bit kernel was compiled for PA2.0 CPUs. Check current CPU
+-       * and halt kernel if we detect a PA1.x CPU. */
++#if defined(CONFIG_PA20)
++      /* check for 64-bit capable CPU as required by current kernel */
+       ldi             32,%r10
+       mtctl           %r10,%cr11
+       .level 2.0
index 9cfc9f67db9a6d412b220c29e6ed51d2b79bb7f2..0947a966be2f4f58b1b17ca006e1aed641fea656 100644 (file)
@@ -97,6 +97,9 @@ s390-cmma-fix-initial-kernel-address-space-page-table-walk.patch
 s390-cmma-fix-handling-of-swapper_pg_dir-and-invalid_pg_dir.patch
 mm-cma-use-nth_page-in-place-of-direct-struct-page-manipulation.patch
 i3c-master-cdns-fix-reading-status-register.patch
+parisc-prevent-booting-64-bit-kernels-on-pa1.x-machines.patch
+parisc-pgtable-do-not-drop-upper-5-address-bits-of-physical-address.patch
+parisc-power-fix-power-soft-off-when-running-on-qemu.patch
 tty-serial-migrate-meson_uart-to-use-has_sysrq.patch
 serial-meson-remove-redundant-initialization-of-vari.patch
 tty-serial-meson-retrieve-port-fifo-size-from-dt.patch