All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vaibhav Jain <vaibhav@linux.ibm.com>
To: Shivaprasad G Bhat <sbhat@linux.ibm.com>,
	qemu-devel@nongnu.org, kvm-ppc@vger.kernel.org,
	qemu-ppc@nongnu.org, david@gibson.dropbear.id.au, mst@redhat.com,
	imammedo@redhat.com, xiaoguangrong.eric@gmail.com
Cc: aneesh.kumar@linux.ibm.com, bharata@linux.vnet.ibm.com,
	shivaprasadbhat@gmail.com, ehabkost@redhat.com, groug@kaod.org
Subject: Re: [PATCH] ppc/spapr: Add support for implement support for H_SCM_HEALTH
Date: Tue, 30 Mar 2021 08:50:13 +0000	[thread overview]
Message-ID: <87tuotox3e.fsf@vajain21.in.ibm.com> (raw)
In-Reply-To: <ef44262e-907d-5200-022c-a26e16522ab0@linux.ibm.com>

Hi Shiva,

Thanks for reviweing this patch. My responses inline below;


Shivaprasad G Bhat <sbhat@linux.ibm.com> writes:

<snip>

>>   
>> +static target_ulong h_scm_health(PowerPCCPU *cpu, SpaprMachineState *spapr,
>> +                                 target_ulong opcode, target_ulong *args)
>> +{
>> +    uint32_t drc_index = args[0];
>> +    SpaprDrc *drc = spapr_drc_by_index(drc_index);
>> +    NVDIMMDevice *nvdimm;
>> +
>> +    if (drc && spapr_drc_type(drc) != SPAPR_DR_CONNECTOR_TYPE_PMEM) {
>> +        return H_PARAMETER;
>> +    }
>> +
>
>
> Please check if drc->dev is not NULL too. DRCs are created in advance
>
> and drc->dev may not be assigned if the device is not plugged yet.
>
>
Sure, will address that in v2

>> +    nvdimm = NVDIMM(drc->dev);
>> +
>> +    /* Check if the nvdimm is unarmed and send its status via health bitmaps */
>> +    args[0] = nvdimm->unarmed ? PAPR_PMEM_UNARMED_MASK : 0;
>
>
> Please use object_property_get_bool to fetch the unarmed value.
>
>
Sure I will switch to object_property_get_bool in v2. However I see
nvdimm->unarmed being accessed in similar manner in
nvdimm_build_structure_memdev() which probably needs an update too.

<snip>

-- 
Cheers
~ Vaibhav

WARNING: multiple messages have this Message-ID (diff)
From: Vaibhav Jain <vaibhav@linux.ibm.com>
To: Shivaprasad G Bhat <sbhat@linux.ibm.com>,
	qemu-devel@nongnu.org, kvm-ppc@vger.kernel.org,
	qemu-ppc@nongnu.org, david@gibson.dropbear.id.au, mst@redhat.com,
	imammedo@redhat.com, xiaoguangrong.eric@gmail.com
Cc: aneesh.kumar@linux.ibm.com, bharata@linux.vnet.ibm.com,
	shivaprasadbhat@gmail.com, ehabkost@redhat.com, groug@kaod.org
Subject: Re: [PATCH] ppc/spapr: Add support for implement support for H_SCM_HEALTH
Date: Tue, 30 Mar 2021 14:08:13 +0530	[thread overview]
Message-ID: <87tuotox3e.fsf@vajain21.in.ibm.com> (raw)
In-Reply-To: <ef44262e-907d-5200-022c-a26e16522ab0@linux.ibm.com>

Hi Shiva,

Thanks for reviweing this patch. My responses inline below;


Shivaprasad G Bhat <sbhat@linux.ibm.com> writes:

<snip>

>>   
>> +static target_ulong h_scm_health(PowerPCCPU *cpu, SpaprMachineState *spapr,
>> +                                 target_ulong opcode, target_ulong *args)
>> +{
>> +    uint32_t drc_index = args[0];
>> +    SpaprDrc *drc = spapr_drc_by_index(drc_index);
>> +    NVDIMMDevice *nvdimm;
>> +
>> +    if (drc && spapr_drc_type(drc) != SPAPR_DR_CONNECTOR_TYPE_PMEM) {
>> +        return H_PARAMETER;
>> +    }
>> +
>
>
> Please check if drc->dev is not NULL too. DRCs are created in advance
>
> and drc->dev may not be assigned if the device is not plugged yet.
>
>
Sure, will address that in v2

>> +    nvdimm = NVDIMM(drc->dev);
>> +
>> +    /* Check if the nvdimm is unarmed and send its status via health bitmaps */
>> +    args[0] = nvdimm->unarmed ? PAPR_PMEM_UNARMED_MASK : 0;
>
>
> Please use object_property_get_bool to fetch the unarmed value.
>
>
Sure I will switch to object_property_get_bool in v2. However I see
nvdimm->unarmed being accessed in similar manner in
nvdimm_build_structure_memdev() which probably needs an update too.

<snip>

-- 
Cheers
~ Vaibhav


  reply	other threads:[~2021-03-30  8:50 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-29 16:22 [PATCH] ppc/spapr: Add support for implement support for H_SCM_HEALTH Vaibhav Jain
2021-03-29 16:34 ` Vaibhav Jain
2021-03-30  6:38 ` Shivaprasad G Bhat
2021-03-30  6:50   ` Shivaprasad G Bhat
2021-03-30  8:38   ` Vaibhav Jain [this message]
2021-03-30  8:50     ` Vaibhav Jain
2021-03-30 14:14 ` Greg Kurz
2021-03-30 14:14   ` Greg Kurz
2021-03-30 17:07   ` Vaibhav Jain
2021-03-30 17:19     ` Vaibhav Jain
2021-03-30 23:49     ` David Gibson
2021-03-30 23:49       ` David Gibson
2021-03-31  3:49       ` Vaibhav Jain
2021-03-31  3:50         ` Vaibhav Jain
2021-03-31  9:15     ` Greg Kurz
2021-03-31  9:15       ` Greg Kurz

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=87tuotox3e.fsf@vajain21.in.ibm.com \
    --to=vaibhav@linux.ibm.com \
    --cc=aneesh.kumar@linux.ibm.com \
    --cc=bharata@linux.vnet.ibm.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=ehabkost@redhat.com \
    --cc=groug@kaod.org \
    --cc=imammedo@redhat.com \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=sbhat@linux.ibm.com \
    --cc=shivaprasadbhat@gmail.com \
    --cc=xiaoguangrong.eric@gmail.com \
    /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.