qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@web.de>
To: Julien Grall <julien.grall@citrix.com>
Cc: xen-devel@lists.xensource.com, qemu-devel@nongnu.org,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	julian.pidancet@citrix.com
Subject: Re: [Qemu-devel] [QEMU][RFC PATCH 3/6] memory: Add xen memory hook
Date: Thu, 22 Mar 2012 18:44:40 +0100	[thread overview]
Message-ID: <4F6B6508.7080205@web.de> (raw)
In-Reply-To: <e423998b589b9ce6cfef087f0af6f37f4277da46.1332430835.git.julien.grall@citrix.com>

[-- Attachment #1: Type: text/plain, Size: 3207 bytes --]

On 2012-03-22 17:01, Julien Grall wrote:
> QEMU will now register all memory range (PIO and MMIO) in Xen.
> We distinct two phases in memory registered :
>   - initialization
>   - running
> 
> For all range registered during the initialization, QEMU will
> check with XenStore if it is authorized to use them.
> After the initialization, QEMU can register all range. Indeed,
> the new ranges will be for PCI Bar.
> 
> Signed-off-by: Julien Grall <julien.grall@citrix.com>
> ---
>  exec.c    |    9 ++++++
>  ioport.c  |   17 ++++++++++++
>  xen-all.c |   83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 109 insertions(+), 0 deletions(-)
> 
> diff --git a/exec.c b/exec.c
> index 780f63f..42d8c56 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -3557,12 +3557,21 @@ static void core_commit(MemoryListener *listener)
>  static void core_region_add(MemoryListener *listener,
>                              MemoryRegionSection *section)
>  {
> +    if (xen_enabled()) {
> +       xen_map_iorange(section->offset_within_address_space,
> +                       section->size, 1);
> +    }
> +
>      cpu_register_physical_memory_log(section, section->readonly);
>  }
>  
>  static void core_region_del(MemoryListener *listener,
>                              MemoryRegionSection *section)
>  {
> +    if (xen_enabled()) {
> +       xen_unmap_iorange(section->offset_within_address_space,
> +                       section->size, 1);
> +    }
>  }

memory_listener_register(xen_io_hooks, system_memory)?

>  
>  static void core_region_nop(MemoryListener *listener,
> diff --git a/ioport.c b/ioport.c
> index 78a3b89..073ed75 100644
> --- a/ioport.c
> +++ b/ioport.c
> @@ -28,6 +28,7 @@
>  #include "ioport.h"
>  #include "trace.h"
>  #include "memory.h"
> +#include "hw/xen.h"
>  
>  /***********************************************************/
>  /* IO Port */
> @@ -155,6 +156,11 @@ int register_ioport_read(pio_addr_t start, int length, int size,
>                       i);
>          ioport_opaque[i] = opaque;
>      }
> +
> +    if (xen_enabled()) {
> +        xen_map_iorange(start, length, 0);
> +    }
> +
>      return 0;
>  }
>  
> @@ -175,7 +181,13 @@ int register_ioport_write(pio_addr_t start, int length, int size,
>                       i);
>          ioport_opaque[i] = opaque;
>      }
> +
> +    if (xen_enabled()) {
> +        xen_map_iorange(start, length, 0);
> +    }
> +
>      return 0;
> +
>  }
>  
>  static uint32_t ioport_readb_thunk(void *opaque, uint32_t addr)
> @@ -260,6 +272,11 @@ void isa_unassign_ioport(pio_addr_t start, int length)
>          ioport_destructor_table[start](ioport_opaque[start]);
>          ioport_destructor_table[start] = NULL;
>      }
> +
> +    if (xen_enabled()) {
> +        xen_unmap_iorange(start, length, 0);
> +    }
> +
>      for(i = start; i < start + length; i++) {
>          ioport_read_table[0][i] = NULL;
>          ioport_read_table[1][i] = NULL;

memory_listener_register(xen_hooks, system_io)?

Even if that is not yet powerful enough, tuning the hooks is usually
better than open-coding.

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

  reply	other threads:[~2012-03-22 17:44 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-22 16:01 [Qemu-devel] [QEMU][RFC PATCH 0/6] QEMU disaggregation Julien Grall
2012-03-22 16:01 ` [Qemu-devel] [QEMU][RFC PATCH 1/6] option: Add -xen-dmid Julien Grall
2012-03-22 17:36   ` Jan Kiszka
2012-03-23 10:42     ` Stefano Stabellini
2012-03-22 16:01 ` [Qemu-devel] [QEMU][RFC PATCH 2/6] xen: Add functions to register PCI and IO in Xen Julien Grall
2012-03-23 10:44   ` Stefano Stabellini
2012-03-22 16:01 ` [Qemu-devel] [QEMU][RFC PATCH 3/6] memory: Add xen memory hook Julien Grall
2012-03-22 17:44   ` Jan Kiszka [this message]
2012-03-23 15:08     ` Julien Grall
2012-03-23 16:37       ` Jan Kiszka
2012-03-25 10:44         ` Avi Kivity
2012-03-26 11:01           ` Stefano Stabellini
2012-03-26 11:02             ` Avi Kivity
2012-03-26 11:24               ` Julien Grall
2012-03-26 13:13                 ` Avi Kivity
2012-03-23 16:47   ` Anthony Liguori
2012-03-22 16:01 ` [Qemu-devel] [QEMU][RFC PATCH 4/6] xen-pci: Register PCI in Xen Julien Grall
2012-03-22 17:47   ` Jan Kiszka
2012-03-22 19:58   ` Anthony Liguori
2012-03-23 11:02     ` Stefano Stabellini
2012-03-25 12:09       ` Avi Kivity
2012-03-26 11:45         ` Stefano Stabellini
2012-03-26 11:57           ` Avi Kivity
2012-03-26 12:20             ` Stefano Stabellini
2012-03-26 12:33               ` Avi Kivity
2012-03-26 13:56                 ` Stefano Stabellini
2012-03-22 16:01 ` [Qemu-devel] [QEMU][RFC PATCH 5/6] xen-io: Handle the new ioreq type IOREQ_TYPE_PCI_CONFIG Julien Grall
2012-03-22 16:01 ` [Qemu-devel] [QEMU][RFC PATCH 6/6] xen: handle qemu disaggregation Julien Grall
2012-03-23 11:07   ` Stefano Stabellini

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=4F6B6508.7080205@web.de \
    --to=jan.kiszka@web.de \
    --cc=julian.pidancet@citrix.com \
    --cc=julien.grall@citrix.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /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).