From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [Qemu-devel] [RFC v9 06/27] virtio-blk: Take PCI memory range into account Date: Thu, 19 Jul 2012 12:29:52 +0300 Message-ID: <5007D390.3090702@redhat.com> References: <1342624074-24650-1-git-send-email-stefanha@linux.vnet.ibm.com> <1342624074-24650-7-git-send-email-stefanha@linux.vnet.ibm.com> <20120718182950.GB2498@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: "Michael S. Tsirkin" , Stefan Hajnoczi , Kevin Wolf , Anthony Liguori , kvm@vger.kernel.org, qemu-devel@nongnu.org, Khoa Huynh , Paolo Bonzini , Asias He To: Stefan Hajnoczi Return-path: Received: from mx1.redhat.com ([209.132.183.28]:45852 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752462Ab2GSJaC (ORCPT ); Thu, 19 Jul 2012 05:30:02 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On 07/19/2012 12:16 PM, Stefan Hajnoczi wrote: > On Thu, Jul 19, 2012 at 10:14 AM, Stefan Hajnoczi wrote: >> On Wed, Jul 18, 2012 at 7:29 PM, Michael S. Tsirkin wrote: >>> On Wed, Jul 18, 2012 at 04:07:33PM +0100, Stefan Hajnoczi wrote: >>>> Support >4 GB physical memory accesses. >>>> >>>> Signed-off-by: Stefan Hajnoczi >>> >>> Need some sane APIs, this is just too scary. >> >> Yes, this prototype has (at least) two layering violations: >> 1. Bypassing QEMU's memory subsystem because it isn't thread-safe. > > Maybe we can use MemoryListener to fix this, although we need to take > care of thread-safety. Better to fix up the memory core. It should be relatively easy to rcu-ify it, as it already works by building a new memory map instead of updating it in place. Currently it has one root pointer, all that is needed is to build it into a temporary pointer, then use rcu_assign_pointer() to atomically switch the memory map. -- error compiling committee.c: too many arguments to function From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:58008) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Srn3i-0008Pw-LV for qemu-devel@nongnu.org; Thu, 19 Jul 2012 05:30:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Srn3Y-0002L0-LX for qemu-devel@nongnu.org; Thu, 19 Jul 2012 05:30:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:12513) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Srn3Y-0002Ko-CT for qemu-devel@nongnu.org; Thu, 19 Jul 2012 05:30:00 -0400 Message-ID: <5007D390.3090702@redhat.com> Date: Thu, 19 Jul 2012 12:29:52 +0300 From: Avi Kivity MIME-Version: 1.0 References: <1342624074-24650-1-git-send-email-stefanha@linux.vnet.ibm.com> <1342624074-24650-7-git-send-email-stefanha@linux.vnet.ibm.com> <20120718182950.GB2498@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC v9 06/27] virtio-blk: Take PCI memory range into account List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , Anthony Liguori , Stefan Hajnoczi , kvm@vger.kernel.org, "Michael S. Tsirkin" , qemu-devel@nongnu.org, Khoa Huynh , Paolo Bonzini , Asias He On 07/19/2012 12:16 PM, Stefan Hajnoczi wrote: > On Thu, Jul 19, 2012 at 10:14 AM, Stefan Hajnoczi wrote: >> On Wed, Jul 18, 2012 at 7:29 PM, Michael S. Tsirkin wrote: >>> On Wed, Jul 18, 2012 at 04:07:33PM +0100, Stefan Hajnoczi wrote: >>>> Support >4 GB physical memory accesses. >>>> >>>> Signed-off-by: Stefan Hajnoczi >>> >>> Need some sane APIs, this is just too scary. >> >> Yes, this prototype has (at least) two layering violations: >> 1. Bypassing QEMU's memory subsystem because it isn't thread-safe. > > Maybe we can use MemoryListener to fix this, although we need to take > care of thread-safety. Better to fix up the memory core. It should be relatively easy to rcu-ify it, as it already works by building a new memory map instead of updating it in place. Currently it has one root pointer, all that is needed is to build it into a temporary pointer, then use rcu_assign_pointer() to atomically switch the memory map. -- error compiling committee.c: too many arguments to function