All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Alexander Graf <agraf@suse.de>
Cc: "qemu-ppc@nongnu.org" <qemu-ppc@nongnu.org>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	Bhushan Bharat-R65777 <R65777@freescale.com>
Subject: Re: [Qemu-devel] [PATCH 2/2] Adding BAR0 for e500 PCI controller
Date: Sun, 07 Oct 2012 14:41:13 +0200	[thread overview]
Message-ID: <50717869.7000802@redhat.com> (raw)
In-Reply-To: <8E204265-B301-49D0-A89F-E074829E9422@suse.de>

On 10/07/2012 01:57 PM, Alexander Graf wrote:
> 
> 
> On 07.10.2012, at 11:48, Avi Kivity <avi@redhat.com> wrote:
> 
>> On 10/05/2012 01:59 PM, Alexander Graf wrote:
>>>>>> Do you mean that we add the "MemoryRegion bar0" in PCIDevice struct. Do the
>>>>> same thing that I was doing in e500_pcihost_initfn() in the k->init() (will add
>>>>> this) function of "e500-host-bridge"
>>>>> 
>>>>> No, he means that you create a new struct like this:
>>>>> 
>>>>> struct foo {
>>>>>   PCIDevice p;
>>>>>   MemoryRegion bar0;
>>>>> };
>>>>> 
>>>>> Please check out any other random PCI device in QEMU. Almost all of them do this
>>>>> to store more information than their parent class can hold.
>>>> 
>>>> Just want to be sure I understood you correctly: Do you mean something like this : ( I know I have to switch to QOM mechanism to share parameters)
>>>> 
>>>> diff --git a/hw/ppce500_pci.c b/hw/ppce500_pci.c
>>>> index 92b1dc0..a948bc6 100644
>>>> --- a/hw/ppce500_pci.c
>>>> +++ b/hw/ppce500_pci.c
>>>> @@ -89,6 +89,12 @@ struct PPCE500PCIState {
>>>>    MemoryRegion iomem;
>>>> };
>>>> 
>>>> +struct BHARAT {
>>>> +    PCIDevice p;
>>>> +    void *bar0;
>>> 
>>> MemoryRegion *bar0
>> 
>> MemoryRegion bar0;
> 
> Why? We want the same region that is mapped outside of the pci device be available as BAR0 too.

A MemoryRegion can only have one container.  If you want dual maps, use
memory_region_init_alias().

It is possible (not trivial though) to extend the memory API to support
m:n container:subregion relationships.  I don't think it's worthwhile
though.


-- 
error compiling committee.c: too many arguments to function

  reply	other threads:[~2012-10-07 12:41 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-03 11:49 [Qemu-devel] [PATCH 0/2] e500: creating CCSR region and registering bar0 Bharat Bhushan
2012-10-03 11:49 ` [Qemu-devel] [PATCH 1/2] e500: Adding CCSR memory region Bharat Bhushan
2012-10-03 12:08   ` Alexander Graf
2012-10-03 12:16     ` Bhushan Bharat-R65777
2012-10-03 12:18       ` Alexander Graf
2012-10-03 11:50 ` [Qemu-devel] [PATCH 2/2] Adding BAR0 for e500 PCI controller Bharat Bhushan
2012-10-03 12:11   ` Alexander Graf
2012-10-03 12:23     ` Bhushan Bharat-R65777
2012-10-04 12:31   ` Avi Kivity
2012-10-04 13:46     ` Bhushan Bharat-R65777
2012-10-04 14:58       ` Avi Kivity
2012-10-04 16:03         ` Bhushan Bharat-R65777
2012-10-04 16:07           ` Alexander Graf
2012-10-04 16:48             ` Bhushan Bharat-R65777
2012-10-04 16:50               ` Alexander Graf
2012-10-04 17:02                 ` Avi Kivity
2012-10-05  7:11             ` Bhushan Bharat-R65777
2012-10-05 11:59               ` Alexander Graf
2012-10-07  9:48                 ` Avi Kivity
2012-10-07 11:57                   ` Alexander Graf
2012-10-07 12:41                     ` Avi Kivity [this message]
2012-10-08  8:23                 ` Bhushan Bharat-R65777
2012-10-08  8:50                   ` Alexander Graf
2012-10-08 13:57                     ` Andreas Färber
2012-10-04 15:54   ` Andreas Färber
2012-10-04 16:01     ` Alexander Graf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50717869.7000802@redhat.com \
    --to=avi@redhat.com \
    --cc=R65777@freescale.com \
    --cc=agraf@suse.de \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.