From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=43552 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q4ykd-0004Qv-9j for qemu-devel@nongnu.org; Wed, 30 Mar 2011 13:00:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q4ykb-0003fb-T4 for qemu-devel@nongnu.org; Wed, 30 Mar 2011 13:00:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:15152) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q4ykb-0003f2-Ho for qemu-devel@nongnu.org; Wed, 30 Mar 2011 13:00:09 -0400 Date: Wed, 30 Mar 2011 18:59:41 +0200 From: "Michael S. Tsirkin" Subject: Re: [Qemu-devel] [PATCH 3/3] vhost: roll our own cpu map variant Message-ID: <20110330165941.GA27472@redhat.com> References: <20110330160953.GB26439@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: kwolf@redhat.com, gleb@redhat.com, Jes Sorensen , Jason Wang , qemu-devel@nongnu.org, armbru@redhat.com, Christoph Hellwig , Alex Williamson , Amit Shah On Wed, Mar 30, 2011 at 05:26:22PM +0100, Stefan Hajnoczi wrote: > On Wed, Mar 30, 2011 at 5:09 PM, Michael S. Tsirkin wr= ote: > > On Tue, Mar 29, 2011 at 11:53:54AM +0100, Stefan Hajnoczi wrote: > >> On Mon, Mar 28, 2011 at 10:14 PM, Michael S. Tsirkin wrote: > >> > vhost used cpu_physical_memory_map to get the > >> > virtual address for the ring, however, > >> > this will exit on an illegal RAM address. > >> > Since the addresses are guest-controlled, we > >> > shouldn't do that. > >> > > >> > Switch to our own variant that uses the vhost > >> > tables and returns an error instead of exiting. > >> > >> We should make all of QEMU more robust instead of just vhost. =A0Per= haps > >> introduce cpu_physical_memory_map_nofail(...) that aborts like the > >> current cpu_physical_memory_map() implementation and then make non-h= w/ > >> users call that one. =A0hw/ users should check for failure. > >> > >> Stefan > > > > Yea, well ... at least vhost-net wants to also check > > it is given a ram address, not some other physical address. > > We could generally replace the memory management in vhost-net > > by some other logic, when that's done this one can > > go away as well. >=20 > Sounds like you do not want to refactor physical memory access for > non-vhost. Fair enough but we have to do it sooner or later in order > to make all of QEMU more robust. If vhost-net is protected but the > IDE CD-ROM and virtio-blk disk still have issues then we haven't > reached our goal yet. Any way I can convince you to do a generic API? > :) >=20 > Stefan If you are talking about splitting real ram from non ram and creating a generic API for that, you don't need to convince me, but I can't commit to implementing it right now. --=20 MST