From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:42388) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvPTR-0001Iy-GI for qemu-devel@nongnu.org; Thu, 09 Feb 2012 03:35:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RvPTL-0007Rr-Jf for qemu-devel@nongnu.org; Thu, 09 Feb 2012 03:35:25 -0500 Received: from fmmailgate02.web.de ([217.72.192.227]:53996) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvPTL-0007Rk-BE for qemu-devel@nongnu.org; Thu, 09 Feb 2012 03:35:19 -0500 Received: from moweb002.kundenserver.de (moweb002.kundenserver.de [172.19.20.108]) by fmmailgate02.web.de (Postfix) with ESMTP id E52AE1C0B8540 for ; Thu, 9 Feb 2012 09:35:17 +0100 (CET) Message-ID: <4F338545.7090205@web.de> Date: Thu, 09 Feb 2012 09:35:17 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <5c058df627b83bf0c35c2e1dcd92b0a3fd301181.1328445531.git.jan.kiszka@web.de> In-Reply-To: <5c058df627b83bf0c35c2e1dcd92b0a3fd301181.1328445531.git.jan.kiszka@web.de> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigADB9551DF4C3E4D8595E89F1" Subject: [Qemu-devel] subpages with memory region aliases (was: [PATCH 3/6] kvmvapic: Introduce TPR access optimization for Windows guests) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: qemu-devel This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigADB9551DF4C3E4D8595E89F1 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Avi, Before I forget: On 2012-02-05 13:39, Jan Kiszka wrote: > +static void vapic_map_rom_writable(VAPICROMState *s) > +{ > + target_phys_addr_t rom_paddr =3D s->rom_state_paddr & ROM_BLOCK_MA= SK; > + MemoryRegionSection section; > + MemoryRegion *as; > + size_t rom_size; > + uint8_t *ram; > + > + as =3D sysbus_address_space(&s->busdev); > + > + if (s->rom_mapped_writable) { > + memory_region_del_subregion(as, &s->rom); > + memory_region_destroy(&s->rom); > + } > + > + /* grab RAM memory region (region @rom_paddr may still be pc.rom) = */ > + section =3D memory_region_find(as, 0, 1); > + > + /* read ROM size from RAM region */ > + ram =3D memory_region_get_ram_ptr(section.mr); > + rom_size =3D ram[rom_paddr + 2] * ROM_BLOCK_SIZE; > + s->rom_size =3D rom_size; > + > + /* FIXME: round up as everything underneath would fall apart other= wise > + * (subpages are broken) */ > + rom_size =3D TARGET_PAGE_ALIGN(rom_size); Removing this alignment triggers an interesting bug in the memory layer. Haven't understood the details yet. Is subpage support supposed to work? > + > + memory_region_init_alias(&s->rom, "kvmvapic-rom", section.mr, rom_= paddr, > + rom_size); > + memory_region_add_subregion_overlap(as, rom_paddr, &s->rom, 1000);= > + s->rom_mapped_writable =3D true; > +} Jan --------------enigADB9551DF4C3E4D8595E89F1 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/ iEYEARECAAYFAk8zhUUACgkQitSsb3rl5xT10ACfYSH5sNeXx/8smqBDQBEFgdq0 CuwAni6uo/j4jTy28DHXKSUHjvdp16Fs =jN4e -----END PGP SIGNATURE----- --------------enigADB9551DF4C3E4D8595E89F1--