public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: kvm <kvm@vger.kernel.org>
Subject: device-assignment: difference between assigned_dev_iomem_map and ...map_slow
Date: Thu, 21 Apr 2011 18:23:01 +0200	[thread overview]
Message-ID: <4DB059E5.7000003@siemens.com> (raw)

Hi,

latest qemu-kvm bails out on cleanup as it tries to call
cpu_register_physical_memory with a zero-sized region of an assigned
device. That made me dig into the setup/cleanup of memory mapped io
regions, trying to consolidate and fix the code.

What are the differences between normal and slow mmio regions? The
former are mapped directly to the physical device (via
qemu_ram_alloc_from_ptr + cpu_register_physical_memory), the latter have
to be dispatched in user land (thus cpu_register_io_memory +
cpu_register_physical_memory), right?

But why do we need to postpone cpu_register_io_memory to
assigned_dev_iomem_map_slow? It looks like that's effectively the only
difference between both mapping callbacks (subtracting some bugs and
dead code). Can't we set up the io region in
assigned_dev_register_regions analogously to normal regions?

BTW, the current code is leaking the slow io region on cleanup.

Comments appreciated, will translate them into a cleanup patch series.

Thanks,
Jan (who wanted to do something completely different...)

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

             reply	other threads:[~2011-04-21 16:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-21 16:23 Jan Kiszka [this message]
2011-04-21 16:44 ` device-assignment: difference between assigned_dev_iomem_map and ...map_slow 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=4DB059E5.7000003@siemens.com \
    --to=jan.kiszka@siemens.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