--- /dev/null
+From 636ab417a7aec4ee993916e688eb5c5977570836 Mon Sep 17 00:00:00 2001
+From: Ard Biesheuvel <ardb@kernel.org>
+Date: Thu, 2 Feb 2023 18:30:06 +0100
+Subject: efi: Accept version 2 of memory attributes table
+
+From: Ard Biesheuvel <ardb@kernel.org>
+
+commit 636ab417a7aec4ee993916e688eb5c5977570836 upstream.
+
+UEFI v2.10 introduces version 2 of the memory attributes table, which
+turns the reserved field into a flags field, but is compatible with
+version 1 in all other respects. So let's not complain about version 2
+if we encounter it.
+
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/firmware/efi/memattr.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/firmware/efi/memattr.c
++++ b/drivers/firmware/efi/memattr.c
+@@ -32,7 +32,7 @@ int __init efi_memattr_init(void)
+ return -ENOMEM;
+ }
+
+- if (tbl->version > 1) {
++ if (tbl->version > 2) {
+ pr_warn("Unexpected EFI Memory Attributes table version %d\n",
+ tbl->version);
+ goto unmap;
--- /dev/null
+From 2b09d5d364986f724f17001ccfe4126b9b43a0be Mon Sep 17 00:00:00 2001
+From: Samuel Thibault <samuel.thibault@ens-lyon.org>
+Date: Sun, 29 Jan 2023 16:17:40 +0100
+Subject: fbcon: Check font dimension limits
+
+From: Samuel Thibault <samuel.thibault@ens-lyon.org>
+
+commit 2b09d5d364986f724f17001ccfe4126b9b43a0be upstream.
+
+blit_x and blit_y are u32, so fbcon currently cannot support fonts
+larger than 32x32.
+
+The 32x32 case also needs shifting an unsigned int, to properly set bit
+31, otherwise we get "UBSAN: shift-out-of-bounds in fbcon_set_font",
+as reported on:
+
+http://lore.kernel.org/all/IA1PR07MB98308653E259A6F2CE94A4AFABCE9@IA1PR07MB9830.namprd07.prod.outlook.com
+Kernel Branch: 6.2.0-rc5-next-20230124
+Kernel config: https://drive.google.com/file/d/1F-LszDAizEEH0ZX0HcSR06v5q8FPl2Uv/view?usp=sharing
+Reproducer: https://drive.google.com/file/d/1mP1jcLBY7vWCNM60OMf-ogw-urQRjNrm/view?usp=sharing
+
+Reported-by: Sanan Hasanov <sanan.hasanov@Knights.ucf.edu>
+Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
+Fixes: 2d2699d98492 ("fbcon: font setting should check limitation of driver")
+Cc: stable@vger.kernel.org
+Tested-by: Miko Larsson <mikoxyzzz@gmail.com>
+Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Helge Deller <deller@gmx.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/video/fbdev/core/fbcon.c | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+--- a/drivers/video/fbdev/core/fbcon.c
++++ b/drivers/video/fbdev/core/fbcon.c
+@@ -2497,9 +2497,12 @@ static int fbcon_set_font(struct vc_data
+ h > FBCON_SWAP(info->var.rotate, info->var.yres, info->var.xres))
+ return -EINVAL;
+
++ if (font->width > 32 || font->height > 32)
++ return -EINVAL;
++
+ /* Make sure drawing engine can handle the font */
+- if (!(info->pixmap.blit_x & (1 << (font->width - 1))) ||
+- !(info->pixmap.blit_y & (1 << (font->height - 1))))
++ if (!(info->pixmap.blit_x & BIT(font->width - 1)) ||
++ !(info->pixmap.blit_y & BIT(font->height - 1)))
+ return -EINVAL;
+
+ /* Make sure driver can handle the font length */
--- /dev/null
+From cbd3a0153cd18a2cbef6bf3cf31bb406c3fc9f55 Mon Sep 17 00:00:00 2001
+From: Xiongfeng Wang <wangxiongfeng2@huawei.com>
+Date: Tue, 29 Nov 2022 10:03:16 +0800
+Subject: iio: adc: berlin2-adc: Add missing of_node_put() in error path
+
+From: Xiongfeng Wang <wangxiongfeng2@huawei.com>
+
+commit cbd3a0153cd18a2cbef6bf3cf31bb406c3fc9f55 upstream.
+
+of_get_parent() will return a device_node pointer with refcount
+incremented. We need to use of_node_put() on it when done. Add the
+missing of_node_put() in the error path of berlin2_adc_probe();
+
+Fixes: 70f1937911ca ("iio: adc: add support for Berlin")
+Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>
+Link: https://lore.kernel.org/r/20221129020316.191731-1-wangxiongfeng2@huawei.com
+Cc: <Stable@vger.kernel.org>
+Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/iio/adc/berlin2-adc.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/drivers/iio/adc/berlin2-adc.c
++++ b/drivers/iio/adc/berlin2-adc.c
+@@ -289,8 +289,10 @@ static int berlin2_adc_probe(struct plat
+ int ret;
+
+ indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*priv));
+- if (!indio_dev)
++ if (!indio_dev) {
++ of_node_put(parent_np);
+ return -ENOMEM;
++ }
+
+ priv = iio_priv(indio_dev);
+ platform_set_drvdata(pdev, indio_dev);
--- /dev/null
+From f804bd0dc28683a93a60f271aaefb2fc5b0853dd Mon Sep 17 00:00:00 2001
+From: Andreas Kemnade <andreas@kemnade.info>
+Date: Thu, 1 Dec 2022 19:16:35 +0100
+Subject: iio:adc:twl6030: Enable measurements of VUSB, VBAT and others
+
+From: Andreas Kemnade <andreas@kemnade.info>
+
+commit f804bd0dc28683a93a60f271aaefb2fc5b0853dd upstream.
+
+Some inputs need to be wired up to produce proper measurements,
+without this change only near zero values are reported.
+
+Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
+Fixes: 1696f36482e70 ("iio: twl6030-gpadc: TWL6030, TWL6032 GPADC driver")
+Link: https://lore.kernel.org/r/20221201181635.3522962-1-andreas@kemnade.info
+Cc: <Stable@vger.kernel.org>
+Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/iio/adc/twl6030-gpadc.c | 32 ++++++++++++++++++++++++++++++++
+ 1 file changed, 32 insertions(+)
+
+--- a/drivers/iio/adc/twl6030-gpadc.c
++++ b/drivers/iio/adc/twl6030-gpadc.c
+@@ -57,6 +57,18 @@
+ #define TWL6030_GPADCS BIT(1)
+ #define TWL6030_GPADCR BIT(0)
+
++#define USB_VBUS_CTRL_SET 0x04
++#define USB_ID_CTRL_SET 0x06
++
++#define TWL6030_MISC1 0xE4
++#define VBUS_MEAS 0x01
++#define ID_MEAS 0x01
++
++#define VAC_MEAS 0x04
++#define VBAT_MEAS 0x02
++#define BB_MEAS 0x01
++
++
+ /**
+ * struct twl6030_chnl_calib - channel calibration
+ * @gain: slope coefficient for ideal curve
+@@ -927,6 +939,26 @@ static int twl6030_gpadc_probe(struct pl
+ return ret;
+ }
+
++ ret = twl_i2c_write_u8(TWL_MODULE_USB, VBUS_MEAS, USB_VBUS_CTRL_SET);
++ if (ret < 0) {
++ dev_err(dev, "failed to wire up inputs\n");
++ return ret;
++ }
++
++ ret = twl_i2c_write_u8(TWL_MODULE_USB, ID_MEAS, USB_ID_CTRL_SET);
++ if (ret < 0) {
++ dev_err(dev, "failed to wire up inputs\n");
++ return ret;
++ }
++
++ ret = twl_i2c_write_u8(TWL6030_MODULE_ID0,
++ VBAT_MEAS | BB_MEAS | BB_MEAS,
++ TWL6030_MISC1);
++ if (ret < 0) {
++ dev_err(dev, "failed to wire up inputs\n");
++ return ret;
++ }
++
+ indio_dev->name = DRIVER_NAME;
+ indio_dev->dev.parent = dev;
+ indio_dev->info = &twl6030_gpadc_iio_info;
--- /dev/null
+From f7b23d1c35d8b8de1425bdfccaefd01f3b7c9d1c Mon Sep 17 00:00:00 2001
+From: Dmitry Perchanov <dmitry.perchanov@intel.com>
+Date: Wed, 11 Jan 2023 14:22:10 +0200
+Subject: iio: hid: fix the retval in accel_3d_capture_sample
+
+From: Dmitry Perchanov <dmitry.perchanov@intel.com>
+
+commit f7b23d1c35d8b8de1425bdfccaefd01f3b7c9d1c upstream.
+
+Return value should be zero for success. This was forgotten for timestamp
+feature. Verified on RealSense cameras.
+
+Fixes: a96cd0f901ee ("iio: accel: hid-sensor-accel-3d: Add timestamp")
+Signed-off-by: Dmitry Perchanov <dmitry.perchanov@intel.com>
+Link: https://lore.kernel.org/r/a6dc426498221c81fa71045b41adf782ebd42136.camel@intel.com
+Cc: <Stable@vger.kernel.org>
+Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/iio/accel/hid-sensor-accel-3d.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/iio/accel/hid-sensor-accel-3d.c
++++ b/drivers/iio/accel/hid-sensor-accel-3d.c
+@@ -279,6 +279,7 @@ static int accel_3d_capture_sample(struc
+ hid_sensor_convert_timestamp(
+ &accel_state->common_attributes,
+ *(int64_t *)raw_data);
++ ret = 0;
+ break;
+ default:
+ break;
--- /dev/null
+From 5d1335dabb3c493a3d6d5b233953b6ac7b6c1ff2 Mon Sep 17 00:00:00 2001
+From: Helge Deller <deller@gmx.de>
+Date: Mon, 19 Dec 2022 20:56:36 +0100
+Subject: parisc: Fix return code of pdc_iodc_print()
+
+From: Helge Deller <deller@gmx.de>
+
+commit 5d1335dabb3c493a3d6d5b233953b6ac7b6c1ff2 upstream.
+
+There is an off-by-one if the printed string includes a new-line
+char.
+
+Cc: stable@vger.kernel.org
+Signed-off-by: Helge Deller <deller@gmx.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/parisc/kernel/firmware.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+--- a/arch/parisc/kernel/firmware.c
++++ b/arch/parisc/kernel/firmware.c
+@@ -1229,7 +1229,7 @@ static char __attribute__((aligned(64)))
+ */
+ int pdc_iodc_print(const unsigned char *str, unsigned count)
+ {
+- unsigned int i;
++ unsigned int i, found = 0;
+ unsigned long flags;
+
+ for (i = 0; i < count;) {
+@@ -1238,6 +1238,7 @@ int pdc_iodc_print(const unsigned char *
+ iodc_dbuf[i+0] = '\r';
+ iodc_dbuf[i+1] = '\n';
+ i += 2;
++ found = 1;
+ goto print;
+ default:
+ iodc_dbuf[i] = str[i];
+@@ -1254,7 +1255,7 @@ print:
+ __pa(iodc_retbuf), 0, __pa(iodc_dbuf), i, 0);
+ spin_unlock_irqrestore(&pdc_lock, flags);
+
+- return i;
++ return i - found;
+ }
+
+ #if !defined(BOOTLOADER)
--- /dev/null
+From 316f1f42b5cc1d95124c1f0387c867c1ba7b6d0e Mon Sep 17 00:00:00 2001
+From: Helge Deller <deller@gmx.de>
+Date: Wed, 1 Feb 2023 16:41:54 +0100
+Subject: parisc: Wire up PTRACE_GETREGS/PTRACE_SETREGS for compat case
+
+From: Helge Deller <deller@gmx.de>
+
+commit 316f1f42b5cc1d95124c1f0387c867c1ba7b6d0e upstream.
+
+Wire up the missing ptrace requests PTRACE_GETREGS, PTRACE_SETREGS,
+PTRACE_GETFPREGS and PTRACE_SETFPREGS when running 32-bit applications
+on 64-bit kernels.
+
+Signed-off-by: Helge Deller <deller@gmx.de>
+Cc: stable@vger.kernel.org # 4.7+
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/parisc/kernel/ptrace.c | 15 +++++++++++++--
+ 1 file changed, 13 insertions(+), 2 deletions(-)
+
+--- a/arch/parisc/kernel/ptrace.c
++++ b/arch/parisc/kernel/ptrace.c
+@@ -128,6 +128,12 @@ long arch_ptrace(struct task_struct *chi
+ unsigned long tmp;
+ long ret = -EIO;
+
++ unsigned long user_regs_struct_size = sizeof(struct user_regs_struct);
++#ifdef CONFIG_64BIT
++ if (is_compat_task())
++ user_regs_struct_size /= 2;
++#endif
++
+ switch (request) {
+
+ /* Read the word at location addr in the USER area. For ptraced
+@@ -183,14 +189,14 @@ long arch_ptrace(struct task_struct *chi
+ return copy_regset_to_user(child,
+ task_user_regset_view(current),
+ REGSET_GENERAL,
+- 0, sizeof(struct user_regs_struct),
++ 0, user_regs_struct_size,
+ datap);
+
+ case PTRACE_SETREGS: /* Set all gp regs in the child. */
+ return copy_regset_from_user(child,
+ task_user_regset_view(current),
+ REGSET_GENERAL,
+- 0, sizeof(struct user_regs_struct),
++ 0, user_regs_struct_size,
+ datap);
+
+ case PTRACE_GETFPREGS: /* Get the child FPU state. */
+@@ -304,6 +310,11 @@ long compat_arch_ptrace(struct task_stru
+ }
+ }
+ break;
++ case PTRACE_GETREGS:
++ case PTRACE_SETREGS:
++ case PTRACE_GETFPREGS:
++ case PTRACE_SETFPREGS:
++ return arch_ptrace(child, request, addr, data);
+
+ default:
+ ret = compat_ptrace_request(child, request, addr, data);
--- /dev/null
+From 2f394c0e7d1129a35156e492bc8f445fb20f43ac Mon Sep 17 00:00:00 2001
+From: Andreas Schwab <schwab@suse.de>
+Date: Wed, 1 Feb 2023 10:29:45 +0100
+Subject: riscv: disable generation of unwind tables
+
+From: Andreas Schwab <schwab@suse.de>
+
+commit 2f394c0e7d1129a35156e492bc8f445fb20f43ac upstream.
+
+GCC 13 will enable -fasynchronous-unwind-tables by default on riscv. In
+the kernel, we don't have any use for unwind tables yet, so disable them.
+More importantly, the .eh_frame section brings relocations
+(R_RISC_32_PCREL, R_RISCV_SET{6,8,16}, R_RISCV_SUB{6,8,16}) into modules
+that we are not prepared to handle.
+
+Signed-off-by: Andreas Schwab <schwab@suse.de>
+Link: https://lore.kernel.org/r/mvmzg9xybqu.fsf@suse.de
+Cc: stable@vger.kernel.org
+Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/riscv/Makefile | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/arch/riscv/Makefile
++++ b/arch/riscv/Makefile
+@@ -75,6 +75,9 @@ ifeq ($(CONFIG_PERF_EVENTS),y)
+ KBUILD_CFLAGS += -fno-omit-frame-pointer
+ endif
+
++# Avoid generating .eh_frame sections.
++KBUILD_CFLAGS += -fno-asynchronous-unwind-tables -fno-unwind-tables
++
+ KBUILD_CFLAGS_MODULE += $(call cc-option,-mno-relax)
+ KBUILD_AFLAGS_MODULE += $(call as-option,-Wa$(comma)-mno-relax)
+
input-i8042-merge-quirk-tables.patch
input-i8042-add-tuxedo-devices-to-i8042-quirk-tables.patch
input-i8042-add-clevo-pcx0dx-to-i8042-quirk-table.patch
+fbcon-check-font-dimension-limits.patch
+watchdog-diag288_wdt-do-not-use-stack-buffers-for-hardware-data.patch
+watchdog-diag288_wdt-fix-__diag288-inline-assembly.patch
+efi-accept-version-2-of-memory-attributes-table.patch
+iio-hid-fix-the-retval-in-accel_3d_capture_sample.patch
+iio-adc-berlin2-adc-add-missing-of_node_put-in-error-path.patch
+iio-adc-twl6030-enable-measurements-of-vusb-vbat-and-others.patch
+parisc-fix-return-code-of-pdc_iodc_print.patch
+parisc-wire-up-ptrace_getregs-ptrace_setregs-for-compat-case.patch
+riscv-disable-generation-of-unwind-tables.patch
--- /dev/null
+From fe8973a3ad0905cb9ba2d42db42ed51de14737df Mon Sep 17 00:00:00 2001
+From: Alexander Egorenkov <egorenar@linux.ibm.com>
+Date: Fri, 27 Jan 2023 14:52:41 +0100
+Subject: watchdog: diag288_wdt: do not use stack buffers for hardware data
+
+From: Alexander Egorenkov <egorenar@linux.ibm.com>
+
+commit fe8973a3ad0905cb9ba2d42db42ed51de14737df upstream.
+
+With CONFIG_VMAP_STACK=y the stack is allocated from the vmalloc space.
+Data passed to a hardware or a hypervisor interface that
+requires V=R can no longer be allocated on the stack.
+
+Use kmalloc() to get memory for a diag288 command.
+
+Signed-off-by: Alexander Egorenkov <egorenar@linux.ibm.com>
+Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/watchdog/diag288_wdt.c | 13 +++++++++++--
+ 1 file changed, 11 insertions(+), 2 deletions(-)
+
+--- a/drivers/watchdog/diag288_wdt.c
++++ b/drivers/watchdog/diag288_wdt.c
+@@ -272,12 +272,21 @@ static int __init diag288_init(void)
+ char ebc_begin[] = {
+ 194, 197, 199, 201, 213
+ };
++ char *ebc_cmd;
+
+ watchdog_set_nowayout(&wdt_dev, nowayout_info);
+
+ if (MACHINE_IS_VM) {
+- if (__diag288_vm(WDT_FUNC_INIT, 15,
+- ebc_begin, sizeof(ebc_begin)) != 0) {
++ ebc_cmd = kmalloc(sizeof(ebc_begin), GFP_KERNEL);
++ if (!ebc_cmd) {
++ pr_err("The watchdog cannot be initialized\n");
++ return -ENOMEM;
++ }
++ memcpy(ebc_cmd, ebc_begin, sizeof(ebc_begin));
++ ret = __diag288_vm(WDT_FUNC_INIT, 15,
++ ebc_cmd, sizeof(ebc_begin));
++ kfree(ebc_cmd);
++ if (ret != 0) {
+ pr_err("The watchdog cannot be initialized\n");
+ return -EINVAL;
+ }
--- /dev/null
+From 32e40f9506b9e32917eb73154f93037b443124d1 Mon Sep 17 00:00:00 2001
+From: Alexander Egorenkov <egorenar@linux.ibm.com>
+Date: Fri, 27 Jan 2023 14:52:42 +0100
+Subject: watchdog: diag288_wdt: fix __diag288() inline assembly
+
+From: Alexander Egorenkov <egorenar@linux.ibm.com>
+
+commit 32e40f9506b9e32917eb73154f93037b443124d1 upstream.
+
+The DIAG 288 statement consumes an EBCDIC string the address of which is
+passed in a register. Use a "memory" clobber to tell the compiler that
+memory is accessed within the inline assembly.
+
+Signed-off-by: Alexander Egorenkov <egorenar@linux.ibm.com>
+Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/watchdog/diag288_wdt.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/watchdog/diag288_wdt.c
++++ b/drivers/watchdog/diag288_wdt.c
+@@ -86,7 +86,7 @@ static int __diag288(unsigned int func,
+ "1:\n"
+ EX_TABLE(0b, 1b)
+ : "+d" (err) : "d"(__func), "d"(__timeout),
+- "d"(__action), "d"(__len) : "1", "cc");
++ "d"(__action), "d"(__len) : "1", "cc", "memory");
+ return err;
+ }
+