qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gavin Shan <gwshan@linux.vnet.ibm.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Alex Williamson <alex.williamson@redhat.com>,
	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 01:34:25 +1100	[thread overview]
Message-ID: <20150316143425.GA6946@shangw> (raw)
In-Reply-To: <1426478732.17565.227.camel@kernel.crashing.org>

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.

Thanks,
Gavin

>Cheers,
>Ben.
>
>

  reply	other threads:[~2015-03-16 14:34 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 [this message]
2015-03-16 15:05           ` Alex Williamson
2015-03-16 15:38             ` Gavin Shan
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=20150316143425.GA6946@shangw \
    --to=gwshan@linux.vnet.ibm.com \
    --cc=alex.williamson@redhat.com \
    --cc=benh@kernel.crashing.org \
    --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).