From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:49677) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SB7Ud-0002sl-Fu for qemu-devel@nongnu.org; Fri, 23 Mar 2012 12:37:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SB7Ua-0002fg-Nx for qemu-devel@nongnu.org; Fri, 23 Mar 2012 12:37:35 -0400 Received: from fmmailgate06.web.de ([217.72.192.247]:37052) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SB7Ua-0002fU-EZ for qemu-devel@nongnu.org; Fri, 23 Mar 2012 12:37:32 -0400 Received: from moweb002.kundenserver.de (moweb002.kundenserver.de [172.19.20.108]) by fmmailgate06.web.de (Postfix) with ESMTP id C88601036A41 for ; Fri, 23 Mar 2012 17:37:29 +0100 (CET) Message-ID: <4F6CA6C0.30701@web.de> Date: Fri, 23 Mar 2012 17:37:20 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <4F6B6508.7080205@web.de> <4F6C91E5.2030507@citrix.com> In-Reply-To: <4F6C91E5.2030507@citrix.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig5B3906DE2F2C831C4CC70495" Subject: Re: [Qemu-devel] [QEMU][RFC PATCH 3/6] memory: Add xen memory hook List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Julien Grall Cc: Avi Kivity , "xen-devel@lists.xensource.com" , "qemu-devel@nongnu.org" , Stefano Stabellini , Julian Pidancet This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig5B3906DE2F2C831C4CC70495 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 2012-03-23 16:08, Julien Grall wrote: > On 03/22/2012 05:44 PM, Jan Kiszka wrote: >>> >>> 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] =3D 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] =3D 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] =3D NULL; >>> } >>> + >>> + if (xen_enabled()) { >>> + xen_unmap_iorange(start, length, 0); >>> + } >>> + >>> for(i =3D start; i< start + length; i++) { >>> ioport_read_table[0][i] =3D NULL; >>> ioport_read_table[1][i] =3D NULL; >>> =20 >> memory_listener_register(xen_hooks, system_io)? >> =20 > QEMU doesn't seem to call region_add/region_del for ioport. > Moreover, some of ioport are directly register without > using memory hook (for example cirrus vga). >=20 > What is the best way to do it ? I haven't looked at details. Maybe it is just a combination of "use case not yet considered, but can easily be added" and "need to switch legacy code to new scheme". Then this still remains the better option than this hook. Avi? Jan --------------enig5B3906DE2F2C831C4CC70495 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk9spsMACgkQitSsb3rl5xRBEgCgulhHB9TYzl96HbXGaD45t2Qn Y/MAoNiPEbeVPw9+bGgIgxQ0VqeVETbR =a66w -----END PGP SIGNATURE----- --------------enig5B3906DE2F2C831C4CC70495--