qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Maxim Levitsky <mlevitsk@redhat.com>
To: qemu-devel@nongnu.org
Cc: Maxim Levitsky <mlevitsk@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>
Subject: [PATCH 0/1] RFC: pcie: parital fix for missing unplug events
Date: Wed, 22 Jul 2020 19:17:21 +0300	[thread overview]
Message-ID: <20200722161722.51416-1-mlevitsk@redhat.com> (raw)

As described in bugzilla #1854264 it is possible to plug
a pcie device and then unplug it before the guest notices
(has time to process the attention button press)

To partially fix this issue, detect and refuse the hotunplug event.

There are other ways to fix this, which is why I am sending this as RFC:

1. Queue/remember the unplug event and fire it (press the attention button again),
when the guest clears its pending status.
According to the spec this should cancel the hotplug event in the guest
if done within 5 seconds (and I think that guest actually should wait 5 seconds
after attention button is pressed before plugging in the device too to be strictly
up to the spec)

2. Detect that device isn't yet powered on by the guest (for example
checking the bus master bit) or check that attention button is still
pressed and in this case just unplug the device immediately.

Best regards,
	Maxim Levitsky

Maxim Levitsky (1):
  pci/pcie: refuse another hotplug/unplug event if attention button is
    pending

 hw/pci/pcie.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

-- 
2.26.2




             reply	other threads:[~2020-07-22 16:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-22 16:17 Maxim Levitsky [this message]
2020-07-22 16:17 ` [PATCH 1/1] pci/pcie: refuse another hotplug/unplug event if attention button is pending Maxim Levitsky
2020-07-22 16:19   ` Maxim Levitsky
2020-07-29  5:09     ` Maxim Levitsky
2020-07-30 11:38       ` Igor Mammedov
2020-07-30 16:04   ` Michael S. Tsirkin
2020-07-30 16:05 ` [PATCH 0/1] RFC: pcie: parital fix for missing unplug events Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200722161722.51416-1-mlevitsk@redhat.com \
    --to=mlevitsk@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).