From: Greg Kroah-Hartman Date: Thu, 23 Jun 2022 16:00:33 +0000 (+0200) Subject: 4.14-stable patches X-Git-Tag: v4.9.320~21 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d6203299165ad12d1dca4fe194b2e2d814217b0a;p=thirdparty%2Fkernel%2Fstable-queue.git 4.14-stable patches added patches: s390-mm-use-non-quiescing-sske-for-kvm-switch-to-keyed-guest.patch usb-gadget-u_ether-fix-regression-in-setting-fixed-mac-address.patch --- diff --git a/queue-4.14/s390-mm-use-non-quiescing-sske-for-kvm-switch-to-keyed-guest.patch b/queue-4.14/s390-mm-use-non-quiescing-sske-for-kvm-switch-to-keyed-guest.patch new file mode 100644 index 00000000000..77d59351962 --- /dev/null +++ b/queue-4.14/s390-mm-use-non-quiescing-sske-for-kvm-switch-to-keyed-guest.patch @@ -0,0 +1,35 @@ +From 3ae11dbcfac906a8c3a480e98660a823130dc16a Mon Sep 17 00:00:00 2001 +From: Christian Borntraeger +Date: Mon, 30 May 2022 11:27:06 +0200 +Subject: s390/mm: use non-quiescing sske for KVM switch to keyed guest + +From: Christian Borntraeger + +commit 3ae11dbcfac906a8c3a480e98660a823130dc16a upstream. + +The switch to a keyed guest does not require a classic sske as the other +guest CPUs are not accessing the key before the switch is complete. +By using the NQ SSKE things are faster especially with multiple guests. + +Signed-off-by: Christian Borntraeger +Suggested-by: Janis Schoetterl-Glausch +Reviewed-by: Claudio Imbrenda +Link: https://lore.kernel.org/r/20220530092706.11637-3-borntraeger@linux.ibm.com +Signed-off-by: Christian Borntraeger +Signed-off-by: Heiko Carstens +Signed-off-by: Greg Kroah-Hartman +--- + arch/s390/mm/pgtable.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/s390/mm/pgtable.c ++++ b/arch/s390/mm/pgtable.c +@@ -684,7 +684,7 @@ void ptep_zap_key(struct mm_struct *mm, + pgste_val(pgste) |= PGSTE_GR_BIT | PGSTE_GC_BIT; + ptev = pte_val(*ptep); + if (!(ptev & _PAGE_INVALID) && (ptev & _PAGE_WRITE)) +- page_set_storage_key(ptev & PAGE_MASK, PAGE_DEFAULT_KEY, 1); ++ page_set_storage_key(ptev & PAGE_MASK, PAGE_DEFAULT_KEY, 0); + pgste_set_unlock(ptep, pgste); + preempt_enable(); + } diff --git a/queue-4.14/series b/queue-4.14/series index b66008cfe6f..79e47e7f2b5 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -227,3 +227,5 @@ ext4-add-reserved-gdt-blocks-check.patch virtio-pci-remove-wrong-address-verification-in-vp_del_vqs.patch l2tp-don-t-use-inet_shutdown-on-ppp-session-destroy.patch l2tp-fix-race-in-pppol2tp_release-with-session-object-destroy.patch +s390-mm-use-non-quiescing-sske-for-kvm-switch-to-keyed-guest.patch +usb-gadget-u_ether-fix-regression-in-setting-fixed-mac-address.patch diff --git a/queue-4.14/usb-gadget-u_ether-fix-regression-in-setting-fixed-mac-address.patch b/queue-4.14/usb-gadget-u_ether-fix-regression-in-setting-fixed-mac-address.patch new file mode 100644 index 00000000000..34d9c8f86fb --- /dev/null +++ b/queue-4.14/usb-gadget-u_ether-fix-regression-in-setting-fixed-mac-address.patch @@ -0,0 +1,79 @@ +From b337af3a4d6147000b7ca6b3438bf5c820849b37 Mon Sep 17 00:00:00 2001 +From: Marian Postevca +Date: Fri, 3 Jun 2022 18:34:59 +0300 +Subject: usb: gadget: u_ether: fix regression in setting fixed MAC address + +From: Marian Postevca + +commit b337af3a4d6147000b7ca6b3438bf5c820849b37 upstream. + +In systemd systems setting a fixed MAC address through +the "dev_addr" module argument fails systematically. +When checking the MAC address after the interface is created +it always has the same but different MAC address to the one +supplied as argument. + +This is partially caused by systemd which by default will +set an internally generated permanent MAC address for interfaces +that are marked as having a randomly generated address. + +Commit 890d5b40908bfd1a ("usb: gadget: u_ether: fix race in +setting MAC address in setup phase") didn't take into account +the fact that the interface must be marked as having a set +MAC address when it's set as module argument. + +Fixed by marking the interface with NET_ADDR_SET when +the "dev_addr" module argument is supplied. + +Fixes: 890d5b40908bfd1a ("usb: gadget: u_ether: fix race in setting MAC address in setup phase") +Cc: stable@vger.kernel.org +Signed-off-by: Marian Postevca +Link: https://lore.kernel.org/r/20220603153459.32722-1-posteuca@mutex.one +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/gadget/function/u_ether.c | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +--- a/drivers/usb/gadget/function/u_ether.c ++++ b/drivers/usb/gadget/function/u_ether.c +@@ -776,9 +776,13 @@ struct eth_dev *gether_setup_name(struct + dev->qmult = qmult; + snprintf(net->name, sizeof(net->name), "%s%%d", netname); + +- if (get_ether_addr(dev_addr, net->dev_addr)) ++ if (get_ether_addr(dev_addr, net->dev_addr)) { ++ net->addr_assign_type = NET_ADDR_RANDOM; + dev_warn(&g->dev, + "using random %s ethernet address\n", "self"); ++ } else { ++ net->addr_assign_type = NET_ADDR_SET; ++ } + if (get_ether_addr(host_addr, dev->host_mac)) + dev_warn(&g->dev, + "using random %s ethernet address\n", "host"); +@@ -835,6 +839,9 @@ struct net_device *gether_setup_name_def + INIT_LIST_HEAD(&dev->tx_reqs); + INIT_LIST_HEAD(&dev->rx_reqs); + ++ /* by default we always have a random MAC address */ ++ net->addr_assign_type = NET_ADDR_RANDOM; ++ + skb_queue_head_init(&dev->rx_frames); + + /* network device setup */ +@@ -872,7 +879,6 @@ int gether_register_netdev(struct net_de + g = dev->gadget; + + memcpy(net->dev_addr, dev->dev_mac, ETH_ALEN); +- net->addr_assign_type = NET_ADDR_RANDOM; + + status = register_netdev(net); + if (status < 0) { +@@ -912,6 +918,7 @@ int gether_set_dev_addr(struct net_devic + if (get_ether_addr(dev_addr, new_addr)) + return -EINVAL; + memcpy(dev->dev_mac, new_addr, ETH_ALEN); ++ net->addr_assign_type = NET_ADDR_SET; + return 0; + } + EXPORT_SYMBOL_GPL(gether_set_dev_addr);