mbox series

[SRU,F,J,L,M,N,0/1] Hotplugging SCSI disk in QEMU VM fails

Message ID 20231226062612.97313-1-chengen.du@canonical.com
Headers show
Series Hotplugging SCSI disk in QEMU VM fails | expand

Message

Chengen Du Dec. 26, 2023, 6:26 a.m. UTC
BugLink: https://bugs.launchpad.net/bugs/2047382

SRU Justification:

[Impact]
Hot-plugging SCSI disks for QEMU VMs booting with UEFI and using guest kernels >= 6.5 might be broken.
The inconsistency suggests a potential race condition.

[Fix]
Reverting the two specified commits appears to restore reliability.
==========
cc22522fd55e2 PCI: acpiphp: Use pci_assign_unassigned_bridge_resources() only for non-root bus
40613da52b13f PCI: acpiphp: Reassign resources on bridge if necessary
==========

Upstream has resolved the issue by reverting both commits through a commit placed below.
==========
5df12742b7e3a Revert "PCI: acpiphp: Reassign resources on bridge if necessary
==========

[Test Plan]
1. Create a VM
virt-install --name scsi_test --memory 2048 --vcpus 2 --boot uefi --disk path=/home/ubuntu/mantic-server-cloudimg-amd64.img,size=20,format=qcow2,bus=virtio -os-variant=ubuntu18.04 --graphics spice --network bridge=virbr0
2. Prepare two XMLs for adding two disk devices
# cat disk_X.xml
<disk type='file' device='disk'>
  <driver name='qemu' type='raw'/>
  <source file='XXX.img'/>
  <target dev='vdX' bus='virtio'/>
</disk>
3. Hotplug disks and check for success
virsh attach-device scsi_test disk_X.xml

[Where problems could occur]
The patch reverts two commits that previously addressed long-standing issues related to hotplugging devices with large BARs.
While this reversion may reintroduce legacy issues, it does not introduce new problems.
The associated risks are deemed low, making it worthwhile to address timing issues during the hotplugging of SCSI disks in QEMU VM.

Bjorn Helgaas (1):
  Revert "PCI: acpiphp: Reassign resources on bridge if necessary"

 drivers/pci/hotplug/acpiphp_glue.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

Comments

Tim Gardner Jan. 3, 2024, 4:54 p.m. UTC | #1
On 12/25/23 11:26 PM, Chengen Du wrote:
> BugLink: https://bugs.launchpad.net/bugs/2047382
> 
> SRU Justification:
> 
> [Impact]
> Hot-plugging SCSI disks for QEMU VMs booting with UEFI and using guest kernels >= 6.5 might be broken.
> The inconsistency suggests a potential race condition.
> 
> [Fix]
> Reverting the two specified commits appears to restore reliability.
> ==========
> cc22522fd55e2 PCI: acpiphp: Use pci_assign_unassigned_bridge_resources() only for non-root bus
> 40613da52b13f PCI: acpiphp: Reassign resources on bridge if necessary
> ==========
> 
> Upstream has resolved the issue by reverting both commits through a commit placed below.
> ==========
> 5df12742b7e3a Revert "PCI: acpiphp: Reassign resources on bridge if necessary
> ==========
> 
> [Test Plan]
> 1. Create a VM
> virt-install --name scsi_test --memory 2048 --vcpus 2 --boot uefi --disk path=/home/ubuntu/mantic-server-cloudimg-amd64.img,size=20,format=qcow2,bus=virtio -os-variant=ubuntu18.04 --graphics spice --network bridge=virbr0
> 2. Prepare two XMLs for adding two disk devices
> # cat disk_X.xml
> <disk type='file' device='disk'>
>    <driver name='qemu' type='raw'/>
>    <source file='XXX.img'/>
>    <target dev='vdX' bus='virtio'/>
> </disk>
> 3. Hotplug disks and check for success
> virsh attach-device scsi_test disk_X.xml
> 
> [Where problems could occur]
> The patch reverts two commits that previously addressed long-standing issues related to hotplugging devices with large BARs.
> While this reversion may reintroduce legacy issues, it does not introduce new problems.
> The associated risks are deemed low, making it worthwhile to address timing issues during the hotplugging of SCSI disks in QEMU VM.
> 
> Bjorn Helgaas (1):
>    Revert "PCI: acpiphp: Reassign resources on bridge if necessary"
> 
>   drivers/pci/hotplug/acpiphp_glue.c | 9 +++------
>   1 file changed, 3 insertions(+), 6 deletions(-)
> 

