public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: kvm <kvm@vger.kernel.org>
Subject: vfio/dev-assignment: potential pci_block_user_cfg_access nesting
Date: Tue, 23 Aug 2011 15:31:44 +0200	[thread overview]
Message-ID: <4E53ABC0.9070202@siemens.com> (raw)

Hi Alex,

just ran into some corner case with my reanimated IRQ sharing patches
that may affect vfio as well:

How are vfio_enable/disable_intx synchronized against all other possible
spots that call pci_block_user_cfg_access?

I hit the recursion bug check in pci_block_user_cfg_access with my code
which takes the user_cfg lock like vfio does. It likely races with
pci_reset_function here - and should do so in vfio as well.

Just taking some lock would mean having to run pci_reset_function with
IRQs disabled to synchronize with the IRQ handler (not sure if that is
possible at all). Alternatively, we would have to disable the interrupt
line or deregister the IRQ while resetting. Or we perform INTx mask
manipulation in an unsynchronized fashion, resolving races with user
space differently (still need to think about this option).

Any other thoughts?

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux

             reply	other threads:[~2011-08-23 13:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-23 13:31 Jan Kiszka [this message]
2011-08-23 22:05 ` vfio/dev-assignment: potential pci_block_user_cfg_access nesting Alex Williamson
2011-08-24  9:09   ` Jan Kiszka
2011-08-24 15:10     ` Alex Williamson

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=4E53ABC0.9070202@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=alex.williamson@redhat.com \
    --cc=kvm@vger.kernel.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