qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Cédric Le Goater" <clg@kaod.org>
To: Balamuruhan S <bala24@linux.ibm.com>
Cc: maddy@linux.vnet.ibm.com, groug@kaod.org, qemu-devel@nongnu.org,
	anju@linux.vnet.ibm.com, qemu-ppc@nongnu.org,
	hari@linux.vnet.ibm.com, david@gibson.dropbear.id.au
Subject: Re: [Qemu-devel] [PATCH v1 3/3] hw/ppc/pnv_homer: add PowerNV homer device model
Date: Tue, 10 Sep 2019 13:00:54 +0200	[thread overview]
Message-ID: <f0a5499f-4a76-85b8-db74-0c83a0587974@kaod.org> (raw)
In-Reply-To: <20190910103054.GB16391@localhost.localdomain>

>>> +
>>> +    object_initialize_child(obj, "homer",  &chip9->homer, sizeof(chip9->homer),
>>> +                            TYPE_PNV9_HOMER, &error_abort, NULL);
>>> +    object_property_add_const_link(OBJECT(&chip9->homer), "chip", obj,
>>> +                                   &error_abort);
>>
>> Does HOMER need the chip ? It is not used but we might want to in the 
>> core_max_array() ? 
> 
> sorry, no it is not required, I will remove it.

It seems you will need the chip in core_max_array(). I would keep it. 
See below,

[ ... ] 

>>> +static bool core_max_array(void *opaque, hwaddr addr)

Please change the 'void *opaque' function parameter in 'PnvHOMER *homer'

>>> +{
>>> +    PnvHOMER *homer = PNV_HOMER(opaque);
>>> +    PnvHOMERClass *homer_class = PNV_HOMER_GET_CLASS(homer);
>>> +
>>> +    MachineState *ms = MACHINE(qdev_get_machine());
>>
>> Do you need the whole machine or only the chip ?  
> 
> yes, I see it is for active cores in the chip, I can use `nr_cores`
> defined in PnvChip.


If you keep the QOM link above, you can grab it in the realize handler of
the HOMER model with :  

    Object *obj;
    Error *local_err = NULL;

    obj = object_property_get_link(OBJECT(dev), "chip", &local_err);
    if (!obj) {
        error_propagate(errp, local_err);
        error_prepend(errp, "required link 'chip' not found: ");
        return;
    }

    homer->chip = PNV_CHIP(obj);

[ ... ] 

>>> +
>>> +/* P9 Pstate table */
>>> +
>>
>> no version ? 
> 
> PNV9_OCC_PSTATE_MAJOR_VERSION is the P9 pstate version.

why isn't it in the switch statement below ? 

[ ... ] 
 
>>> +typedef struct PnvHOMER {
>>> +    DeviceState parent;
>>> +
>>> +    MemoryRegion homer_regs;
>>
>> the homer_ prefix is not useful.
> 
> okay, I will change it to `hregs`.

I would just remove the prefix

Thanks,

C. 



  reply	other threads:[~2019-09-10 11:04 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-10  7:10 [Qemu-devel] [PATCH v1 0/3] add Homer/OCC common area emulation for PowerNV Balamuruhan S
2019-09-10  7:10 ` [Qemu-devel] [PATCH v1 1/3] hw/ppc/pnv_xscom: retrieve homer/occ base address from PBA BARs Balamuruhan S
2019-09-10  7:16   ` Cédric Le Goater
2019-09-10  7:10 ` [Qemu-devel] [PATCH v1 2/3] hw/ppc/pnv_occ: add sram device model for occ common area Balamuruhan S
2019-09-10  7:19   ` Cédric Le Goater
2019-09-10  9:31     ` Balamuruhan S
2019-09-10  9:33       ` Cédric Le Goater
2019-09-10  7:10 ` [Qemu-devel] [PATCH v1 3/3] hw/ppc/pnv_homer: add PowerNV homer device model Balamuruhan S
2019-09-10  7:46   ` Cédric Le Goater
2019-09-10 10:30     ` Balamuruhan S
2019-09-10 11:00       ` Cédric Le Goater [this message]
2019-09-10 14:55         ` Balamuruhan S
2019-09-11  0:34   ` David Gibson
2019-09-11  4:47     ` Balamuruhan S
2019-09-10 11:45 ` [Qemu-devel] [PATCH v1 0/3] add Homer/OCC common area emulation for PowerNV Cédric Le Goater
2019-09-10 14:40   ` Balamuruhan S

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=f0a5499f-4a76-85b8-db74-0c83a0587974@kaod.org \
    --to=clg@kaod.org \
    --cc=anju@linux.vnet.ibm.com \
    --cc=bala24@linux.ibm.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=groug@kaod.org \
    --cc=hari@linux.vnet.ibm.com \
    --cc=maddy@linux.vnet.ibm.com \
    --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 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).