You mention reverting 2 patches, but I only see one.
Chengen Du Jan. 4, 2024, 2:42 a.m. UTC | #2
Hi Tim,

Upstream has reverted two commits in a single commit, and you can find it here:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5df12742b7e3aae2594a30a9d14d5d6e9e7699f4

I have directly backported this commit to address the revert of the
related commits.

Best regards,
Chengen Du

On Thu, Jan 4, 2024 at 12:54 AM Tim Gardner <tim.gardner@canonical.com> wrote:
>
> On 12/25/23 11:26 PM, Chengen Du wrote:
> > BugLink: https://bugs.launchpad.net/bugs/2047382
> >
> > SRU Justification:
> >
> > [Impact]
> > Hot-plugging SCSI disks for QEMU VMs booting with UEFI and using guest kernels >= 6.5 might be broken.
> > The inconsistency suggests a potential race condition.
> >
> > [Fix]
> > Reverting the two specified commits appears to restore reliability.
> > ==========
> > cc22522fd55e2 PCI: acpiphp: Use pci_assign_unassigned_bridge_resources() only for non-root bus
> > 40613da52b13f PCI: acpiphp: Reassign resources on bridge if necessary
> > ==========
> >
> > Upstream has resolved the issue by reverting both commits through a commit placed below.
> > ==========
> > 5df12742b7e3a Revert "PCI: acpiphp: Reassign resources on bridge if necessary
> > ==========
> >
> > [Test Plan]
> > 1. Create a VM
> > virt-install --name scsi_test --memory 2048 --vcpus 2 --boot uefi --disk path=/home/ubuntu/mantic-server-cloudimg-amd64.img,size=20,format=qcow2,bus=virtio -os-variant=ubuntu18.04 --graphics spice --network bridge=virbr0
> > 2. Prepare two XMLs for adding two disk devices
> > # cat disk_X.xml
> > <disk type='file' device='disk'>
> >    <driver name='qemu' type='raw'/>
> >    <source file='XXX.img'/>
> >    <target dev='vdX' bus='virtio'/>
> > </disk>
> > 3. Hotplug disks and check for success
> > virsh attach-device scsi_test disk_X.xml
> >
> > [Where problems could occur]
> > The patch reverts two commits that previously addressed long-standing issues related to hotplugging devices with large BARs.
> > While this reversion may reintroduce legacy issues, it does not introduce new problems.
> > The associated risks are deemed low, making it worthwhile to address timing issues during the hotplugging of SCSI disks in QEMU VM.
> >
> > Bjorn Helgaas (1):
> >    Revert "PCI: acpiphp: Reassign resources on bridge if necessary"
> >
> >   drivers/pci/hotplug/acpiphp_glue.c | 9 +++------
> >   1 file changed, 3 insertions(+), 6 deletions(-)
> >
>
> You mention reverting 2 patches, but I only see one.
> --
> -----------
> Tim Gardner
> Canonical, Inc
>
Tim Gardner Jan. 4, 2024, 4:10 p.m. UTC | #3
On 1/3/24 7:42 PM, Chengen Du wrote:
> Hi Tim,
> 
> Upstream has reverted two commits in a single commit, and you can find it here:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5df12742b7e3aae2594a30a9d14d5d6e9e7699f4
> 
> I have directly backported this commit to address the revert of the
> related commits.
> 

Indeed. Must read for content...

