qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: Blue Swirl <blauwirbel@gmail.com>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH, RFC 2/4] Convert PCI devices to use pci_register_memory()
Date: Mon, 24 May 2010 15:00:49 -0500	[thread overview]
Message-ID: <4BFADAF1.5000108@codemonkey.ws> (raw)
In-Reply-To: <AANLkTinjCm8Ayl2jpttx-FglTkuO_Qe1cDL-9TLFv90b@mail.gmail.com>

On 05/23/2010 03:34 PM, Blue Swirl wrote:
> Signed-off-by: Blue Swirl<blauwirbel@gmail.com>
> ---
>   hw/cirrus_vga.c   |   12 ++++++------
>   hw/e1000.c        |    2 +-
>   hw/eepro100.c     |    2 +-
>   hw/isa.h          |    1 +
>   hw/isa_mmio.c     |   18 ++++++++++++++++--
>   hw/lsi53c895a.c   |    4 ++--
>   hw/macio.c        |   24 ++++++++++++------------
>   hw/msix.c         |    4 ++--
>   hw/openpic.c      |    6 +++---
>   hw/pcnet.c        |    3 ++-
>   hw/rtl8139.c      |    2 +-
>   hw/sun4u.c        |    7 +++++--
>   hw/usb-ohci.c     |    2 +-
>   hw/vga-pci.c      |    4 ++--
>   hw/vmware_vga.c   |    7 +++----
>   hw/wdt_i6300esb.c |    2 +-
>   16 files changed, 59 insertions(+), 41 deletions(-)
>
> diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
> index ba48289..52e51e0 100644
> --- a/hw/cirrus_vga.c
> +++ b/hw/cirrus_vga.c
> @@ -3145,10 +3145,10 @@ static void cirrus_pci_lfb_map(PCIDevice *d,
> int region_num,
>       CirrusVGAState *s =&DO_UPCAST(PCICirrusVGAState, dev, d)->cirrus_vga;
>
>       /* XXX: add byte swapping apertures */
> -    cpu_register_physical_memory(addr, s->vga.vram_size,
> -				 s->cirrus_linear_io_addr);
> -    cpu_register_physical_memory(addr + 0x1000000, 0x400000,
> -				 s->cirrus_linear_bitblt_io_addr);
> +    pci_register_memory(d->bus, addr, s->vga.vram_size,
> +                        s->cirrus_linear_io_addr);
> +    pci_register_memory(d->bus, addr + 0x1000000, 0x400000,
> +                        s->cirrus_linear_bitblt_io_addr);
>    

It would probably be better to pass the PCIDevice instead of the bus.  
That would allow a per-device PCI IOMMU to be used (such as emulated VT-d).

Ultimately, I don't think devices should be handling their IO region 
mappings but I think this could be a reasonable intermediate solution.

Regards,

Anthony Liguori

      reply	other threads:[~2010-05-24 20:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-23 20:34 [Qemu-devel] [PATCH, RFC 2/4] Convert PCI devices to use pci_register_memory() Blue Swirl
2010-05-24 20:00 ` Anthony Liguori [this message]

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=4BFADAF1.5000108@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=blauwirbel@gmail.com \
    --cc=qemu-devel@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).