qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Gavin Shan <gwshan@linux.vnet.ibm.com>
Cc: Alex Williamson <alex.williamson@redhat.com>,
	qemu-ppc@nongnu.org, qemu-devel@nongnu.org,
	david@gibson.dropbear.id.au
Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH 2/3] VFIO: Clear INTx pending state on EEH reset
Date: Mon, 16 Mar 2015 15:05:32 +1100	[thread overview]
Message-ID: <1426478732.17565.227.camel@kernel.crashing.org> (raw)
In-Reply-To: <20150316010459.GA13680@shangw>

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.

Cheers,
Ben.

  reply	other threads:[~2015-03-16  4:05 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       ` Benjamin Herrenschmidt [this message]
2015-03-16 14:34         ` [Qemu-devel] [Qemu-ppc] " Gavin Shan
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=1426478732.17565.227.camel@kernel.crashing.org \
    --to=benh@kernel.crashing.org \
    --cc=alex.williamson@redhat.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=gwshan@linux.vnet.ibm.com \
    --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).