> Best regards,
> Chengen Du
> 
> On Thu, Jan 4, 2024 at 12:54 AM Tim Gardner <tim.gardner@canonical.com> wrote:
>>
>> On 12/25/23 11:26 PM, Chengen Du wrote:
>>> BugLink: https://bugs.launchpad.net/bugs/2047382
>>>
>>> SRU Justification:
>>>
>>> [Impact]
>>> Hot-plugging SCSI disks for QEMU VMs booting with UEFI and using guest kernels >= 6.5 might be broken.
>>> The inconsistency suggests a potential race condition.
>>>
>>> [Fix]
>>> Reverting the two specified commits appears to restore reliability.
>>> ==========
>>> cc22522fd55e2 PCI: acpiphp: Use pci_assign_unassigned_bridge_resources() only for non-root bus
>>> 40613da52b13f PCI: acpiphp: Reassign resources on bridge if necessary
>>> ==========
>>>
>>> Upstream has resolved the issue by reverting both commits through a commit placed below.
>>> ==========
>>> 5df12742b7e3a Revert "PCI: acpiphp: Reassign resources on bridge if necessary
>>> ==========
>>>
>>> [Test Plan]
>>> 1. Create a VM
>>> virt-install --name scsi_test --memory 2048 --vcpus 2 --boot uefi --disk path=/home/ubuntu/mantic-server-cloudimg-amd64.img,size=20,format=qcow2,bus=virtio -os-variant=ubuntu18.04 --graphics spice --network bridge=virbr0
>>> 2. Prepare two XMLs for adding two disk devices
>>> # cat disk_X.xml
>>> <disk type='file' device='disk'>
>>>     <driver name='qemu' type='raw'/>
>>>     <source file='XXX.img'/>
>>>     <target dev='vdX' bus='virtio'/>
>>> </disk>
>>> 3. Hotplug disks and check for success
>>> virsh attach-device scsi_test disk_X.xml
>>>
>>> [Where problems could occur]
>>> The patch reverts two commits that previously addressed long-standing issues related to hotplugging devices with large BARs.
>>> While this reversion may reintroduce legacy issues, it does not introduce new problems.
>>> The associated risks are deemed low, making it worthwhile to address timing issues during the hotplugging of SCSI disks in QEMU VM.
>>>
>>> Bjorn Helgaas (1):
>>>     Revert "PCI: acpiphp: Reassign resources on bridge if necessary"
>>>
>>>    drivers/pci/hotplug/acpiphp_glue.c | 9 +++------
>>>    1 file changed, 3 insertions(+), 6 deletions(-)
>>>
>>
>> You mention reverting 2 patches, but I only see one.
>> --
>> -----------
>> Tim Gardner
>> Canonical, Inc
>>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Manuel Diewald Jan. 5, 2024, 10:33 a.m. UTC | #4
On Tue, Dec 26, 2023 at 02:26:11PM +0800, Chengen Du wrote:
> BugLink: https://bugs.launchpad.net/bugs/2047382
> 
> SRU Justification:
> 
> [Impact]
> Hot-plugging SCSI disks for QEMU VMs booting with UEFI and using guest kernels >= 6.5 might be broken.
> The inconsistency suggests a potential race condition.
> 
> [Fix]
> Reverting the two specified commits appears to restore reliability.
> ==========
> cc22522fd55e2 PCI: acpiphp: Use pci_assign_unassigned_bridge_resources() only for non-root bus
> 40613da52b13f PCI: acpiphp: Reassign resources on bridge if necessary
> ==========
> 
> Upstream has resolved the issue by reverting both commits through a commit placed below.
> ==========
> 5df12742b7e3a Revert "PCI: acpiphp: Reassign resources on bridge if necessary
> ==========
> 
> [Test Plan]
> 1. Create a VM
> virt-install --name scsi_test --memory 2048 --vcpus 2 --boot uefi --disk path=/home/ubuntu/mantic-server-cloudimg-amd64.img,size=20,format=qcow2,bus=virtio -os-variant=ubuntu18.04 --graphics spice --network bridge=virbr0
> 2. Prepare two XMLs for adding two disk devices
> # cat disk_X.xml
> <disk type='file' device='disk'>
>   <driver name='qemu' type='raw'/>
>   <source file='XXX.img'/>
>   <target dev='vdX' bus='virtio'/>
> </disk>
> 3. Hotplug disks and check for success
> virsh attach-device scsi_test disk_X.xml
> 
> [Where problems could occur]
> The patch reverts two commits that previously addressed long-standing issues related to hotplugging devices with large BARs.
> While this reversion may reintroduce legacy issues, it does not introduce new problems.
> The associated risks are deemed low, making it worthwhile to address timing issues during the hotplugging of SCSI disks in QEMU VM.
> 
> Bjorn Helgaas (1):
>   Revert "PCI: acpiphp: Reassign resources on bridge if necessary"
> 
>  drivers/pci/hotplug/acpiphp_glue.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> -- 
> 2.40.1
> 
> 
> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team

