[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 1/1] pcie: Add hotplug detect state register to cmask
From: |
Leonardo Bras Soares Passos |
Subject: |
Re: [PATCH v2 1/1] pcie: Add hotplug detect state register to cmask |
Date: |
Thu, 6 Jul 2023 15:37:48 -0300 |
On Thu, Jul 6, 2023 at 3:24 PM Peter Xu <peterx@redhat.com> wrote:
>
> On Thu, Jul 06, 2023 at 03:07:40PM -0300, Leonardo Bras Soares Passos wrote:
> > > I asked the same question, and I still keep confused: whether there's a
> > > first bad commit? Starting from when it fails?
> > >
> > > For example, is this broken on 6.0 binaries too with pc-q35-6.0?
> >
> > I tested for qemu 6.0, and it still reproduces, but have not pursued
> > this any further.
>
> I see, thanks!
>
> But then do you know why it's never hit before? I assume it means this bug
> has been there for a long time.
Oh, I totally missed updating the commit msg on this:
---
In this scenario, hotplug_handler_plug() calls pcie_cap_slot_plug_cb(),
which sets dev->config byte 0x6e with bit PCI_EXP_SLTSTA_PDS to signal PCI
- hotplug for the guest. After a while the guest will deal with this hotplug
- and qemu will clear the above bit.
+ hotplug for the guest. After a while, if the guest powers down the device
+ qemu will clear the above bit.
---
The whole idea is that the guest powers down the device, which causes
qemu to hot-remove it, and clear PCI_EXP_SLTSTA_PDS.
---
/*
* If the slot is populated, power indicator is off and power
* controller is off, it is safe to detach the devices.
*
* Note: don't detach if condition was already true:
* this is a work around for guests that overwrite
* control of powered off slots before powering them on.
*/
if ((sltsta & PCI_EXP_SLTSTA_PDS) && pcie_sltctl_powered_off(val) &&
!pcie_sltctl_powered_off(old_slt_ctl))
{
pcie_cap_slot_do_unplug(dev); // clear PCI_EXP_SLTSTA_PDS
}
---
Since the bit is different on source & target qemu, the migration is aborted.
>
> --
> Peter Xu
>
Thanks for reviewing Peter!
I will send a v3 with the updated commit msg and add the comments
suggested by Juan in the source code.
Thanks!
Leo
- [PATCH v2 1/1] pcie: Add hotplug detect state register to cmask, Leonardo Bras, 2023/07/06
- Re: [PATCH v2 1/1] pcie: Add hotplug detect state register to cmask, Juan Quintela, 2023/07/06
- Re: [PATCH v2 1/1] pcie: Add hotplug detect state register to cmask, Peter Xu, 2023/07/06
- Re: [PATCH v2 1/1] pcie: Add hotplug detect state register to cmask, Leonardo Bras Soares Passos, 2023/07/06
- Re: [PATCH v2 1/1] pcie: Add hotplug detect state register to cmask, Peter Xu, 2023/07/06
- Re: [PATCH v2 1/1] pcie: Add hotplug detect state register to cmask,
Leonardo Bras Soares Passos <=
- Re: [PATCH v2 1/1] pcie: Add hotplug detect state register to cmask, Michael S. Tsirkin, 2023/07/06
- Re: [PATCH v2 1/1] pcie: Add hotplug detect state register to cmask, Peter Xu, 2023/07/06
- Re: [PATCH v2 1/1] pcie: Add hotplug detect state register to cmask, Michael S. Tsirkin, 2023/07/06
- Re: [PATCH v2 1/1] pcie: Add hotplug detect state register to cmask, Peter Xu, 2023/07/06
- Re: [PATCH v2 1/1] pcie: Add hotplug detect state register to cmask, Leonardo Bras Soares Passos, 2023/07/10
- Re: [PATCH v2 1/1] pcie: Add hotplug detect state register to cmask, Michael S. Tsirkin, 2023/07/10
- Re: [PATCH v2 1/1] pcie: Add hotplug detect state register to cmask, Leonardo Bras Soares Passos, 2023/07/10
- Re: [PATCH v2 1/1] pcie: Add hotplug detect state register to cmask, Leonardo Bras Soares Passos, 2023/07/06