* [Qemu-devel] Adding memory region without specifying address
@ 2014-06-28 0:29 Stalley, Sean
2014-06-28 1:26 ` Peter Crosthwaite
0 siblings, 1 reply; 6+ messages in thread
From: Stalley, Sean @ 2014-06-28 0:29 UTC (permalink / raw)
To: qemu-devel@nongnu.org
[-- Attachment #1: Type: text/plain, Size: 654 bytes --]
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't particularly care what the physical address of the memory region is (so long as it doesn't overlap with any other memory region).
I was wondering if QEMU is able to 'allocate' a memory 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).
Can QEMU do this? was looking at the various flavors of memory_region_add_subregion(), but they all seem to require a hardware offset...
Thanks,
Sean O. Stalley
[-- Attachment #2: Type: text/html, Size: 2638 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] Adding memory region without specifying address
2014-06-28 0:29 [Qemu-devel] Adding memory region without specifying address Stalley, Sean
@ 2014-06-28 1:26 ` Peter Crosthwaite
2014-06-30 17:53 ` Stalley, Sean
0 siblings, 1 reply; 6+ messages in thread
From: Peter Crosthwaite @ 2014-06-28 1:26 UTC (permalink / raw)
To: Stalley, Sean, Alexander Graf; +Cc: qemu-devel@nongnu.org
On Sat, Jun 28, 2014 at 10:29 AM, Stalley, Sean <sean.stalley@intel.com> 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’t particularly care what the physical address of the
> memory region is (so long as it doesn’t overlap with any other memory
> region).
>
Curious, what's your mechanism for giving the auto allocated address
to the guest?
>
>
> I was wondering if QEMU is able to ‘allocate’ a memory 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
sub-regions too and can you implement a "for-everything" allocator on
the machine level?
>
>
> Can QEMU do this? was looking at the various flavors of
> memory_region_add_subregion(), but they all seem to require a hardware
> offset…
>
Alex's addressless -device work may be related but it's more about
command line usability. Autoallocation of MMIO addresses is a feature
there however.
Regards,
Peter
>
>
> Thanks,
>
> Sean O. Stalley
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] Adding memory region without specifying address
2014-06-28 1:26 ` Peter Crosthwaite
@ 2014-06-30 17:53 ` Stalley, Sean
2014-06-30 20:21 ` Alexander Graf
0 siblings, 1 reply; 6+ messages in thread
From: Stalley, Sean @ 2014-06-30 17:53 UTC (permalink / raw)
To: Peter Crosthwaite, Alexander Graf; +Cc: qemu-devel@nongnu.org
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 Crosthwaite
> 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 address
>
> On Sat, Jun 28, 2014 at 10:29 AM, Stalley, Sean <sean.stalley@intel.com> 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’t particularly care what the physical address of
> > the memory region is (so long as it doesn’t overlap with any other
> > memory region).
> >
>
> Curious, what's your mechanism for giving the auto allocated address to the
> guest?
>
We have one memory space that is fixed. The plan is to put the addresses of the automatically allocated locations in the fixed space.
> >
> >
> > I was wondering if QEMU is able to ‘allocate’ a memory 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 sub-
> 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, so a "for-everything" allocator isn't really a good option.
> >
> >
> > Can QEMU do this? was looking at the various flavors of
> > memory_region_add_subregion(), but they all seem to require a hardware
> > offset…
> >
>
> Alex's addressless -device work may be related but it's more about command
> line usability. Autoallocation of MMIO addresses is a feature there however.
Where is this code located? I have been looking, but I haven’t been able to find it yet. Is this called by qdev_device_add()?
I have also been thinking about doing something like what pci_add_capability() does for capability descriptors, but this just reserves already allocated space.
Thanks,
Sean
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] Adding memory region without specifying address
2014-06-30 17:53 ` Stalley, Sean
@ 2014-06-30 20:21 ` Alexander Graf
2014-06-30 21:47 ` Stalley, Sean
0 siblings, 1 reply; 6+ messages in thread
From: Alexander Graf @ 2014-06-30 20:21 UTC (permalink / raw)
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 Crosthwaite
>> 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 address
>>
>> On Sat, Jun 28, 2014 at 10:29 AM, Stalley, Sean <sean.stalley@intel.com> 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’t particularly care what the physical address of
>>> the memory region is (so long as it doesn’t overlap with any other
>>> memory region).
>>>
>> Curious, what's your mechanism for giving the auto allocated address to the
>> guest?
>>
> We have one memory space that is fixed. The plan is to put the addresses of the automatically allocated locations in the fixed space.
That sounds exactly like what I've been working on. The first
incarnation was called "platform bus", the second "platform devices",
the current work is going to be "sysbus hints" - but it's WIP.
>
>>>
>>> I was wondering if QEMU is able to ‘allocate’ a memory 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 sub-
>> 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, so 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 hardware
>>> offset…
>>>
>> Alex's addressless -device work may be related but it's more about command
>> line usability. Autoallocation of MMIO addresses is a feature there however.
> Where is this code located? I have been looking, but I haven’t been able to find it yet. Is this called by qdev_device_add()?
It's not upstream yet ;).
Alex
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] Adding memory region without specifying address
2014-06-30 20:21 ` Alexander Graf
@ 2014-06-30 21:47 ` Stalley, Sean
2014-07-01 4:03 ` Alexander Graf
0 siblings, 1 reply; 6+ messages in thread
From: Stalley, Sean @ 2014-06-30 21:47 UTC (permalink / raw)
To: Alexander Graf, Peter Crosthwaite; +Cc: qemu-devel@nongnu.org
> -----Original Message-----
> From: Alexander Graf [mailto:agraf@suse.de]
> Sent: Monday, June 30, 2014 1:22 PM
> To: Stalley, Sean; Peter Crosthwaite
> Cc: qemu-devel@nongnu.org
> Subject: Re: [Qemu-devel] Adding memory region without specifying address
>
>
> 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
> >> Crosthwaite
> >> 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
> >> address
> >>
> >> On Sat, Jun 28, 2014 at 10:29 AM, Stalley, Sean <sean.stalley@intel.com>
> 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’t particularly care what the physical address of
> >>> the memory region is (so long as it doesn’t overlap with any other
> >>> memory region).
> >>>
> >> Curious, what's your mechanism for giving the auto allocated address
> >> to the guest?
> >>
> > We have one memory space that is fixed. The plan is to put the addresses of
> the automatically allocated locations in the fixed space.
>
> That sounds exactly like what I've been working on. The first incarnation was
> called "platform bus", the second "platform devices", the current work is going
> to be "sysbus hints" - but it's WIP.
Hmm, it sounds very similar. Out of curiosity, is there any relation to Linux platform devices?
>
> >
> >>>
> >>> I was wondering if QEMU is able to ‘allocate’ a memory 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 sub-
> >> 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, so a
> "for-everything" allocator isn't really a good option.
>
> Why not?
I think I misinterpreted the meaning of the term 'full control'.
Right now, the sole purpose of the guest machine is to validate this hardware model. I can change the hardware models in the guest as needed (although I hope to keep them the same). In that sense, I have full control over the memory region.
>
> >
> >>>
> >>> Can QEMU do this? was looking at the various flavors of
> >>> memory_region_add_subregion(), but they all seem to require a hardware
> >>> offset…
> >>>
> >> Alex's addressless -device work may be related but it's more about command
> >> line usability. Autoallocation of MMIO addresses is a feature there however.
> > Where is this code located? I have been looking, but I haven’t been able to find
> it yet. Is this called by qdev_device_add()?
>
> It's not upstream yet ;).
Aah, that explains why I couldn't find it :P
It seems like the answer to my initial question, "can qemu add a memory region for hardware without being given a specific address" is "Not yet".
Thanks,
Sean
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] Adding memory region without specifying address
2014-06-30 21:47 ` Stalley, Sean
@ 2014-07-01 4:03 ` Alexander Graf
0 siblings, 0 replies; 6+ messages in thread
From: Alexander Graf @ 2014-07-01 4:03 UTC (permalink / raw)
To: Stalley, Sean; +Cc: Peter Crosthwaite, qemu-devel@nongnu.org
> Am 30.06.2014 um 23:47 schrieb "Stalley, Sean" <sean.stalley@intel.com>:
>
>
>
>> -----Original Message-----
>> From: Alexander Graf [mailto:agraf@suse.de]
>> Sent: Monday, June 30, 2014 1:22 PM
>> To: Stalley, Sean; Peter Crosthwaite
>> Cc: qemu-devel@nongnu.org
>> Subject: Re: [Qemu-devel] Adding memory region without specifying address
>>
>>
>>> 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
>>>> Crosthwaite
>>>> 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
>>>> address
>>>>
>>>> On Sat, Jun 28, 2014 at 10:29 AM, Stalley, Sean <sean.stalley@intel.com>
>> 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’t particularly care what the physical address of
>>>>> the memory region is (so long as it doesn’t overlap with any other
>>>>> memory region).
>>>> Curious, what's your mechanism for giving the auto allocated address
>>>> to the guest?
>>> We have one memory space that is fixed. The plan is to put the addresses of
>> the automatically allocated locations in the fixed space.
>>
>> That sounds exactly like what I've been working on. The first incarnation was
>> called "platform bus", the second "platform devices", the current work is going
>> to be "sysbus hints" - but it's WIP.
>
> Hmm, it sounds very similar. Out of curiosity, is there any relation to Linux platform devices?
There's inspiration from them. After all, both are basically abstractions of the same things ;).
>
>>
>>>
>>>>>
>>>>> I was wondering if QEMU is able to ‘allocate’ a memory 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 sub-
>>>> 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, so a
>> "for-everything" allocator isn't really a good option.
>>
>> Why not?
>
> I think I misinterpreted the meaning of the term 'full control'.
> Right now, the sole purpose of the guest machine is to validate this hardware model. I can change the hardware models in the guest as needed (although I hope to keep them the same). In that sense, I have full control over the memory region.
>
>>
>>>
>>>>>
>>>>> Can QEMU do this? was looking at the various flavors of
>>>>> memory_region_add_subregion(), but they all seem to require a hardware
>>>>> offset…
>>>> Alex's addressless -device work may be related but it's more about command
>>>> line usability. Autoallocation of MMIO addresses is a feature there however.
>>> Where is this code located? I have been looking, but I haven’t been able to find
>> it yet. Is this called by qdev_device_add()?
>>
>> It's not upstream yet ;).
>
> Aah, that explains why I couldn't find it :P
>
>
> It seems like the answer to my initial question, "can qemu add a memory region for hardware without being given a specific address" is "Not yet".
Exactly. But you can also add a "it will very soon". :)
Alex
>
> Thanks,
> Sean
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-07-01 4:03 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-28 0:29 [Qemu-devel] Adding memory region without specifying address Stalley, Sean
2014-06-28 1:26 ` Peter Crosthwaite
2014-06-30 17:53 ` Stalley, Sean
2014-06-30 20:21 ` Alexander Graf
2014-06-30 21:47 ` Stalley, Sean
2014-07-01 4:03 ` Alexander Graf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).