diff --git a/blacklist.conf b/blacklist.conf index 551791c..a17485c 100644 --- a/blacklist.conf +++ b/blacklist.conf @@ -191,8 +191,6 @@ faf890985e30d5e88cc3a7c50c1bcad32f89ab7c # Duplicate of a63bcf08f0efb5348105bb8e a9cdc1c5e3700a5200e5ca1f90b6958b6483845b # Checked into perf userspace package 218848835699879ed6260ec49bbb22e9e7839017 # went in through stable 1cbf731ef3a17b3dd4c22ed0c634ac126d1a4876 # The docs that this patch removes never got backported -ef775a0e36c6a81c5b07cb228c02f967133fe768 # PROC_FS is always set in our configs -f28439db470cca8b6b082239314e9fd10bd39034 # sparse warning fix only 3e2a56e6f639492311e0a8533f0a7aed60816308 # optimization only a672b2e36a648afb04ad3bda93b6bda947a479a5 # we lack type changes needed to make bpf_ret composable, not serious enough to justify backport 5a897531e00243cebbcc4dbe4ab06cd559ccf53f # added to perf userspace package @@ -220,7 +218,6 @@ a7ebf564de325e1d7d52cd85b12721c424338bcc # build warning in !CONFIG_MEMCG_KMEM 1f06f7d97f741667bab0f459a4f940b21cab1549 # Dup of a10834a36c8ab59b1a76df48d526fd9ddc090fca 9de2b9286a6dd16966959b3cb34fc2ddfd39213e # SoC:mediatek: Reverted in stable aff6657f5243db77e50838072b841cb6fa26375a # Soc:mediatek: reverting the above -b59f2f2b865cedd6d1641394b9cd84399bd738ff # cosmetic c7a75d07827a1f33d566e18e6098379cc2a0c2b2 # pci:xgene: caused a regression (bsc#1195352) 03ee5956781b2245b1c77334ecdea6386fd3bfba # not applicable 83dbf898a2d45289be875deb580e93050ba67529 # pci:msi: caused a regression (bsc#1196403) @@ -245,7 +242,6 @@ bf9727a27442a50c75b7d99a5088330c578b2a42 # misattributed. Introduced in 680a2ead d2f8114f9574509580a8506d2ef72e7e43d1a5bd # misattributed, actually introduced with cf75ad8b41d2aa06f98f365d42a3ae8b059daddd b3cf94c8b6b2f1a2b94825a025db291da2b151fd # misattributed, actually introduced with d2f8114f9574509580a8506d2ef72e7e43d1a5bd 3d135db510240fefd79da46181493d3e3b415f6b # changes the layout of attributes in sysfs by design -f6fb34390cd047543ff00b34b8ad910bf76c8eb3 # build fix selecting option we also switch on anyway 8aadeb8ad874b3b13431fd08c1ddb6d5e0212c7f # Duplicate of 50ca8cc7c0fdd9ab16b8b66ffb301fface101fac: drm/vmwgfx: Remove the dedicated memory accounting 4e13f6706d5aee1a6b835a44f6cf4971a921dcb8 # applied to perf userspace package ffab487052054162b3b6c9c6005777ec6cfcea05 # applied to perf userspace package @@ -286,7 +282,6 @@ f32c34d6cfbb3d1f1c26f223cb549cca9767cfbd # duplicate of 41512e4dc0b84525495e7842 f094399fae9cde11c3f98565eb150522aa7c15ab # duplicate of 21d90aaee8d5c2a097ef41f1430d97661233ecc6 2a19b28f7929866e1cec92a3619f4de9f2d20005 # introduces a regression (bsc#1200569) 245a489e81e13dd55ae46d27becf6d5901eb7828 # depends on 2a19b28f7929866e1cec92a3619f4de9f2d20005 -9974cb5c879048f5144d0660c4932d98176213c4 # deletes redundant declaration in header file 54f0bad6686cdc50a3f4c5f7c4252c5018511459 # net: sungem_phy: fix code indentation ffc95a46d677adb5f49f01789db9d8c3ae0af5e2 # CONFIG_SLAB not set in config 7acae6183cf37c48b8da48bbbdb78820fb3913f3 # N/A, bug introduced by e1a4541ec0b9 ("ceph: flush the mdlog before waiting on unsafe reqs") @@ -347,9 +342,7 @@ cfd3a9be0ac423be41afcc7a07d708056bf097a8 # selftest:vm: reverting the above 504627ee4cf4a2d42cba7ce156d423299c06a618 # net: wwan: already applied d68c2e1d19c540464ad12a8a11bdd88eedcaf3dc # octeontx2-nicvf:: a76053707dbf is not applied d8d83d8ab0a453e17e68b3a3bed1f940c34b8646 # lib/crypto: blake2s: breakes KABI -c26d4c5d4f0df7207da3975458261927f9305465 # config only fix c51ba246cb172c9e947dc6fb8868a1eaf0b2a913 # cleanup with a risk of regressions -9ef165406308515dcf2e3f6e97b39a1c56d86db5 # pure cleanup 14c174633f349cb41ea90c2c0aaddac157012f74 # tracepoints removal cleanup, not a bug 5f41fdaea63ddf96d921ab36b2af4a90ccdb5744 # Requires new mount API in ext4 d41b60359ffb24a39c93ea1f4bffaafd651118c3 # Documentation fix diff --git a/config/x86_64/default b/config/x86_64/default index 94f7e2b..426854b 100644 --- a/config/x86_64/default +++ b/config/x86_64/default @@ -7578,6 +7578,7 @@ CONFIG_TYPEC_TCPCI=m CONFIG_TYPEC_RT1711H=m CONFIG_TYPEC_TCPCI_MAXIM=m CONFIG_TYPEC_FUSB302=m +CONFIG_TYPEC_WCOVE=m CONFIG_TYPEC_UCSI=m CONFIG_UCSI_CCG=m CONFIG_UCSI_ACPI=m diff --git a/patches.suse/USB-hcd-pci-Drop-the-unused-id-parameter-from-usb_hc.patch b/patches.suse/USB-hcd-pci-Drop-the-unused-id-parameter-from-usb_hc.patch new file mode 100644 index 0000000..e5074ca --- /dev/null +++ b/patches.suse/USB-hcd-pci-Drop-the-unused-id-parameter-from-usb_hc.patch @@ -0,0 +1,125 @@ +From 4e55e22d3d9aa50ef1ba059bf3a53aa61109c179 Mon Sep 17 00:00:00 2001 +From: Heikki Krogerus +Date: Wed, 31 Aug 2022 15:50:52 +0300 +Subject: [PATCH] USB: hcd-pci: Drop the unused id parameter from + usb_hcd_pci_probe() +Git-commit: 4e55e22d3d9aa50ef1ba059bf3a53aa61109c179 +References: jsc#PED-531 +Patch-mainline: v6.1-rc1 + +Since the HC driver is now passed to the function with its +own parameter (it used to be picked from id->driver_data), +the id parameter serves no purpose. + +Signed-off-by: Heikki Krogerus +Link: https://lore.kernel.org/r/20220831125052.71584-1-heikki.krogerus@linux.intel.com +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Oliver Neukum +--- + drivers/usb/core/hcd-pci.c | 7 +------ + drivers/usb/host/ehci-pci.c | 2 +- + drivers/usb/host/ohci-pci.c | 2 +- + drivers/usb/host/uhci-pci.c | 2 +- + drivers/usb/host/xhci-pci.c | 2 +- + include/linux/usb/hcd.h | 1 - + 6 files changed, 5 insertions(+), 11 deletions(-) + +diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c +index 482dae72ef1c..9b77f49b3560 100644 +--- a/drivers/usb/core/hcd-pci.c ++++ b/drivers/usb/core/hcd-pci.c +@@ -157,7 +157,6 @@ static void ehci_wait_for_companions(struct pci_dev *pdev, struct usb_hcd *hcd, + /** + * usb_hcd_pci_probe - initialize PCI-based HCDs + * @dev: USB Host Controller being probed +- * @id: pci hotplug id connecting controller to HCD framework + * @driver: USB HC driver handle + * + * Context: task context, might sleep +@@ -170,8 +169,7 @@ static void ehci_wait_for_companions(struct pci_dev *pdev, struct usb_hcd *hcd, + * + * Return: 0 if successful. + */ +-int usb_hcd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id, +- const struct hc_driver *driver) ++int usb_hcd_pci_probe(struct pci_dev *dev, const struct hc_driver *driver) + { + struct usb_hcd *hcd; + int retval; +@@ -180,9 +178,6 @@ int usb_hcd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id, + if (usb_disabled()) + return -ENODEV; + +- if (!id) +- return -EINVAL; +- + if (!driver) + return -EINVAL; + +diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c +index 9581952d999a..17f8b6ea0c35 100644 +--- a/drivers/usb/host/ehci-pci.c ++++ b/drivers/usb/host/ehci-pci.c +@@ -382,7 +382,7 @@ static int ehci_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) + { + if (is_bypassed_id(pdev)) + return -ENODEV; +- return usb_hcd_pci_probe(pdev, id, &ehci_pci_hc_driver); ++ return usb_hcd_pci_probe(pdev, &ehci_pci_hc_driver); + } + + static void ehci_pci_remove(struct pci_dev *pdev) +diff --git a/drivers/usb/host/ohci-pci.c b/drivers/usb/host/ohci-pci.c +index a146b2d3ef0b..d7b4f40f9ff4 100644 +--- a/drivers/usb/host/ohci-pci.c ++++ b/drivers/usb/host/ohci-pci.c +@@ -282,7 +282,7 @@ MODULE_DEVICE_TABLE (pci, pci_ids); + + static int ohci_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) + { +- return usb_hcd_pci_probe(dev, id, &ohci_pci_hc_driver); ++ return usb_hcd_pci_probe(dev, &ohci_pci_hc_driver); + } + + /* pci driver glue; this is a "new style" PCI driver module */ +diff --git a/drivers/usb/host/uhci-pci.c b/drivers/usb/host/uhci-pci.c +index 9b88745d247f..3592f757fe05 100644 +--- a/drivers/usb/host/uhci-pci.c ++++ b/drivers/usb/host/uhci-pci.c +@@ -294,7 +294,7 @@ MODULE_DEVICE_TABLE(pci, uhci_pci_ids); + + static int uhci_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) + { +- return usb_hcd_pci_probe(dev, id, &uhci_driver); ++ return usb_hcd_pci_probe(dev, &uhci_driver); + } + + static struct pci_driver uhci_pci_driver = { +diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c +index dce6c0ec8d34..40228a3d77a0 100644 +--- a/drivers/usb/host/xhci-pci.c ++++ b/drivers/usb/host/xhci-pci.c +@@ -431,7 +431,7 @@ static int xhci_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) + * to say USB 2.0, but I'm not sure what the implications would be in + * the other parts of the HCD code. + */ +- retval = usb_hcd_pci_probe(dev, id, &xhci_pci_hc_driver); ++ retval = usb_hcd_pci_probe(dev, &xhci_pci_hc_driver); + + if (retval) + goto put_runtime_pm; +diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h +index 67f8713d3fa3..78cd566ee238 100644 +--- a/include/linux/usb/hcd.h ++++ b/include/linux/usb/hcd.h +@@ -479,7 +479,6 @@ static inline int ehset_single_step_set_feature(struct usb_hcd *hcd, int port) + struct pci_dev; + struct pci_device_id; + extern int usb_hcd_pci_probe(struct pci_dev *dev, +- const struct pci_device_id *id, + const struct hc_driver *driver); + extern void usb_hcd_pci_remove(struct pci_dev *dev); + extern void usb_hcd_pci_shutdown(struct pci_dev *dev); +-- +2.35.3 + diff --git a/patches.suse/USB-xhci-make-xhci_get_endpoint_address-static.patch b/patches.suse/USB-xhci-make-xhci_get_endpoint_address-static.patch new file mode 100644 index 0000000..fa486d2 --- /dev/null +++ b/patches.suse/USB-xhci-make-xhci_get_endpoint_address-static.patch @@ -0,0 +1,47 @@ +From d017aeaf844db21e8e7b22d79de229b746359f3b Mon Sep 17 00:00:00 2001 +From: Greg Kroah-Hartman +Date: Thu, 1 Sep 2022 15:47:44 +0200 +Subject: [PATCH] USB: xhci: make xhci_get_endpoint_address static +Git-commit: d017aeaf844db21e8e7b22d79de229b746359f3b +References: jsc#PED-531 +Patch-mainline: v6.1-rc1 + +This is only called in the xhci.c file, so make the symbol static. + +Cc: Mathias Nyman +Link: https://lore.kernel.org/r/20220901134744.2039891-1-gregkh@linuxfoundation.org +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Oliver Neukum +--- + drivers/usb/host/xhci.c | 2 +- + drivers/usb/host/xhci.h | 1 - + 2 files changed, 1 insertion(+), 2 deletions(-) + +diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c +index 38649284ff88..e8837c5d6f5c 100644 +--- a/drivers/usb/host/xhci.c ++++ b/drivers/usb/host/xhci.c +@@ -1482,7 +1482,7 @@ EXPORT_SYMBOL_GPL(xhci_get_endpoint_index); + /* The reverse operation to xhci_get_endpoint_index. Calculate the USB endpoint + * address from the XHCI endpoint index. + */ +-unsigned int xhci_get_endpoint_address(unsigned int ep_index) ++static unsigned int xhci_get_endpoint_address(unsigned int ep_index) + { + unsigned int number = DIV_ROUND_UP(ep_index, 2); + unsigned int direction = ep_index % 2 ? USB_DIR_OUT : USB_DIR_IN; +diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h +index 6dfbf73ee840..2fa7be41a8b5 100644 +--- a/drivers/usb/host/xhci.h ++++ b/drivers/usb/host/xhci.h +@@ -2042,7 +2042,6 @@ int xhci_setup_addressable_virt_dev(struct xhci_hcd *xhci, struct usb_device *ud + void xhci_copy_ep0_dequeue_into_input_ctx(struct xhci_hcd *xhci, + struct usb_device *udev); + unsigned int xhci_get_endpoint_index(struct usb_endpoint_descriptor *desc); +-unsigned int xhci_get_endpoint_address(unsigned int ep_index); + unsigned int xhci_last_valid_endpoint(u32 added_ctxs); + void xhci_endpoint_zero(struct xhci_hcd *xhci, struct xhci_virt_device *virt_dev, struct usb_host_endpoint *ep); + void xhci_update_tt_active_eps(struct xhci_hcd *xhci, +-- +2.35.3 + diff --git a/patches.suse/habanalabs-select-CRC32.patch b/patches.suse/habanalabs-select-CRC32.patch new file mode 100644 index 0000000..24e182a --- /dev/null +++ b/patches.suse/habanalabs-select-CRC32.patch @@ -0,0 +1,34 @@ +From f6fb34390cd047543ff00b34b8ad910bf76c8eb3 Mon Sep 17 00:00:00 2001 +From: Vegard Nossum +Date: Mon, 11 Oct 2021 17:14:43 +0200 +Subject: [PATCH] habanalabs: select CRC32 +Git-commit: f6fb34390cd047543ff00b34b8ad910bf76c8eb3 +References: git-fixes +Patch-mainline: v5.16-rc1 + +Fix the following build/link error by adding a dependency on the CRC32 +routines: + + ld: drivers/misc/habanalabs/common/firmware_if.o: in function `hl_fw_dynamic_request_descriptor': + firmware_if.c:(.text.unlikely+0xc89): undefined reference to `crc32_le' + +Fixes: 8a43c83fec12 ("habanalabs: load boot fit to device") +Signed-off-by: Vegard Nossum +Acked-by: Arnd Bergmann +Reviewed-by: Oded Gabbay +Signed-off-by: Oded Gabbay +Signed-off-by: Oliver Neukum +--- + drivers/misc/habanalabs/Kconfig | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/misc/habanalabs/Kconfig ++++ b/drivers/misc/habanalabs/Kconfig +@@ -8,6 +8,7 @@ config HABANA_AI + depends on PCI && HAS_IOMEM + select GENERIC_ALLOCATOR + select HWMON ++ select CRC32 + help + Enables PCIe card driver for Habana's AI Processors (AIP) that are + designed to accelerate Deep Learning inference and training workloads. diff --git a/patches.suse/net-delete-redundant-function-declaration.patch b/patches.suse/net-delete-redundant-function-declaration.patch new file mode 100644 index 0000000..ec8bade --- /dev/null +++ b/patches.suse/net-delete-redundant-function-declaration.patch @@ -0,0 +1,38 @@ +From 9974cb5c879048f5144d0660c4932d98176213c4 Mon Sep 17 00:00:00 2001 +From: Chen Wandun +Date: Wed, 13 Oct 2021 17:47:02 +0800 +Subject: [PATCH] net: delete redundant function declaration +Git-commit: 9974cb5c879048f5144d0660c4932d98176213c4 +References: git-fixes +Patch-mainline: v5.16-rc1 + +The implement of function netdev_all_upper_get_next_dev_rcu has been +removed in: + commit f1170fd462c6 ("net: Remove all_adj_list and its references") +so delete redundant declaration in header file. + +Fixes: f1170fd462c6 ("net: Remove all_adj_list and its references") +Signed-off-by: Chen Wandun +Link: https://lore.kernel.org/r/20211013094702.3931071-1-chenwandun@huawei.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Oliver Neukum +--- + include/linux/netdevice.h | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h +index f33af341bfb2..173984414f38 100644 +--- a/include/linux/netdevice.h ++++ b/include/linux/netdevice.h +@@ -4801,8 +4801,6 @@ struct netdev_nested_priv { + bool netdev_has_upper_dev(struct net_device *dev, struct net_device *upper_dev); + struct net_device *netdev_upper_get_next_dev_rcu(struct net_device *dev, + struct list_head **iter); +-struct net_device *netdev_all_upper_get_next_dev_rcu(struct net_device *dev, +- struct list_head **iter); + + #ifdef CONFIG_LOCKDEP + static LIST_HEAD(net_unlink_list); +-- +2.35.3 + diff --git a/patches.suse/powerpc-kvm-Remove-obsolete-and-unneeded-select.patch b/patches.suse/powerpc-kvm-Remove-obsolete-and-unneeded-select.patch new file mode 100644 index 0000000..32bb5cc --- /dev/null +++ b/patches.suse/powerpc-kvm-Remove-obsolete-and-unneeded-select.patch @@ -0,0 +1,43 @@ +From c26d4c5d4f0df7207da3975458261927f9305465 Mon Sep 17 00:00:00 2001 +From: Lukas Bulwahn +Date: Thu, 19 Aug 2021 13:39:53 +0200 +Subject: [PATCH] powerpc/kvm: Remove obsolete and unneeded select +Git-commit: c26d4c5d4f0df7207da3975458261927f9305465 +References: git-fixes +Patch-mainline: v5.15-rc1 + +Commit a278e7ea608b ("powerpc: Fix compile issue with force DAWR") +selects the non-existing config PPC_DAWR_FORCE_ENABLE for config +KVM_BOOK3S_64_HANDLER. As this commit also introduces a config PPC_DAWR +and this config PPC_DAWR is selected with PPC if PPC64, there is no +need for any further select in the KVM_BOOK3S_64_HANDLER. + +Remove an obsolete and unneeded select in config KVM_BOOK3S_64_HANDLER. + +The issue was identified with ./scripts/checkkconfigsymbols.py. + +Fixes: a278e7ea608b ("powerpc: Fix compile issue with force DAWR") +Signed-off-by: Lukas Bulwahn +Reviewed-by: Daniel Axtens +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20210819113954.17515-2-lukas.bulwahn@gmail.com +Signed-off-by: Oliver Neukum +--- + arch/powerpc/kvm/Kconfig | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/arch/powerpc/kvm/Kconfig b/arch/powerpc/kvm/Kconfig +index e45644657d49..ff581d70f20c 100644 +--- a/arch/powerpc/kvm/Kconfig ++++ b/arch/powerpc/kvm/Kconfig +@@ -38,7 +38,6 @@ config KVM_BOOK3S_32_HANDLER + config KVM_BOOK3S_64_HANDLER + bool + select KVM_BOOK3S_HANDLER +- select PPC_DAWR_FORCE_ENABLE + + config KVM_BOOK3S_PR_POSSIBLE + bool +-- +2.35.3 + diff --git a/patches.suse/tracing-Fix-smatch-warning-for-do-while-check-in-eve.patch b/patches.suse/tracing-Fix-smatch-warning-for-do-while-check-in-eve.patch new file mode 100644 index 0000000..c0a96a3 --- /dev/null +++ b/patches.suse/tracing-Fix-smatch-warning-for-do-while-check-in-eve.patch @@ -0,0 +1,48 @@ +From b59f2f2b865cedd6d1641394b9cd84399bd738ff Mon Sep 17 00:00:00 2001 +From: Tom Zanussi +Date: Thu, 27 Jan 2022 15:44:16 -0600 +Subject: [PATCH] tracing: Fix smatch warning for do while check in + event_hist_trigger_parse() +Git-commit: b59f2f2b865cedd6d1641394b9cd84399bd738ff +References: git-fixes +Patch-mainline: v5.17-rc2 + +The patch ec5ce0987541: "tracing: Allow whitespace to surround hist +trigger filter" from Jan 15, 2018, leads to the following Smatch +static checker warning: + + kernel/trace/trace_events_hist.c:6199 event_hist_trigger_parse() + warn: 'p' can't be NULL. + +Since p is always checked for a NULL value at the top of loop and +nothing in the rest of the loop will set it to NULL, the warning +is correct and might as well be 1 to silence the warning. + +Link: https://lkml.kernel.org/r/a1d4c79766c0cf61e20438dc35244d216633fef6.1643319703.git.zanussi@kernel.org + +Fixes: ec5ce09875410 ("tracing: Allow whitespace to surround hist trigger filter") +Reported-by: kernel test robot +Reported-by: Dan Carpenter +Signed-off-by: Tom Zanussi +Signed-off-by: Steven Rostedt (Google) +Signed-off-by: Oliver Neukum +--- + kernel/trace/trace_events_hist.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c +index e0860146dd39..b894d68082ea 100644 +--- a/kernel/trace/trace_events_hist.c ++++ b/kernel/trace/trace_events_hist.c +@@ -6199,7 +6199,7 @@ static int event_hist_trigger_parse(struct event_command *cmd_ops, + continue; + } + break; +- } while (p); ++ } while (1); + + if (!p) + param = NULL; +-- +2.35.3 + diff --git a/patches.suse/tracing-Tag-trace_percpu_buffer-as-a-percpu-pointer.patch b/patches.suse/tracing-Tag-trace_percpu_buffer-as-a-percpu-pointer.patch new file mode 100644 index 0000000..bf420ae --- /dev/null +++ b/patches.suse/tracing-Tag-trace_percpu_buffer-as-a-percpu-pointer.patch @@ -0,0 +1,54 @@ +From f28439db470cca8b6b082239314e9fd10bd39034 Mon Sep 17 00:00:00 2001 +From: "Naveen N. Rao" +Date: Thu, 23 Dec 2021 16:04:39 +0530 +Subject: [PATCH] tracing: Tag trace_percpu_buffer as a percpu pointer +Git-commit: f28439db470cca8b6b082239314e9fd10bd39034 +References: git-fixes +Patch-mainline: v5.16 + +Tag trace_percpu_buffer as a percpu pointer to resolve warnings +reported by sparse: + /linux/kernel/trace/trace.c:3218:46: warning: incorrect type in initializer (different address spaces) + /linux/kernel/trace/trace.c:3218:46: expected void const [noderef] __percpu *__vpp_verify + /linux/kernel/trace/trace.c:3218:46: got struct trace_buffer_struct * + /linux/kernel/trace/trace.c:3234:9: warning: incorrect type in initializer (different address spaces) + /linux/kernel/trace/trace.c:3234:9: expected void const [noderef] __percpu *__vpp_verify + /linux/kernel/trace/trace.c:3234:9: got int * + +Link: https://lkml.kernel.org/r/ebabd3f23101d89cb75671b68b6f819f5edc830b.1640255304.git.naveen.n.rao@linux.vnet.ibm.com + +Cc: stable@vger.kernel.org +Reported-by: kernel test robot +Fixes: 07d777fe8c398 ("tracing: Add percpu buffers for trace_printk()") +Signed-off-by: Naveen N. Rao +Signed-off-by: Steven Rostedt +Signed-off-by: Oliver Neukum +--- + kernel/trace/trace.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c +index e1f55851e53f..78ea542ce3bc 100644 +--- a/kernel/trace/trace.c ++++ b/kernel/trace/trace.c +@@ -3207,7 +3207,7 @@ struct trace_buffer_struct { + char buffer[4][TRACE_BUF_SIZE]; + }; + +-static struct trace_buffer_struct *trace_percpu_buffer; ++static struct trace_buffer_struct __percpu *trace_percpu_buffer; + + /* + * This allows for lockless recording. If we're nested too deeply, then +@@ -3236,7 +3236,7 @@ static void put_trace_buf(void) + + static int alloc_percpu_trace_buffer(void) + { +- struct trace_buffer_struct *buffers; ++ struct trace_buffer_struct __percpu *buffers; + + if (trace_percpu_buffer) + return 0; +-- +2.35.3 + diff --git a/patches.suse/usb-host-remove-dead-EHCI-support-for-on-chip-PMC-MS.patch b/patches.suse/usb-host-remove-dead-EHCI-support-for-on-chip-PMC-MS.patch new file mode 100644 index 0000000..529b849 --- /dev/null +++ b/patches.suse/usb-host-remove-dead-EHCI-support-for-on-chip-PMC-MS.patch @@ -0,0 +1,399 @@ +From b2582996a74799c84fd19473c7b914565249b050 Mon Sep 17 00:00:00 2001 +From: Lukas Bulwahn +Date: Wed, 18 Aug 2021 09:11:35 +0200 +Subject: [PATCH] usb: host: remove dead EHCI support for on-chip PMC MSP71xx + USB controller +Git-commit: b2582996a74799c84fd19473c7b914565249b050 +References: jsc#PED-531 +Patch-mainline: v5.15-rc1 + +Commit 1b00767fd8e1 ("MIPS: Remove PMC MSP71xx platform") deletes +./arch/mips/pmcs-msp71xx/Kconfig, including its config MSP_HAS_USB. + +Hence, since then, the corresponding EHCI support for on-chip PMC MSP71xx +USB controller is dead code. Remove this dead driver. + +Signed-off-by: Lukas Bulwahn +Link: https://lore.kernel.org/r/20210818071137.22711-2-lukas.bulwahn@gmail.com +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Oliver Neukum +--- + drivers/usb/host/Kconfig | 9 - + drivers/usb/host/ehci-hcd.c | 5 - + drivers/usb/host/ehci-pmcmsp.c | 328 --------------------------------- + 3 files changed, 342 deletions(-) + delete mode 100644 drivers/usb/host/ehci-pmcmsp.c + +diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig +index df9428f1dc5e..c4736d1d020c 100644 +--- a/drivers/usb/host/Kconfig ++++ b/drivers/usb/host/Kconfig +@@ -187,15 +187,6 @@ config USB_EHCI_PCI + depends on USB_PCI + default y + +-config USB_EHCI_HCD_PMC_MSP +- tristate "EHCI support for on-chip PMC MSP71xx USB controller" +- depends on MSP_HAS_USB +- select USB_EHCI_BIG_ENDIAN_DESC +- select USB_EHCI_BIG_ENDIAN_MMIO +- help +- Enables support for the onchip USB controller on the PMC_MSP7100 Family SoC's. +- If unsure, say N. +- + config XPS_USB_HCD_XILINX + bool "Use Xilinx usb host EHCI controller core" + depends on (PPC32 || MICROBLAZE) +diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c +index 10b0365f3439..6bdc6d6bf74d 100644 +--- a/drivers/usb/host/ehci-hcd.c ++++ b/drivers/usb/host/ehci-hcd.c +@@ -1296,11 +1296,6 @@ MODULE_LICENSE ("GPL"); + #define XILINX_OF_PLATFORM_DRIVER ehci_hcd_xilinx_of_driver + #endif + +-#ifdef CONFIG_USB_EHCI_HCD_PMC_MSP +-#include "ehci-pmcmsp.c" +-#define PLATFORM_DRIVER ehci_hcd_msp_driver +-#endif +- + #ifdef CONFIG_SPARC_LEON + #include "ehci-grlib.c" + #define PLATFORM_DRIVER ehci_grlib_driver +diff --git a/drivers/usb/host/ehci-pmcmsp.c b/drivers/usb/host/ehci-pmcmsp.c +deleted file mode 100644 +index 5fb92b956cc7..000000000000 +--- a/drivers/usb/host/ehci-pmcmsp.c ++++ /dev/null +@@ -1,328 +0,0 @@ +-// SPDX-License-Identifier: GPL-2.0 +-/* +- * PMC MSP EHCI (Host Controller Driver) for USB. +- * +- * (C) Copyright 2006-2010 PMC-Sierra Inc +- */ +- +-/* includes */ +-#include +-#include +-#include +-#include +- +-/* stream disable*/ +-#define USB_CTRL_MODE_STREAM_DISABLE 0x10 +- +-/* threshold */ +-#define USB_CTRL_FIFO_THRESH 0x00300000 +- +-/* register offset for usb_mode */ +-#define USB_EHCI_REG_USB_MODE 0x68 +- +-/* register offset for usb fifo */ +-#define USB_EHCI_REG_USB_FIFO 0x24 +- +-/* register offset for usb status */ +-#define USB_EHCI_REG_USB_STATUS 0x44 +- +-/* serial/parallel transceiver */ +-#define USB_EHCI_REG_BIT_STAT_STS (1<<29) +- +-/* TWI USB0 host device pin */ +-#define MSP_PIN_USB0_HOST_DEV 49 +- +-/* TWI USB1 host device pin */ +-#define MSP_PIN_USB1_HOST_DEV 50 +- +- +-static void usb_hcd_tdi_set_mode(struct ehci_hcd *ehci) +-{ +- u8 *base; +- u8 *statreg; +- u8 *fiforeg; +- u32 val; +- struct ehci_regs *reg_base = ehci->regs; +- +- /* get register base */ +- base = (u8 *)reg_base + USB_EHCI_REG_USB_MODE; +- statreg = (u8 *)reg_base + USB_EHCI_REG_USB_STATUS; +- fiforeg = (u8 *)reg_base + USB_EHCI_REG_USB_FIFO; +- +- /* Disable controller mode stream */ +- val = ehci_readl(ehci, (u32 *)base); +- ehci_writel(ehci, (val | USB_CTRL_MODE_STREAM_DISABLE), +- (u32 *)base); +- +- /* clear STS to select parallel transceiver interface */ +- val = ehci_readl(ehci, (u32 *)statreg); +- val = val & ~USB_EHCI_REG_BIT_STAT_STS; +- ehci_writel(ehci, val, (u32 *)statreg); +- +- /* write to set the proper fifo threshold */ +- ehci_writel(ehci, USB_CTRL_FIFO_THRESH, (u32 *)fiforeg); +- +- /* set TWI GPIO USB_HOST_DEV pin high */ +- gpio_direction_output(MSP_PIN_USB0_HOST_DEV, 1); +-} +- +-/* called during probe() after chip reset completes */ +-static int ehci_msp_setup(struct usb_hcd *hcd) +-{ +- struct ehci_hcd *ehci = hcd_to_ehci(hcd); +- int retval; +- +- ehci->big_endian_mmio = 1; +- ehci->big_endian_desc = 1; +- +- ehci->caps = hcd->regs; +- hcd->has_tt = 1; +- +- retval = ehci_setup(hcd); +- if (retval) +- return retval; +- +- usb_hcd_tdi_set_mode(ehci); +- +- return retval; +-} +- +- +-/* configure so an HC device and id are always provided +- * always called with process context; sleeping is OK +- */ +- +-static int usb_hcd_msp_map_regs(struct mspusb_device *dev) +-{ +- struct resource *res; +- struct platform_device *pdev = &dev->dev; +- u32 res_len; +- int retval; +- +- /* MAB register space */ +- res = platform_get_resource(pdev, IORESOURCE_MEM, 1); +- if (res == NULL) +- return -ENOMEM; +- res_len = resource_size(res); +- if (!request_mem_region(res->start, res_len, "mab regs")) +- return -EBUSY; +- +- dev->mab_regs = ioremap(res->start, res_len); +- if (dev->mab_regs == NULL) { +- retval = -ENOMEM; +- goto err1; +- } +- +- /* MSP USB register space */ +- res = platform_get_resource(pdev, IORESOURCE_MEM, 2); +- if (res == NULL) { +- retval = -ENOMEM; +- goto err2; +- } +- res_len = resource_size(res); +- if (!request_mem_region(res->start, res_len, "usbid regs")) { +- retval = -EBUSY; +- goto err2; +- } +- dev->usbid_regs = ioremap(res->start, res_len); +- if (dev->usbid_regs == NULL) { +- retval = -ENOMEM; +- goto err3; +- } +- +- return 0; +-err3: +- res = platform_get_resource(pdev, IORESOURCE_MEM, 2); +- res_len = resource_size(res); +- release_mem_region(res->start, res_len); +-err2: +- iounmap(dev->mab_regs); +-err1: +- res = platform_get_resource(pdev, IORESOURCE_MEM, 1); +- res_len = resource_size(res); +- release_mem_region(res->start, res_len); +- dev_err(&pdev->dev, "Failed to map non-EHCI regs.\n"); +- return retval; +-} +- +-/** +- * usb_hcd_msp_probe - initialize PMC MSP-based HCDs +- * @driver: Pointer to hc driver instance +- * @dev: USB controller to probe +- * +- * Context: task context, might sleep +- * +- * Allocates basic resources for this USB host controller, and +- * then invokes the start() method for the HCD associated with it +- * through the hotplug entry's driver_data. +- */ +-int usb_hcd_msp_probe(const struct hc_driver *driver, +- struct platform_device *dev) +-{ +- int retval; +- struct usb_hcd *hcd; +- struct resource *res; +- struct ehci_hcd *ehci ; +- +- hcd = usb_create_hcd(driver, &dev->dev, "pmcmsp"); +- if (!hcd) +- return -ENOMEM; +- +- res = platform_get_resource(dev, IORESOURCE_MEM, 0); +- if (res == NULL) { +- pr_debug("No IOMEM resource info for %s.\n", dev->name); +- retval = -ENOMEM; +- goto err1; +- } +- hcd->rsrc_start = res->start; +- hcd->rsrc_len = resource_size(res); +- if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, dev->name)) { +- retval = -EBUSY; +- goto err1; +- } +- hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len); +- if (!hcd->regs) { +- pr_debug("ioremap failed"); +- retval = -ENOMEM; +- goto err2; +- } +- +- res = platform_get_resource(dev, IORESOURCE_IRQ, 0); +- if (res == NULL) { +- dev_err(&dev->dev, "No IRQ resource info for %s.\n", dev->name); +- retval = -ENOMEM; +- goto err3; +- } +- +- /* Map non-EHCI register spaces */ +- retval = usb_hcd_msp_map_regs(to_mspusb_device(dev)); +- if (retval != 0) +- goto err3; +- +- ehci = hcd_to_ehci(hcd); +- ehci->big_endian_mmio = 1; +- ehci->big_endian_desc = 1; +- +- +- retval = usb_add_hcd(hcd, res->start, IRQF_SHARED); +- if (retval == 0) { +- device_wakeup_enable(hcd->self.controller); +- return 0; +- } +- +- usb_remove_hcd(hcd); +-err3: +- iounmap(hcd->regs); +-err2: +- release_mem_region(hcd->rsrc_start, hcd->rsrc_len); +-err1: +- usb_put_hcd(hcd); +- +- return retval; +-} +- +- +- +-/** +- * usb_hcd_msp_remove - shutdown processing for PMC MSP-based HCDs +- * @hcd: USB Host Controller being removed +- * +- * Context: task context, might sleep +- * +- * Reverses the effect of usb_hcd_msp_probe(), first invoking +- * the HCD's stop() method. It is always called from a thread +- * context, normally "rmmod", "apmd", or something similar. +- * +- * may be called without controller electrically present +- * may be called with controller, bus, and devices active +- */ +-static void usb_hcd_msp_remove(struct usb_hcd *hcd) +-{ +- usb_remove_hcd(hcd); +- iounmap(hcd->regs); +- release_mem_region(hcd->rsrc_start, hcd->rsrc_len); +- usb_put_hcd(hcd); +-} +- +-static const struct hc_driver ehci_msp_hc_driver = { +- .description = hcd_name, +- .product_desc = "PMC MSP EHCI", +- .hcd_priv_size = sizeof(struct ehci_hcd), +- +- /* +- * generic hardware linkage +- */ +- .irq = ehci_irq, +- .flags = HCD_MEMORY | HCD_DMA | HCD_USB2 | HCD_BH, +- +- /* +- * basic lifecycle operations +- */ +- .reset = ehci_msp_setup, +- .shutdown = ehci_shutdown, +- .start = ehci_run, +- .stop = ehci_stop, +- +- /* +- * managing i/o requests and associated device resources +- */ +- .urb_enqueue = ehci_urb_enqueue, +- .urb_dequeue = ehci_urb_dequeue, +- .endpoint_disable = ehci_endpoint_disable, +- .endpoint_reset = ehci_endpoint_reset, +- +- /* +- * scheduling support +- */ +- .get_frame_number = ehci_get_frame, +- +- /* +- * root hub support +- */ +- .hub_status_data = ehci_hub_status_data, +- .hub_control = ehci_hub_control, +- .bus_suspend = ehci_bus_suspend, +- .bus_resume = ehci_bus_resume, +- .relinquish_port = ehci_relinquish_port, +- .port_handed_over = ehci_port_handed_over, +- +- .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete, +-}; +- +-static int ehci_hcd_msp_drv_probe(struct platform_device *pdev) +-{ +- int ret; +- +- pr_debug("In ehci_hcd_msp_drv_probe"); +- +- if (usb_disabled()) +- return -ENODEV; +- +- gpio_request(MSP_PIN_USB0_HOST_DEV, "USB0_HOST_DEV_GPIO"); +- +- ret = usb_hcd_msp_probe(&ehci_msp_hc_driver, pdev); +- +- return ret; +-} +- +-static int ehci_hcd_msp_drv_remove(struct platform_device *pdev) +-{ +- struct usb_hcd *hcd = platform_get_drvdata(pdev); +- +- usb_hcd_msp_remove(hcd); +- +- /* free TWI GPIO USB_HOST_DEV pin */ +- gpio_free(MSP_PIN_USB0_HOST_DEV); +- +- return 0; +-} +- +-MODULE_ALIAS("pmcmsp-ehci"); +- +-static struct platform_driver ehci_hcd_msp_driver = { +- .probe = ehci_hcd_msp_drv_probe, +- .remove = ehci_hcd_msp_drv_remove, +- .driver = { +- .name = "pmcmsp-ehci", +- }, +-}; +-- +2.35.3 + diff --git a/patches.suse/usb-renesas-xhci-Do-not-print-any-log-while-fw-verif.patch b/patches.suse/usb-renesas-xhci-Do-not-print-any-log-while-fw-verif.patch new file mode 100644 index 0000000..a07e11a --- /dev/null +++ b/patches.suse/usb-renesas-xhci-Do-not-print-any-log-while-fw-verif.patch @@ -0,0 +1,44 @@ +From b2d0dd5155c437ec5aad2141d74a8fac97ef755f Mon Sep 17 00:00:00 2001 +From: Chen Xingdi +Date: Wed, 27 Jul 2022 11:11:46 +0800 +Subject: [PATCH] usb: renesas-xhci: Do not print any log while fw verif + success +Git-commit: b2d0dd5155c437ec5aad2141d74a8fac97ef755f +References: jsc#PED-531 +Patch-mainline: v6.0-rc1 + +When drivers are working properly, they should be quiet. + +Signed-off-by: Chen Xingdi +Link: https://lore.kernel.org/r/20220727031146.19345-1-chenxingdi@huawei.com +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Oliver Neukum +--- + drivers/usb/host/xhci-pci-renesas.c | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/drivers/usb/host/xhci-pci-renesas.c b/drivers/usb/host/xhci-pci-renesas.c +index 52599d96634f..93f8b355bc70 100644 +--- a/drivers/usb/host/xhci-pci-renesas.c ++++ b/drivers/usb/host/xhci-pci-renesas.c +@@ -120,7 +120,6 @@ static int renesas_fw_verify(const void *fw_data, + size_t length) + { + u16 fw_version_pointer; +- u16 fw_version; + + /* + * The Firmware's Data Format is describe in +@@ -150,9 +149,6 @@ static int renesas_fw_verify(const void *fw_data, + return -EINVAL; + } + +- fw_version = get_unaligned_le16(fw_data + fw_version_pointer); +- pr_err("got firmware version: %02x.", fw_version); +- + return 0; + } + +-- +2.35.3 + diff --git a/patches.suse/usb-typec-wcove-Drop-wrong-dependency-to-INTEL_SOC_P.patch b/patches.suse/usb-typec-wcove-Drop-wrong-dependency-to-INTEL_SOC_P.patch new file mode 100644 index 0000000..741d584 --- /dev/null +++ b/patches.suse/usb-typec-wcove-Drop-wrong-dependency-to-INTEL_SOC_P.patch @@ -0,0 +1,44 @@ +From 9ef165406308515dcf2e3f6e97b39a1c56d86db5 Mon Sep 17 00:00:00 2001 +From: Andy Shevchenko +Date: Mon, 20 Jun 2022 13:43:16 +0300 +Subject: [PATCH] usb: typec: wcove: Drop wrong dependency to INTEL_SOC_PMIC +Git-commit: 9ef165406308515dcf2e3f6e97b39a1c56d86db5 +References: git-fixes +Patch-mainline: v5.19-rc4 + +Intel SoC PMIC is a generic name for all PMICs that are used +on Intel platforms. In particular, INTEL_SOC_PMIC kernel configuration +option refers to Crystal Cove PMIC, which has never been a part +of any Intel Broxton hardware. Drop wrong dependency from Kconfig. + +Note, the correct dependency is satisfied via ACPI PMIC OpRegion driver, +which the Type-C depends on. + +Fixes: d2061f9cc32d ("usb: typec: add driver for Intel Whiskey Cove PMIC USB Type-C PHY") +Reported-by: Hans de Goede +Reviewed-by: Guenter Roeck +Reviewed-by: Heikki Krogerus +Reviewed-by: Hans de Goede +Signed-off-by: Andy Shevchenko +Link: https://lore.kernel.org/r/20220620104316.57592-1-andriy.shevchenko@linux.intel.com +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Oliver Neukum +--- + drivers/usb/typec/tcpm/Kconfig | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/drivers/usb/typec/tcpm/Kconfig b/drivers/usb/typec/tcpm/Kconfig +index 557f392fe24d..073fd2ea5e0b 100644 +--- a/drivers/usb/typec/tcpm/Kconfig ++++ b/drivers/usb/typec/tcpm/Kconfig +@@ -56,7 +56,6 @@ config TYPEC_WCOVE + tristate "Intel WhiskeyCove PMIC USB Type-C PHY driver" + depends on ACPI + depends on MFD_INTEL_PMC_BXT +- depends on INTEL_SOC_PMIC + depends on BXT_WC_PMIC_OPREGION + help + This driver adds support for USB Type-C on Intel Broxton platforms +-- +2.35.3 + diff --git a/patches.suse/x86-Kconfig-Fix-an-unused-variable-error-in-dell-smm.patch b/patches.suse/x86-Kconfig-Fix-an-unused-variable-error-in-dell-smm.patch new file mode 100644 index 0000000..97d821a --- /dev/null +++ b/patches.suse/x86-Kconfig-Fix-an-unused-variable-error-in-dell-smm.patch @@ -0,0 +1,54 @@ +From ef775a0e36c6a81c5b07cb228c02f967133fe768 Mon Sep 17 00:00:00 2001 +From: Randy Dunlap +Date: Fri, 10 Sep 2021 00:19:21 -0700 +Subject: [PATCH] x86/Kconfig: Fix an unused variable error in dell-smm-hwmon +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +Git-commit: ef775a0e36c6a81c5b07cb228c02f967133fe768 +References: git-fixes +Patch-mainline: v5.16-rc1 + +When CONFIG_PROC_FS is not set, there is a build warning (turned +into an error): + + ../drivers/hwmon/dell-smm-hwmon.c: In function 'i8k_init_procfs': + ../drivers/hwmon/dell-smm-hwmon.c:624:24: error: unused variable 'data' [-Werror=unused-variable] + struct dell_smm_data *data = dev_get_drvdata(dev); + +Make I8K depend on PROC_FS and HWMON (instead of selecting HWMON -- it +is strongly preferred to not select entire subsystems). + +Build tested in all possible combinations of SENSORS_DELL_SMM, I8K, and +PROC_FS. + +Fixes: 039ae58503f3 ("hwmon: Allow to compile dell-smm-hwmon driver without /proc/i8k") +Reported-by: Arnd Bergmann +Signed-off-by: Randy Dunlap +Signed-off-by: Borislav Petkov +Reviewed-by: Arnd Bergmann +Acked-by: Guenter Roeck +Acked-by: Pali Rohár +Link: https://lkml.kernel.org/r/20210910071921.16777-1-rdunlap@infradead.org +Signed-off-by: Oliver Neukum +--- + arch/x86/Kconfig | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig +index ab83c22d274e..16e216b57863 100644 +--- a/arch/x86/Kconfig ++++ b/arch/x86/Kconfig +@@ -1256,7 +1256,8 @@ config TOSHIBA + + config I8K + tristate "Dell i8k legacy laptop support" +- select HWMON ++ depends on HWMON ++ depends on PROC_FS + select SENSORS_DELL_SMM + help + This option enables legacy /proc/i8k userspace interface in hwmon +-- +2.35.3 + diff --git a/patches.suse/xen-blkfront-force-data-bouncing-when-backend-is-unt.patch b/patches.suse/xen-blkfront-force-data-bouncing-when-backend-is-unt.patch index 144be33..0229e5e 100644 --- a/patches.suse/xen-blkfront-force-data-bouncing-when-backend-is-unt.patch +++ b/patches.suse/xen-blkfront-force-data-bouncing-when-backend-is-unt.patch @@ -23,14 +23,12 @@ This is CVE-2022-33742, part of XSA-403. Signed-off-by: Roger Pau Monné Reviewed-by: Juergen Gross --- - drivers/block/xen-blkfront.c | 49 +++++++++++++++++++++++++----------- + drivers/block/xen-blkfront.c | 49 +++++++++++++++++++++++++++++-------------- 1 file changed, 34 insertions(+), 15 deletions(-) -diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c -index 4b3bef6ace68..3646c0cae672 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c -@@ -152,6 +152,10 @@ static unsigned int xen_blkif_max_ring_order; +@@ -151,6 +151,10 @@ static unsigned int xen_blkif_max_ring_o module_param_named(max_ring_page_order, xen_blkif_max_ring_order, int, 0444); MODULE_PARM_DESC(max_ring_page_order, "Maximum order of pages to be used for the shared ring"); @@ -41,7 +39,7 @@ index 4b3bef6ace68..3646c0cae672 100644 #define BLK_RING_SIZE(info) \ __CONST_RING_SIZE(blkif, XEN_PAGE_SIZE * (info)->nr_ring_pages) -@@ -210,6 +214,7 @@ struct blkfront_info +@@ -208,6 +212,7 @@ struct blkfront_info unsigned int feature_discard:1; unsigned int feature_secdiscard:1; unsigned int feature_persistent:1; @@ -49,7 +47,7 @@ index 4b3bef6ace68..3646c0cae672 100644 unsigned int discard_granularity; unsigned int discard_alignment; /* Number of 4KB segments handled */ -@@ -310,7 +315,7 @@ static int fill_grant_buffer(struct blkfront_ring_info *rinfo, int num) +@@ -310,7 +315,7 @@ static int fill_grant_buffer(struct blkf if (!gnt_list_entry) goto out_of_memory; @@ -58,7 +56,7 @@ index 4b3bef6ace68..3646c0cae672 100644 granted_page = alloc_page(GFP_NOIO | __GFP_ZERO); if (!granted_page) { kfree(gnt_list_entry); -@@ -330,7 +335,7 @@ static int fill_grant_buffer(struct blkfront_ring_info *rinfo, int num) +@@ -330,7 +335,7 @@ out_of_memory: list_for_each_entry_safe(gnt_list_entry, n, &rinfo->grants, node) { list_del(&gnt_list_entry->node); @@ -67,7 +65,7 @@ index 4b3bef6ace68..3646c0cae672 100644 __free_page(gnt_list_entry->page); kfree(gnt_list_entry); i--; -@@ -376,7 +381,7 @@ static struct grant *get_grant(grant_ref_t *gref_head, +@@ -376,7 +381,7 @@ static struct grant *get_grant(grant_ref /* Assign a gref to this page */ gnt_list_entry->gref = gnttab_claim_grant_reference(gref_head); BUG_ON(gnt_list_entry->gref == -ENOSPC); @@ -76,7 +74,7 @@ index 4b3bef6ace68..3646c0cae672 100644 grant_foreign_access(gnt_list_entry, info); else { /* Grant access to the GFN passed by the caller */ -@@ -400,7 +405,7 @@ static struct grant *get_indirect_grant(grant_ref_t *gref_head, +@@ -400,7 +405,7 @@ static struct grant *get_indirect_grant( /* Assign a gref to this page */ gnt_list_entry->gref = gnttab_claim_grant_reference(gref_head); BUG_ON(gnt_list_entry->gref == -ENOSPC); @@ -85,7 +83,7 @@ index 4b3bef6ace68..3646c0cae672 100644 struct page *indirect_page; /* Fetch a pre-allocated page to use for indirect grefs */ -@@ -703,7 +708,7 @@ static int blkif_queue_rw_req(struct request *req, struct blkfront_ring_info *ri +@@ -702,7 +707,7 @@ static int blkif_queue_rw_req(struct req .grant_idx = 0, .segments = NULL, .rinfo = rinfo, @@ -94,7 +92,7 @@ index 4b3bef6ace68..3646c0cae672 100644 }; /* -@@ -981,11 +986,12 @@ static void xlvbd_flush(struct blkfront_info *info) +@@ -980,11 +985,12 @@ static void xlvbd_flush(struct blkfront_ { blk_queue_write_cache(info->rq, info->feature_flush ? true : false, info->feature_fua ? true : false); @@ -109,7 +107,7 @@ index 4b3bef6ace68..3646c0cae672 100644 } static int xen_translate_vdev(int vdevice, int *minor, unsigned int *offset) -@@ -1207,7 +1213,7 @@ static void blkif_free_ring(struct blkfront_ring_info *rinfo) +@@ -1212,7 +1218,7 @@ static void blkif_free_ring(struct blkfr if (!list_empty(&rinfo->indirect_pages)) { struct page *indirect_page, *n; @@ -118,8 +116,8 @@ index 4b3bef6ace68..3646c0cae672 100644 list_for_each_entry_safe(indirect_page, n, &rinfo->indirect_pages, lru) { list_del(&indirect_page->lru); __free_page(indirect_page); -@@ -1224,7 +1230,7 @@ static void blkif_free_ring(struct blkfront_ring_info *rinfo) - 0, 0UL); +@@ -1229,7 +1235,7 @@ static void blkif_free_ring(struct blkfr + 0UL); rinfo->persistent_gnts_c--; } - if (info->feature_persistent) @@ -127,16 +125,16 @@ index 4b3bef6ace68..3646c0cae672 100644 __free_page(persistent_gnt->page); kfree(persistent_gnt); } -@@ -1245,7 +1251,7 @@ static void blkif_free_ring(struct blkfront_ring_info *rinfo) +@@ -1250,7 +1256,7 @@ static void blkif_free_ring(struct blkfr for (j = 0; j < segs; j++) { persistent_gnt = rinfo->shadow[i].grants_used[j]; - gnttab_end_foreign_access(persistent_gnt->gref, 0, 0UL); + gnttab_end_foreign_access(persistent_gnt->gref, 0UL); - if (info->feature_persistent) + if (info->bounce) __free_page(persistent_gnt->page); kfree(persistent_gnt); } -@@ -1428,7 +1434,7 @@ static int blkif_completion(unsigned long *id, +@@ -1440,7 +1446,7 @@ static int blkif_completion(unsigned lon data.s = s; num_sg = s->num_sg; @@ -145,7 +143,7 @@ index 4b3bef6ace68..3646c0cae672 100644 for_each_sg(s->sg, sg, num_sg, i) { BUG_ON(sg->offset + sg->length > PAGE_SIZE); -@@ -1487,7 +1493,7 @@ static int blkif_completion(unsigned long *id, +@@ -1499,7 +1505,7 @@ static int blkif_completion(unsigned lon * Add the used indirect page back to the list of * available pages for indirect grefs. */ @@ -154,7 +152,7 @@ index 4b3bef6ace68..3646c0cae672 100644 indirect_page = s->indirect_grants[i]->page; list_add(&indirect_page->lru, &rinfo->indirect_pages); } -@@ -1764,6 +1770,10 @@ static int talk_to_blkback(struct xenbus_device *dev, +@@ -1790,6 +1796,10 @@ static int talk_to_blkback(struct xenbus if (!info) return -ENODEV; @@ -165,7 +163,7 @@ index 4b3bef6ace68..3646c0cae672 100644 max_page_order = xenbus_read_unsigned(info->xbdev->otherend, "max-ring-page-order", 0); ring_page_order = min(xen_blkif_max_ring_order, max_page_order); -@@ -2173,10 +2183,10 @@ static int blkfront_setup_indirect(struct blkfront_ring_info *rinfo) +@@ -2197,10 +2207,10 @@ static int blkfront_setup_indirect(struc if (err) goto out_of_memory; @@ -179,7 +177,7 @@ index 4b3bef6ace68..3646c0cae672 100644 * used for mapping indirect grefs */ int num = INDIRECT_GREFS(grants) * BLK_RING_SIZE(info); -@@ -2277,6 +2287,8 @@ static void blkfront_gather_backend_features(struct blkfront_info *info) +@@ -2301,6 +2311,8 @@ static void blkfront_gather_backend_feat info->feature_persistent = !!xenbus_read_unsigned(info->xbdev->otherend, "feature-persistent", 0); @@ -188,7 +186,7 @@ index 4b3bef6ace68..3646c0cae672 100644 indirect_segments = xenbus_read_unsigned(info->xbdev->otherend, "feature-max-indirect-segments", 0); -@@ -2548,6 +2560,13 @@ static void blkfront_delay_work(struct work_struct *work) +@@ -2561,6 +2573,13 @@ static void blkfront_delay_work(struct w struct blkfront_info *info; bool need_schedule_work = false; @@ -202,6 +200,3 @@ index 4b3bef6ace68..3646c0cae672 100644 mutex_lock(&blkfront_mutex); list_for_each_entry(info, &info_list, info_list) { --- -2.35.3 - diff --git a/patches.suse/xen-grant-table-remove-readonly-parameter-from-funct.patch b/patches.suse/xen-grant-table-remove-readonly-parameter-from-funct.patch new file mode 100644 index 0000000..a908623 --- /dev/null +++ b/patches.suse/xen-grant-table-remove-readonly-parameter-from-funct.patch @@ -0,0 +1,469 @@ +From c94b731da21f10086a9e52d63c21c730e3f6c939 Mon Sep 17 00:00:00 2001 +From: Juergen Gross +Date: Fri, 11 Mar 2022 11:34:29 +0100 +Subject: [PATCH] xen/grant-table: remove readonly parameter from functions +Git-commit: c94b731da21f10086a9e52d63c21c730e3f6c939 +References: jsc#PED-531 +Patch-mainline: v5.18-rc1 + +The gnttab_end_foreign_access() family of functions is taking a +"readonly" parameter, which isn't used. Remove it from the function +parameters. + +Signed-off-by: Juergen Gross +Link: https://lore.kernel.org/r/20220311103429.12845-3-jgross@suse.com +Reviewed-by: Jan Beulich +Acked-by: Christian Schoenebeck +Signed-off-by: Boris Ostrovsky +Signed-off-by: Oliver Neukum +--- + drivers/block/xen-blkfront.c | 8 ++--- + drivers/char/tpm/xen-tpmfront.c | 2 - + drivers/gpu/drm/xen/xen_drm_front_evtchnl.c | 2 - + drivers/input/misc/xen-kbdfront.c | 4 +- + drivers/net/xen-netfront.c | 13 ++++----- + drivers/pci/xen-pcifront.c | 2 - + drivers/scsi/xen-scsifront.c | 4 +- + drivers/usb/host/xen-hcd.c | 4 +- + drivers/xen/gntalloc.c | 2 - + drivers/xen/gntdev-dmabuf.c | 2 - + drivers/xen/grant-table.c | 38 +++++++++++----------------- + drivers/xen/pvcalls-front.c | 6 ++-- + drivers/xen/xen-front-pgdir-shbuf.c | 3 -- + include/xen/grant_table.h | 5 +-- + net/9p/trans_xen.c | 8 ++--- + sound/xen/xen_snd_front_evtchnl.c | 2 - + 16 files changed, 48 insertions(+), 57 deletions(-) + +--- a/drivers/block/xen-blkfront.c ++++ b/drivers/block/xen-blkfront.c +@@ -1226,7 +1226,7 @@ static void blkif_free_ring(struct blkfr + list_del(&persistent_gnt->node); + if (persistent_gnt->gref != GRANT_INVALID_REF) { + gnttab_end_foreign_access(persistent_gnt->gref, +- 0, 0UL); ++ 0UL); + rinfo->persistent_gnts_c--; + } + if (info->feature_persistent) +@@ -1249,7 +1249,7 @@ static void blkif_free_ring(struct blkfr + rinfo->shadow[i].req.u.rw.nr_segments; + for (j = 0; j < segs; j++) { + persistent_gnt = rinfo->shadow[i].grants_used[j]; +- gnttab_end_foreign_access(persistent_gnt->gref, 0, 0UL); ++ gnttab_end_foreign_access(persistent_gnt->gref, 0UL); + if (info->feature_persistent) + __free_page(persistent_gnt->page); + kfree(persistent_gnt); +@@ -1264,7 +1264,7 @@ static void blkif_free_ring(struct blkfr + + for (j = 0; j < INDIRECT_GREFS(segs); j++) { + persistent_gnt = rinfo->shadow[i].indirect_grants[j]; +- gnttab_end_foreign_access(persistent_gnt->gref, 0, 0UL); ++ gnttab_end_foreign_access(persistent_gnt->gref, 0UL); + __free_page(persistent_gnt->page); + kfree(persistent_gnt); + } +@@ -1287,7 +1287,7 @@ free_shadow: + /* Free resources associated with old device channel. */ + for (i = 0; i < info->nr_ring_pages; i++) { + if (rinfo->ring_ref[i] != GRANT_INVALID_REF) { +- gnttab_end_foreign_access(rinfo->ring_ref[i], 0, 0); ++ gnttab_end_foreign_access(rinfo->ring_ref[i], 0); + rinfo->ring_ref[i] = GRANT_INVALID_REF; + } + } +--- a/drivers/char/tpm/xen-tpmfront.c ++++ b/drivers/char/tpm/xen-tpmfront.c +@@ -332,7 +332,7 @@ static void ring_free(struct tpm_private + return; + + if (priv->ring_ref) +- gnttab_end_foreign_access(priv->ring_ref, 0, ++ gnttab_end_foreign_access(priv->ring_ref, + (unsigned long)priv->shr); + else + free_page((unsigned long)priv->shr); +--- a/drivers/gpu/drm/xen/xen_drm_front_evtchnl.c ++++ b/drivers/gpu/drm/xen/xen_drm_front_evtchnl.c +@@ -148,7 +148,7 @@ static void evtchnl_free(struct xen_drm_ + + /* end access and free the page */ + if (evtchnl->gref != GRANT_INVALID_REF) +- gnttab_end_foreign_access(evtchnl->gref, 0, page); ++ gnttab_end_foreign_access(evtchnl->gref, page); + + memset(evtchnl, 0, sizeof(*evtchnl)); + } +--- a/drivers/input/misc/xen-kbdfront.c ++++ b/drivers/input/misc/xen-kbdfront.c +@@ -481,7 +481,7 @@ static int xenkbd_connect_backend(struct + error_evtchan: + xenbus_free_evtchn(dev, evtchn); + error_grant: +- gnttab_end_foreign_access(info->gref, 0, 0UL); ++ gnttab_end_foreign_access(info->gref, 0UL); + info->gref = -1; + return ret; + } +@@ -492,7 +492,7 @@ static void xenkbd_disconnect_backend(st + unbind_from_irqhandler(info->irq, info); + info->irq = -1; + if (info->gref >= 0) +- gnttab_end_foreign_access(info->gref, 0, 0UL); ++ gnttab_end_foreign_access(info->gref, 0UL); + info->gref = -1; + } + +--- a/drivers/net/xen-netfront.c ++++ b/drivers/net/xen-netfront.c +@@ -425,7 +425,7 @@ static bool xennet_tx_buf_gc(struct netf + skb = queue->tx_skbs[id]; + queue->tx_skbs[id] = NULL; + if (unlikely(!gnttab_end_foreign_access_ref( +- queue->grant_tx_ref[id], GNTMAP_readonly))) { ++ queue->grant_tx_ref[id]))) { + dev_alert(dev, + "Grant still in use by backend domain\n"); + goto err; +@@ -1007,7 +1007,7 @@ static int xennet_get_responses(struct n + goto next; + } + +- if (!gnttab_end_foreign_access_ref(ref, 0)) { ++ if (!gnttab_end_foreign_access_ref(ref)) { + dev_alert(dev, + "Grant still in use by backend domain\n"); + queue->info->broken = true; +@@ -1366,7 +1366,6 @@ static void xennet_release_tx_bufs(struc + queue->tx_skbs[i] = NULL; + get_page(queue->grant_tx_page[i]); + gnttab_end_foreign_access(queue->grant_tx_ref[i], +- GNTMAP_readonly, + (unsigned long)page_address(queue->grant_tx_page[i])); + queue->grant_tx_page[i] = NULL; + queue->grant_tx_ref[i] = GRANT_INVALID_REF; +@@ -1399,7 +1398,7 @@ static void xennet_release_rx_bufs(struc + * foreign access is ended (which may be deferred). + */ + get_page(page); +- gnttab_end_foreign_access(ref, 0, ++ gnttab_end_foreign_access(ref, + (unsigned long)page_address(page)); + queue->grant_rx_ref[id] = GRANT_INVALID_REF; + +@@ -1740,7 +1739,7 @@ static void xennet_end_access(int ref, v + { + /* This frees the page as a side-effect */ + if (ref != GRANT_INVALID_REF) +- gnttab_end_foreign_access(ref, 0, (unsigned long)page); ++ gnttab_end_foreign_access(ref, (unsigned long)page); + } + + static void xennet_disconnect_backend(struct netfront_info *info) +@@ -1957,14 +1956,14 @@ static int setup_netfront(struct xenbus_ + */ + fail: + if (queue->rx_ring_ref != GRANT_INVALID_REF) { +- gnttab_end_foreign_access(queue->rx_ring_ref, 0, ++ gnttab_end_foreign_access(queue->rx_ring_ref, + (unsigned long)rxs); + queue->rx_ring_ref = GRANT_INVALID_REF; + } else { + free_page((unsigned long)rxs); + } + if (queue->tx_ring_ref != GRANT_INVALID_REF) { +- gnttab_end_foreign_access(queue->tx_ring_ref, 0, ++ gnttab_end_foreign_access(queue->tx_ring_ref, + (unsigned long)txs); + queue->tx_ring_ref = GRANT_INVALID_REF; + } else { +--- a/drivers/pci/xen-pcifront.c ++++ b/drivers/pci/xen-pcifront.c +@@ -767,7 +767,7 @@ static void free_pdev(struct pcifront_de + xenbus_free_evtchn(pdev->xdev, pdev->evtchn); + + if (pdev->gnt_ref != INVALID_GRANT_REF) +- gnttab_end_foreign_access(pdev->gnt_ref, 0 /* r/w page */, ++ gnttab_end_foreign_access(pdev->gnt_ref, + (unsigned long)pdev->sh_info); + else + free_page((unsigned long)pdev->sh_info); +--- a/drivers/scsi/xen-scsifront.c ++++ b/drivers/scsi/xen-scsifront.c +@@ -757,7 +757,7 @@ static int scsifront_alloc_ring(struct v + free_irq: + unbind_from_irqhandler(info->irq, info); + free_gnttab: +- gnttab_end_foreign_access(info->ring_ref, 0, ++ gnttab_end_foreign_access(info->ring_ref, + (unsigned long)info->ring.sring); + + return err; +@@ -766,7 +766,7 @@ free_gnttab: + static void scsifront_free_ring(struct vscsifrnt_info *info) + { + unbind_from_irqhandler(info->irq, info); +- gnttab_end_foreign_access(info->ring_ref, 0, ++ gnttab_end_foreign_access(info->ring_ref, + (unsigned long)info->ring.sring); + } + +--- a/drivers/usb/host/xen-hcd.c ++++ b/drivers/usb/host/xen-hcd.c +@@ -1073,14 +1073,14 @@ static void xenhcd_destroy_rings(struct + info->irq = 0; + + if (info->urb_ring_ref != GRANT_INVALID_REF) { +- gnttab_end_foreign_access(info->urb_ring_ref, 0, ++ gnttab_end_foreign_access(info->urb_ring_ref, + (unsigned long)info->urb_ring.sring); + info->urb_ring_ref = GRANT_INVALID_REF; + } + info->urb_ring.sring = NULL; + + if (info->conn_ring_ref != GRANT_INVALID_REF) { +- gnttab_end_foreign_access(info->conn_ring_ref, 0, ++ gnttab_end_foreign_access(info->conn_ring_ref, + (unsigned long)info->conn_ring.sring); + info->conn_ring_ref = GRANT_INVALID_REF; + } +--- a/drivers/xen/gntalloc.c ++++ b/drivers/xen/gntalloc.c +@@ -192,7 +192,7 @@ static void __del_gref(struct gntalloc_g + if (gref->gref_id) { + if (gref->page) { + addr = (unsigned long)page_to_virt(gref->page); +- gnttab_end_foreign_access(gref->gref_id, 0, addr); ++ gnttab_end_foreign_access(gref->gref_id, addr); + } else + gnttab_free_grant_reference(gref->gref_id); + } +--- a/drivers/xen/gntdev-dmabuf.c ++++ b/drivers/xen/gntdev-dmabuf.c +@@ -530,7 +530,7 @@ static void dmabuf_imp_end_foreign_acces + + for (i = 0; i < count; i++) + if (refs[i] != GRANT_INVALID_REF) +- gnttab_end_foreign_access(refs[i], 0, 0UL); ++ gnttab_end_foreign_access(refs[i], 0UL); + } + + static void dmabuf_imp_free_storage(struct gntdev_dmabuf *gntdev_dmabuf) +--- a/drivers/xen/grant-table.c ++++ b/drivers/xen/grant-table.c +@@ -118,13 +118,12 @@ struct gnttab_ops { + unsigned long frame, unsigned flags); + /* + * Stop granting a grant entry to domain for accessing. Ref parameter is +- * reference of a grant entry whose grant access will be stopped, +- * readonly is not in use in this function. If the grant entry is +- * currently mapped for reading or writing, just return failure(==0) +- * directly and don't tear down the grant access. Otherwise, stop grant +- * access for this entry and return success(==1). ++ * reference of a grant entry whose grant access will be stopped. ++ * If the grant entry is currently mapped for reading or writing, just ++ * return failure(==0) directly and don't tear down the grant access. ++ * Otherwise, stop grant access for this entry and return success(==1). + */ +- int (*end_foreign_access_ref)(grant_ref_t ref, int readonly); ++ int (*end_foreign_access_ref)(grant_ref_t ref); + /* + * Stop granting a grant entry to domain for transfer. Ref parameter is + * reference of a grant entry whose grant transfer will be stopped. If +@@ -304,7 +303,7 @@ int gnttab_query_foreign_access(grant_re + } + EXPORT_SYMBOL_GPL(gnttab_query_foreign_access); + +-static int gnttab_end_foreign_access_ref_v1(grant_ref_t ref, int readonly) ++static int gnttab_end_foreign_access_ref_v1(grant_ref_t ref) + { + u16 flags, nflags; + u16 *pflags; +@@ -320,7 +319,7 @@ static int gnttab_end_foreign_access_ref + return 1; + } + +-static int gnttab_end_foreign_access_ref_v2(grant_ref_t ref, int readonly) ++static int gnttab_end_foreign_access_ref_v2(grant_ref_t ref) + { + gnttab_shared.v2[ref].hdr.flags = 0; + mb(); /* Concurrent access by hypervisor. */ +@@ -343,14 +342,14 @@ static int gnttab_end_foreign_access_ref + return 1; + } + +-static inline int _gnttab_end_foreign_access_ref(grant_ref_t ref, int readonly) ++static inline int _gnttab_end_foreign_access_ref(grant_ref_t ref) + { +- return gnttab_interface->end_foreign_access_ref(ref, readonly); ++ return gnttab_interface->end_foreign_access_ref(ref); + } + +-int gnttab_end_foreign_access_ref(grant_ref_t ref, int readonly) ++int gnttab_end_foreign_access_ref(grant_ref_t ref) + { +- if (_gnttab_end_foreign_access_ref(ref, readonly)) ++ if (_gnttab_end_foreign_access_ref(ref)) + return 1; + pr_warn("WARNING: g.e. %#x still in use!\n", ref); + return 0; +@@ -370,7 +369,6 @@ static unsigned long gnttab_read_frame_v + struct deferred_entry { + struct list_head list; + grant_ref_t ref; +- bool ro; + uint16_t warn_delay; + struct page *page; + }; +@@ -394,7 +392,7 @@ static void gnttab_handle_deferred(struc + break; + list_del(&entry->list); + spin_unlock_irqrestore(&gnttab_list_lock, flags); +- if (_gnttab_end_foreign_access_ref(entry->ref, entry->ro)) { ++ if (_gnttab_end_foreign_access_ref(entry->ref)) { + put_free_entry(entry->ref); + pr_debug("freeing g.e. %#x (pfn %#lx)\n", + entry->ref, page_to_pfn(entry->page)); +@@ -420,8 +418,7 @@ static void gnttab_handle_deferred(struc + spin_unlock_irqrestore(&gnttab_list_lock, flags); + } + +-static void gnttab_add_deferred(grant_ref_t ref, bool readonly, +- struct page *page) ++static void gnttab_add_deferred(grant_ref_t ref, struct page *page) + { + struct deferred_entry *entry; + gfp_t gfp = (in_atomic() || irqs_disabled()) ? GFP_ATOMIC : GFP_KERNEL; +@@ -439,7 +436,6 @@ static void gnttab_add_deferred(grant_re + unsigned long flags; + + entry->ref = ref; +- entry->ro = readonly; + entry->page = page; + entry->warn_delay = 60; + spin_lock_irqsave(&gnttab_list_lock, flags); +@@ -457,7 +453,7 @@ static void gnttab_add_deferred(grant_re + + int gnttab_try_end_foreign_access(grant_ref_t ref) + { +- int ret = _gnttab_end_foreign_access_ref(ref, 0); ++ int ret = _gnttab_end_foreign_access_ref(ref); + + if (ret) + put_free_entry(ref); +@@ -466,15 +462,13 @@ int gnttab_try_end_foreign_access(grant_ + } + EXPORT_SYMBOL_GPL(gnttab_try_end_foreign_access); + +-void gnttab_end_foreign_access(grant_ref_t ref, int readonly, +- unsigned long page) ++void gnttab_end_foreign_access(grant_ref_t ref, unsigned long page) + { + if (gnttab_try_end_foreign_access(ref)) { + if (page != 0) + put_page(virt_to_page(page)); + } else +- gnttab_add_deferred(ref, readonly, +- page ? virt_to_page(page) : NULL); ++ gnttab_add_deferred(ref, page ? virt_to_page(page) : NULL); + } + EXPORT_SYMBOL_GPL(gnttab_end_foreign_access); + +--- a/drivers/xen/pvcalls-front.c ++++ b/drivers/xen/pvcalls-front.c +@@ -238,8 +238,8 @@ static void pvcalls_front_free_map(struc + spin_unlock(&bedata->socket_lock); + + for (i = 0; i < (1 << PVCALLS_RING_ORDER); i++) +- gnttab_end_foreign_access(map->active.ring->ref[i], 0, 0); +- gnttab_end_foreign_access(map->active.ref, 0, 0); ++ gnttab_end_foreign_access(map->active.ring->ref[i], 0); ++ gnttab_end_foreign_access(map->active.ref, 0); + free_page((unsigned long)map->active.ring); + + kfree(map); +@@ -1117,7 +1117,7 @@ static int pvcalls_front_remove(struct x + } + } + if (bedata->ref != -1) +- gnttab_end_foreign_access(bedata->ref, 0, 0); ++ gnttab_end_foreign_access(bedata->ref, 0); + kfree(bedata->ring.sring); + kfree(bedata); + xenbus_switch_state(dev, XenbusStateClosed); +--- a/drivers/xen/xen-front-pgdir-shbuf.c ++++ b/drivers/xen/xen-front-pgdir-shbuf.c +@@ -143,8 +143,7 @@ void xen_front_pgdir_shbuf_free(struct x + + for (i = 0; i < buf->num_grefs; i++) + if (buf->grefs[i] != GRANT_INVALID_REF) +- gnttab_end_foreign_access(buf->grefs[i], +- 0, 0UL); ++ gnttab_end_foreign_access(buf->grefs[i], 0UL); + } + kfree(buf->grefs); + kfree(buf->directory); +--- a/include/xen/grant_table.h ++++ b/include/xen/grant_table.h +@@ -97,7 +97,7 @@ int gnttab_grant_foreign_access(domid_t + * longer in use. Return 1 if the grant entry was freed, 0 if it is still in + * use. + */ +-int gnttab_end_foreign_access_ref(grant_ref_t ref, int readonly); ++int gnttab_end_foreign_access_ref(grant_ref_t ref); + + /* + * Eventually end access through the given grant reference, and once that +@@ -114,8 +114,7 @@ int gnttab_end_foreign_access_ref(grant_ + * gnttab_end_foreign_access() are done via alloc_pages_exact() (and freeing + * via free_pages_exact()) in order to avoid high order pages. + */ +-void gnttab_end_foreign_access(grant_ref_t ref, int readonly, +- unsigned long page); ++void gnttab_end_foreign_access(grant_ref_t ref, unsigned long page); + + /* + * End access through the given grant reference, iff the grant entry is +--- a/net/9p/trans_xen.c ++++ b/net/9p/trans_xen.c +@@ -302,13 +302,13 @@ static void xen_9pfs_front_free(struct x + grant_ref_t ref; + + ref = priv->rings[i].intf->ref[j]; +- gnttab_end_foreign_access(ref, 0, 0); ++ gnttab_end_foreign_access(ref, 0); + } + free_pages_exact(priv->rings[i].data.in, + 1UL << (priv->rings[i].intf->ring_order + + XEN_PAGE_SHIFT)); + } +- gnttab_end_foreign_access(priv->rings[i].ref, 0, 0); ++ gnttab_end_foreign_access(priv->rings[i].ref, 0); + free_page((unsigned long)priv->rings[i].intf); + } + kfree(priv->rings); +@@ -376,10 +376,10 @@ static int xen_9pfs_front_alloc_dataring + out: + if (bytes) { + for (i--; i >= 0; i--) +- gnttab_end_foreign_access(ring->intf->ref[i], 0, 0); ++ gnttab_end_foreign_access(ring->intf->ref[i], 0); + free_pages_exact(bytes, 1UL << (order + XEN_PAGE_SHIFT)); + } +- gnttab_end_foreign_access(ring->ref, 0, 0); ++ gnttab_end_foreign_access(ring->ref, 0); + free_page((unsigned long)ring->intf); + return ret; + } +--- a/sound/xen/xen_snd_front_evtchnl.c ++++ b/sound/xen/xen_snd_front_evtchnl.c +@@ -168,7 +168,7 @@ static void evtchnl_free(struct xen_snd_ + + /* End access and free the page. */ + if (channel->gref != GRANT_INVALID_REF) +- gnttab_end_foreign_access(channel->gref, 0, page); ++ gnttab_end_foreign_access(channel->gref, page); + else + free_page(page); + diff --git a/patches.suse/xen-update-ring.h.patch b/patches.suse/xen-update-ring.h.patch new file mode 100644 index 0000000..77047a3 --- /dev/null +++ b/patches.suse/xen-update-ring.h.patch @@ -0,0 +1,100 @@ +From 6fac592cca60dca0b2a524c303c83e958c2003bb Mon Sep 17 00:00:00 2001 +From: Juergen Gross +Date: Thu, 28 Apr 2022 09:59:01 +0200 +Subject: [PATCH] xen: update ring.h +Git-commit: 6fac592cca60dca0b2a524c303c83e958c2003bb +References: jsc#PED-531 +Patch-mainline: v5.19-rc1 + +Update include/xen/interface/io/ring.h to its newest version. + +Switch the two improper use cases of RING_HAS_UNCONSUMED_RESPONSES() to +XEN_RING_NR_UNCONSUMED_RESPONSES() in order to avoid the nasty +XEN_RING_HAS_UNCONSUMED_IS_BOOL #define. + +Signed-off-by: Juergen Gross +Reviewed-by: Boris Ostrovsky +Signed-off-by: Juergen Gross +Signed-off-by: Oliver Neukum +--- + drivers/net/xen-netfront.c | 4 ++-- + include/xen/interface/io/ring.h | 19 ++++++++++++++----- + 2 files changed, 16 insertions(+), 7 deletions(-) + +diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c +index af3d3de7d9fa..966bee2a6902 100644 +--- a/drivers/net/xen-netfront.c ++++ b/drivers/net/xen-netfront.c +@@ -866,7 +866,7 @@ static void xennet_set_rx_rsp_cons(struct netfront_queue *queue, RING_IDX val) + + spin_lock_irqsave(&queue->rx_cons_lock, flags); + queue->rx.rsp_cons = val; +- queue->rx_rsp_unconsumed = RING_HAS_UNCONSUMED_RESPONSES(&queue->rx); ++ queue->rx_rsp_unconsumed = XEN_RING_NR_UNCONSUMED_RESPONSES(&queue->rx); + spin_unlock_irqrestore(&queue->rx_cons_lock, flags); + } + +@@ -1498,7 +1498,7 @@ static bool xennet_handle_rx(struct netfront_queue *queue, unsigned int *eoi) + return false; + + spin_lock_irqsave(&queue->rx_cons_lock, flags); +- work_queued = RING_HAS_UNCONSUMED_RESPONSES(&queue->rx); ++ work_queued = XEN_RING_NR_UNCONSUMED_RESPONSES(&queue->rx); + if (work_queued > queue->rx_rsp_unconsumed) { + queue->rx_rsp_unconsumed = work_queued; + *eoi = 0; +diff --git a/include/xen/interface/io/ring.h b/include/xen/interface/io/ring.h +index 2470ec45ebb2..ba4c4274b714 100644 +--- a/include/xen/interface/io/ring.h ++++ b/include/xen/interface/io/ring.h +@@ -72,9 +72,8 @@ typedef unsigned int RING_IDX; + * of the shared memory area (PAGE_SIZE, for instance). To initialise + * the front half: + * +- * mytag_front_ring_t front_ring; +- * SHARED_RING_INIT((mytag_sring_t *)shared_page); +- * FRONT_RING_INIT(&front_ring, (mytag_sring_t *)shared_page, PAGE_SIZE); ++ * mytag_front_ring_t ring; ++ * XEN_FRONT_RING_INIT(&ring, (mytag_sring_t *)shared_page, PAGE_SIZE); + * + * Initializing the back follows similarly (note that only the front + * initializes the shared ring): +@@ -146,6 +145,11 @@ struct __name##_back_ring { \ + + #define FRONT_RING_INIT(_r, _s, __size) FRONT_RING_ATTACH(_r, _s, 0, __size) + ++#define XEN_FRONT_RING_INIT(r, s, size) do { \ ++ SHARED_RING_INIT(s); \ ++ FRONT_RING_INIT(r, s, size); \ ++} while (0) ++ + #define BACK_RING_ATTACH(_r, _s, _i, __size) do { \ + (_r)->rsp_prod_pvt = (_i); \ + (_r)->req_cons = (_i); \ +@@ -170,16 +174,21 @@ struct __name##_back_ring { \ + (RING_FREE_REQUESTS(_r) == 0) + + /* Test if there are outstanding messages to be processed on a ring. */ +-#define RING_HAS_UNCONSUMED_RESPONSES(_r) \ ++#define XEN_RING_NR_UNCONSUMED_RESPONSES(_r) \ + ((_r)->sring->rsp_prod - (_r)->rsp_cons) + +-#define RING_HAS_UNCONSUMED_REQUESTS(_r) ({ \ ++#define XEN_RING_NR_UNCONSUMED_REQUESTS(_r) ({ \ + unsigned int req = (_r)->sring->req_prod - (_r)->req_cons; \ + unsigned int rsp = RING_SIZE(_r) - \ + ((_r)->req_cons - (_r)->rsp_prod_pvt); \ + req < rsp ? req : rsp; \ + }) + ++#define RING_HAS_UNCONSUMED_RESPONSES(_r) \ ++ (!!XEN_RING_NR_UNCONSUMED_RESPONSES(_r)) ++#define RING_HAS_UNCONSUMED_REQUESTS(_r) \ ++ (!!XEN_RING_NR_UNCONSUMED_REQUESTS(_r)) ++ + /* Direct access to individual ring elements, by index. */ + #define RING_GET_REQUEST(_r, _idx) \ + (&((_r)->sring->ring[((_idx) & (RING_SIZE(_r) - 1))].req)) +-- +2.35.3 + diff --git a/patches.suse/xen-usb-don-t-use-arbitrary_virt_to_machine.patch b/patches.suse/xen-usb-don-t-use-arbitrary_virt_to_machine.patch index 7ee8174..9d02291 100644 --- a/patches.suse/xen-usb-don-t-use-arbitrary_virt_to_machine.patch +++ b/patches.suse/xen-usb-don-t-use-arbitrary_virt_to_machine.patch @@ -3,7 +3,7 @@ From: Juergen Gross Date: Fri, 11 Mar 2022 11:35:00 +0100 Subject: [PATCH] xen/usb: don't use arbitrary_virt_to_machine() Git-commit: cee03ca3cb44c867b45f9d32601c1d532f66fe7a -References: git-fixes +References: jsc#PED-531 Patch-mainline: v5.18-rc1 arbitrary_virt_to_machine() is meant to be used in PV guests only. diff --git a/patches.suse/xen-usb-harden-xen_hcd-against-malicious-backends.patch b/patches.suse/xen-usb-harden-xen_hcd-against-malicious-backends.patch new file mode 100644 index 0000000..1df0d58 --- /dev/null +++ b/patches.suse/xen-usb-harden-xen_hcd-against-malicious-backends.patch @@ -0,0 +1,169 @@ +From aff477cb8f94613f501d386d10f20019e294bc35 Mon Sep 17 00:00:00 2001 +From: Juergen Gross +Date: Fri, 11 Mar 2022 11:35:09 +0100 +Subject: [PATCH] xen/usb: harden xen_hcd against malicious backends +Git-commit: aff477cb8f94613f501d386d10f20019e294bc35 +References: jsc#PED-531 +Patch-mainline: v5.18-rc1 + +Make sure a malicious backend can't cause any harm other than wrong +I/O data. + +Missing are verification of the request id in a response, sanitizing +the reported actual I/O length, and protection against interrupt storms +from the backend. + +Signed-off-by: Juergen Gross +Link: https://lore.kernel.org/r/20220311103509.12908-1-jgross@suse.com +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Oliver Neukum +--- + drivers/usb/host/xen-hcd.c | 57 ++++++++++++++++++++++++++++---------- + 1 file changed, 43 insertions(+), 14 deletions(-) + +diff --git a/drivers/usb/host/xen-hcd.c b/drivers/usb/host/xen-hcd.c +index 47ec092bd8e3..210f91bf661c 100644 +--- a/drivers/usb/host/xen-hcd.c ++++ b/drivers/usb/host/xen-hcd.c +@@ -51,6 +51,7 @@ struct vdevice_status { + struct usb_shadow { + struct xenusb_urb_request req; + struct urb *urb; ++ bool in_flight; + }; + + struct xenhcd_info { +@@ -720,6 +721,12 @@ static void xenhcd_gnttab_done(struct xenhcd_info *info, unsigned int id) + int nr_segs = 0; + int i; + ++ if (!shadow->in_flight) { ++ xenhcd_set_error(info, "Illegal request id"); ++ return; ++ } ++ shadow->in_flight = false; ++ + nr_segs = shadow->req.nr_buffer_segs; + + if (xenusb_pipeisoc(shadow->req.pipe)) +@@ -803,6 +810,7 @@ static int xenhcd_do_request(struct xenhcd_info *info, struct urb_priv *urbp) + + info->urb_ring.req_prod_pvt++; + info->shadow[id].urb = urb; ++ info->shadow[id].in_flight = true; + + RING_PUSH_REQUESTS_AND_CHECK_NOTIFY(&info->urb_ring, notify); + if (notify) +@@ -931,10 +939,27 @@ static int xenhcd_unlink_urb(struct xenhcd_info *info, struct urb_priv *urbp) + return ret; + } + +-static int xenhcd_urb_request_done(struct xenhcd_info *info) ++static void xenhcd_res_to_urb(struct xenhcd_info *info, ++ struct xenusb_urb_response *res, struct urb *urb) ++{ ++ if (unlikely(!urb)) ++ return; ++ ++ if (res->actual_length > urb->transfer_buffer_length) ++ urb->actual_length = urb->transfer_buffer_length; ++ else if (res->actual_length < 0) ++ urb->actual_length = 0; ++ else ++ urb->actual_length = res->actual_length; ++ urb->error_count = res->error_count; ++ urb->start_frame = res->start_frame; ++ xenhcd_giveback_urb(info, urb, res->status); ++} ++ ++static int xenhcd_urb_request_done(struct xenhcd_info *info, ++ unsigned int *eoiflag) + { + struct xenusb_urb_response res; +- struct urb *urb; + RING_IDX i, rp; + __u16 id; + int more_to_do = 0; +@@ -961,16 +986,12 @@ static int xenhcd_urb_request_done(struct xenhcd_info *info) + xenhcd_gnttab_done(info, id); + if (info->error) + goto err; +- urb = info->shadow[id].urb; +- if (likely(urb)) { +- urb->actual_length = res.actual_length; +- urb->error_count = res.error_count; +- urb->start_frame = res.start_frame; +- xenhcd_giveback_urb(info, urb, res.status); +- } ++ xenhcd_res_to_urb(info, &res, info->shadow[id].urb); + } + + xenhcd_add_id_to_freelist(info, id); ++ ++ *eoiflag = 0; + } + info->urb_ring.rsp_cons = i; + +@@ -988,7 +1009,7 @@ static int xenhcd_urb_request_done(struct xenhcd_info *info) + return 0; + } + +-static int xenhcd_conn_notify(struct xenhcd_info *info) ++static int xenhcd_conn_notify(struct xenhcd_info *info, unsigned int *eoiflag) + { + struct xenusb_conn_response res; + struct xenusb_conn_request *req; +@@ -1033,6 +1054,8 @@ static int xenhcd_conn_notify(struct xenhcd_info *info) + info->conn_ring.req_prod_pvt); + req->id = id; + info->conn_ring.req_prod_pvt++; ++ ++ *eoiflag = 0; + } + + if (rc != info->conn_ring.req_prod_pvt) +@@ -1055,14 +1078,19 @@ static int xenhcd_conn_notify(struct xenhcd_info *info) + static irqreturn_t xenhcd_int(int irq, void *dev_id) + { + struct xenhcd_info *info = (struct xenhcd_info *)dev_id; ++ unsigned int eoiflag = XEN_EOI_FLAG_SPURIOUS; + +- if (unlikely(info->error)) ++ if (unlikely(info->error)) { ++ xen_irq_lateeoi(irq, XEN_EOI_FLAG_SPURIOUS); + return IRQ_HANDLED; ++ } + +- while (xenhcd_urb_request_done(info) | xenhcd_conn_notify(info)) ++ while (xenhcd_urb_request_done(info, &eoiflag) | ++ xenhcd_conn_notify(info, &eoiflag)) + /* Yield point for this unbounded loop. */ + cond_resched(); + ++ xen_irq_lateeoi(irq, eoiflag); + return IRQ_HANDLED; + } + +@@ -1139,9 +1167,9 @@ static int xenhcd_setup_rings(struct xenbus_device *dev, + goto fail; + } + +- err = bind_evtchn_to_irq(info->evtchn); ++ err = bind_evtchn_to_irq_lateeoi(info->evtchn); + if (err <= 0) { +- xenbus_dev_fatal(dev, err, "bind_evtchn_to_irq"); ++ xenbus_dev_fatal(dev, err, "bind_evtchn_to_irq_lateeoi"); + goto fail; + } + +@@ -1494,6 +1522,7 @@ static struct usb_hcd *xenhcd_create_hcd(struct xenbus_device *dev) + for (i = 0; i < XENUSB_URB_RING_SIZE; i++) { + info->shadow[i].req.id = i + 1; + info->shadow[i].urb = NULL; ++ info->shadow[i].in_flight = false; + } + info->shadow[XENUSB_URB_RING_SIZE - 1].req.id = 0x0fff; + +-- +2.35.3 + diff --git a/patches.suse/xen-usb-switch-xen-hcd-to-use-INVALID_GRANT_REF.patch b/patches.suse/xen-usb-switch-xen-hcd-to-use-INVALID_GRANT_REF.patch new file mode 100644 index 0000000..fbcc2a7 --- /dev/null +++ b/patches.suse/xen-usb-switch-xen-hcd-to-use-INVALID_GRANT_REF.patch @@ -0,0 +1,68 @@ +From edd81e7caa77a2772bb9ddb8562e2d45aeed2cc1 Mon Sep 17 00:00:00 2001 +From: Juergen Gross +Date: Thu, 28 Apr 2022 09:01:02 +0200 +Subject: [PATCH] xen/usb: switch xen-hcd to use INVALID_GRANT_REF +Git-commit: edd81e7caa77a2772bb9ddb8562e2d45aeed2cc1 +References: jsc#PED-531 +Patch-mainline: v5.19-rc1 + +Instead of using a private macro for an invalid grant reference use +the common one. + +Signed-off-by: Juergen Gross +Acked-by: Greg Kroah-Hartman +Signed-off-by: Juergen Gross +Signed-off-by: Oliver Neukum +--- + drivers/usb/host/xen-hcd.c | 14 ++++++-------- + 1 file changed, 6 insertions(+), 8 deletions(-) + +diff --git a/drivers/usb/host/xen-hcd.c b/drivers/usb/host/xen-hcd.c +index 3e487baf8422..9cbc7c2dab02 100644 +--- a/drivers/usb/host/xen-hcd.c ++++ b/drivers/usb/host/xen-hcd.c +@@ -87,8 +87,6 @@ struct xenhcd_info { + bool error; + }; + +-#define GRANT_INVALID_REF 0 +- + #define XENHCD_RING_JIFFIES (HZ/200) + #define XENHCD_SCAN_JIFFIES 1 + +@@ -1100,17 +1098,17 @@ static void xenhcd_destroy_rings(struct xenhcd_info *info) + unbind_from_irqhandler(info->irq, info); + info->irq = 0; + +- if (info->urb_ring_ref != GRANT_INVALID_REF) { ++ if (info->urb_ring_ref != INVALID_GRANT_REF) { + gnttab_end_foreign_access(info->urb_ring_ref, + (unsigned long)info->urb_ring.sring); +- info->urb_ring_ref = GRANT_INVALID_REF; ++ info->urb_ring_ref = INVALID_GRANT_REF; + } + info->urb_ring.sring = NULL; + +- if (info->conn_ring_ref != GRANT_INVALID_REF) { ++ if (info->conn_ring_ref != INVALID_GRANT_REF) { + gnttab_end_foreign_access(info->conn_ring_ref, + (unsigned long)info->conn_ring.sring); +- info->conn_ring_ref = GRANT_INVALID_REF; ++ info->conn_ring_ref = INVALID_GRANT_REF; + } + info->conn_ring.sring = NULL; + } +@@ -1123,8 +1121,8 @@ static int xenhcd_setup_rings(struct xenbus_device *dev, + grant_ref_t gref; + int err; + +- info->urb_ring_ref = GRANT_INVALID_REF; +- info->conn_ring_ref = GRANT_INVALID_REF; ++ info->urb_ring_ref = INVALID_GRANT_REF; ++ info->conn_ring_ref = INVALID_GRANT_REF; + + urb_sring = (struct xenusb_urb_sring *)get_zeroed_page( + GFP_NOIO | __GFP_HIGH); +-- +2.35.3 + diff --git a/patches.suse/xen-usbfront-use-xenbus_setup_ring-and-xenbus_teardo.patch b/patches.suse/xen-usbfront-use-xenbus_setup_ring-and-xenbus_teardo.patch new file mode 100644 index 0000000..8fd27a3 --- /dev/null +++ b/patches.suse/xen-usbfront-use-xenbus_setup_ring-and-xenbus_teardo.patch @@ -0,0 +1,109 @@ +From 2b3daf083aa8297c737c8cd8f896596d509ead35 Mon Sep 17 00:00:00 2001 +From: Juergen Gross +Date: Thu, 28 Apr 2022 09:01:05 +0200 +Subject: [PATCH] xen/usbfront: use xenbus_setup_ring() and + xenbus_teardown_ring() +Git-commit: 2b3daf083aa8297c737c8cd8f896596d509ead35 +References: jsc#PED-531 +Patch-mainline: v5.19-rc1 + +Simplify xen-hcd's ring creation and removal via xenbus_setup_ring() +and xenbus_teardown_ring(). + +Signed-off-by: Juergen Gross +Acked-by: Greg Kroah-Hartman +Signed-off-by: Juergen Gross +Signed-off-by: Oliver Neukum +--- + drivers/usb/host/xen-hcd.c | 61 ++++++++++---------------------------- + 1 file changed, 15 insertions(+), 46 deletions(-) + +diff --git a/drivers/usb/host/xen-hcd.c b/drivers/usb/host/xen-hcd.c +index 9cbc7c2dab02..de1b09158318 100644 +--- a/drivers/usb/host/xen-hcd.c ++++ b/drivers/usb/host/xen-hcd.c +@@ -1098,19 +1098,10 @@ static void xenhcd_destroy_rings(struct xenhcd_info *info) + unbind_from_irqhandler(info->irq, info); + info->irq = 0; + +- if (info->urb_ring_ref != INVALID_GRANT_REF) { +- gnttab_end_foreign_access(info->urb_ring_ref, +- (unsigned long)info->urb_ring.sring); +- info->urb_ring_ref = INVALID_GRANT_REF; +- } +- info->urb_ring.sring = NULL; +- +- if (info->conn_ring_ref != INVALID_GRANT_REF) { +- gnttab_end_foreign_access(info->conn_ring_ref, +- (unsigned long)info->conn_ring.sring); +- info->conn_ring_ref = INVALID_GRANT_REF; +- } +- info->conn_ring.sring = NULL; ++ xenbus_teardown_ring((void **)&info->urb_ring.sring, 1, ++ &info->urb_ring_ref); ++ xenbus_teardown_ring((void **)&info->conn_ring.sring, 1, ++ &info->conn_ring_ref); + } + + static int xenhcd_setup_rings(struct xenbus_device *dev, +@@ -1118,46 +1109,24 @@ static int xenhcd_setup_rings(struct xenbus_device *dev, + { + struct xenusb_urb_sring *urb_sring; + struct xenusb_conn_sring *conn_sring; +- grant_ref_t gref; + int err; + +- info->urb_ring_ref = INVALID_GRANT_REF; + info->conn_ring_ref = INVALID_GRANT_REF; +- +- urb_sring = (struct xenusb_urb_sring *)get_zeroed_page( +- GFP_NOIO | __GFP_HIGH); +- if (!urb_sring) { +- xenbus_dev_fatal(dev, -ENOMEM, "allocating urb ring"); +- return -ENOMEM; +- } +- SHARED_RING_INIT(urb_sring); +- FRONT_RING_INIT(&info->urb_ring, urb_sring, PAGE_SIZE); +- +- err = xenbus_grant_ring(dev, urb_sring, 1, &gref); +- if (err < 0) { +- free_page((unsigned long)urb_sring); +- info->urb_ring.sring = NULL; +- goto fail; +- } +- info->urb_ring_ref = gref; +- +- conn_sring = (struct xenusb_conn_sring *)get_zeroed_page( +- GFP_NOIO | __GFP_HIGH); +- if (!conn_sring) { +- xenbus_dev_fatal(dev, -ENOMEM, "allocating conn ring"); +- err = -ENOMEM; +- goto fail; ++ err = xenbus_setup_ring(dev, GFP_NOIO | __GFP_HIGH, ++ (void **)&urb_sring, 1, &info->urb_ring_ref); ++ if (err) { ++ xenbus_dev_fatal(dev, err, "allocating urb ring"); ++ return err; + } +- SHARED_RING_INIT(conn_sring); +- FRONT_RING_INIT(&info->conn_ring, conn_sring, PAGE_SIZE); ++ XEN_FRONT_RING_INIT(&info->urb_ring, urb_sring, PAGE_SIZE); + +- err = xenbus_grant_ring(dev, conn_sring, 1, &gref); +- if (err < 0) { +- free_page((unsigned long)conn_sring); +- info->conn_ring.sring = NULL; ++ err = xenbus_setup_ring(dev, GFP_NOIO | __GFP_HIGH, ++ (void **)&conn_sring, 1, &info->conn_ring_ref); ++ if (err) { ++ xenbus_dev_fatal(dev, err, "allocating conn ring"); + goto fail; + } +- info->conn_ring_ref = gref; ++ XEN_FRONT_RING_INIT(&info->conn_ring, conn_sring, PAGE_SIZE); + + err = xenbus_alloc_evtchn(dev, &info->evtchn); + if (err) { +-- +2.35.3 + diff --git a/patches.suse/xen-xenbus-add-xenbus_setup_ring-service-function.patch b/patches.suse/xen-xenbus-add-xenbus_setup_ring-service-function.patch new file mode 100644 index 0000000..19e942b --- /dev/null +++ b/patches.suse/xen-xenbus-add-xenbus_setup_ring-service-function.patch @@ -0,0 +1,130 @@ +From 7050096d07755c53f71e486af18475050cc4e04b Mon Sep 17 00:00:00 2001 +From: Juergen Gross +Date: Thu, 28 Apr 2022 09:01:03 +0200 +Subject: [PATCH] xen/xenbus: add xenbus_setup_ring() service function +Git-commit: 7050096d07755c53f71e486af18475050cc4e04b +References: jsc#PED-531 +Patch-mainline: v5.19-rc1 + +Most PV device frontends share very similar code for setting up shared +ring buffers: + +- allocate page(s) +- init the ring admin data +- give the backend access to the ring via grants + +Tearing down the ring requires similar actions in all frontends again: + +- remove grants +- free the page(s) + +Provide service functions xenbus_setup_ring() and xenbus_teardown_ring() +for that purpose. + +Signed-off-by: Juergen Gross +Reviewed-by: Boris Ostrovsky +Signed-off-by: Juergen Gross +Signed-off-by: Oliver Neukum +--- + drivers/xen/xenbus/xenbus_client.c | 69 ++++++++++++++++++++++++++++++ + include/xen/xenbus.h | 4 ++ + 2 files changed, 73 insertions(+) + +diff --git a/drivers/xen/xenbus/xenbus_client.c b/drivers/xen/xenbus/xenbus_client.c +index df6890681231..1a2e0d94ccd1 100644 +--- a/drivers/xen/xenbus/xenbus_client.c ++++ b/drivers/xen/xenbus/xenbus_client.c +@@ -407,6 +407,75 @@ int xenbus_grant_ring(struct xenbus_device *dev, void *vaddr, + } + EXPORT_SYMBOL_GPL(xenbus_grant_ring); + ++/* ++ * xenbus_setup_ring ++ * @dev: xenbus device ++ * @vaddr: pointer to starting virtual address of the ring ++ * @nr_pages: number of pages to be granted ++ * @grefs: grant reference array to be filled in ++ * ++ * Allocate physically contiguous pages for a shared ring buffer and grant it ++ * to the peer of the given device. The ring buffer is initially filled with ++ * zeroes. The virtual address of the ring is stored at @vaddr and the ++ * grant references are stored in the @grefs array. In case of error @vaddr ++ * will be set to NULL and @grefs will be filled with INVALID_GRANT_REF. ++ */ ++int xenbus_setup_ring(struct xenbus_device *dev, gfp_t gfp, void **vaddr, ++ unsigned int nr_pages, grant_ref_t *grefs) ++{ ++ unsigned long ring_size = nr_pages * XEN_PAGE_SIZE; ++ unsigned int i; ++ int ret; ++ ++ *vaddr = alloc_pages_exact(ring_size, gfp | __GFP_ZERO); ++ if (!*vaddr) { ++ ret = -ENOMEM; ++ goto err; ++ } ++ ++ ret = xenbus_grant_ring(dev, *vaddr, nr_pages, grefs); ++ if (ret) ++ goto err; ++ ++ return 0; ++ ++ err: ++ if (*vaddr) ++ free_pages_exact(*vaddr, ring_size); ++ for (i = 0; i < nr_pages; i++) ++ grefs[i] = INVALID_GRANT_REF; ++ *vaddr = NULL; ++ ++ return ret; ++} ++EXPORT_SYMBOL_GPL(xenbus_setup_ring); ++ ++/* ++ * xenbus_teardown_ring ++ * @vaddr: starting virtual address of the ring ++ * @nr_pages: number of pages ++ * @grefs: grant reference array ++ * ++ * Remove grants for the shared ring buffer and free the associated memory. ++ * On return the grant reference array is filled with INVALID_GRANT_REF. ++ */ ++void xenbus_teardown_ring(void **vaddr, unsigned int nr_pages, ++ grant_ref_t *grefs) ++{ ++ unsigned int i; ++ ++ for (i = 0; i < nr_pages; i++) { ++ if (grefs[i] != INVALID_GRANT_REF) { ++ gnttab_end_foreign_access(grefs[i], 0); ++ grefs[i] = INVALID_GRANT_REF; ++ } ++ } ++ ++ if (*vaddr) ++ free_pages_exact(*vaddr, nr_pages * XEN_PAGE_SIZE); ++ *vaddr = NULL; ++} ++EXPORT_SYMBOL_GPL(xenbus_teardown_ring); + + /** + * Allocate an event channel for the given xenbus_device, assigning the newly +diff --git a/include/xen/xenbus.h b/include/xen/xenbus.h +index b13eb86395e0..b533b4adc835 100644 +--- a/include/xen/xenbus.h ++++ b/include/xen/xenbus.h +@@ -226,6 +226,10 @@ int xenbus_watch_pathfmt(struct xenbus_device *dev, struct xenbus_watch *watch, + int xenbus_switch_state(struct xenbus_device *dev, enum xenbus_state new_state); + int xenbus_grant_ring(struct xenbus_device *dev, void *vaddr, + unsigned int nr_pages, grant_ref_t *grefs); ++int xenbus_setup_ring(struct xenbus_device *dev, gfp_t gfp, void **vaddr, ++ unsigned int nr_pages, grant_ref_t *grefs); ++void xenbus_teardown_ring(void **vaddr, unsigned int nr_pages, ++ grant_ref_t *grefs); + int xenbus_map_ring_valloc(struct xenbus_device *dev, grant_ref_t *gnt_refs, + unsigned int nr_grefs, void **vaddr); + +-- +2.35.3 + diff --git a/patches.suse/xhci-remove-unused-command-member-from-struct-xhci_h.patch b/patches.suse/xhci-remove-unused-command-member-from-struct-xhci_h.patch new file mode 100644 index 0000000..2e24700 --- /dev/null +++ b/patches.suse/xhci-remove-unused-command-member-from-struct-xhci_h.patch @@ -0,0 +1,32 @@ +From 1a855a83592ed968d95ea28f15755c22f8336fba Mon Sep 17 00:00:00 2001 +From: Mathias Nyman +Date: Wed, 21 Sep 2022 15:34:49 +0300 +Subject: [PATCH] xhci: remove unused command member from struct xhci_hcd + struct +Git-commit: 1a855a83592ed968d95ea28f15755c22f8336fba +References: jsc#PED-531 +Patch-mainline: v6.1-rc1 + +The u32 command was added to struct xhci_hcd over 10 years ago in +commit 9777e3ce907d ("USB: xHCI: bus power management implementation") + +It wasn't even used back then, so remove it. + +Signed-off-by: Mathias Nyman +Link: https://lore.kernel.org/r/20220921123450.671459-6-mathias.nyman@linux.intel.com +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Oliver Neukum +--- + drivers/usb/host/xhci.h | 1 - + 1 file changed, 1 deletion(-) + +--- a/drivers/usb/host/xhci.h ++++ b/drivers/usb/host/xhci.h +@@ -1827,7 +1827,6 @@ struct xhci_hcd { + /* Host controller watchdog timer structures */ + unsigned int xhc_state; + +- u32 command; + struct s3_save s3; + /* Host controller is dying - not responding to commands. "I'm not dead yet!" + * diff --git a/patches.suse/xhci-remove-unused-lpm_failed_dev-member-from-struct.patch b/patches.suse/xhci-remove-unused-lpm_failed_dev-member-from-struct.patch new file mode 100644 index 0000000..fe9439b --- /dev/null +++ b/patches.suse/xhci-remove-unused-lpm_failed_dev-member-from-struct.patch @@ -0,0 +1,43 @@ +From d2e672a67fd24d842874216911ea2d1cdb54173e Mon Sep 17 00:00:00 2001 +From: Mathias Nyman +Date: Wed, 21 Sep 2022 15:34:50 +0300 +Subject: [PATCH] xhci: remove unused lpm_failed_dev member from struct + xhci_hcd +Git-commit: d2e672a67fd24d842874216911ea2d1cdb54173e +References: jsc#PED-531 +Patch-mainline: v6.1-rc1 + +xhci used to test if link power management (LPM) capable USB2 devices +really could enter and exit L1 state link state. +Failed devices were added to a lpm_failed_dev list. + +This feature was removed 9 years ago in +commit de68bab4fa96 ("usb: Don't enable USB 2.0 Link PM by default.") +but lpm_failed_dev member was still left. + +Remove it now. + +Signed-off-by: Mathias Nyman +Link: https://lore.kernel.org/r/20220921123450.671459-7-mathias.nyman@linux.intel.com +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Oliver Neukum +--- + drivers/usb/host/xhci.h | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h +index e1091bce942f..c0964fe8ac12 100644 +--- a/drivers/usb/host/xhci.h ++++ b/drivers/usb/host/xhci.h +@@ -1807,8 +1807,6 @@ struct xhci_hcd { + struct xhci_erst erst; + /* Scratchpad */ + struct xhci_scratchpad *scratchpad; +- /* Store LPM test failed devices' information */ +- struct list_head lpm_failed_devs; + + /* slot enabling and address device helpers */ + /* these are not thread safe so use mutex */ +-- +2.35.3 + diff --git a/series.conf b/series.conf index 5ac8dcd..9b52aa6 100644 --- a/series.conf +++ b/series.conf @@ -1398,6 +1398,7 @@ patches.suse/usb-host-ohci-tmio-add-IRQ-check.patch patches.suse/usb-phy-tahvo-add-IRQ-check.patch patches.suse/usb-dwc3-Decouple-USB-2.0-L1-L2-events.patch + patches.suse/usb-host-remove-dead-EHCI-support-for-on-chip-PMC-MS.patch patches.suse/usb-gadget-mv_u3d-request_irq-after-initializing-UDC.patch patches.suse/USB-EHCI-Add-register-array-bounds-to-HCS-ports.patch patches.suse/USB-EHCI-Add-alias-for-Broadcom-INSNREG.patch @@ -2827,6 +2828,7 @@ patches.suse/powerpc-pseries-Fix-build-error-when-NUMA-n.patch patches.suse/powerpc-config-Fix-IPV6-warning-in-mpc855_ads.patch patches.suse/powerpc-config-Renable-MTD_PHYSMAP_OF.patch + patches.suse/powerpc-kvm-Remove-obsolete-and-unneeded-select.patch patches.suse/powerpc-perf-hv-gpci-Fix-counter-value-parsing.patch patches.suse/powerpc-perf-Use-stack-siar-instead-of-mfspr.patch patches.suse/powerpc-perf-Drop-the-case-of-returning-0-as-instruc.patch @@ -5041,6 +5043,7 @@ patches.suse/x86-sev-replace-occurrences-of-sev_es_active-with-cc_platform_has patches.suse/treewide-replace-the-use-of-mem_encrypt_active-with-cc_platform_has patches.suse/x86-cpu-Fix-migration-safety-with-X86_BUG_NULL_SEL.patch + patches.suse/x86-Kconfig-Fix-an-unused-variable-error-in-dell-smm.patch patches.suse/x86-insn-Use-get_unaligned-instead-of-memcpy.patch patches.suse/x86-sev-carve-out-hv-call-s-return-value-verification patches.suse/x86-sme-use-define-use_early_pgtable_l5-in-mem_encrypt_identity-c.patch @@ -5552,6 +5555,7 @@ patches.suse/ip-use-dev_addr_set-in-tunnels.patch patches.suse/net-remove-single-byte-netdev-dev_addr-writes.patch patches.suse/marvell-octeontx2-build-error-unknown-type-name-u64.patch + patches.suse/net-delete-redundant-function-declaration.patch patches.suse/ice-Refactor-ice_aqc_link_topo_addr.patch patches.suse/ice-Implement-functions-for-reading-and-setting-GPIO.patch patches.suse/ice-Add-support-for-SMA-control-multiplexer.patch @@ -6760,6 +6764,7 @@ patches.suse/staging-rtl8192u-fix-control-message-timeouts.patch patches.suse/staging-r8712u-fix-control-message-timeout.patch patches.suse/pvpanic-Fix-typos-in-the-comments.patch + patches.suse/habanalabs-select-CRC32.patch patches.suse/binder-don-t-detect-sender-target-during-buffer-clea.patch patches.suse/char-xillybus-fix-msg_ep-UAF-in-xillyusb_probe.patch patches.suse/dt-bindings-iio-accel-Add-DT-binding-doc-for-ADXL355.patch @@ -8456,6 +8461,7 @@ patches.suse/ieee802154-atusb-fix-uninit-value-in-atusb_set_exten.patch patches.suse/Revert-net-usb-r8152-Add-MAC-passthrough-support-for.patch patches.suse/tracing-Fix-check-for-trace_percpu_buffer-validity-in-get_trace_buf.patch + patches.suse/tracing-Tag-trace_percpu_buffer-as-a-percpu-pointer.patch patches.suse/RDMA-rxe-Prevent-double-freeing-rxe_map_set.patch patches.suse/Revert-RDMA-mlx5-Fix-releasing-unallocated-memory-in.patch patches.suse/RDMA-uverbs-Check-for-null-return-of-kmalloc_array.patch @@ -10290,6 +10296,7 @@ patches.suse/ucount-Make-get_ucount-a-safe-get_user-replacement.patch patches.suse/tracing-histogram-Fix-a-potential-memory-leak-for-kstrdup.patch patches.suse/tracing-Fix-smatch-warning-for-null-glob-in-event_hist_trigger_parse.patch + patches.suse/tracing-Fix-smatch-warning-for-do-while-check-in-eve.patch patches.suse/tracing-Propagate-is_signed-to-expression.patch patches.suse/tracing-Don-t-inc-err_log-entry-count-if-entry-allocation-fails.patch patches.suse/PM-wakeup-simplify-the-output-logic-of-pm_show_wakel.patch @@ -12537,6 +12544,7 @@ patches.suse/usb-dwc3-gadget-ep_queue-simplify-isoc-start-conditi.patch patches.suse/usb-dwc3-gadget-move-cmd_endtransfer-to-extra-functi.patch patches.suse/usb-dwc3-gadget-Wait-for-ep0-xfers-to-complete-durin.patch + patches.suse/xen-usb-harden-xen_hcd-against-malicious-backends.patch patches.suse/usb-usbip-eliminate-anonymous-module_init-module_exi.patch patches.suse/usb-gadget-eliminate-anonymous-module_init-module_ex.patch patches.suse/USB-usb-storage-Fix-use-of-bitfields-for-hardware-da.patch @@ -12630,6 +12638,7 @@ patches.suse/serial-samsung_tty-do-not-unlock-port-lock-for-uart_.patch patches.suse/serial-sc16is7xx-Clear-RS485-bits-in-the-shutdown.patch patches.suse/serial-8250-fix-XOFF-XON-sending-when-DMA-is-used.patch + patches.suse/xen-grant-table-remove-readonly-parameter-from-funct.patch patches.suse/xen-fix-is_xen_pmu.patch patches.suse/livepatch-Don-t-block-removal-of-patches-that-are-safe-to-unload.patch patches.suse/net-stmmac-dwmac-qcom-ethqos-Enable-RGMII-functional.patch @@ -13603,6 +13612,10 @@ patches.suse/x86-platform-uv-update-tsc-sync-state-for-uv5.patch patches.suse/x86-platform-uv-log-gap-hole-end-size.patch patches.suse/platform-x86-intel-hid-fix-_DSM-function-index-handl.patch + patches.suse/xen-usb-switch-xen-hcd-to-use-INVALID_GRANT_REF.patch + patches.suse/xen-update-ring.h.patch + patches.suse/xen-xenbus-add-xenbus_setup_ring-service-function.patch + patches.suse/xen-usbfront-use-xenbus_setup_ring-and-xenbus_teardo.patch patches.suse/irqchip-irq-xtensa-mx-fix-initial-IRQ-affinity.patch patches.suse/tty-goldfish-Introduce-gf_ioread32-gf_iowrite32.patch patches.suse/s390-stp-clock_delta-should-be-signed @@ -14900,6 +14913,7 @@ patches.suse/usb-gadget-Fix-non-unique-driver-names-in-raw-gadget.patch patches.suse/dt-bindings-usb-ohci-Increase-the-number-of-PHYs.patch patches.suse/dt-bindings-usb-ehci-Increase-the-number-of-PHYs.patch + patches.suse/usb-typec-wcove-Drop-wrong-dependency-to-INTEL_SOC_P.patch patches.suse/USB-serial-option-add-Telit-LE910Cx-0x1250-compositi.patch patches.suse/USB-serial-pl2303-add-support-for-more-HXN-G-types.patch patches.suse/USB-serial-option-add-Quectel-EM05-G-modem.patch @@ -15953,6 +15967,7 @@ patches.suse/USB-serial-fix-tty-port-initialized-comments.patch patches.suse/USB-HCD-Fix-URB-giveback-issue-in-tasklet-function.patch patches.suse/usb-core-fix-repeated-words-in-comments.patch + patches.suse/usb-renesas-xhci-Do-not-print-any-log-while-fw-verif.patch patches.suse/usb-cdns3-change-place-of-priv_ep-assignment-in-cdns.patch patches.suse/usb-typec-ucsi-Acknowledge-the-GET_ERROR_STATUS-comm.patch patches.suse/usb-cdns3-Don-t-use-priv_dev-uninitialized-in-cdns3_.patch @@ -17034,9 +17049,13 @@ patches.suse/tty-serial-fsl_lpuart-disable-dma-rx-tx-use-flags-in.patch patches.suse/serial-8250-Fix-restoring-termios-speed-after-suspen.patch patches.suse/usb-common-debug-Check-non-standard-control-requests.patch + patches.suse/USB-hcd-pci-Drop-the-unused-id-parameter-from-usb_hc.patch + patches.suse/USB-xhci-make-xhci_get_endpoint_address-static.patch patches.suse/USB-serial-console-move-mutex_unlock-before-usb_seri.patch patches.suse/xhci-dbc-Fix-memory-leak-in-xhci_alloc_dbc.patch patches.suse/xhci-Don-t-show-warning-for-reinit-on-known-broken-s.patch + patches.suse/xhci-remove-unused-command-member-from-struct-xhci_h.patch + patches.suse/xhci-remove-unused-lpm_failed_dev-member-from-struct.patch patches.suse/usb-gadget-function-fix-dangling-pnp_string-in-f_pri.patch patches.suse/usb-mon-make-mmapped-memory-read-only.patch patches.suse/USB-add-RESET_RESUME-quirk-for-NVIDIA-Jetson-devices.patch