From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50073) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1i5O-0002Qv-2L for qemu-devel@nongnu.org; Mon, 30 Jun 2014 16:22:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X1i5I-0008W1-Tj for qemu-devel@nongnu.org; Mon, 30 Jun 2014 16:21:57 -0400 Received: from cantor2.suse.de ([195.135.220.15]:59035 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1i5I-0008T6-Mo for qemu-devel@nongnu.org; Mon, 30 Jun 2014 16:21:52 -0400 Message-ID: <53B1C6DD.3090606@suse.de> Date: Mon, 30 Jun 2014 22:21:49 +0200 From: Alexander Graf MIME-Version: 1.0 References: <5FE5E296BC647B42A2509AB982F88C131D1748CD@ORSMSX108.amr.corp.intel.com> <5FE5E296BC647B42A2509AB982F88C131D1757A3@ORSMSX108.amr.corp.intel.com> In-Reply-To: <5FE5E296BC647B42A2509AB982F88C131D1757A3@ORSMSX108.amr.corp.intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] Adding memory region without specifying address List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Stalley, Sean" , Peter Crosthwaite Cc: "qemu-devel@nongnu.org" On 30.06.14 19:53, Stalley, Sean wrote: > Thanks for the quick response! Sorry for my belated reply... > >> -----Original Message----- >> From: peter.crosthwaite@petalogix.com >> [mailto:peter.crosthwaite@petalogix.com] On Behalf Of Peter Crosthwait= e >> Sent: Friday, June 27, 2014 6:26 PM >> To: Stalley, Sean; Alexander Graf >> Cc: qemu-devel@nongnu.org >> Subject: Re: [Qemu-devel] Adding memory region without specifying addr= ess >> >> On Sat, Jun 28, 2014 at 10:29 AM, Stalley, Sean wrote: >>> Hello All, >>> >>> >>> >>> I am working on building a hardware model for QEMU. This model needs = a >>> couple memory regions for MMIO. >>> >>> The thing is, I don=E2=80=99t particularly care what the physical add= ress of >>> the memory region is (so long as it doesn=E2=80=99t overlap with any = other >>> memory region). >>> >> Curious, what's your mechanism for giving the auto allocated address t= o the >> guest? >> > We have one memory space that is fixed. The plan is to put the addresse= s of the automatically allocated locations in the fixed space. That sounds exactly like what I've been working on. The first=20 incarnation was called "platform bus", the second "platform devices",=20 the current work is going to be "sysbus hints" - but it's WIP. > >>> >>> I was wondering if QEMU is able to =E2=80=98allocate=E2=80=99 a memor= y region for >>> hardware >>> (IE: I call into something saying I need a memory region X bytes long= , >>> and QEMU returns with a pointer to a memory region X bytes long). >>> >> Do you have full control over the memory region you are adding these s= ub- >> regions too and can you implement a "for-everything" allocator on the = machine >> level? >> > We want to be able to put these sub-regions anywhere in memory-space, s= o a "for-everything" allocator isn't really a good option. Why not? > >>> >>> Can QEMU do this? was looking at the various flavors of >>> memory_region_add_subregion(), but they all seem to require a hardwar= e >>> offset=E2=80=A6 >>> >> Alex's addressless -device work may be related but it's more about com= mand >> line usability. Autoallocation of MMIO addresses is a feature there ho= wever. > Where is this code located? I have been looking, but I haven=E2=80=99t = been able to find it yet. Is this called by qdev_device_add()? It's not upstream yet ;). Alex