From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:33946) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvUu1-0006nT-GA for qemu-devel@nongnu.org; Thu, 09 Feb 2012 09:23:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RvUtz-0002Hp-UL for qemu-devel@nongnu.org; Thu, 09 Feb 2012 09:23:13 -0500 Received: from fmmailgate02.web.de ([217.72.192.227]:48632) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvUtz-0002HP-Iu for qemu-devel@nongnu.org; Thu, 09 Feb 2012 09:23:11 -0500 Received: from moweb001.kundenserver.de (moweb001.kundenserver.de [172.19.20.114]) by fmmailgate02.web.de (Postfix) with ESMTP id DEA731C0BACD9 for ; Thu, 9 Feb 2012 15:23:04 +0100 (CET) Message-ID: <4F33D6C7.4020304@web.de> Date: Thu, 09 Feb 2012 15:23:03 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <5c058df627b83bf0c35c2e1dcd92b0a3fd301181.1328445531.git.jan.kiszka@web.de> <4F338545.7090205@web.de> <4F3392A7.1020603@redhat.com> In-Reply-To: <4F3392A7.1020603@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigD6ED2280D56D0B89B762FF4C" Subject: Re: [Qemu-devel] subpages with memory region aliases 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) --------------enigD6ED2280D56D0B89B762FF4C Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable On 2012-02-09 10:32, Avi Kivity wrote: > On 02/09/2012 10:35 AM, Jan Kiszka wrote: >> 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_= MASK; >>> + 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 oth= erwise >>> + * (subpages are broken) */ >>> + rom_size =3D TARGET_PAGE_ALIGN(rom_size); >> >> Removing this alignment triggers an interesting bug in the memory laye= r. >> Haven't understood the details yet. Is subpage support supposed to wor= k? >> >> >=20 > There are plenty of restrictions wrt page size in the memory API. Some= > will be removed, some are enforced by hardware (for example the low bit= s > of the guest address and host address must match). >=20 > Subpage of course works, but it can't be direct mapped. >=20 Does this mean you can't use them with RAM backing? Should probably be documented and caught gracefully in that case. Jan --------------enigD6ED2280D56D0B89B762FF4C 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/ iEYEARECAAYFAk8z1scACgkQitSsb3rl5xT9DQCeJh3ZsEkPl4xxrMj2FI+mwjcW avUAoInoPwGYIihGdZU8C924SvXfncFf =U5Ip -----END PGP SIGNATURE----- --------------enigD6ED2280D56D0B89B762FF4C--