Re: [PATCH] pciehp: fast unplug for virtual machines

Lukas Wunner
2021-11-14T18:06:13Z

On Sun, Nov 14, 2021 at 12:24:43PM -0500, Michael S. Tsirkin wrote:
> On Sun, Nov 14, 2021 at 05:39:58PM +0100, Lukas Wunner wrote:
> > Why does virtual hardware implement the Attention Button if it's
> > perceived as annoying? Just amend qemu so that it doesn't advertise
> > presence of an Attention Button to get rid of the delay. (Clear the
> > Attention Button Present bit in the Slot Capabilities register.)
>
> Because we want ability to request device removal from outside the
> guest.

Please elaborate. Does "outside the guest" mean on the host?
How do you represent the Attention Button outside the guest
and route events through to the guest?

> > An Attention Button doesn't make any sense for virtual hardware
> > except to test or debug support for it in the kernel. Just make
> > presence of the Attention Button optional and be done with it.
> >
> > You'll still be able to bring down the slot in software via the
> > "remove" attribute in sysfs.
>
> This requires guest specific code though. Emulating the attention button
> works in a guest independent way.

It sounds like you're using the Attention Button because it does
almost, but not quite what you want for your specific use case.
Now you're trying to change its behavior in a way that deviates
from the spec to align it with your use case.

Why don't you just trigger surprise-removal from outside the guest?

Thanks,

Lukas