From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=58764 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q4yDx-0003yp-Js for qemu-devel@nongnu.org; Wed, 30 Mar 2011 12:26:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q4yDv-00032d-Nk for qemu-devel@nongnu.org; Wed, 30 Mar 2011 12:26:25 -0400 Received: from mail-gx0-f173.google.com ([209.85.161.173]:58300) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q4yDv-00032M-LU for qemu-devel@nongnu.org; Wed, 30 Mar 2011 12:26:23 -0400 Received: by gxk26 with SMTP id 26so671840gxk.4 for ; Wed, 30 Mar 2011 09:26:22 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20110330160953.GB26439@redhat.com> References: <20110330160953.GB26439@redhat.com> Date: Wed, 30 Mar 2011 17:26:22 +0100 Message-ID: Subject: Re: [Qemu-devel] [PATCH 3/3] vhost: roll our own cpu map variant From: Stefan Hajnoczi Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" 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 5:09 PM, Michael S. Tsirkin wrote: > 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 wr= ote: >> > 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. =A0Perhaps >> introduce cpu_physical_memory_map_nofail(...) that aborts like the >> current cpu_physical_memory_map() implementation and then make non-hw/ >> 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. 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? :) Stefan