Acked-by: Manuel Diewald <manuel.diewald@canonical.com>
Roxana Nicolescu Jan. 5, 2024, 11:25 a.m. UTC | #5
On 26/12/2023 07:26, Chengen Du wrote:
> BugLink: https://bugs.launchpad.net/bugs/2047382
>
> SRU Justification:
>
> [Impact]
> Hot-plugging SCSI disks for QEMU VMs booting with UEFI and using guest kernels >= 6.5 might be broken.
> The inconsistency suggests a potential race condition.
>
> [Fix]
> Reverting the two specified commits appears to restore reliability.
> ==========
> cc22522fd55e2 PCI: acpiphp: Use pci_assign_unassigned_bridge_resources() only for non-root bus
> 40613da52b13f PCI: acpiphp: Reassign resources on bridge if necessary
> ==========
>
> Upstream has resolved the issue by reverting both commits through a commit placed below.
> ==========
> 5df12742b7e3a Revert "PCI: acpiphp: Reassign resources on bridge if necessary
> ==========
>
> [Test Plan]
> 1. Create a VM
> virt-install --name scsi_test --memory 2048 --vcpus 2 --boot uefi --disk path=/home/ubuntu/mantic-server-cloudimg-amd64.img,size=20,format=qcow2,bus=virtio -os-variant=ubuntu18.04 --graphics spice --network bridge=virbr0
> 2. Prepare two XMLs for adding two disk devices
> # cat disk_X.xml
> <disk type='file' device='disk'>
>    <driver name='qemu' type='raw'/>
>    <source file='XXX.img'/>
>    <target dev='vdX' bus='virtio'/>
> </disk>
> 3. Hotplug disks and check for success
> virsh attach-device scsi_test disk_X.xml
>
> [Where problems could occur]
> The patch reverts two commits that previously addressed long-standing issues related to hotplugging devices with large BARs.
> While this reversion may reintroduce legacy issues, it does not introduce new problems.
> The associated risks are deemed low, making it worthwhile to address timing issues during the hotplugging of SCSI disks in QEMU VM.
>
> Bjorn Helgaas (1):
>    Revert "PCI: acpiphp: Reassign resources on bridge if necessary"
>
>   drivers/pci/hotplug/acpiphp_glue.c | 9 +++------
>   1 file changed, 3 insertions(+), 6 deletions(-)
>
Applied to mantic, lunar, jammy, focal master-next branch. Thanks!
Stefan Bader Jan. 12, 2024, 10 a.m. UTC | #6
On 26.12.23 07:26, Chengen Du wrote:
> BugLink: https://bugs.launchpad.net/bugs/2047382
> 
> SRU Justification:
> 
> [Impact]
> Hot-plugging SCSI disks for QEMU VMs booting with UEFI and using guest kernels >= 6.5 might be broken.
> The inconsistency suggests a potential race condition.
> 
> [Fix]
> Reverting the two specified commits appears to restore reliability.
> ==========
> cc22522fd55e2 PCI: acpiphp: Use pci_assign_unassigned_bridge_resources() only for non-root bus
> 40613da52b13f PCI: acpiphp: Reassign resources on bridge if necessary
> ==========
> 
> Upstream has resolved the issue by reverting both commits through a commit placed below.
> ==========
> 5df12742b7e3a Revert "PCI: acpiphp: Reassign resources on bridge if necessary
> ==========
> 
> [Test Plan]
> 1. Create a VM
> virt-install --name scsi_test --memory 2048 --vcpus 2 --boot uefi --disk path=/home/ubuntu/mantic-server-cloudimg-amd64.img,size=20,format=qcow2,bus=virtio -os-variant=ubuntu18.04 --graphics spice --network bridge=virbr0
> 2. Prepare two XMLs for adding two disk devices
> # cat disk_X.xml
> <disk type='file' device='disk'>
>    <driver name='qemu' type='raw'/>
>    <source file='XXX.img'/>
>    <target dev='vdX' bus='virtio'/>
> </disk>
> 3. Hotplug disks and check for success
> virsh attach-device scsi_test disk_X.xml
> 
> [Where problems could occur]
> The patch reverts two commits that previously addressed long-standing issues related to hotplugging devices with large BARs.
> While this reversion may reintroduce legacy issues, it does not introduce new problems.
> The associated risks are deemed low, making it worthwhile to address timing issues during the hotplugging of SCSI disks in QEMU VM.
> 
> Bjorn Helgaas (1):
>    Revert "PCI: acpiphp: Reassign resources on bridge if necessary"
> 
>   drivers/pci/hotplug/acpiphp_glue.c | 9 +++------
>   1 file changed, 3 insertions(+), 6 deletions(-)
> 

Rejected for the following reasons:
- The change is already included in Noble with 6.7.

-Stefan