From: Gavin Shan <gwshan@linux.vnet.ibm.com>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: david@gibson.dropbear.id.au, qemu-ppc@nongnu.org,
Gavin Shan <gwshan@linux.vnet.ibm.com>,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH 2/3] VFIO: Clear INTx pending state on EEH reset
Date: Tue, 17 Mar 2015 02:38:26 +1100 [thread overview]
Message-ID: <20150316153826.GA8718@shangw> (raw)
In-Reply-To: <1426518327.3643.177.camel@redhat.com>
On Mon, Mar 16, 2015 at 09:05:27AM -0600, Alex Williamson wrote:
>On Tue, 2015-03-17 at 01:34 +1100, Gavin Shan wrote:
>> On Mon, Mar 16, 2015 at 03:05:32PM +1100, Benjamin Herrenschmidt wrote:
>> >On Mon, 2015-03-16 at 12:04 +1100, Gavin Shan wrote:
>> >>
>> >> (2) QEMU sends IOCTL commands to host to disable MSIx and enable INTx. At
>> >> this stage the INTx is still masked. At later point, the guest is requesting
>> >> unmasking INTx, which is captured by host. Host checks and founds pending
>> >> INTx, which is sent to QEMU. In QEMU INTx handler (vfio_intx_interrupt()),
>> >> the mmap'ed regions are disabled, "intx.pending" is set and a timer is started
>> >> to reenable mmap'ed regions if "intx.pending" is cleared there. However,
>> >> "intx.pending" is only cleared upon BAR access in slow path, which is never
>> >> happing.
>> >>
>> >> (3) After guest disables MSIx and issue EEH reset, the device driver starts
>> >> to check its firmware state by reading MMIO register, which isn't completed
>> >> by QEMU VFIO BAR slow path (Note: fast path supported by mmaped regions have
>> >> been disabled). Eventually, the guest hangs on reading MMIO register. With
>> >> this patch applied to QEMU, I didn't see the problem again.
>> >
>> >Note that it might be a good idea to disable INTx (and synchronize with a cfg
>> >read of some sort) around resetting a device.
>> >
>> >Otherwise, you may hit a known issue if the device is behind a switch and has
>> >sent the INTx "assert" message, and not the "deassert" one before it gets reset.
>> >
>> >That can cause the INTx to effectively be "stuck" in the switch preventing a
>> >subsequent one from being delivered.
>> >
>>
>> Yeah, It makes more sense to disable INTx before issuing EEH reset. I verified
>> that disabling INTx interrupt upon EEH reset can avoid the issue as well. I'll
>> post updated patch accordingly if Alex Williamson doesn't object.
>
>That sounds like a cleaner approach, but you seem to be skipping
>something around why the slow-path clearing of intx.pending isn't
>working for you. Step (2) says "... is only cleared upon BAR access in
>slow path, which is never happening." Step (3) "the device driver
>starts to check its firmware state by reading MMIO register, which isn't
>completed by QEMU VFIO BAR slow path". So it sounds like (3) is doing
>exactly what should allow the QEMU path INTx state machine to advance,
>so why doesn't it work? Thanks,
>
Thanks for confirm. I'll send out v2 tomorrow.
Nope, I'm not skipping why the slow path doesn't work. I didn't
understand well on how the QEMU memory model works together with
KVM. I need more time to trace and update with the findings.
Thanks,
Gavin
>Alex
>
>
next prev parent reply other threads:[~2015-03-16 15:39 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-11 6:11 [Qemu-devel] [PATCH 1/3] VFIO: Clear stale MSIx table during EEH reset Gavin Shan
2015-03-11 6:11 ` [Qemu-devel] [PATCH 2/3] VFIO: Clear INTx pending state on " Gavin Shan
2015-03-12 1:48 ` David Gibson
2015-03-12 3:07 ` Gavin Shan
2015-03-13 21:51 ` Alex Williamson
2015-03-16 1:04 ` Gavin Shan
2015-03-16 4:05 ` [Qemu-devel] [Qemu-ppc] " Benjamin Herrenschmidt
2015-03-16 14:34 ` Gavin Shan
2015-03-16 15:05 ` Alex Williamson
2015-03-16 15:38 ` Gavin Shan [this message]
2015-03-11 6:11 ` [Qemu-devel] [PATCH 3/3] sPAPR: Reenable EEH functionality on reboot Gavin Shan
2015-03-12 1:04 ` [Qemu-devel] [PATCH 1/3] VFIO: Clear stale MSIx table during EEH reset David Gibson
2015-03-12 3:02 ` Gavin Shan
2015-03-13 21:33 ` Alex Williamson
2015-03-15 22:27 ` Gavin Shan
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=20150316153826.GA8718@shangw \
--to=gwshan@linux.vnet.ibm.com \
--cc=alex.williamson@redhat.com \
--cc=david@gibson.dropbear.id.au \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@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).