From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:55143) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QgOnQ-0007Mg-Fb for qemu-devel@nongnu.org; Mon, 11 Jul 2011 18:17:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QgOnO-0005yX-5a for qemu-devel@nongnu.org; Mon, 11 Jul 2011 18:17:44 -0400 Received: from fmmailgate01.web.de ([217.72.192.221]:33142) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QgOnN-0005xU-Ak for qemu-devel@nongnu.org; Mon, 11 Jul 2011 18:17:41 -0400 Message-ID: <4E1B767E.7010606@web.de> Date: Tue, 12 Jul 2011 00:17:34 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <1305826546-19059-4-git-send-email-stefano.stabellini@eu.citrix.com> In-Reply-To: <1305826546-19059-4-git-send-email-stefano.stabellini@eu.citrix.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig699221E360C68F25B511A350" Sender: jan.kiszka@web.de Subject: Re: [Qemu-devel] [PATCH v2 4/5] exec.c: refactor cpu_physical_memory_map List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: stefano.stabellini@eu.citrix.com Cc: Stefan BOSAK , xen-devel@lists.xensource.com, qemu-devel@nongnu.org, agraf@suse.de This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig699221E360C68F25B511A350 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable On 2011-05-19 19:35, stefano.stabellini@eu.citrix.com wrote: > From: Stefano Stabellini >=20 > Introduce qemu_ram_ptr_length that takes an address and a size as > parameters rather than just an address. >=20 > Refactor cpu_physical_memory_map so that we call qemu_ram_ptr_length on= ly > once rather than calling qemu_get_ram_ptr one time per page. > This is not only more efficient but also tries to simplify the logic of= > the function. > Currently we are relying on the fact that all the pages are mapped > contiguously in qemu's address space: we have a check to make sure that= > the virtual address returned by qemu_get_ram_ptr from the second call o= n > is consecutive. Now we are making this more explicit replacing all the > calls to qemu_get_ram_ptr with a single call to qemu_ram_ptr_length > passing a size argument. This breaks cpu_physical_memory_map for >4G addresses on PC. Effectively, it doesn't account for the PCI gap, ie. that the RAM block is actually mapped in two chunks into the guest physical memory. One outcome is that QEMU aborts when we try to process an address that is now "outside" RAM. Simple to reproduce with a virtio NIC and 5G guest memory, even without KVM. Please fix or revert. Thanks, Jan --------------enig699221E360C68F25B511A350 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/ iEYEARECAAYFAk4bdn4ACgkQitSsb3rl5xS9sgCgq9oL0cVw1RI8w4+SVcAm3IPA S8kAoK7nnmt/V9RjkQFsTNVVIVLGVDGu =IHxY -----END PGP SIGNATURE----- --------------enig699221E360C68F25B511A350--