All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@qumranet.com>
To: Laurent Vivier <Laurent.Vivier@bull.net>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH 7/7] qemu: delayed MMIO support (e1000)
Date: Mon, 26 May 2008 17:05:32 +0300	[thread overview]
Message-ID: <483AC3AC.30801@qumranet.com> (raw)
In-Reply-To: <12115326461790-git-send-email-Laurent.Vivier@bull.net>

Laurent Vivier wrote:
> This patch defines delayed MMIO zones for e1000 ethernet card.
>
> Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net>
> ---
>  qemu/hw/e1000.c |   17 +++++++++++++++++
>  1 files changed, 17 insertions(+), 0 deletions(-)
>
> diff --git a/qemu/hw/e1000.c b/qemu/hw/e1000.c
> index 01f8983..97f46f6 100644
> --- a/qemu/hw/e1000.c
> +++ b/qemu/hw/e1000.c
> @@ -26,6 +26,7 @@
>  #include "hw.h"
>  #include "pci.h"
>  #include "net.h"
> +#include "qemu-kvm.h"
>  
>  #include "e1000_hw.h"
>  
> @@ -938,6 +939,22 @@ e1000_mmio_map(PCIDevice *pci_dev, int region_num,
>  
>      d->mmio_base = addr;
>      cpu_register_physical_memory(addr, PNPMMIO_SIZE, d->mmio_index);
> +
> +    if (kvm_enabled()) {
> +        /* delayed zones are:
> +         * 0x00000 -> 0x000C0        exclude: E1000_ICR,4
> +         * 0x000C4 -> 0x00400        exclude: E1000_TCTL,4
> +         * 0x00404 -> 0x03818        exclude: E1000_TDT,4
> +         * 0x0381C -> 0x20000        PNPMMIO_SIZE
> +         */
> +        qemu_kvm_register_delayed_mmio(addr, E1000_ICR);
> +        qemu_kvm_register_delayed_mmio(addr + E1000_ICR + 4,
> +                                       E1000_TCTL - (E1000_ICR + 4));
> +        qemu_kvm_register_delayed_mmio(addr + E1000_TCTL + 4,
> +                                       E1000_TDT - (E1000_TCTL + 4));
> +        qemu_kvm_register_delayed_mmio(addr + E1000_TDT + 4,
> +                                       PNPMMIO_SIZE - (E1000_TDT + 4));
> +    }
>  }
>  

What about the calls to set_ics()?  They can cause interrupts to be 
deasserted AFAICS.  So IMC (and maybe a few other registers) need to be 
excluded as well.

Instead of hardcoding this, how about a

uint32_t delayed_mmi_excluded_regs[] = {
   E1000_ICR, E1000_TCTL, ...
};

The code can sort them and generate the ranges automatically.

(alternatively, a boolmap:

bool delayed_mmi_excluded_regs[] = {
  [E1000_ICR]: true, ...
};
)

-- 
error compiling committee.c: too many arguments to function


  reply	other threads:[~2008-05-26 14:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-23  8:50 [PATCH 0/7] kvm-userspace: Batch writes to MMIO Laurent Vivier
2008-05-23  8:50 ` [PATCH 1/7] libkvm: delayed MMIO support (common part) Laurent Vivier
2008-05-23  8:50   ` [PATCH 2/7] libkvm: delayed MMIO support (x86 part) Laurent Vivier
2008-05-23  8:50     ` [PATCH 3/7] libkvm: delayed MMIO support (powerpc part) Laurent Vivier
2008-05-23  8:50       ` [PATCH 4/7] libkvm: delayed MMIO support (ia64 part) Laurent Vivier
2008-05-23  8:50         ` [PATCH 5/7] qemu: delayed MMIO support (core) Laurent Vivier
2008-05-23  8:50           ` [PATCH 6/7] qemu: delayed MMIO support (VGA) Laurent Vivier
2008-05-23  8:50             ` [PATCH 7/7] qemu: delayed MMIO support (e1000) Laurent Vivier
2008-05-26 14:05               ` Avi Kivity [this message]
2008-05-26 14:27                 ` Laurent Vivier
2008-05-26 13:58             ` [PATCH 6/7] qemu: delayed MMIO support (VGA) Avi Kivity
2008-05-26 13:55   ` [PATCH 1/7] libkvm: delayed MMIO support (common part) Avi Kivity
2008-05-26 14:15     ` Laurent Vivier

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=483AC3AC.30801@qumranet.com \
    --to=avi@qumranet.com \
    --cc=Laurent.Vivier@bull.net \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.