[Kernel-packages] [Bug 1758378] Re: [Hyper-V] PCI: hv: Fix 2 hang issues in hv_compose_msi_msg
** Tags removed: verification-needed-bionic ** Tags added: verification-done-bionic -- You received this bug notification because you are a member of Kernel Packages, which is subscribed to linux in Ubuntu. https://bugs.launchpad.net/bugs/1758378 Title: [Hyper-V] PCI: hv: Fix 2 hang issues in hv_compose_msi_msg Status in linux package in Ubuntu: Incomplete Status in linux-azure package in Ubuntu: Fix Released Status in linux-azure-edge package in Ubuntu: Invalid Status in linux source package in Xenial: Invalid Status in linux-azure source package in Xenial: Fix Released Status in linux-azure-edge source package in Xenial: Fix Released Status in linux source package in Bionic: Fix Committed Status in linux-azure source package in Bionic: Fix Released Status in linux-azure-edge source package in Bionic: Invalid Bug description: We've identified some issues in recent testing against upstream 4.15 SR-IOV and DPDK. The following commits are in Lorenzo's PCI tree on their way into 4.16 and stable: Tree: https://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git/log/?h=pci/hv PCI: hv: Only queue new work items in hv_pci_devices_present() if necessary If there is pending work in hv_pci_devices_present() we just need to add the new dr entry into the dr_list. Add a check to detect pending work items and update the code to skip queuing work if pending work items are detected. https://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git/commit/?h=pci/hv&id=948373b3ed1bcf05a237c24675b84804315aff14 PCI: hv: Remove the bogus test in hv_eject_device_work() When kernel is executing hv_eject_device_work(), hpdev->state value must be hv_pcichild_ejecting; any other value would consist in a bug, therefore replace the bogus check with an explicit WARN_ON() on the condition failure detection. https://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git/commit/?h=pci/hv&id=fca288c0153b2b97114b9081bc3c33c3735145b6 PCI: hv: Fix a comment typo in _hv_pcifront_read_config() Comment in _hv_pcifront_read_config() contains a typo, fix it. No functional change. https://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git/commit/?h=pci/hv&id=df3f2159f4e4146d40b244725ce79ed921530b99 PCI: hv: Fix 2 hang issues in hv_compose_msi_msg() 1. With the patch "x86/vector/msi: Switch to global reservation mode", the recent v4.15 and newer kernels always hang for 1-vCPU Hyper-V VM with SR-IOV. This is because when we reach hv_compose_msi_msg() by request_irq() -> request_threaded_irq() ->__setup_irq()->irq_startup() -> __irq_startup() -> irq_domain_activate_irq() -> ... -> msi_domain_activate() -> ... -> hv_compose_msi_msg(), local irq is disabled in __setup_irq(). Note: when we reach hv_compose_msi_msg() by another code path: pci_enable_msix_range() -> ... -> irq_domain_activate_irq() -> ... -> hv_compose_msi_msg(), local irq is not disabled. hv_compose_msi_msg() depends on an interrupt from the host. With interrupts disabled, a UP VM always hangs in the busy loop in the function, because the interrupt callback hv_pci_onchannelcallback() can not be called. We can do nothing but work it around by polling the channel. This is ugly, but we don't have any other choice. 2. If the host is ejecting the VF device before we reach hv_compose_msi_msg(), in a UP VM, we can hang in hv_compose_msi_msg() forever, because at this time the host doesn't respond to the CREATE_INTERRUPT request. This issue exists the first day the pci-hyperv driver appears in the kernel. Luckily, this can also by worked around by polling the channel for the PCI_EJECT message and hpdev->state, and by checking the PCI vendor ID. Note: actually the above 2 issues also happen to a SMP VM, if "hbus->hdev->channel->target_cpu == smp_processor_id()" is true. https://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git/commit/?h=pci/hv&id=de0aa7b2f97d348ba7d1e17a00744c989baa0cb6 PCI: hv: Serialize the present and eject work items When we hot-remove the device, we first receive a PCI_EJECT message and then receive a PCI_BUS_RELATIONS message with bus_rel->device_count == 0. The first message is offloaded to hv_eject_device_work(), and the second is offloaded to pci_devices_present_work(). Both the paths can be running list_del(&hpdev->list_entry), causing general protection fault, because system_wq can run them concurrently. The patch eliminates the race condition. Since access to present/eject work items is serialized, we do not need the hbus->enum_sem anymore, so remove it. https://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git/commit/?h=pci/hv&id=021ad274d7dc31611d4f47f7dd4ac7a224526f30 All 4.15-based kernels need these fixes, or any kernels that picked up: Fixes: 4900be83602b ("x86/vector/msi: Switch to global reservation mode") The race condition fixed by the serializ
[Kernel-packages] [Bug 1758378] Re: [Hyper-V] PCI: hv: Fix 2 hang issues in hv_compose_msi_msg
This bug was fixed in the package linux - 4.15.0-24.26 --- linux (4.15.0-24.26) bionic; urgency=medium * linux: 4.15.0-24.26 -proposed tracker (LP: #1776338) * Bionic update: upstream stable patchset 2018-06-06 (LP: #1775483) - drm: bridge: dw-hdmi: Fix overflow workaround for Amlogic Meson GX SoCs - i40e: Fix attach VF to VM issue - tpm: cmd_ready command can be issued only after granting locality - tpm: tpm-interface: fix tpm_transmit/_cmd kdoc - tpm: add retry logic - Revert "ath10k: send (re)assoc peer command when NSS changed" - bonding: do not set slave_dev npinfo before slave_enable_netpoll in bond_enslave - ipv6: add RTA_TABLE and RTA_PREFSRC to rtm_ipv6_policy - ipv6: sr: fix NULL pointer dereference in seg6_do_srh_encap()- v4 pkts - KEYS: DNS: limit the length of option strings - l2tp: check sockaddr length in pppol2tp_connect() - net: validate attribute sizes in neigh_dump_table() - llc: delete timers synchronously in llc_sk_free() - tcp: don't read out-of-bounds opsize - net: af_packet: fix race in PACKET_{R|T}X_RING - tcp: md5: reject TCP_MD5SIG or TCP_MD5SIG_EXT on established sockets - net: fix deadlock while clearing neighbor proxy table - team: avoid adding twice the same option to the event list - net/smc: fix shutdown in state SMC_LISTEN - team: fix netconsole setup over team - packet: fix bitfield update race - tipc: add policy for TIPC_NLA_NET_ADDR - pppoe: check sockaddr length in pppoe_connect() - vlan: Fix reading memory beyond skb->tail in skb_vlan_tagged_multi - amd-xgbe: Add pre/post auto-negotiation phy hooks - sctp: do not check port in sctp_inet6_cmp_addr - amd-xgbe: Improve KR auto-negotiation and training - strparser: Do not call mod_delayed_work with a timeout of LONG_MAX - amd-xgbe: Only use the SFP supported transceiver signals - strparser: Fix incorrect strp->need_bytes value. - net: sched: ife: signal not finding metaid - tcp: clear tp->packets_out when purging write queue - net: sched: ife: handle malformed tlv length - net: sched: ife: check on metadata length - llc: hold llc_sap before release_sock() - llc: fix NULL pointer deref for SOCK_ZAPPED - net: ethernet: ti: cpsw: fix tx vlan priority mapping - virtio_net: split out ctrl buffer - virtio_net: fix adding vids on big-endian - KVM: s390: force bp isolation for VSIE - s390: correct module section names for expoline code revert - microblaze: Setup dependencies for ASM optimized lib functions - commoncap: Handle memory allocation failure. - scsi: mptsas: Disable WRITE SAME - cdrom: information leak in cdrom_ioctl_media_changed() - m68k/mac: Don't remap SWIM MMIO region - block/swim: Check drive type - block/swim: Don't log an error message for an invalid ioctl - block/swim: Remove extra put_disk() call from error path - block/swim: Rename macros to avoid inconsistent inverted logic - block/swim: Select appropriate drive on device open - block/swim: Fix array bounds check - block/swim: Fix IO error at end of medium - tracing: Fix missing tab for hwlat_detector print format - s390/cio: update chpid descriptor after resource accessibility event - s390/dasd: fix IO error for newly defined devices - s390/uprobes: implement arch_uretprobe_is_alive() - ACPI / video: Only default only_lcd to true on Win8-ready _desktops_ - docs: ip-sysctl.txt: fix name of some ipv6 variables - net: mvpp2: Fix DMA address mask size - net: stmmac: Disable ACS Feature for GMAC >= 4 - l2tp: hold reference on tunnels in netlink dumps - l2tp: hold reference on tunnels printed in pppol2tp proc file - l2tp: hold reference on tunnels printed in l2tp/tunnels debugfs file - l2tp: fix {pppol2tp, l2tp_dfs}_seq_stop() in case of seq_file overflow - s390/qeth: fix error handling in adapter command callbacks - s390/qeth: avoid control IO completion stalls - s390/qeth: handle failure on workqueue creation - bnxt_en: Fix memory fault in bnxt_ethtool_init() - virtio-net: add missing virtqueue kick when flushing packets - VSOCK: make af_vsock.ko removable again - hwmon: (k10temp) Add temperature offset for Ryzen 2700X - hwmon: (k10temp) Add support for AMD Ryzen w/ Vega graphics - s390/cpum_cf: rename IBM z13/z14 counter names - kprobes: Fix random address output of blacklist file - Revert "pinctrl: intel: Initialize GPIO properly when used through irqchip" * Lenovo V330 needs patch in ideapad_laptop module for rfkill (LP: #1774636) - SAUCE: Add Lenovo V330 to the ideapad_laptop rfkill blacklist * bluetooth controller fail after suspend with USB autosuspend on XPS 13 9360 (LP: #1775217) - Bluetooth: btusb: Add Dell XPS 13 9360 to btusb_needs_reset_resume_table * [Hyper-V] PCI: hv: Fix 2 hang issues in hv_compose_msi
[Kernel-packages] [Bug 1758378] Re: [Hyper-V] PCI: hv: Fix 2 hang issues in hv_compose_msi_msg
** Also affects: linux (Ubuntu) Importance: Undecided Status: New ** Changed in: linux (Ubuntu Xenial) Status: New => Invalid ** Changed in: linux (Ubuntu Bionic) Status: New => In Progress ** Changed in: linux (Ubuntu Bionic) Assignee: (unassigned) => Marcelo Cerri (mhcerri) -- You received this bug notification because you are a member of Kernel Packages, which is subscribed to linux-azure in Ubuntu. https://bugs.launchpad.net/bugs/1758378 Title: [Hyper-V] PCI: hv: Fix 2 hang issues in hv_compose_msi_msg Status in linux package in Ubuntu: Incomplete Status in linux-azure package in Ubuntu: Fix Released Status in linux-azure-edge package in Ubuntu: Invalid Status in linux source package in Xenial: Invalid Status in linux-azure source package in Xenial: Fix Released Status in linux-azure-edge source package in Xenial: Fix Released Status in linux source package in Bionic: In Progress Status in linux-azure source package in Bionic: Fix Released Status in linux-azure-edge source package in Bionic: Invalid Bug description: We've identified some issues in recent testing against upstream 4.15 SR-IOV and DPDK. The following commits are in Lorenzo's PCI tree on their way into 4.16 and stable: Tree: https://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git/log/?h=pci/hv PCI: hv: Only queue new work items in hv_pci_devices_present() if necessary If there is pending work in hv_pci_devices_present() we just need to add the new dr entry into the dr_list. Add a check to detect pending work items and update the code to skip queuing work if pending work items are detected. https://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git/commit/?h=pci/hv&id=948373b3ed1bcf05a237c24675b84804315aff14 PCI: hv: Remove the bogus test in hv_eject_device_work() When kernel is executing hv_eject_device_work(), hpdev->state value must be hv_pcichild_ejecting; any other value would consist in a bug, therefore replace the bogus check with an explicit WARN_ON() on the condition failure detection. https://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git/commit/?h=pci/hv&id=fca288c0153b2b97114b9081bc3c33c3735145b6 PCI: hv: Fix a comment typo in _hv_pcifront_read_config() Comment in _hv_pcifront_read_config() contains a typo, fix it. No functional change. https://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git/commit/?h=pci/hv&id=df3f2159f4e4146d40b244725ce79ed921530b99 PCI: hv: Fix 2 hang issues in hv_compose_msi_msg() 1. With the patch "x86/vector/msi: Switch to global reservation mode", the recent v4.15 and newer kernels always hang for 1-vCPU Hyper-V VM with SR-IOV. This is because when we reach hv_compose_msi_msg() by request_irq() -> request_threaded_irq() ->__setup_irq()->irq_startup() -> __irq_startup() -> irq_domain_activate_irq() -> ... -> msi_domain_activate() -> ... -> hv_compose_msi_msg(), local irq is disabled in __setup_irq(). Note: when we reach hv_compose_msi_msg() by another code path: pci_enable_msix_range() -> ... -> irq_domain_activate_irq() -> ... -> hv_compose_msi_msg(), local irq is not disabled. hv_compose_msi_msg() depends on an interrupt from the host. With interrupts disabled, a UP VM always hangs in the busy loop in the function, because the interrupt callback hv_pci_onchannelcallback() can not be called. We can do nothing but work it around by polling the channel. This is ugly, but we don't have any other choice. 2. If the host is ejecting the VF device before we reach hv_compose_msi_msg(), in a UP VM, we can hang in hv_compose_msi_msg() forever, because at this time the host doesn't respond to the CREATE_INTERRUPT request. This issue exists the first day the pci-hyperv driver appears in the kernel. Luckily, this can also by worked around by polling the channel for the PCI_EJECT message and hpdev->state, and by checking the PCI vendor ID. Note: actually the above 2 issues also happen to a SMP VM, if "hbus->hdev->channel->target_cpu == smp_processor_id()" is true. https://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git/commit/?h=pci/hv&id=de0aa7b2f97d348ba7d1e17a00744c989baa0cb6 PCI: hv: Serialize the present and eject work items When we hot-remove the device, we first receive a PCI_EJECT message and then receive a PCI_BUS_RELATIONS message with bus_rel->device_count == 0. The first message is offloaded to hv_eject_device_work(), and the second is offloaded to pci_devices_present_work(). Both the paths can be running list_del(&hpdev->list_entry), causing general protection fault, because system_wq can run them concurrently. The patch eliminates the race condition. Since access to present/eject work items is serialized, we do not need the hbus->enum_sem anymore, so remove it. https://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git/commit/?h=pci/hv&id=021ad2
[Kernel-packages] [Bug 1758378] Re: [Hyper-V] PCI: hv: Fix 2 hang issues in hv_compose_msi_msg
https://lists.ubuntu.com/archives/kernel-team/2018-June/093239.html -- You received this bug notification because you are a member of Kernel Packages, which is subscribed to linux-azure in Ubuntu. https://bugs.launchpad.net/bugs/1758378 Title: [Hyper-V] PCI: hv: Fix 2 hang issues in hv_compose_msi_msg Status in linux package in Ubuntu: Incomplete Status in linux-azure package in Ubuntu: Fix Released Status in linux-azure-edge package in Ubuntu: Invalid Status in linux source package in Xenial: Invalid Status in linux-azure source package in Xenial: Fix Released Status in linux-azure-edge source package in Xenial: Fix Released Status in linux source package in Bionic: In Progress Status in linux-azure source package in Bionic: Fix Released Status in linux-azure-edge source package in Bionic: Invalid Bug description: We've identified some issues in recent testing against upstream 4.15 SR-IOV and DPDK. The following commits are in Lorenzo's PCI tree on their way into 4.16 and stable: Tree: https://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git/log/?h=pci/hv PCI: hv: Only queue new work items in hv_pci_devices_present() if necessary If there is pending work in hv_pci_devices_present() we just need to add the new dr entry into the dr_list. Add a check to detect pending work items and update the code to skip queuing work if pending work items are detected. https://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git/commit/?h=pci/hv&id=948373b3ed1bcf05a237c24675b84804315aff14 PCI: hv: Remove the bogus test in hv_eject_device_work() When kernel is executing hv_eject_device_work(), hpdev->state value must be hv_pcichild_ejecting; any other value would consist in a bug, therefore replace the bogus check with an explicit WARN_ON() on the condition failure detection. https://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git/commit/?h=pci/hv&id=fca288c0153b2b97114b9081bc3c33c3735145b6 PCI: hv: Fix a comment typo in _hv_pcifront_read_config() Comment in _hv_pcifront_read_config() contains a typo, fix it. No functional change. https://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git/commit/?h=pci/hv&id=df3f2159f4e4146d40b244725ce79ed921530b99 PCI: hv: Fix 2 hang issues in hv_compose_msi_msg() 1. With the patch "x86/vector/msi: Switch to global reservation mode", the recent v4.15 and newer kernels always hang for 1-vCPU Hyper-V VM with SR-IOV. This is because when we reach hv_compose_msi_msg() by request_irq() -> request_threaded_irq() ->__setup_irq()->irq_startup() -> __irq_startup() -> irq_domain_activate_irq() -> ... -> msi_domain_activate() -> ... -> hv_compose_msi_msg(), local irq is disabled in __setup_irq(). Note: when we reach hv_compose_msi_msg() by another code path: pci_enable_msix_range() -> ... -> irq_domain_activate_irq() -> ... -> hv_compose_msi_msg(), local irq is not disabled. hv_compose_msi_msg() depends on an interrupt from the host. With interrupts disabled, a UP VM always hangs in the busy loop in the function, because the interrupt callback hv_pci_onchannelcallback() can not be called. We can do nothing but work it around by polling the channel. This is ugly, but we don't have any other choice. 2. If the host is ejecting the VF device before we reach hv_compose_msi_msg(), in a UP VM, we can hang in hv_compose_msi_msg() forever, because at this time the host doesn't respond to the CREATE_INTERRUPT request. This issue exists the first day the pci-hyperv driver appears in the kernel. Luckily, this can also by worked around by polling the channel for the PCI_EJECT message and hpdev->state, and by checking the PCI vendor ID. Note: actually the above 2 issues also happen to a SMP VM, if "hbus->hdev->channel->target_cpu == smp_processor_id()" is true. https://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git/commit/?h=pci/hv&id=de0aa7b2f97d348ba7d1e17a00744c989baa0cb6 PCI: hv: Serialize the present and eject work items When we hot-remove the device, we first receive a PCI_EJECT message and then receive a PCI_BUS_RELATIONS message with bus_rel->device_count == 0. The first message is offloaded to hv_eject_device_work(), and the second is offloaded to pci_devices_present_work(). Both the paths can be running list_del(&hpdev->list_entry), causing general protection fault, because system_wq can run them concurrently. The patch eliminates the race condition. Since access to present/eject work items is serialized, we do not need the hbus->enum_sem anymore, so remove it. https://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git/commit/?h=pci/hv&id=021ad274d7dc31611d4f47f7dd4ac7a224526f30 All 4.15-based kernels need these fixes, or any kernels that picked up: Fixes: 4900be83602b ("x86/vector/msi: Switch to global reservation mode") The race condition fixed by the serialization patch
[Kernel-packages] [Bug 1758378] Re: [Hyper-V] PCI: hv: Fix 2 hang issues in hv_compose_msi_msg
** Changed in: linux (Ubuntu Bionic) Status: In Progress => Fix Committed -- You received this bug notification because you are a member of Kernel Packages, which is subscribed to linux-azure in Ubuntu. https://bugs.launchpad.net/bugs/1758378 Title: [Hyper-V] PCI: hv: Fix 2 hang issues in hv_compose_msi_msg Status in linux package in Ubuntu: Incomplete Status in linux-azure package in Ubuntu: Fix Released Status in linux-azure-edge package in Ubuntu: Invalid Status in linux source package in Xenial: Invalid Status in linux-azure source package in Xenial: Fix Released Status in linux-azure-edge source package in Xenial: Fix Released Status in linux source package in Bionic: Fix Committed Status in linux-azure source package in Bionic: Fix Released Status in linux-azure-edge source package in Bionic: Invalid Bug description: We've identified some issues in recent testing against upstream 4.15 SR-IOV and DPDK. The following commits are in Lorenzo's PCI tree on their way into 4.16 and stable: Tree: https://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git/log/?h=pci/hv PCI: hv: Only queue new work items in hv_pci_devices_present() if necessary If there is pending work in hv_pci_devices_present() we just need to add the new dr entry into the dr_list. Add a check to detect pending work items and update the code to skip queuing work if pending work items are detected. https://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git/commit/?h=pci/hv&id=948373b3ed1bcf05a237c24675b84804315aff14 PCI: hv: Remove the bogus test in hv_eject_device_work() When kernel is executing hv_eject_device_work(), hpdev->state value must be hv_pcichild_ejecting; any other value would consist in a bug, therefore replace the bogus check with an explicit WARN_ON() on the condition failure detection. https://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git/commit/?h=pci/hv&id=fca288c0153b2b97114b9081bc3c33c3735145b6 PCI: hv: Fix a comment typo in _hv_pcifront_read_config() Comment in _hv_pcifront_read_config() contains a typo, fix it. No functional change. https://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git/commit/?h=pci/hv&id=df3f2159f4e4146d40b244725ce79ed921530b99 PCI: hv: Fix 2 hang issues in hv_compose_msi_msg() 1. With the patch "x86/vector/msi: Switch to global reservation mode", the recent v4.15 and newer kernels always hang for 1-vCPU Hyper-V VM with SR-IOV. This is because when we reach hv_compose_msi_msg() by request_irq() -> request_threaded_irq() ->__setup_irq()->irq_startup() -> __irq_startup() -> irq_domain_activate_irq() -> ... -> msi_domain_activate() -> ... -> hv_compose_msi_msg(), local irq is disabled in __setup_irq(). Note: when we reach hv_compose_msi_msg() by another code path: pci_enable_msix_range() -> ... -> irq_domain_activate_irq() -> ... -> hv_compose_msi_msg(), local irq is not disabled. hv_compose_msi_msg() depends on an interrupt from the host. With interrupts disabled, a UP VM always hangs in the busy loop in the function, because the interrupt callback hv_pci_onchannelcallback() can not be called. We can do nothing but work it around by polling the channel. This is ugly, but we don't have any other choice. 2. If the host is ejecting the VF device before we reach hv_compose_msi_msg(), in a UP VM, we can hang in hv_compose_msi_msg() forever, because at this time the host doesn't respond to the CREATE_INTERRUPT request. This issue exists the first day the pci-hyperv driver appears in the kernel. Luckily, this can also by worked around by polling the channel for the PCI_EJECT message and hpdev->state, and by checking the PCI vendor ID. Note: actually the above 2 issues also happen to a SMP VM, if "hbus->hdev->channel->target_cpu == smp_processor_id()" is true. https://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git/commit/?h=pci/hv&id=de0aa7b2f97d348ba7d1e17a00744c989baa0cb6 PCI: hv: Serialize the present and eject work items When we hot-remove the device, we first receive a PCI_EJECT message and then receive a PCI_BUS_RELATIONS message with bus_rel->device_count == 0. The first message is offloaded to hv_eject_device_work(), and the second is offloaded to pci_devices_present_work(). Both the paths can be running list_del(&hpdev->list_entry), causing general protection fault, because system_wq can run them concurrently. The patch eliminates the race condition. Since access to present/eject work items is serialized, we do not need the hbus->enum_sem anymore, so remove it. https://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git/commit/?h=pci/hv&id=021ad274d7dc31611d4f47f7dd4ac7a224526f30 All 4.15-based kernels need these fixes, or any kernels that picked up: Fixes: 4900be83602b ("x86/vector/msi: Switch to global reservation mode") The race condition fixed by the seria
[Kernel-packages] [Bug 1758378] Re: [Hyper-V] PCI: hv: Fix 2 hang issues in hv_compose_msi_msg
This bug is awaiting verification that the kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed- bionic' to 'verification-done-bionic'. If the problem still exists, change the tag 'verification-needed-bionic' to 'verification-failed- bionic'. If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you! ** Tags added: verification-needed-bionic -- You received this bug notification because you are a member of Kernel Packages, which is subscribed to linux in Ubuntu. https://bugs.launchpad.net/bugs/1758378 Title: [Hyper-V] PCI: hv: Fix 2 hang issues in hv_compose_msi_msg Status in linux package in Ubuntu: Incomplete Status in linux-azure package in Ubuntu: Fix Released Status in linux-azure-edge package in Ubuntu: Invalid Status in linux source package in Xenial: Invalid Status in linux-azure source package in Xenial: Fix Released Status in linux-azure-edge source package in Xenial: Fix Released Status in linux source package in Bionic: Fix Committed Status in linux-azure source package in Bionic: Fix Released Status in linux-azure-edge source package in Bionic: Invalid Bug description: We've identified some issues in recent testing against upstream 4.15 SR-IOV and DPDK. The following commits are in Lorenzo's PCI tree on their way into 4.16 and stable: Tree: https://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git/log/?h=pci/hv PCI: hv: Only queue new work items in hv_pci_devices_present() if necessary If there is pending work in hv_pci_devices_present() we just need to add the new dr entry into the dr_list. Add a check to detect pending work items and update the code to skip queuing work if pending work items are detected. https://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git/commit/?h=pci/hv&id=948373b3ed1bcf05a237c24675b84804315aff14 PCI: hv: Remove the bogus test in hv_eject_device_work() When kernel is executing hv_eject_device_work(), hpdev->state value must be hv_pcichild_ejecting; any other value would consist in a bug, therefore replace the bogus check with an explicit WARN_ON() on the condition failure detection. https://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git/commit/?h=pci/hv&id=fca288c0153b2b97114b9081bc3c33c3735145b6 PCI: hv: Fix a comment typo in _hv_pcifront_read_config() Comment in _hv_pcifront_read_config() contains a typo, fix it. No functional change. https://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git/commit/?h=pci/hv&id=df3f2159f4e4146d40b244725ce79ed921530b99 PCI: hv: Fix 2 hang issues in hv_compose_msi_msg() 1. With the patch "x86/vector/msi: Switch to global reservation mode", the recent v4.15 and newer kernels always hang for 1-vCPU Hyper-V VM with SR-IOV. This is because when we reach hv_compose_msi_msg() by request_irq() -> request_threaded_irq() ->__setup_irq()->irq_startup() -> __irq_startup() -> irq_domain_activate_irq() -> ... -> msi_domain_activate() -> ... -> hv_compose_msi_msg(), local irq is disabled in __setup_irq(). Note: when we reach hv_compose_msi_msg() by another code path: pci_enable_msix_range() -> ... -> irq_domain_activate_irq() -> ... -> hv_compose_msi_msg(), local irq is not disabled. hv_compose_msi_msg() depends on an interrupt from the host. With interrupts disabled, a UP VM always hangs in the busy loop in the function, because the interrupt callback hv_pci_onchannelcallback() can not be called. We can do nothing but work it around by polling the channel. This is ugly, but we don't have any other choice. 2. If the host is ejecting the VF device before we reach hv_compose_msi_msg(), in a UP VM, we can hang in hv_compose_msi_msg() forever, because at this time the host doesn't respond to the CREATE_INTERRUPT request. This issue exists the first day the pci-hyperv driver appears in the kernel. Luckily, this can also by worked around by polling the channel for the PCI_EJECT message and hpdev->state, and by checking the PCI vendor ID. Note: actually the above 2 issues also happen to a SMP VM, if "hbus->hdev->channel->target_cpu == smp_processor_id()" is true. https://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git/commit/?h=pci/hv&id=de0aa7b2f97d348ba7d1e17a00744c989baa0cb6 PCI: hv: Serialize the present and eject work items When we hot-remove the device, we first receive a PCI_EJECT message and then receive a PCI_BUS_RELATIONS message with bus_rel->device_count == 0. The first message is offloaded to hv_eject_device_work(), and the second is offloaded to pci_devices_present_work(). Both the paths can be running list_del(&hpdev->list_entry), causing
[Kernel-packages] [Bug 1758378] Re: [Hyper-V] PCI: hv: Fix 2 hang issues in hv_compose_msi_msg
This bug was fixed in the package linux - 4.15.0-29.31 --- linux (4.15.0-29.31) bionic; urgency=medium * linux: 4.15.0-29.31 -proposed tracker (LP: #1782173) * [SRU Bionic][Cosmic] kernel panic in ipmi_ssif at msg_done_handler (LP: #116) - ipmi_ssif: Fix kernel panic at msg_done_handler * Update to ocxl driver for 18.04.1 (LP: #1775786) - misc: ocxl: use put_device() instead of device_unregister() - powerpc: Add TIDR CPU feature for POWER9 - powerpc: Use TIDR CPU feature to control TIDR allocation - powerpc: use task_pid_nr() for TID allocation - ocxl: Rename pnv_ocxl_spa_remove_pe to clarify it's action - ocxl: Expose the thread_id needed for wait on POWER9 - ocxl: Add an IOCTL so userspace knows what OCXL features are available - ocxl: Document new OCXL IOCTLs - ocxl: Fix missing unlock on error in afu_ioctl_enable_p9_wait() * Critical upstream bugfix missing in Ubuntu 18.04 - frequent Xorg crash after suspend (LP: #1776887) - ocxl: Document the OCXL_IOCTL_GET_METADATA IOCTL * Hard LOCKUP observed on stressing Ubuntu 18 04 (LP: #1777194) - powerpc: use NMI IPI for smp_send_stop - powerpc: Fix smp_send_stop NMI IPI handling * IPL: ppc64_cpu --frequency hang with INFO: rcu_sched detected stalls on CPUs/tasks on w34 and wsbmc016 with 920.1714.20170330n (LP: #1773964) - rtc: opal: Fix OPAL RTC driver OPAL_BUSY loops * [Regression] EXT4-fs error (device sda2): ext4_validate_block_bitmap:383: comm stress-ng: bg 4705: bad block bitmap checksum (LP: #1781709) - SAUCE: Revert "UBUNTU: SAUCE: ext4: fix ext4_validate_inode_bitmap: comm stress-ng: Corrupt inode bitmap" - SAUCE: ext4: check for allocation block validity with block group locked linux (4.15.0-28.30) bionic; urgency=medium * linux: 4.15.0-28.30 -proposed tracker (LP: #1781433) * Cannot set MTU higher than 1500 in Xen instance (LP: #1781413) - xen-netfront: Fix mismatched rtnl_unlock - xen-netfront: Update features after registering netdev linux (4.15.0-27.29) bionic; urgency=medium * linux: 4.15.0-27.29 -proposed tracker (LP: #1781062) * [Regression] EXT4-fs error (device sda1): ext4_validate_inode_bitmap:99: comm stress-ng: Corrupt inode bitmap (LP: #1780137) - SAUCE: ext4: fix ext4_validate_inode_bitmap: comm stress-ng: Corrupt inode bitmap linux (4.15.0-26.28) bionic; urgency=medium * linux: 4.15.0-26.28 -proposed tracker (LP: #1780112) * failure to boot with linux-image-4.15.0-24-generic (LP: #1779827) // Cloud- init causes potentially huge boot delays with 4.15 kernels (LP: #1780062) - random: Make getrandom() ready earlier linux (4.15.0-25.27) bionic; urgency=medium * linux: 4.15.0-25.27 -proposed tracker (LP: #1779354) * hisi_sas_v3_hw: internal task abort: timeout and not done. (LP: #136) - scsi: hisi_sas: Update a couple of register settings for v3 hw * hisi_sas: Add missing PHY spinlock init (LP: #134) - scsi: hisi_sas: Add missing PHY spinlock init * hisi_sas: improve read performance by pre-allocating slot DMA buffers (LP: #127) - scsi: hisi_sas: use dma_zalloc_coherent() - scsi: hisi_sas: Use dmam_alloc_coherent() - scsi: hisi_sas: Pre-allocate slot DMA buffers * hisi_sas: Failures during host reset (LP: #1777696) - scsi: hisi_sas: Only process broadcast change in phy_bcast_v3_hw() - scsi: hisi_sas: Fix the conflict between dev gone and host reset - scsi: hisi_sas: Adjust task reject period during host reset - scsi: hisi_sas: Add a flag to filter PHY events during reset - scsi: hisi_sas: Release all remaining resources in clear nexus ha * Fake SAS addresses for SATA disks on HiSilicon D05 are non-unique (LP: #1776750) - scsi: hisi_sas: make SAS address of SATA disks unique * Vcs-Git header on bionic linux source package points to zesty git tree (LP: #1766055) - [Packaging]: Update Vcs-Git * large KVM instances run out of IRQ routes (LP: #1778261) - SAUCE: kvm -- increase KVM_MAX_IRQ_ROUTES to 2048 on x86 -- Stefan Bader Tue, 17 Jul 2018 10:57:50 +0200 ** Changed in: linux (Ubuntu) Status: Incomplete => Fix Released -- You received this bug notification because you are a member of Kernel Packages, which is subscribed to linux in Ubuntu. https://bugs.launchpad.net/bugs/1758378 Title: [Hyper-V] PCI: hv: Fix 2 hang issues in hv_compose_msi_msg Status in linux package in Ubuntu: Fix Released Status in linux-azure package in Ubuntu: Fix Released Status in linux-azure-edge package in Ubuntu: Invalid Status in linux source package in Xenial: Invalid Status in linux-azure source package in Xenial: Fix Released Status in linux-azure-edge source package in Xenial: Fix Released Status in linux source package in Bionic: Fix Released Status in linux-azure source package in Bionic: Fix Released Status in linux-azure-edge source package in Bionic: In